/* ==========================================================
   thelenails.de - eigene Ergaenzungen
   Laedt nach dem Kadence-CSS und ueberschreibt gezielt.
   ========================================================== */

:root {
  --tn-ease: cubic-bezier(.22,.61,.36,1);
  --tn-fast: .25s;
  --tn-slow: .7s;
  --tn-accent: var(--global-palette1, #b08d78);
  --tn-dark: var(--global-palette3, #2b2b2b);
}

html { scroll-behavior: smooth; }

/* ---------- Scroll-Reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--tn-slow) var(--tn-ease),
              transform var(--tn-slow) var(--tn-ease);
  transition-delay: var(--tn-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal="left"]  { transform: translateX(-32px); }
[data-reveal="right"] { transform: translateX(32px); }
[data-reveal="zoom"]  { transform: scale(.94); }
[data-reveal].tn-in   { opacity: 1; transform: none; }

/* ---------- Bilder ---------- */
.wp-block-image,
.kb-gallery-item,
.kadence-image-wrap,
figure.wp-block-image {
  overflow: hidden;
  border-radius: 6px;
}
.wp-block-image img,
.kb-gallery-item img,
.kadence-image-wrap img,
figure img {
  transition: transform .6s var(--tn-ease);
  backface-visibility: hidden;
}
.wp-block-image:hover img,
.kb-gallery-item:hover img,
.kadence-image-wrap:hover img,
figure:hover img {
  transform: scale(1.06);
}

/* Sanfte Aufblende, sobald ein Bild geladen ist */
img.tn-img-loading { opacity: 0; }
img.tn-img-ready {
  opacity: 1;
  transition: opacity .55s var(--tn-ease);
}

/* ---------- Buttons ---------- */
.wp-block-button__link,
.kb-button,
.kt-button,
.kb-btn,
button.tn-cta {
  position: relative;
  overflow: hidden;
  transition: transform var(--tn-fast) var(--tn-ease),
              box-shadow var(--tn-fast) var(--tn-ease),
              filter var(--tn-fast) var(--tn-ease);
}
.wp-block-button__link:hover,
.kb-button:hover,
.kt-button:hover,
.kb-btn:hover,
button.tn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,0,0,.16);
  filter: brightness(1.05);
}
.wp-block-button__link:active,
.kb-button:active,
.kt-button:active,
.kb-btn:active { transform: translateY(0); }

/* Shine-Effekt beim Hover */
.wp-block-button__link::after,
.kb-button::after,
.kb-btn::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(115deg,
    transparent 35%, rgba(255,255,255,.35) 50%, transparent 65%);
  transform: translateX(-130%);
  transition: transform .8s var(--tn-ease);
  pointer-events: none;
}
.wp-block-button__link:hover::after,
.kb-button:hover::after,
.kb-btn:hover::after { transform: translateX(130%); }

/* ---------- Textlinks ---------- */
.entry-content a:not(.wp-block-button__link):not(.kb-button):not(.kb-btn):not(.kt-svg-icon-link) {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size .35s var(--tn-ease);
  text-decoration: none;
}
.entry-content a:not(.wp-block-button__link):not(.kb-button):not(.kb-btn):not(.kt-svg-icon-link):hover {
  background-size: 100% 1px;
}

/* ---------- Social-Icons ---------- */
.kt-svg-icon-link,
.kb-svg-icon-wrap {
  transition: transform .3s var(--tn-ease), color .3s var(--tn-ease);
  display: inline-block;
}
.kt-svg-icon-link:hover { transform: translateY(-3px) scale(1.12); }

/* ---------- Hauptnavigation ---------- */
.main-navigation .primary-menu-container > ul > li.menu-item > a { position: relative; }
.main-navigation .primary-menu-container > ul > li.menu-item > a::before {
  content: "";
  position: absolute; left: 50%; bottom: .35em;
  width: 0; height: 1.5px;
  background: currentColor;
  transform: translateX(-50%);
  transition: width .3s var(--tn-ease);
}
.main-navigation .primary-menu-container > ul > li.menu-item > a:hover::before,
.main-navigation .primary-menu-container > ul > li.current-menu-item > a::before {
  width: calc(100% - 1.2em);
}

/* ---------- Header beim Scrollen ---------- */
#masthead {
  transition: box-shadow .3s var(--tn-ease), background-color .3s var(--tn-ease);
}
body.tn-scrolled #masthead { box-shadow: 0 2px 18px rgba(0,0,0,.09); }
.site-main-header-inner-wrap { transition: min-height .3s var(--tn-ease); }
body.tn-scrolled .site-main-header-inner-wrap { min-height: 64px; }

