/* ==========================================================================
   Avery Foundation — Redesign v2
   New direction: warm ivory/cream base, deep emerald-forest ink,
   warm gold accent. Editorial serif headlines + geometric sans body.
   ========================================================================== */

:root {
  --cream: #FBF6EC;
  --cream-deep: #F1E8D5;
  --paper: #FFFDF8;
  --ink: #032b55;
  --ink-soft: #3E4E45;
  --forest: #0e243b;
  --forest-light: #1E5C4E;
  --gold: #C08A2E;
  --gold-light: #E7C069;
  --gold-soft: #F3DCA6;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Manrope', system-ui, -apple-system, sans-serif;

  --radius-lg: 28px;
  --radius-md: 18px;
  --shadow-soft: 0 25px 60px -25px rgba(14, 59, 51, 0.35);
  --shadow-card: 0 14px 34px -16px rgba(21, 39, 31, 0.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .font-display { font-family: var(--font-display); }

em { font-style: italic; color: var(--gold); }

a { text-decoration: none; color: inherit; }

img { max-width: 100%; height: auto; display: block; }

.section { padding: 7rem 0; position: relative; }

@media (max-width: 767.98px) {
  .section { padding: 4.5rem 0; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.4rem;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--gold);
  display: inline-block;
}

.eyebrow-ink { color: var(--forest); }
.eyebrow-ink::before { background: var(--forest); }

.section-title {
  font-weight: 600;
  font-size: clamp(2.1rem, 3.6vw, 3rem);
  line-height: 1.12;
  color: var(--forest);
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

.section-lead {
  color: var(--ink-soft);
  max-width: 620px;
  font-size: 1.08rem;
  line-height: 1.8;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: var(--forest);
  margin-top: 1.75rem;
  font-size: 0.98rem;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 0.2rem;
  transition: gap 0.2s ease, color 0.2s ease;
}

.text-link:hover { gap: 1rem; color: var(--gold); }

/* ---------- Decorative blobs ---------- */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  z-index: 0;
  pointer-events: none;
}

.blob-gold { width: 420px; height: 420px; background: rgba(192, 138, 46, 0.22); top: -120px; right: -100px; }
.blob-forest { width: 360px; height: 360px; background: rgba(14, 59, 51, 0.14); bottom: -140px; left: -80px; }
.blob-gold-soft { width: 380px; height: 380px; background: rgba(231, 192, 105, 0.28); top: 10%; right: -140px; }

/* ---------- Preview banner ---------- */
/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(251, 246, 236, 0.92);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(14, 59, 51, 0.08);
}

.brand-logo {
  height: 50px;
  width: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-soft);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--forest);
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--gold);
  text-transform: uppercase;
  font-weight: 700;
}

