/* ==========================================================================
   Friends of the Westlake Village Library — site stylesheet
   Fonts: Fraunces (display/headings), Nunito (body)
   ========================================================================== */

@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/fraunces.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-optical-sizing: auto;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('../fonts/nunito.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* brand */
  --purple: #4D2368;
  --purple-ink: #2B1638;
  --purple-tint: #E7DAF0;
  --gold: #EFCB52;
  --rust: #983906;
  --sage: #6E8B63;
  --parchment: #F8F1DE;
  --parchment-soft: #EFE4C8;
  --parchment-light: #FCF8EC;

  /* chrome */
  --bg: var(--parchment);
  --surface: var(--parchment-light);
  --surface-soft: var(--parchment-soft);
  --text: var(--purple-ink);
  --text-muted: var(--purple-ink);
  --border: rgba(43, 22, 56, 0.14);
  --focus: var(--rust);

  /* type */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Nunito', Helvetica, Arial, sans-serif;

  /* layout */
  --container: 1120px;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(43, 22, 56, 0.06), 0 8px 24px -12px rgba(43, 22, 56, 0.18);
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--purple);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius);
  z-index: 1000;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--purple);
  line-height: 1.15;
  text-wrap: balance;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.25rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.25rem); letter-spacing: -0.008em; }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1em; max-width: 68ch; }
.lede { font-size: 1.15rem; color: var(--text); max-width: 62ch; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  color: var(--rust);
  margin: 0 0 12px;
}

.tagline {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--rust);
  margin: 10px 0 0;
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 40px);
}
.section {
  padding: clamp(48px, 8vw, 88px) 0;
}
.section-border-top {
  border-top: 1px solid var(--border);
}
.section-head {
  max-width: 68ch;
  margin-bottom: clamp(28px, 5vw, 44px);
}
.section-head-center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.section-head-center .lede { margin-left: auto; margin-right: auto; }
.section-soft {
  background: var(--surface-soft);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.98rem;
  padding: 13px 24px;
  border-radius: var(--radius);
  border: 1.5px solid var(--purple);
  cursor: pointer;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary { background: var(--gold); color: var(--purple-ink); border-color: var(--gold); }
.btn-ghost { background: transparent; color: var(--purple); }
.btn-ghost.on-dark { color: #fff; border-color: #fff; }
.btn-sm { padding: 9px 16px; font-size: 0.88rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--parchment-light);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(20px, 5vw, 40px);
  max-width: var(--container);
  margin: 0 auto;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo img { width: clamp(150px, 24vw, 230px); height: auto; }
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
}
.nav-links a {
  text-decoration: none;
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--purple-ink);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  border-bottom-color: var(--rust);
  color: var(--rust);
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--purple-ink);
}
.nav-toggle:hover,
.nav-toggle:active {
  color: var(--rust);
}
.nav-toggle svg { width: 26px; height: 26px; display: block; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--parchment-light);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px clamp(20px, 5vw, 40px) 20px;
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 12px 4px; border-bottom: 1px solid var(--border); }
  .nav-links .btn { margin-top: 12px; }
}

/* ---------- Hero ----------
   One fixed recipe for every page — same height, same content column
   width, regardless of how much copy a given hero holds. */
