/* =========================================================
   The Barn at Ivy Oaks – With Dark Mode Toggle
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;700&family=Inter:wght@400;500;600&family=Libre+Baskerville:wght@400;700&display=swap');

/* Root variables – shared + light/dark specific */
:root {
  --color-bg:        #fdfaf7;          /* warm off-white */
  --color-text:      #2d2d2d;
  --color-headline:  #1a1a1a;
  --color-accent:    #8a9a5b;          /* sage green */
  --color-accent-alt:#c47c5e;          /* terracotta */
  --color-muted:     #6b7280;
  --color-border:    #e5e0d8;
  --color-card-bg:   #ffffff;
  --color-hero-overlay: rgba(0,0,0,0.35);
  --max-width:       1200px;
  --pad-section:     clamp(4rem, 8vw, 7rem);
  --radius:          1.25rem;
  --shadow-sm:       0 4px 12px rgba(0,0,0,0.06);
  --shadow-md:       0 10px 30px rgba(0,0,0,0.08);
  --transition:      all 0.25s ease;
}

/* Dark mode variables override */
[data-theme="dark"] {
  --color-bg:        #1a1612;          /* deep warm charcoal/brown */
  --color-text:      #e8e0d8;          /* warm off-white */
  --color-headline:  #f5f0e8;
  --color-accent:    #a8b97d;          /* lighter sage */
  --color-accent-alt:#d89f8a;          /* softer terracotta */
  --color-muted:     #a89f94;
  --color-border:    #4a4038;
  --color-card-bg:   #251f19;
  --color-hero-overlay: rgba(0,0,0,0.55);
  --shadow-sm:       0 4px 16px rgba(0,0,0,0.4);
  --shadow-md:       0 12px 36px rgba(0,0,0,0.5);
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  font-size: 1.1rem;
  transition: background 0.4s ease, color 0.4s ease;
}

h1, h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--color-headline);
}

h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-headline);
}


/* Long-form content paragraphs */
.content p,
.page-content p,
.spider-content p {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--color-body);
}


a { color: var(--color-accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--color-accent-alt); }

/* Wrap / Container */
.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.wrap.narrow { max-width: 800px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(253, 250, 247, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  padding: 1.25rem 0;
  transition: background 0.4s ease, border-color 0.4s ease;
}
[data-theme="dark"] .site-header {
  background: rgba(26, 22, 18, 0.92);
}

.site-header .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.logo {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  margin: 0;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  gap: 2rem;
  font-weight: 500;
}
.nav a { font-size: 1.05rem; transition: var(--transition); }
.nav a:hover { color: var(--color-accent-alt); }

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: var(--transition);
  color: var(--color-headline);
}
.theme-toggle {
  background: none;
  border: 2px solid var(--color-border);
  border-radius: 999px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;

  color: var(--color-headline);
  font-size: 1.2rem;
  transition: var(--transition);
}

.theme-toggle:hover {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}


.hero {
  background:
    linear-gradient(var(--color-hero-overlay), var(--color-hero-overlay)),
    url('/landing/images/hero2.jpg');
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;

  color: white;
  text-align: center;
  padding: clamp(8rem, 20vh, 14rem) 1.5rem;
  position: relative;
}

.hero::before { content:''; position:absolute; inset:0; background: linear-gradient(to bottom, rgba(0,0,0,0.1), var(--color-hero-overlay)); }
.hero .wrap { position: relative; z-index: 2; }

.hero h2 { font-size: clamp(3rem, 8vw, 5.5rem); margin-bottom: 1.25rem; text-shadow: 0 4px 12px rgba(0,0,0,0.5); }
.hero p { font-size: clamp(1.25rem, 3vw, 1.6rem); max-width: 50ch; margin: 0 auto 2.5rem; opacity: 0.95; }
.hero h2,
.hero p {
  color: #ffffff;
}

.hero {
  background:
    linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.55)),
    url('/landing/images/hero.jpg');
}

