/* =========================================================
   Treflyn Barn — FINISH v2.6
   Final cohesive polish for the whole homepage
   Safe: never hide images / maps
   ========================================================= */

body.tb-front {
  --finish-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --finish-gold: #c9a66b;
  --finish-gold-soft: #e0c49a;
  --finish-ink: #0f1c16;
  --finish-paper: #fffcf8;
  --finish-muted: #6f6a63;
}

/* —— Page canvas —— */
body.tb-front {
  background:
    radial-gradient(ellipse 120% 50% at 50% -5%, rgba(201, 166, 107, 0.07), transparent 50%),
    #f6f1e8 !important;
  color: #1c1b18;
  -webkit-font-smoothing: antialiased;
}

body.tb-front img,
body.tb-front .exp-visual,
body.tb-front .final-cta-bg,
body.tb-front .location-map iframe,
body.tb-front .loc-photo img,
body.tb-front .gallery-item img,
body.tb-front .sleep-img img,
body.tb-front .film-card img,
body.tb-front .about-images img {
  opacity: 1 !important;
  visibility: visible !important;
  clip-path: none !important;
}

body.tb-front .hero-slide:not(.active) {
  opacity: 0 !important;
}
body.tb-front .hero-slide.active {
  opacity: 1 !important;
}

/* —— Header —— */
body.tb-front .site-header {
  transition: background 0.35s var(--finish-ease), box-shadow 0.35s, border-color 0.3s !important;
}

body.tb-front .site-header .tb-nav-bar,
body.tb-front .site-header .nav {
  min-height: var(--nav-h, 90px);
  align-items: center;
}

body.tb-front .site-header:not(.scrolled) .nav-links a[data-nav] {
  color: rgba(255, 252, 248, 0.88);
}

body.tb-front .site-header:not(.scrolled) .nav-links a[data-nav]:hover,
body.tb-front .site-header:not(.scrolled) .nav-links a[data-nav].active {
  color: #f0d7b0;
}

body.tb-front .nav-cta {
  border-radius: 999px !important;
  font-weight: 700 !important;
  letter-spacing: 0.07em !important;
}

/* —— Hero —— */
body.tb-front .hero {
  isolation: isolate;
}

body.tb-front .hero-content {
  max-width: 36rem;
}

body.tb-front .hero-trust {
  margin-bottom: 1.1rem !important;
}

body.tb-front .hero .lead {
  max-width: 34rem;
  line-height: 1.7;
}

body.tb-front .hero-meta {
  gap: 0.5rem !important;
  margin-bottom: 1.65rem !important;
}

body.tb-front .hero-meta span {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.tb-front .hero-actions {
  gap: 0.75rem !important;
}

body.tb-front .hero-card {
  max-width: 400px;
}

body.tb-front .hc-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255, 252, 248, 0.1);
  font-size: 0.9rem;
}

body.tb-front .hc-list li span {
  opacity: 0.72;
}

body.tb-front .hc-list li strong {
  font-weight: 600;
  text-align: right;
}

body.tb-front .hc-note {
  margin-top: 0.85rem;
  font-size: 0.78rem;
  line-height: 1.45;
  opacity: 0.72;
  text-align: center;
}

/* —— Buttons unified —— */
body.tb-front .btn {
  border-radius: 999px !important;
  letter-spacing: 0.07em;
  font-weight: 600;
  transition: transform 0.3s var(--finish-ease), box-shadow 0.3s, background 0.3s, border-color 0.25s !important;
}

body.tb-front .btn:hover {
  transform: translateY(-2px);
}

body.tb-front .btn-primary {
  background: var(--finish-ink) !important;
  color: #fffcf8 !important;
  border-color: transparent !important;
  box-shadow: 0 12px 28px rgba(15, 28, 22, 0.18);
}

body.tb-front .btn-primary:hover {
  background: #1a2e24 !important;
  box-shadow: 0 16px 36px rgba(15, 28, 22, 0.24);
}

