/*
 * Fern & Fang Co. — Homepage Styles
 * Companion stylesheet for template-fern-fang-homepage.php
 *
 * All selectors are prefixed with .ff- to avoid conflicts with
 * your active WordPress theme.
 */

/* ─── Reset for this page only ─────────────────────────────── */
.ff-homepage *,
.ff-homepage *::before,
.ff-homepage *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── CSS Custom Properties ────────────────────────────────── */
.ff-homepage {
  --cream:        hsl(37, 75%, 97%);
  --dark-forest:  hsl(140, 20%, 12%);
  --hero-start:   hsl(140, 18%, 36%);
  --hero-mid:     hsl(145, 22%, 22%);
  --hero-end:     hsl(150, 25%, 8%);
  --sage:         hsl(140, 12%, 44%);
  --sage-footer:  hsl(140, 15%, 42%);
  --gold:         hsl(43, 40%, 58%);
  --muted-text:   hsl(140, 10%, 40%);
  --border:       hsl(83, 15%, 82%);
  --radius:       0.5rem;

  font-family: 'Montserrat', sans-serif;
  background-color: var(--cream);
  color: var(--dark-forest);
}

.ff-homepage a {
  text-decoration: none;
  color: inherit;
}

/* ─── Header ───────────────────────────────────────────────── */
.ff-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  background-color: var(--cream);
  border-bottom: 1px solid var(--border);
  padding: 0 2.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ff-logo {
  font-family: 'Great Vibes', cursive;
  font-size: 1.85rem;
  color: var(--dark-forest);
  letter-spacing: 0.02em;
}

.ff-nav {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.ff-nav a {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dark-forest);
  transition: color 0.2s;
}
.ff-nav a:hover { color: var(--sage); }

.ff-search-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--dark-forest);
  display: flex;
  align-items: center;
  padding: 4px;
  transition: color 0.2s;
}
.ff-search-btn:hover { color: var(--sage); }

/* ─── Search Overlay ───────────────────────────────────────── */
.ff-search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(20, 35, 20, 0.85);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
}
.ff-search-overlay.active { display: flex; }

.ff-search-overlay form {
  display: flex;
  gap: 0;
}
.ff-search-overlay input[type="search"] {
  padding: 0.75rem 1.2rem;
  width: 320px;
  border: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  outline: none;
}
.ff-search-overlay button[type="submit"] {
  padding: 0.75rem 1.4rem;
  background: var(--sage);
  color: white;
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.ff-search-close {
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.ff-search-close:hover { opacity: 1; }

/* ─── Hero ─────────────────────────────────────────────────── */
.ff-hero {
  min-height: 100vh;
  padding-top: 60px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(
    160deg,
    var(--hero-start) 0%,
    var(--hero-mid)   45%,
    var(--hero-end)   100%
  );
  position: relative;
  overflow: hidden;
}

/* Subtle radial light from left */
.ff-hero::before {
  content: '';
  position: absolute;
  top: 10%; left: 5%;
  width: 55%; height: 70%;
  background: radial-gradient(
    ellipse at 30% 40%,
    hsla(140, 25%, 50%, 0.22) 0%,
    transparent 65%
  );
  pointer-events: none;
}

.ff-hero-content {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 4rem 2.5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.ff-hero-card {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 1rem;
  padding: 2.8rem 3rem;
  max-width: 440px;
  backdrop-filter: blur(4px);
}

.ff-eyebrow {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.ff-hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3.2rem;
  font-weight: 500;
  line-height: 1.1;
  color: var(--dark-forest);
  margin-bottom: 1.2rem;
}

.ff-hero-desc {
  font-size: 0.82rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 2rem;
}

.ff-btn-gold {
  display: inline-block;
  background-color: var(--gold);
  color: var(--dark-forest);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.15s;
}
.ff-btn-gold:hover {
  background-color: hsl(43, 50%, 50%);
  color: white;
  transform: translateY(-1px);
}

.ff-scroll-label {
  text-align: center;
  padding: 1.5rem 0 2.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.55);
}

/* ─── Knowledge Web ─────────────────────────────────────────── */
.ff-knowledge {
  background: linear-gradient(
    to bottom,
    var(--hero-end)         0%,
    hsl(150, 28%, 6%)       100%
  );
  padding: 5rem 2rem 6rem;
  text-align: center;
}

.ff-section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.2rem;
  font-weight: 500;
  color: var(--cream);
  margin-bottom: 0.75rem;
}

.ff-section-subtitle {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.7;
  max-width: 420px;
  margin: 0 auto 3.5rem;
}

/* Override for newsletter section (light bg) */
.ff-dark-title  { color: var(--dark-forest) !important; }
.ff-dark-subtitle { color: var(--muted-text) !important; }

/*
 * ── Honeycomb grid (mathematically correct tessellation) ──────
 *
 *  W = 140px   H = W × (2/√3) ≈ 161.7px → rounded to 162px
 *
 *  Tessellation rules for pointy-top hexagons:
 *    • Rows overlap vertically by H/4 → margin-top: -40px
 *    • Every other row shifts right by W/2 → margin-left: 70px
 *    • Visual gaps: inner element scaled to 0.93 (layout unchanged)
 */
.ff-hex-grid {
  width: 648px;       /* = 4 × 140px — fits 4 hexagons across */
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  flex-$irection: column;
  align-items: flex-start;
}

.ff-hex-row {
  display: flex;
  gap: 81px;
  margin-top: -70px;  /* H × 0.25 — rows drop into each other's valleys */
  flex-shrink: 0;
}
.ff-hex-row:first-child { margin-top: 0; }

/* Row 2: offset right by W/2 so each hex lands in a row-1 valley */
.ff-hex-row:nth-child(2) { margin-left: 122px; }

/* Row 3: single hex centered under row 2's middle hex */
.ff-hex-row:nth-child(3) { margin-left: 365px; }

.ff-hex-cell {
  position: relative;
  width: 162px;
  height: 140px;
  flex-shrink: 0;
  cursor: pointer;
  display: block;     /* <a> tag needs this */
}

.ff-hex-inner {
  position: absolute;
  inset: 0;
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  background: hsl(37, 55%, 96%);
  transform: scale(0.93);
  transform-origin: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 1rem 0.5rem;
  transition: background 0.2s, transform 0.2s;
}

.ff-hex-cell:hover .ff-hex-inner {
  background: hsl(37, 65%, 90%);
  transform: scale(0.97);
}

.ff-hex-emoji { font-size: 1.6rem; }

.ff-hex-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--dark-forest);
  text-align: center;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.ff-hex-count {
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-text);
}