.nav-links a {
  font-family: var(--font-body);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.94rem;
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.2s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav-links a:hover,
.nav-links a.active { color: var(--forest); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

.btn-cta {
  background: var(--forest);
  color: var(--cream) !important;
  font-weight: 700;
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  font-size: 0.9rem;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-cta:hover { background: var(--gold); color: var(--ink) !important; transform: translateY(-1px); }

.menu-toggle {
  border: 0;
  background: none;
  width: 32px;
  height: 24px;
  position: relative;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--forest);
  transition: transform 0.25s ease, opacity 0.25s ease, top 0.25s ease;
}

.menu-toggle span:nth-child(1) { top: 0; }
.menu-toggle span:nth-child(2) { top: 11px; }
.menu-toggle span:nth-child(3) { top: 22px; }

.menu-toggle.is-open span:nth-child(1) { top: 11px; transform: rotate(45deg); }
.menu-toggle.is-open span:nth-child(2) { opacity: 0; }
.menu-toggle.is-open span:nth-child(3) { top: 11px; transform: rotate(-45deg); }

.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mobile-menu.is-open { max-height: 420px; }

.mobile-menu ul { padding-top: 1rem; }
.mobile-menu a {
  display: block;
  padding: 0.65rem 0;
  color: var(--ink);
  font-weight: 600;
  border-bottom: 1px solid rgba(14, 59, 51, 0.08);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--cream);
  padding: 5.5rem 0 5rem;
  overflow: hidden;
  isolation: isolate;
}

.hero-copy { position: relative; z-index: 1; }

.hero-title {
  font-weight: 600;
  font-size: clamp(2.6rem, 5.4vw, 4.2rem);
  line-height: 1.06;
  color: var(--forest);
  margin-bottom: 1.6rem;
  letter-spacing: -0.015em;
}

.hero-text {
  font-size: 1.12rem;
  line-height: 1.8;
  color: var(--ink-soft);
  max-width: 30rem;
  margin-bottom: 2.4rem;
}

.btn-primary-solid {
  background: var(--forest);
  color: var(--cream) !important;
  font-weight: 700;
  padding: 0.9rem 1.9rem;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn-primary-solid:hover { background: var(--gold); color: var(--ink) !important; transform: translateY(-2px); }

.btn-outline-ink {
  border: 1.5px solid var(--forest);
  color: var(--forest) !important;
  font-weight: 700;
  padding: 0.9rem 1.9rem;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn-outline-ink:hover { background: var(--forest); color: var(--cream) !important; }

.btn-cream-solid {
  background: var(--cream);
  color: var(--forest) !important;
  font-weight: 700;
  padding: 0.9rem 2rem;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease;
}

.btn-cream-solid:hover { transform: translateY(-2px); }

.hero-image-frame {
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
  transform-style: preserve-3d;
}

.hero-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 63% 37% 54% 46% / 43% 47% 53% 57%;
  box-shadow: var(--shadow-soft);
  border: 6px solid var(--paper);
  transition: border-radius 0.6s ease;
}

.hero-badge {
  position: absolute;
  left: -1.25rem;
  bottom: -1.25rem;
  background: var(--forest);
  color: var(--cream);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  box-shadow: var(--shadow-soft);
}

.hero-badge-num {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--gold-light);
}

.hero-badge-label {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 575.98px) {
  .hero-badge { left: 0.5rem; bottom: -1rem; padding: 0.85rem 1.1rem; }
}

/* ---------- Stats strip ---------- */
.stats-strip {
  background: var(--paper);
  border-top: 1px solid rgba(14, 59, 51, 0.08);
  border-bottom: 1px solid rgba(14, 59, 51, 0.08);
  padding: 3rem 0;
}

.stat-col { position: relative; }

.stat-col:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 10%;
  bottom: 10%;
  width: 1px;
  background: rgba(14, 59, 51, 0.12);
}

@media (max-width: 767.98px) {
  .stat-col:nth-child(2)::after { display: none; }
  .stat-col { margin-bottom: 1.5rem; }
}

.stat-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 2.6rem);
  color: var(--forest);
}

.stat-label {
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0.2rem 0 0;
}

/* ---------- About — editorial split ---------- */
.about-section { background: var(--cream); }

.value-row {
  display: flex;
  gap: 1.75rem;
  padding: 1.9rem 0;
  border-top: 1px solid rgba(14, 59, 51, 0.14);
}

.value-row:last-child { border-bottom: 1px solid rgba(14, 59, 51, 0.14); }

.value-index {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-light);
  min-width: 2.5rem;
}

.value-row h3 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--forest);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.value-row h3 i { color: var(--gold); font-size: 0.95rem; }

.value-row p {
  color: var(--ink-soft);
  font-size: 0.96rem;
  line-height: 1.75;
  margin: 0;
}

/* ---------- Founder ---------- */
.founder-section { background: var(--paper); overflow: hidden; }

.founder-image-frame {
  position: relative;
  padding: 0 0 1.5rem 1.5rem;
}

.founder-image-frame::before {
  content: "";
  position: absolute;
  inset: 1.5rem 0 0 0;
  background: var(--gold-soft);
  border-radius: var(--radius-lg);
  z-index: 0;
}

.founder-image {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 4 / 4.6;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  filter: grayscale(0.15) sepia(0.08) saturate(1.05);
}