body.tb-front .btn-outline {
  border-width: 1.5px !important;
}

/* —— Containers —— */
body.tb-front .container {
  width: min(100% - 3rem, var(--max, 1180px));
  margin-inline: auto;
}

@media (max-width: 640px) {
  body.tb-front .container {
    width: min(100% - 1.5rem, var(--max, 1180px));
  }
}

/* —— Cards shared —— */
body.tb-front .promise-card,
body.tb-front .amenity-cat,
body.tb-front .review-card,
body.tb-front .rule-card,
body.tb-front .book-reason,
body.tb-front .season-card,
body.tb-front .location-point,
body.tb-front .check-item {
  transition: transform 0.4s var(--finish-ease), box-shadow 0.35s, border-color 0.3s !important;
}

/* —— Trust bar —— */
body.tb-front .trust-bar {
  border-top: 1px solid rgba(201, 166, 107, 0.15);
}

body.tb-front .tb-item strong {
  letter-spacing: 0.01em;
}

/* —— Stats —— */
body.tb-front .stats-band-inner {
  backdrop-filter: blur(8px);
}

/* —— Pull quote —— */
body.tb-front .pull-quote blockquote p {
  max-width: 42rem;
  margin-inline: auto;
}

/* —— Gallery —— */
body.tb-front .gallery-filters button {
  transition: transform 0.25s, background 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.3s;
}

/* —— Filmstrip —— */
body.tb-front .film-card {
  transition: transform 0.45s var(--finish-ease), box-shadow 0.4s !important;
}

/* —— Booking form —— */
body.tb-front .booking-aside {
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(201, 166, 107, 0.16), transparent 50%),
    linear-gradient(165deg, #121f19 0%, #0a1410 100%);
  color: rgba(255, 252, 248, 0.9);
}

body.tb-front .booking-aside h2 {
  font-family: var(--font-display, Georgia, serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 2.5vw, 2rem);
  color: #fffcf8;
  margin: 0.35rem 0 0.75rem;
}

body.tb-front .booking-aside .aside-eye {
  color: var(--finish-gold-soft);
}

body.tb-front .booking-rules {
  margin: 1.15rem 0;
  display: grid;
  gap: 0.45rem;
  font-size: 0.88rem;
  opacity: 0.85;
}

body.tb-front .booking-rules li {
  padding-left: 0.9rem;
  position: relative;
}

body.tb-front .booking-rules li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--finish-gold);
}

body.tb-front .stay-summary {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(255, 252, 248, 0.06);
  border: 1px solid rgba(255, 252, 248, 0.1);
  font-size: 0.88rem;
  line-height: 1.45;
}

body.tb-front .field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
  color: var(--forest-soft, #2d4a3c);
}

body.tb-front .field input,
body.tb-front .field select,
body.tb-front .field textarea {
  width: 100%;
  border-radius: 12px !important;
  border: 1px solid rgba(15, 28, 22, 0.12) !important;
  padding: 0.75rem 0.9rem;
  background: #fffcf8 !important;
  transition: border-color 0.2s, box-shadow 0.25s !important;
}

body.tb-front .field textarea {
  min-height: 110px;
  resize: vertical;
}

body.tb-front .book-panel-title {
  font-family: var(--font-display, Georgia, serif);
  font-weight: 500;
}

/* —— Pills —— */
body.tb-front .pill,
body.tb-front .host-badges .pill {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(15, 28, 22, 0.05);
  border: 1px solid rgba(15, 28, 22, 0.08);
  color: var(--forest-soft, #2d4a3c);
}

/* —— Mobile book bar —— */
body.tb-front .mobile-book-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
}

body.tb-front .mobile-book-bar .info strong {
  display: block;
  font-family: var(--font-display, Georgia, serif);
  font-size: 1.15rem;
  font-weight: 500;
}