/* ─── Newsletter ────────────────────────────────────────────── */
.ff-newsletter {
  background-color: hsl(80, 20%, 92%);
  padding: 5rem 2rem;
  text-align: center;
}

.ff-newsletter-form {
  display: flex;
  justify-content: center;
  max-width: 480px;
  margin: 0 auto;
}

.ff-newsletter-input {
  flex: 1;
  padding: 0.75rem 1.2rem;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.82rem;
  color: var(--dark-forest);
  background: white;
  outline: none;
}
.ff-newsletter-input:focus { border-color: var(--sage); }
.ff-newsletter-input::placeholder { color: hsl(140, 8%, 65%); }

.ff-btn-sage {
  padding: 0.75rem 1.6rem;
  background-color: var(--sage);
  color: white;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  transition: background-color 0.2s;
}
.ff-btn-sage:hover { background-color: hsl(140, 14%, 38%); }

/* ─── Footer ────────────────────────────────────────────────── */
.ff-footer {
  background-color: var(--sage-footer);
  color: rgba(255, 255, 255, 0.88);
  padding: 4rem 2.5rem 2rem;
}

.ff-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto 3rem;
}

.ff-footer-logo {
  font-family: 'Great Vibes', cursive;
  font-size: 2rem;
  color: white;
  display: block;
  margin-bottom: 0.5rem;
}

.ff-footer-location {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 1rem;
}

.ff-footer-socials {
  display: flex;
  gap: 0.6rem;
}
.ff-footer-socials a {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s;
}
.ff-footer-socials a:hover { color: white; }

.ff-footer-col h4 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: white;
  margin-bottom: 1.2rem;
}

.ff-footer-col ul { list-style: none; }
.ff-footer-col ul li { margin-bottom: 0.65rem; }
.ff-footer-col ul li a {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.65);
  transition: color 0.2s;
}
.ff-footer-col ul li a:hover { color: white; }

.ff-footer-bottom {
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 1.5rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .ff-header  { padding: 0 1.2rem; }
  .ff-hero-content  { padding: 3rem 1.2rem 1.5rem; }
  .ff-hero-card     { padding: 2rem 1.5rem; }
  .ff-hero-title    { font-size: 2.4rem; }
  .ff-hex-grid      { transform: scale(0.78); transform-origin: top center; margin-bottom: -80px; }
  .ff-footer-grid   { grid-template-columns: 1fr 1fr; gap: 2rem 1.5rem; }
}

@media (max-width: 480px) {
  /* ─── Mobile nav hamburger ─────────────────────────────────── */
.ff-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 17px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: inherit;
  flex-shrink: 0;
}
.ff-nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.ff-nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.ff-nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.ff-nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

@media (max-width: 768px) {
  .ff-nav-toggle { display: flex; }
  .ff-nav {
    position: fixed;
    top: 0; right: -100%;
    width: 72%; max-width: 280px; height: 100vh;
    background: var(--dark-forest);
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 2rem 2rem;
    gap: 0;
    transition: right 0.3s ease;
    z-index: 9998;
    box-shadow: -4px 0 24px rgba(0,0,0,0.35);
  }
  .ff-nav.open { right: 0; }
  .ff-nav a {
    display: block;
    width: 100%;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: var(--cream);
    font-size: 1rem;
    letter-spacing: 0.05em;
  }
  .ff-nav .ff-search-btn {
    margin-top: 1rem;
    color: var(--cream);
  }
  .ff-nav-toggle {
    color: var(--cream);
    position: relative;
    z-index: 9999;
  }
  /* dim overlay behind open menu */
  body.ff-nav-open::after {
    content: '';
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9997;
  }
}

@media (max-width: 480px) {
  .ff-hex-grid      { transform: scale(0.62); transform-origin: top center; margin-bottom: -160px; }
  .ff-newsletter-form { flex-direction: column; }
  .ff-newsletter-input {
    border-right: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
  }
  .ff-btn-sage { border-radius: 0 0 var(--radius) var(--radius); }
  .ff-footer-grid { grid-template-columns: 1fr; }
}
/* ─── WordPress admin bar offset ───────────────────────────── */
.admin-bar .ff-header { top: 32px !important; }
.admin-bar .ff-hero   { padding-top: 92px !important; }

/* Font specificity override */
.ff-homepage .ff-hero-title { font-family: 'Cormorant Garamond', serif !important; }
.ff-homepage .ff-section-title { font-family: 'Cormorant Garamond', serif !important; }