.founder-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.55;
  color: var(--forest);
  margin: 1.25rem 0 1.5rem;
  padding-left: 1.25rem;
  border-left: 3px solid var(--gold);
}

.founder-text {
  color: var(--ink-soft);
  line-height: 1.85;
  margin-bottom: 1.1rem;
}

.highlight-pill {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--cream);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  height: 100%;
}

.highlight-pill i {
  color: var(--gold);
  font-size: 1.2rem;
  width: 28px;
  text-align: center;
}

.highlight-pill div { display: flex; flex-direction: column; line-height: 1.35; }
.highlight-pill strong { font-size: 0.92rem; color: var(--forest); }
.highlight-pill span { font-size: 0.78rem; color: var(--ink-soft); }

/* ---------- Programs — staggered index grid ---------- */
.programs-section { background: var(--cream); }

.program-offset { margin-top: 0; }

@media (min-width: 992px) {
  .program-offset { margin-top: 2.5rem; }
}

.program-card {
  position: relative;
  background: var(--paper);
  border-radius: var(--radius-md);
  padding: 2.25rem 1.75rem;
  height: 100%;
  border-top: 4px solid var(--forest);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.program-card:hover { transform: translateY(-6px); border-color: var(--gold); }

.program-ghost-num {
  position: absolute;
  top: -0.5rem;
  right: 0.75rem;
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 700;
  color: rgba(14, 59, 51, 0.06);
  line-height: 1;
}

.program-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--forest);
  color: var(--gold-light);
  font-size: 1.2rem;
  margin-bottom: 1.4rem;
  position: relative;
}

.program-card h3 { font-size: 1.1rem; font-weight: 800; color: var(--forest); margin-bottom: 0.65rem; position: relative; }
.program-card p { color: var(--ink-soft); font-size: 0.93rem; line-height: 1.75; margin: 0; position: relative; }

/* ---------- CTA banner — angled ---------- */
.cta-banner {
  background: var(--forest);
  color: var(--cream);
  padding: 6.5rem 0 8rem;
  text-align: center;
  clip-path: polygon(0 6%, 100% 0, 100% 100%, 0 100%);
  margin-top: -3rem;
}

.cta-banner .eyebrow { color: var(--gold-light); }
.cta-banner .eyebrow::before { background: var(--gold-light); }

.cta-banner h2 {
  font-weight: 600;
  font-size: clamp(2rem, 3.6vw, 2.8rem);
  line-height: 1.15;
  margin-bottom: 1rem;
}

.cta-banner p {
  color: rgba(251, 246, 236, 0.8);
  margin-bottom: 2.25rem;
  font-size: 1.05rem;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(251, 246, 236, 0.72); }

.footer-brand {
  font-family: var(--font-display);
  color: var(--cream);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.footer-about { font-size: 0.9rem; line-height: 1.8; }

.footer-social { display: flex; gap: 0.75rem; margin-top: 1.4rem; }
.footer-social a {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(251, 246, 236, 0.08);
  color: var(--cream);
  transition: background 0.2s ease, transform 0.2s ease;
}
.footer-social a:hover { background: var(--gold); color: var(--ink); transform: translateY(-2px); }

.footer-heading {
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
}

.footer-links li { margin-bottom: 0.65rem; }
.footer-links a { color: rgba(251, 246, 236, 0.68); font-size: 0.92rem; }
.footer-links a:hover { color: var(--gold-light); }

.footer-item { font-size: 0.92rem; margin-bottom: 0.8rem; }
.footer-item i { color: var(--gold-light); width: 20px; }
.footer-item a { color: rgba(251, 246, 236, 0.75); }
.footer-item a:hover { color: var(--gold-light); }

.footer-bottom {
  border-top: 1px solid rgba(251, 246, 236, 0.1);
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  font-size: 0.85rem;
}

.footer-credit {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: rgba(251, 246, 236, 0.55);
}

/* ---------- Floating contact ---------- */
.floating-contact {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 900;
}

.fab-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
  background: var(--paper);
  border: 2px solid var(--gold-soft);
  transition: transform 0.2s ease;
}