/* —— Footer —— */
body.tb-front .footer-about {
  margin: 1rem 0 1.25rem;
  max-width: 34ch;
  line-height: 1.65;
  opacity: 0.78;
  font-size: 0.95rem;
}

body.tb-front .footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.35rem;
  border-top: 1px solid rgba(255, 252, 248, 0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  font-size: 0.8rem;
  opacity: 0.65;
}

body.tb-front .footer-bottom a {
  color: var(--finish-gold-soft);
  text-decoration: none;
}

body.tb-front .footer-bottom a:hover {
  color: #fff;
}

/* —— Scroll progress —— */
body.tb-front .scroll-progress {
  z-index: 10080 !important;
}

/* —— Back top already handled; ensure above mobile bar —— */
body.tb-front .back-top {
  z-index: 120 !important;
}

/* —— Section CTA spacing —— */
body.tb-front .section-cta .btn {
  min-width: 12rem;
}

/* —— Soft selection —— */
body.tb-front ::selection {
  background: rgba(201, 166, 107, 0.35);
  color: #0f1c16;
}

/* —— Hero bottom controls —— */
body.tb-front .hero-bottom {
  z-index: 5;
}

body.tb-front .hero-arrow {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 252, 248, 0.1);
  color: #fffcf8;
  border: 1px solid rgba(255, 252, 248, 0.25);
  cursor: pointer;
  transition: background 0.25s, transform 0.25s, border-color 0.25s;
}

body.tb-front .hero-arrow:hover {
  background: rgba(201, 166, 107, 0.35);
  border-color: rgba(240, 215, 176, 0.55);
  transform: scale(1.05);
}

/* —— Lightbox —— */
body.tb-front .lightbox-close,
body.tb-front .lightbox-nav {
  border-radius: 50%;
  background: rgba(255, 252, 248, 0.1);
  border: 1px solid rgba(255, 252, 248, 0.2);
  color: #fff;
  transition: background 0.25s, transform 0.25s;
}

body.tb-front .lightbox-close:hover,
body.tb-front .lightbox-nav:hover {
  background: rgba(201, 166, 107, 0.35);
  transform: scale(1.05);
}

/* —— Reduce motion —— */
@media (prefers-reduced-motion: reduce) {
  body.tb-front .btn:hover,
  body.tb-front .hero-arrow:hover {
    transform: none;
  }
}

/* —— Touch: no sticky hover lifts —— */
@media (hover: none) {
  body.tb-front .btn:hover,
  body.tb-front .promise-card:hover,
  body.tb-front .review-card:hover,
  body.tb-front .exp-card:hover,
  body.tb-front .sleep-card:hover {
    transform: none !important;
  }
}

/* —— Final safety: reveal content never stuck —— */
body.tb-front .reveal.visible,
body.tb-front.tb-compat-ready .reveal {
  opacity: 1;
  transform: none;
  filter: none;
}


/* —— Hero text anti-flicker v3.1.6 (Brave mobile + Firefox + DDG) —— */

/* Never hide hero copy while "booting" */
body.tb-front.tb-booting .hero-content,
body.tb-front.tb-booting .hero-card,
body.tb-front .hero-content,
body.tb-front .hero-card {
  opacity: 1 !important;
  filter: none !important;
  animation: none !important;
  transform: none !important;
}

/* Stack text above all effects with a stable paint root */
.hero-inner {
  position: relative;
  z-index: 6;
  isolation: isolate;
}