/* ---------- Mobiles Menue ---------- */
#mobile-drawer {
  transition: opacity .3s var(--tn-ease), visibility .3s;
  opacity: 0; visibility: hidden;
}
#mobile-drawer.active { opacity: 1; visibility: visible; }
#mobile-drawer .drawer-inner {
  transform: translateX(40px);
  transition: transform .35s var(--tn-ease);
}
#mobile-drawer.active .drawer-inner { transform: none; }
#mobile-drawer.active .mobile-navigation li {
  animation: tn-slide-in .4s var(--tn-ease) backwards;
}
#mobile-drawer.active .mobile-navigation li:nth-child(1) { animation-delay: .05s; }
#mobile-drawer.active .mobile-navigation li:nth-child(2) { animation-delay: .10s; }
#mobile-drawer.active .mobile-navigation li:nth-child(3) { animation-delay: .15s; }
#mobile-drawer.active .mobile-navigation li:nth-child(4) { animation-delay: .20s; }
#mobile-drawer.active .mobile-navigation li:nth-child(5) { animation-delay: .25s; }
#mobile-drawer.active .mobile-navigation li:nth-child(6) { animation-delay: .30s; }
#mobile-drawer.active .mobile-navigation li:nth-child(7) { animation-delay: .35s; }
@keyframes tn-slide-in {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: none; }
}
body.showing-popup-drawer-from-right { overflow: hidden; }
li.tn-sub-open > ul.sub-menu { display: block; }

/* ---------- Google Maps Consent ---------- */
.tn-map-consent {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 1.1rem;
  min-height: 340px; padding: 2.4rem;
  background: linear-gradient(135deg, #f7f5f4, #ebe6e3);
  border: 1px solid rgba(0,0,0,.07); border-radius: 8px;
  text-align: center;
}
.tn-map-consent p { margin: 0; max-width: 42ch; font-size: .9rem; line-height: 1.6; }
.tn-map-consent button {
  padding: .8em 1.9em; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--tn-dark); color: #fff;
  font-size: .88rem; letter-spacing: .03em;
  transition: transform .25s var(--tn-ease), box-shadow .25s var(--tn-ease);
}
.tn-map-consent button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,.2);
}
.tn-map-frame { width: 100%; min-height: 340px; border: 0; border-radius: 8px; }
.kb-google-maps-container { min-height: 340px; }

/* ---------- Lightbox ---------- */
.tn-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(12,10,10,.93);
  opacity: 0; visibility: hidden;
  transition: opacity .3s var(--tn-ease), visibility .3s;
  padding: 4vh 4vw;
}
.tn-lightbox.tn-open { opacity: 1; visibility: visible; }
.tn-lightbox img {
  max-width: 100%; max-height: 92vh;
  border-radius: 6px; box-shadow: 0 24px 70px rgba(0,0,0,.6);
  transform: scale(.94);
  transition: transform .35s var(--tn-ease);
}
.tn-lightbox.tn-open img { transform: none; }
.tn-lightbox button {
  position: absolute; background: none; border: 0; cursor: pointer;
  color: #fff; font-size: 2.4rem; line-height: 1; padding: .4rem .9rem;
  opacity: .65; transition: opacity .2s;
}
.tn-lightbox button:hover { opacity: 1; }
.tn-lb-close { top: 1rem; right: 1.4rem; }
.tn-lb-prev  { left: .6rem;  top: 50%; transform: translateY(-50%); }
.tn-lb-next  { right: .6rem; top: 50%; transform: translateY(-50%); }
.tn-lb-count {
  position: absolute; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.7); font-size: .8rem; letter-spacing: .08em;
}
.tn-zoomable { cursor: zoom-in; }

/* ---------- Zurueck nach oben ---------- */
.tn-top {
  position: fixed; right: 1.4rem; bottom: 1.4rem; z-index: 900;
  width: 46px; height: 46px; border: 0; border-radius: 50%;
  background: var(--tn-dark); color: #fff;
  cursor: pointer; font-size: 1.1rem; line-height: 1;
  opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: opacity .3s var(--tn-ease), transform .3s var(--tn-ease),
              box-shadow .25s var(--tn-ease);
}
.tn-top.tn-show { opacity: .92; transform: none; pointer-events: auto; }
.tn-top:hover { opacity: 1; box-shadow: 0 8px 22px rgba(0,0,0,.28); }

/* ---------- Lesefortschritt ---------- */
.tn-progress {
  position: fixed; top: 0; left: 0; z-index: 1000;
  height: 2.5px; width: 0;
  background: var(--tn-accent);
  transition: width .1s linear;
}