.fab-btn:hover { transform: scale(1.08); }
.fab-btn img { width: 26px; height: 26px; }

/* ---------- Scroll reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   Shared subpage components
   ========================================================================== */

/* ---------- Page hero (compact, dark) ---------- */
.page-hero {
  position: relative;
  background: linear-gradient(135deg, var(--forest), var(--forest-light));
  color: var(--cream);
  padding: 4.5rem 0 4rem;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

.page-hero .blob-gold { opacity: 0.5; }

.page-hero .eyebrow { color: var(--gold-light); justify-content: center; }
.page-hero .eyebrow::before { background: var(--gold-light); }

.page-hero h1 {
  font-weight: 600;
  font-size: clamp(2.1rem, 4.4vw, 3.2rem);
  line-height: 1.15;
  margin-bottom: 1.1rem;
}

.page-hero h1 em { color: var(--gold-light); font-style: italic; }

.page-hero p {
  color: rgba(251, 246, 236, 0.82);
  max-width: 44rem;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.75;
}

/* ---------- Caption figure (secondary supporting photo, reused across pages) ---------- */
.caption-figure {
  margin: 0;
}

.caption-figure img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  display: block;
}

.caption-figure figcaption {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

/* ---------- Split media frame (image + offset panel, reused across pages) ---------- */
.split-media-frame {
  position: relative;
  padding: 0 0 1.5rem 1.5rem;
}

.split-media-frame::before {
  content: "";
  position: absolute;
  inset: 1.5rem 0 0 0;
  background: var(--gold-soft);
  border-radius: var(--radius-lg);
  z-index: 0;
}

.split-media-frame img {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  object-fit: contain;
  background: var(--paper);
}

/* ---------- Generic info card (reuses program-card visual language) ---------- */
.info-card {
  background: var(--paper);
  border-radius: var(--radius-md);
  padding: 2rem 1.6rem;
  height: 100%;
  border-top: 4px solid var(--forest);
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.info-card:hover { transform: translateY(-5px); border-color: var(--gold); }

.info-card .info-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--forest);
  color: var(--gold-light);
  font-size: 1.1rem;
  margin-bottom: 1.1rem;
}

.info-card h3 { font-size: 1.02rem; font-weight: 800; color: var(--forest); margin-bottom: 0.6rem; }
.info-card p { color: var(--ink-soft); font-size: 0.92rem; line-height: 1.7; margin: 0; }

/* Compact variant used for simple two-line reason/process blocks */
.info-card-sm {
  background: var(--cream-deep);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.4rem;
  height: 100%;
}

.info-card-sm h3 { font-size: 0.98rem; font-weight: 800; color: var(--forest); margin-bottom: 0.5rem; }
.info-card-sm p { color: var(--ink-soft); font-size: 0.88rem; line-height: 1.6; margin: 0; }

/* ---------- Numbered process steps ---------- */
.process-step {
  position: relative;
  background: var(--paper);
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem 1.6rem;
  height: 100%;
  box-shadow: var(--shadow-card);
}

.process-step .process-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  color: var(--gold-light);
  display: block;
  margin-bottom: 0.75rem;
}

.process-step h3 { font-size: 1rem; font-weight: 800; color: var(--forest); margin-bottom: 0.5rem; }
.process-step p { color: var(--ink-soft); font-size: 0.9rem; line-height: 1.65; margin: 0; }

/* ---------- Quote block (founder message, etc.) ---------- */
.quote-block {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  line-height: 1.6;
  color: var(--forest);
  text-align: center;
  max-width: 46rem;
  margin: 0 auto 1.5rem;
  padding: 0 1rem;
}

/* ---------- Forms ---------- */
.form-card {
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-card);
}

@media (max-width: 575.98px) {
  .form-card { padding: 1.75rem 1.25rem; }
}

.form-label-custom {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--forest);
  margin-bottom: 0.4rem;
}

.form-control-custom {
  width: 100%;
  border: 1.5px solid rgba(14, 59, 51, 0.15);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--cream);
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control-custom:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(192, 138, 46, 0.15);
}