.hero-content {
  position: relative;
  z-index: 6;
  /* Avoid forced GPU layers on mobile — they shimmer text over fading slides */
  transform: none;
  backface-visibility: visible;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.hero h1,
.hero h1 em,
.hero .lead,
.hero-kicker,
.hero-trust,
.hero-meta,
.hero-actions,
.luxe-est {
  opacity: 1 !important;
  visibility: visible !important;
  filter: none !important;
  animation: none !important;
  background-image: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  -webkit-text-fill-color: unset;
}

.hero h1 {
  color: var(--paper, #fffcf8) !important;
  /* soft shadow without blur-filter thrash */
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45) !important;
}

body.tb-luxe .hero h1 em,
.hero-content h1 em,
.hero h1 em {
  color: #e0c49a !important;
  -webkit-text-fill-color: #e0c49a !important;
  font-style: italic;
}

/* Word spans (if any leftover) always solid */
.hero-content h1 .word {
  display: inline !important;
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

/* Kill particles / mesh / grain over the hero */
.hero-grain,
.hero-mesh,
.hero-sparkles,
.sig-dust,
.cursor-glow {
  display: none !important;
  animation: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Backdrop blur sampling moving slides = shimmer on Android Brave */
.hero-trust,
.hero-meta span,
body.tb-luxe .hero-trust {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(8, 14, 11, 0.55) !important;
}

.hero-card {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(12, 20, 16, 0.82) !important;
}

/* Slides: no continuous filter/transform under text */
.hero-slide img {
  filter: none !important;
  will-change: auto !important;
  animation: none !important;
  transform: scale(1.03) !important;
  transition: opacity 0.8s ease !important;
}

/* Mobile / touch: freeze carousel crossfade entirely */
@media (max-width: 900px), (pointer: coarse) {
  .hero-slide {
    transition: none !important;
  }

  .hero-slide:not(.active) {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .hero-slide.active {
    opacity: 1 !important;
    visibility: visible !important;
  }

  .hero-slide img {
    transition: none !important;
    transform: none !important;
    object-position: center 35% !important;
  }

  .hero-frame,
  .hero-side-label,
  .hero-scroll-cue {
    display: none !important;
  }

  /* Slight panel behind copy so type isn't pure transparent-over-photo */
  .hero-content {
    padding: 0.85rem 0.9rem 1rem;
    margin-inline: -0.25rem;
    border-radius: 16px;
    background: linear-gradient(
      105deg,
      rgba(8, 14, 11, 0.55) 0%,
      rgba(8, 14, 11, 0.28) 70%,
      transparent 100%
    );
  }

  .hero h1 {
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55) !important;
  }
}

/* —— Native pointer (no custom cursor) —— */
html.tb-front,
html.tb-front body,
html.tb-front body * {
  cursor: auto;
}
html.tb-front a,
html.tb-front a *,
html.tb-front button,
html.tb-front button *,
html.tb-front [role="button"],
html.tb-front .gallery-item,
html.tb-front .nav-toggle,
html.tb-front .faq-q,
html.tb-front label,
html.tb-front select {
  cursor: pointer;
}
html.tb-front input[type="text"],
html.tb-front input[type="search"],
html.tb-front input[type="email"],
html.tb-front textarea {
  cursor: text;
}

/* —— Simple booking panel —— */
.book-simple {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  background: var(--paper, #fffcf8);
  border: 1px solid rgba(201, 166, 107, 0.28);
  border-radius: 22px;
  padding: clamp(1.6rem, 4vw, 2.4rem);
  box-shadow: 0 18px 40px rgba(15, 20, 16, 0.06);
}
.book-simple-copy {
  margin: 0 0 1.35rem;
  color: var(--ink-soft, #3a3834);
  font-size: 1.05rem;
  line-height: 1.6;
}
.book-simple .btn {
  display: inline-flex;
}
.book-simple-email {
  margin: 1.15rem 0 0;
  color: var(--muted, #6f6a63);
}
.book-simple-email a {
  color: var(--forest, #0f1c16);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.book-simple-meta {
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 0;
  color: var(--muted, #6f6a63);
  font-size: 0.92rem;
}
.book-simple-meta li + li {
  margin-top: 0.35rem;
}

.faq-filter-empty[hidden] {
  display: none !important;
}
.faq-item.open .faq-a {
  max-height: 320px;
}

/* —— Open hero: no booking card, photo-first, all devices —— */
.hero.hero--simple .hero-card {
  display: none !important;
}

.hero.hero--simple {
  align-items: flex-end;
  min-height: 100vh;
  min-height: calc(var(--app-vh, 1vh) * 100);
  min-height: 100svh;
  padding-bottom: 5.25rem;
}

.hero.hero--simple .hero-inner {
  display: flex !important;
  flex-direction: column;
  justify-content: flex-end;
  grid-template-columns: none !important;
  min-height: 0 !important;
  width: min(100% - 3rem, var(--max, 1180px)) !important;
  padding-bottom: 0;
}

.hero.hero--simple .hero-content {
  max-width: min(38rem, 100%) !important;
  margin: 0;
}

.hero.hero--simple .hero-veil {
  background:
    linear-gradient(180deg, rgba(8, 14, 11, 0.42) 0%, transparent 28%, transparent 48%, rgba(8, 14, 11, 0.78) 100%),
    linear-gradient(90deg, rgba(8, 14, 11, 0.55) 0%, rgba(8, 14, 11, 0.18) 52%, transparent 78%) !important;
}

.hero.hero--simple h1 {
  font-size: clamp(2.6rem, 6.4vw, 4.5rem) !important;
  margin-bottom: 0.85rem !important;
}

.hero.hero--simple .lead {
  max-width: 32rem;
  margin-bottom: 1.15rem !important;
  display: block !important;
  -webkit-line-clamp: unset !important;
  overflow: visible !important;
}

.hero.hero--simple .hero-meta {
  margin-bottom: 1.35rem !important;
}

/* Cover photos must fill the slide (override global img { height: auto }) */
body.tb-front .hero-slide,
body.tb-front .hero-slides {
  position: absolute;
  inset: 0;
}

body.tb-front .hero-slide img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  object-position: center 38% !important;
}

/* Rotator: no position swap (Firefox / DDG flicker) */
.hero-rotator {
  min-height: 1.55em;
  height: 1.55em;
  overflow: hidden;
}

.hero-rotator-line,
.hero-rotator-line.is-active {
  position: absolute !important;
  left: 0;
  top: 0;
  right: 0;
  transform: none !important;
}

@media (max-width: 900px), (pointer: coarse) {
  .hero.hero--simple {
    padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  }

  .hero.hero--simple .hero-inner {
    width: min(100% - 1.5rem, var(--max, 1180px)) !important;
  }

  .hero.hero--simple .hero-content {
    padding: 0.85rem 0.9rem 1rem !important;
    border-radius: 16px;
    background: linear-gradient(
      165deg,
      rgba(8, 14, 11, 0.62) 0%,
      rgba(8, 14, 11, 0.32) 72%,
      rgba(8, 14, 11, 0.12) 100%
    ) !important;
  }

  .hero.hero--simple h1 {
    font-size: clamp(2.05rem, 9vw, 2.85rem) !important;
  }

  .hero.hero--simple .hero-actions {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .hero.hero--simple .hero-actions .btn {
    width: 100% !important;
    justify-content: center !important;
    min-height: 48px;
  }

  .hero.hero--simple .hero-bottom {
    padding-bottom: max(0.85rem, env(safe-area-inset-bottom, 0px));
  }

  .hero-rotator-line:not(.is-active) {
    display: none !important;
  }

  .hero-rotator-line.is-active {
    position: relative !important;
    opacity: 1 !important;
  }
}

@media (max-width: 380px) {
  .hero.hero--simple h1 {
    font-size: 1.85rem !important;
  }
}

/* Firefox: no Ken Burns / crossfade under type */
@supports (-moz-appearance: none) {
  .hero-slide {
    transition: none !important;
  }
  .hero-slide img {
    transform: none !important;
    transition: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide,
  .hero-slide img,
  .hero-rotator-line {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}