.btn-primary {
  display: inline-block;
  background: var(--color-accent-alt);
  color: white;
  font-weight: 600;
  padding: 1rem 2.2rem;
  border-radius: 999px;
  font-size: 1.15rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.btn-primary:hover {
  background: color-mix(in srgb, var(--color-accent-alt) 85%, black);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(196,124,94,0.3);
}

/* Sections, grid, cards – similar updates */
.section { padding: var(--pad-section) 0; }
.section.alt { background: #f8f5f0; }
[data-theme="dark"] .section.alt { background: #201a14; }

.section h3 { font-size: clamp(2.4rem, 5vw, 3.5rem); text-align: center; margin-bottom: 2.5rem; }

/* Grid & Cards – add transitions */
.grid, .cards { /* same as before */ }
.card {
  background: var(--color-card-bg);
  padding: 2.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid var(--color-border);
}
.card:hover { transform: translateY(-8px); box-shadow: var(--shadow-md); }
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  margin-top: 3rem;
}

.contact-form .field {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.25rem;
}

.contact-form label {
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.contact-form input,
.contact-form textarea {
  padding: 0.75rem 0.85rem;
  border-radius: 0.6rem;
  border: 1px solid var(--color-border);
  font-family: inherit;
  font-size: 1rem;
  background: var(--color-card-bg);
  color: var(--color-text);
}

.contact-map iframe {
  width: 100%;
  height: 280px;
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.location-meta {
  margin-top: 1.25rem;
}

.btn-secondary {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  border: 2px solid var(--color-accent);
  color: var(--color-accent);
  font-weight: 600;
}

.btn-secondary:hover {
  background: var(--color-accent);
  color: white;
}

/* Mobile */
@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.75rem;
  margin-top: 3rem;
}

.gallery-item {
  background: var(--color-card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.gallery-item img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

.gallery-item figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  color: var(--color-muted);
  background: var(--color-card-bg);
}

/* Footer */
.site-footer {
  background: var(--color-headline);
  color: #d4d0c9;
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  font-size: 0.95rem;
}
[data-theme="dark"] .site-footer { background: #0f0b07; }

/* Mobile */
@media (max-width: 640px) {
  .nav { flex-direction: column; gap: 1rem; text-align: center; width: 100%; }
  .hero { padding: clamp(6rem, 18vh, 10rem) 1rem; }
}
.site-header .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

/* Optional: center nav more deliberately on wider screens */
.nav {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 2rem;
}
/* ── Mobile Nav Toggle (Hamburger) ────────────────────────────────────── */

/* Hide checkbox visually but keep it functional */
.nav-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Hamburger icon styling */
.nav-toggle-label {
  display: none;                  /* Hidden on desktop */
  cursor: pointer;
  padding: 0.5rem;
  z-index: 110;
}

.hamburger {
  display: block;
  width: 28px;
  height: 20px;
  position: relative;
}

.bar {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--color-headline);
  border-radius: 2px;
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}

.bar:nth-child(1) { top: 0; }
.bar:nth-child(2) { top: 8px; }
.bar:nth-child(3) { top: 16px; }

/* "X" animation when open */
#nav-toggle:checked + .nav-toggle-label .bar:nth-child(1) {
  transform: rotate(45deg);
  top: 8px;
}
#nav-toggle:checked + .nav-toggle-label .bar:nth-child(2) {
  opacity: 0;
}
#nav-toggle:checked + .nav-toggle-label .bar:nth-child(3) {
  transform: rotate(-45deg);
  top: 8px;
}

/* Nav on mobile: hidden by default, slide/fade in when checked */
.nav {
  transition: all 0.35s ease;
}

/* Desktop: horizontal nav */
@media (min-width: 769px) {
  .nav-toggle-label { display: none; } /* No hamburger needed */
  .nav {
    display: flex;
    gap: 2rem;
    margin-left: auto; /* Pushes nav to right if needed */
  }
}

/* Mobile: vertical dropdown/full overlay when toggled */
@media (max-width: 768px) {
  .nav-toggle-label { display: block; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--color-bg);
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 0;
    border-top: 1px solid var(--color-border);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 100;
  }

  /* When toggled open */
  #nav-toggle:checked ~ .nav {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav a {
    font-size: 1.3rem;
    padding: 0.75rem 1.5rem;
  }


  .content p,
.page-content p,
.spider-content p {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--color-text); /* FIXED */
}


/* ── Lightbox ───────────────────────────────────────────── */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 2rem;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.lightbox-caption {
  margin-top: 1rem;
  text-align: center;
  color: #ddd;
  font-size: 1rem;
}

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  font-size: 2.5rem;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  line-height: 1;
}

  /* Optional: full-screen overlay style (more dramatic) */
  /* .nav { height: 100vh; justify-content: center; background: rgba(253,250,247,0.98); } */
}

/* Dark mode adjustments for hamburger */
[data-theme="dark"] .bar {
  background: var(--color-headline);
}
/* Reduced motion */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; transform: none !important; } }