.form-alert {
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.form-alert-success { background: rgba(30, 92, 78, 0.1); color: var(--forest-light); }
.form-alert-error { background: rgba(193, 68, 46, 0.1); color: #a13d26; }

.contact-info-card {
  background: var(--forest);
  color: var(--cream);
  border-radius: var(--radius-lg);
  padding: 2.25rem 1.9rem;
  height: 100%;
}

.contact-info-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 1.75rem;
}

.contact-info-row {
  display: flex;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.contact-info-row i { color: var(--gold-light); font-size: 1.05rem; width: 22px; margin-top: 0.2rem; }
.contact-info-row p { margin: 0; font-size: 0.9rem; line-height: 1.6; color: rgba(251, 246, 236, 0.85); }
.contact-info-row .ci-label { font-weight: 700; color: var(--cream); display: block; margin-bottom: 0.15rem; }

/* ---------- Gallery ---------- */

/* Desktop: 3D cursor-tilt card. .tilt-card holds the perspective so each
   card gets its own independent vanishing point; .gallery-item is the
   element JS actually rotates via the --rx/--ry/--tz custom properties. */
.tilt-card {
  perspective: 1000px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(var(--tz, 0px));
  transform-style: preserve-3d;
  transition: transform 0.25s ease-out, box-shadow 0.35s ease;
  will-change: transform;
}

.gallery-item.is-tilting {
  transition: transform 0.05s linear, box-shadow 0.35s ease;
}

.gallery-item img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  transition: transform 0.5s ease;
  display: block;
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(14, 59, 51, 0.88), rgba(14, 59, 51, 0) 60%);
  display: flex;
  align-items: flex-end;
  padding: 1.1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-overlay span {
  color: var(--cream);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.35;
}

/* Static caption — the default, touch-friendly reading of a gallery card */
.gallery-caption-mobile {
  display: block;
  margin-top: 0.65rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

/* Only mouse-driven, fine-pointer devices get the tilt + hover-reveal
   treatment; touch devices keep flat cards with the caption always visible
   underneath instead of relying on an unreliable :hover state. */
@media (hover: hover) and (pointer: fine) {
  .gallery-caption-mobile { display: none; }

  .gallery-item:hover .gallery-overlay { opacity: 1; }
  .gallery-item:hover img { transform: scale(1.05); }
  .gallery-item:hover {
    box-shadow: 0 32px 55px -22px rgba(14, 59, 51, 0.45), 0 0 0 1px rgba(192, 138, 46, 0.18);
  }
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 16, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 2000;
}

.lightbox.is-open { display: flex; }

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: var(--radius-md);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cream);
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
}

/* ---------- PDF modal (Programs page) ---------- */
.pdf-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 16, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1.5rem;
}

.pdf-modal.is-open { display: flex; }

.pdf-modal-content {
  background: var(--paper);
  width: 100%;
  max-width: 900px;
  height: 88vh;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.5);
}

.pdf-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--forest);
  color: var(--cream);
}

.pdf-modal-header h3 { font-size: 0.95rem; font-weight: 700; margin: 0; }

.pdf-modal-header button {
  background: none;
  border: none;
  color: var(--cream);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.pdf-modal iframe { flex: 1; width: 100%; border: none; }

/* ---------- Workshop list rows (Programs page) ---------- */
.workshop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--paper);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.4rem;
  box-shadow: var(--shadow-card);
}

.workshop-row + .workshop-row { margin-top: 0.9rem; }

.workshop-row .workshop-name { font-weight: 700; color: var(--forest); font-size: 0.96rem; }
.workshop-row .workshop-date { display: block; font-size: 0.8rem; color: var(--ink-soft); font-weight: 500; margin-top: 0.2rem; }

.workshop-row button {
  background: none;
  border: 1.5px solid var(--forest);
  color: var(--forest);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.workshop-row button:hover { background: var(--forest); color: var(--cream); }

@media (max-width: 575.98px) {
  .workshop-row { flex-direction: column; align-items: flex-start; }
  .workshop-row button { align-self: flex-start; }
}