.hero {
  position: relative;
  color: #fff;
  overflow: hidden;
  height: clamp(420px, 50vw, 640px);
  display: flex;
  align-items: flex-end;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(43,22,56,0.72) 0%, rgba(43,22,56,0.55) 45%, rgba(43,22,56,0.82) 100%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  padding-bottom: clamp(36px, 6vw, 56px);
}
.hero-copy { max-width: 720px; }
.hero .eyebrow { color: var(--gold); }
.hero h1 { color: #fff; }
.hero .tagline { color: var(--gold); }
.hero-lede { color: #F1E7D2; max-width: 58ch; font-size: 1.1rem; }

/* ---------- Teaser cards ---------- */
.grid {
  display: grid;
  gap: 24px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card-img-wrap {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-soft);
}
.card-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.card-body-center { justify-content: center; }
.card-link {
  text-decoration: none;
  color: inherit;
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.card-link:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card h3 { margin-bottom: 2px; }
.card p { margin-bottom: 0; font-size: 0.96rem; }
.card-more { font-weight: 700; color: var(--rust); font-size: 0.9rem; margin-top: auto; }

/* ---------- Stats strip ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--purple);
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ---------- Pull quote / callout ---------- */
.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 40px);
}
.pull {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  color: var(--purple);
  border-left: 4px solid var(--gold);
  padding-left: 20px;
  margin: 0;
  text-wrap: balance;
}

/* ---------- Gallery / lightbox ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 760px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
.gallery-item {
  border: none;
  padding: 0;
  background: none;
  cursor: zoom-in;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 200ms ease; }
.gallery-item:hover img { transform: scale(1.05); }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(27, 14, 35, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: min(90vw, 1000px); max-height: 85vh; border-radius: var(--radius); }
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: 2px solid #fff;
  color: #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

/* ---------- Hours & status ---------- */
.hours-list {
  display: grid;
  row-gap: 8px;
  max-width: 320px;
}
.hours-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}
.hours-day { font-weight: 700; }
.hours-time { font-variant-numeric: tabular-nums; color: var(--text-muted); }
.hours-row.is-today .hours-day,
.hours-row.is-today .hours-time { color: var(--rust); font-weight: 800; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sage); }
.status-badge.is-closed .status-dot { background: var(--rust); }
.status-badge.is-closed { color: var(--rust); }
.status-badge:not(.is-closed) { color: var(--sage); }

/* ---------- Price list ---------- */
.price-list { display: grid; gap: 10px; max-width: 460px; }
.price-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}
.price-row span:last-child { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--rust); white-space: nowrap; }

/* ---------- Video embed ---------- */
.video-embed {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}
.video-embed iframe { width: 100%; height: 100%; display: block; border: none; }

/* ---------- Read more toggle ---------- */
.read-more-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 4px 0;
  margin-top: 4px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--rust);
  cursor: pointer;
}
.read-more-toggle:hover { text-decoration: underline; }
.read-more-toggle::after {
  content: '\2193';
  font-size: 0.8em;
  transition: transform 150ms ease;
}
.read-more-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }

/* ---------- Tags ---------- */
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: 100px;
  border: 1px solid transparent;
}
.tag-purple { background: var(--purple); color: #fff; }
.tag-rust { background: transparent; border-color: var(--rust); color: var(--rust); }
.tag-sage { background: var(--sage); color: #fff; }

/* ---------- Details / FAQ ---------- */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}
.faq-item summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--purple);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--rust);
  flex-shrink: 0;
  transition: transform 150ms ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-body { padding-top: 12px; }
.faq-body ul { display: grid; gap: 8px; }
.faq-body li { padding-left: 20px; position: relative; }
.faq-body li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rust);
}

/* ---------- Program cards ---------- */
.program-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}
.program-card h3 { margin-bottom: 8px; }

/* ---------- Contact cards ---------- */
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}
.contact-card .eyebrow { display: block; margin-bottom: 6px; }
.contact-card a { text-decoration: none; font-weight: 700; color: var(--purple); }
.contact-card a:hover { color: var(--rust); }

/* ---------- Footer ----------
   Background is Burnt Sienna. The wordmark image is purple-on-purple-dark
   territory here too (~1.7:1 contrast against rust — same problem the
   brand guide calls out for a purple ground), so the footer uses a text
   wordmark instead of the logo image, set in Parchment. */
.site-footer {
  background: var(--rust);
  color: var(--parchment);
  padding: clamp(40px, 6vw, 64px) 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(248, 241, 222, 0.22);
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 {
  color: var(--gold);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  font-family: var(--font-body);
}
.footer-grid a { text-decoration: none; color: var(--parchment); opacity: 0.88; }
.footer-grid a:hover { color: var(--gold); opacity: 1; }
.footer-links { display: grid; gap: 10px; }
.social-link { display: inline-flex; align-items: center; gap: 8px; }
.social-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.footer-wordmark {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--parchment);
  margin-bottom: 4px;
}
.footer-wordmark span { display: block; font-size: 0.62em; font-weight: 700; color: var(--gold); letter-spacing: 0.04em; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 20px;
  font-size: 0.82rem;
  color: var(--parchment);
  opacity: 0.75;
}

/* ---------- Misc ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.mt-0 { margin-top: 0; }