/* ---------- Kontaktformular ---------- */
.tn-form {
  display: grid; gap: 1.1rem;
  max-width: 620px; margin: 2rem auto;
}
.tn-form label {
  display: block; font-size: .82rem; letter-spacing: .04em;
  text-transform: uppercase; margin-bottom: .4rem; opacity: .75;
}
.tn-form input[type="text"],
.tn-form input[type="email"],
.tn-form input[type="tel"],
.tn-form textarea {
  width: 100%; padding: .85em 1em;
  border: 1px solid rgba(0,0,0,.18); border-radius: 6px;
  background: #fff; font: inherit; font-size: .95rem;
  transition: border-color .25s var(--tn-ease), box-shadow .25s var(--tn-ease);
}
.tn-form input:focus, .tn-form textarea:focus {
  outline: none;
  border-color: var(--tn-accent);
  box-shadow: 0 0 0 3px rgba(176,141,120,.18);
}
.tn-form textarea { min-height: 150px; resize: vertical; }
.tn-form .tn-hp { position: absolute; left: -9999px; opacity: 0; }
.tn-form button[type="submit"] {
  justify-self: start;
  padding: .9em 2.2em; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--tn-dark); color: #fff; font-size: .92rem;
  letter-spacing: .04em;
  transition: transform .25s var(--tn-ease), box-shadow .25s var(--tn-ease),
              opacity .2s;
}
.tn-form button[type="submit"]:hover:not(:disabled) {
  transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.2);
}
.tn-form button[type="submit"]:disabled { opacity: .55; cursor: wait; }
.tn-form-status {
  padding: .9em 1.1em; border-radius: 6px; font-size: .9rem;
  display: none;
}
.tn-form-status.tn-ok {
  display: block; background: #e9f5ec; border: 1px solid #b7ddc2; color: #21603a;
}
.tn-form-status.tn-err {
  display: block; background: #fdecec; border: 1px solid #f2b9b9; color: #8a2020;
}
.tn-form .tn-consent {
  display: flex; gap: .7rem; align-items: flex-start;
  font-size: .82rem; line-height: 1.5; text-transform: none;
  letter-spacing: 0; opacity: 1;
}
.tn-form .tn-consent input { margin-top: .2rem; flex: 0 0 auto; }

/* ---------- Barrierefreiheit ---------- */
:focus-visible { outline: 2px solid var(--tn-accent); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  img.tn-img-loading { opacity: 1; }
}

/* ==========================================================
   Galerie-Karussell (Ersatz fuer Kadence/Splide)
   ========================================================== */

.tn-carousel-wrap { position: relative; }

.kb-gallery-ul.kb-gallery-type-fluidcarousel {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 1rem;
  margin: 0;
  padding: 0 0 .5rem 0;
  list-style: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.kb-gallery-ul.kb-gallery-type-fluidcarousel::-webkit-scrollbar { display: none; }

.kb-gallery-ul.kb-gallery-type-fluidcarousel > .kb-slide-item {
  flex: 0 0 auto !important;
  width: min(78%, 420px);
  max-width: 100%;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  scroll-snap-align: center;
  opacity: .55;
  transform: scale(.95);
  transition: opacity .45s var(--tn-ease), transform .45s var(--tn-ease);
}
.kb-gallery-ul.kb-gallery-type-fluidcarousel > .kb-slide-item.tn-aktiv {
  opacity: 1;
  transform: none;
}

.kb-gallery-ul.kb-gallery-type-fluidcarousel .kb-gallery-figure,
.kb-gallery-ul.kb-gallery-type-fluidcarousel .kb-gal-image-radius,
.kb-gallery-ul.kb-gallery-type-fluidcarousel .kb-gallery-image-contain {
  width: 100%;
  height: auto !important;
  max-height: none !important;
  margin: 0;
}
.kb-gallery-ul.kb-gallery-type-fluidcarousel img {
  width: 100%;
  height: auto !important;
  max-height: none !important;
  object-fit: contain;
  display: block;
  border-radius: 6px;
}

/* Pfeile */
.tn-car-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 5;
  width: 42px; height: 42px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.92); color: #222;
  font-size: 1.3rem; line-height: 1; cursor: pointer;
  box-shadow: 0 3px 14px rgba(0,0,0,.18);
  transition: opacity .25s var(--tn-ease), transform .25s var(--tn-ease);
}
.tn-car-btn:hover { transform: translateY(-50%) scale(1.08); }
.tn-car-btn[disabled] { opacity: 0; pointer-events: none; }
.tn-car-prev { left: -6px; }
.tn-car-next { right: -6px; }
@media (min-width: 900px) {
  .tn-car-prev { left: -20px; }
  .tn-car-next { right: -20px; }
}

/* Punkte */
.tn-car-dots {
  display: flex; justify-content: center; gap: .45rem;
  margin: .9rem 0 0 0; padding: 0; list-style: none;
}
.tn-car-dots button {
  width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%;
  background: currentColor; opacity: .25; cursor: pointer;
  transition: opacity .25s var(--tn-ease), transform .25s var(--tn-ease);
}
.tn-car-dots button.tn-aktiv { opacity: .85; transform: scale(1.5); }

@media (prefers-reduced-motion: reduce) {
  .kb-gallery-ul.kb-gallery-type-fluidcarousel { scroll-behavior: auto; }
  .kb-gallery-ul.kb-gallery-type-fluidcarousel > .kb-slide-item {
    opacity: 1; transform: none;
  }
}

/* Karussell: Hoehe begrenzen */
.kb-gallery-ul.kb-gallery-type-fluidcarousel > .kb-slide-item {
  width: clamp(200px, 66vw, 340px);
}
.kb-gallery-ul.kb-gallery-type-fluidcarousel img {
  max-height: 58vh !important;
  object-fit: cover;
}
.kb-gallery-ul.kb-gallery-type-fluidcarousel .kb-gallery-figure,
.kb-gallery-ul.kb-gallery-type-fluidcarousel .kb-gal-image-radius,
.kb-gallery-ul.kb-gallery-type-fluidcarousel .kb-gallery-image-contain {
  max-height: 58vh;
  overflow: hidden;
}
