/* =================================================================
   Heartwood Montessori — styles
   ================================================================= */

:root {
  --green: #007F5B;
  --dark-green: #00534C;
  --brown: #7C2B43;
  --warm-gray: #E8E5E2; /*- warm gray -*/
  --blue: #A2C1E3;

  --border-radius: 0.5rem;

  --font-heading: "Proza Libre", system-ui, -apple-system, Segoe UI, Helvetica, Arial, sans-serif;
  --font-body: "Lexend", system-ui, -apple-system, Segoe UI, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--warm-gray);
  color: black;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--dark-green); }

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

/* ==================== Headings (universal) ==================== */
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--dark-green);
  line-height: 1.5;
  margin-top: 0;
}
h1, h2 { line-height: 1.25; }
h1 {
  font-size: clamp(2rem, 1.318rem + 2.909vw, 3.5rem);
  margin-bottom: clamp(1rem, 0.659rem + 1.455vw, 1.75rem);
}
h2 {
  font-size: clamp(1.5rem, 1.159rem + 1.455vw, 2.25rem);
  margin-bottom: clamp(0.875rem, 0.704rem + 0.727vw, 1.25rem);
}
h3 { 
  font-size: clamp(1.25rem, 1.023rem + 0.97vw, 1.75rem); 
  margin-bottom: clamp(0.625rem, 0.511rem + 0.485vw, 0.875rem);
}

/* ==================== Top nav ==================== */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 7%;
  background: rgba(232, 229, 226, 0.9);
  backdrop-filter: blur(6px);
  color: #f3ead8;
}
.topnav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}
.topnav-brand img {
  height: 4rem;
  width: auto;
  flex-shrink: 0;
}
@media (max-width: 1000px) {
  .topnav {
    padding-left: 5%;
    padding-right: 5%;
  }
}
@media (max-width: 768px) {
  .topnav {
    padding: 1rem 3%;
    gap: 0.375rem;
  }
}

/* ==================== Hero ==================== */
.hero {
  position: relative;
  height: clamp(31.125rem, calc(85svh + 3.125rem), 53.125rem);
  overflow: hidden;
}
.hero-image {
  position: absolute;
  inset: 0;
  border-radius: 0;
  background: linear-gradient(rgba(58, 40, 23, 0.5), rgba(29, 20, 12, 0.5)), url('/images/hero.jpg');
  background-size: cover;
  background-position: center;
}
.hero-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.hero-badge img {
  width: clamp(11.25rem, 45vw, 21.25rem);
  max-width: 80vw;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

/* ==================== Section variants ==================== */
.section--tagline {
  background: var(--warm-gray);
  text-align: center;
}
.section--welcome {
  background: var(--dark-green);
  color: white;
  text-align: center;
}
.section--links {
  background: white;
  color: var(--brown-text);
  text-align: center;
}
.section--why {
  background: var(--warm-gray);
}

/* ==================== Section ==================== */
.section {
  padding: 5rem 10%;
}
/* Must come after .section so it overrides the top and bottom padding; left and right come from .section */
.section--links {
  padding-top: 3rem;
  padding-bottom: 5rem;
}
@media (max-width: 1000px) {
  .section {
    padding-left: 5%;
    padding-right: 5%;
  }
}
@media (max-width: 768px) {
  .section {
    padding-left: 3%;
    padding-right: 3%;
  }
}
.section--mission-vision { background: white; }
.section--programs { background: var(--dark-green); }
/* overflow-x: clip keeps the outward-pulled gallery arrows from making phones scroll sideways. */
.section--gallery { background: white; padding-bottom: 3rem; overflow-x: clip; }

/* Section headings (h1) */
.section h1 {
  text-align: center;
}
.section--why h1 { text-align: left; }
.section--programs h1 { color: white; }
.section--welcome h1 {
  color: white;
  text-align: center;
}
.section--links h1 {
  color: var(--dark-green);
  text-align: left;
}
/* Tagline band */
.section--tagline h2 {
  font-size: clamp(1.5rem, 1.1rem + 1.2vw, 1.875rem);
  margin-bottom: clamp(1.5rem, 1.1rem + 1.2vw, 1.875rem);
}

/* Welcome */
.welcome-copy {
  max-width: 47.5rem;
  margin: 0 auto;
  text-align: center;
}
.welcome-copy p { margin: 0 0 1.125rem; line-height: 1.5; }

/* Mission + Vision */
.mv-grid {
  max-width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
}
.section--mission-vision article { text-align: center; }
.section--mission-vision img {
  aspect-ratio: 4 / 3;
  width: 100%;
  margin-bottom: 1.25rem;
  border-radius: var(--border-radius);
}
.section--mission-vision h3 {
  font-family: var(--font-heading);
  font-weight: 700;
}
.section--mission-vision p {
  width: 100%;
  line-height: 1.5;
}

/* Why Montessori */
.why-grid {
  max-width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: stretch;
}
.why-photo-container {
  position: relative;
  width: 100%;
  align-self: stretch;
  margin-bottom: 1.125rem;
  overflow: hidden;
  border-radius: var(--border-radius);
}
/* Two columns: the photo fills the full height of the heading + paragraph */
.why-photo-container img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center top;
}
/* Stacked (single column): no text beside it, so use a fixed ratio */
@media (max-width: 1000px) {
  .why-photo-container {
    aspect-ratio: 4 / 3;
  }
}
.why-text p {
  line-height: 1.5;
  margin-bottom: 1.125rem;
}
.section--why > p {
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* Programs Collage */
.programs-collage {
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  gap: 1.125rem;
  align-items: flex-start;
}
.programs-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}
.prog-card {
  background: var(--warm-gray);
  border-radius: var(--border-radius);
  padding: 1.5rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.prog-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.prog-card-header h3 { margin-bottom: 0; }
.prog-card-age {
  display: inline-block;
  font-size: clamp(0.9375rem, 0.9rem + 0.1vw, 1rem);
  font-weight: 600;
  color:var(--dark-green);
  padding: 0;
  letter-spacing: 0.01em;
}
.prog-card-schedule {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.prog-sched-row {
  display: flex;
  align-items: stretch;
  gap: 0.625rem;
  padding: 0.5625rem 0.8%;
  border-radius: var(--border-radius);
  background: white;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
}
.prog-sched-accent {
  flex: 0 0 3px;
  width: 3px;
  max-width: 0.1875rem;
  border-radius: var(--border-radius);
  align-self: stretch;
  min-height: 1.75rem;
  background: var(--blue);
}
.prog-sched-row > div {
  flex: 1;
  min-width: 0;
}
.prog-sched-label {
  font-size: clamp(0.8125rem, 0.78rem + 0.1vw, 0.875rem);
  font-weight: 600;
  color: var(--green);
  margin: 0 0 0.125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.prog-sched-time {
  margin: 0;
}
.prog-sched-note {
  font-size: clamp(0.8125rem, 0.78rem + 0.1vw, 0.875rem);
  font-weight: 600;
  color: var(--green);
}
.prog-card-desc {
  line-height: 1.5;
  margin: 0;
}

/* Gallery */
.gallery {
  max-width: 100%;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.gallery-track {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  overflow: hidden;
}
.gallery-slide {
  aspect-ratio: 3 / 4;
  border-radius: var(--border-radius);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
@media (max-width: 768px) {
  .gallery-track {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .gallery-track {
    grid-template-columns: 1fr;
  }
  .gallery-slide {
    aspect-ratio: 1 / 1;
  }
}
.gallery-slide:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-slide:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 8, 0.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox-stage {
  position: relative;
  z-index: 1;
  max-width: min(80vw, 68.75rem);
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-stage img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--border-radius);
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}
.lightbox-close,
.lightbox-arrow {
  position: absolute;
  z-index: 2;
  background: rgba(255,255,255,0.10);
  border: 0.0625rem solid rgba(255,255,255,0.18);
  color: white;
  width: 44px; height: 2.75rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.lightbox-close:hover,
.lightbox-arrow:hover { background: rgba(255,255,255,0.22); }
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: clamp(0.75rem, 0.73rem + 0.1vw, 0.8125rem);
  letter-spacing: 0.06em;
}
@media (max-width: 768px) {
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
  .lightbox-close { top: 12px; right: 12px; }
}
.gallery-arrow {
  background: rgba(0,0,0,0.0);
  border: 0;
  color: var(--brown);
  cursor: pointer;
  padding: 0;
  transition: opacity 0.15s;
}
.gallery-arrow svg {
  width: 3rem;
  height: 3rem;
}
.gallery-arrow:hover { opacity: 0.7; }
/* The chevron is drawn ~1rem in from the edge of its 3rem icon box.
   Pull each arrow outward by that much so the visible arrow lines up with the section edges. */
.gallery-arrow:first-child { margin-left: -1rem; }
.gallery-arrow:last-child { margin-right: -1rem; }
.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 0.625rem;
  margin-top: 1.5rem;
}
.gallery-dot {
  width: 8px; height: 0.5rem;
  border-radius: 50%;
  background: var(--warm-gray);
  cursor: pointer;
  border: 0;
  padding: 0;
}
.gallery-dot.active { background: var(--brown); }

/* CTA buttons */
.cta-grid {
  max-width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.875rem 1.125rem;
}
.cta-button {
  display: block;
  text-align: center;
  background: var(--brown);
  color: white;
  text-decoration: none;
  padding: 0.875rem 1.2%;
  border-radius: var(--border-radius);
  font-size: clamp(0.9375rem, 0.9rem + 0.1vw, 1rem);
  font-weight: 500;
  transition: background 0.15s, transform 0.15s;
}
.cta-button:hover {
  background: var(--dark-green);
  transform: translateY(-1px);
}

/* Footer */
.footer {
  background: var(--warm-gray);
  padding: 1.875rem 0 0;
}
.footer-inner {
  max-width: 85%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 5fr 3fr 2fr;
  gap: 2.5rem 3.75rem;
  align-items: center;
  padding-bottom: 2.25rem;
}
.footer-inner > :nth-child(1) {
  min-width: 220px;
}
.footer-inner > :nth-child(2),
.footer-inner > :nth-child(3) {
  padding: 0;
}
.footer-logo {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 1.25rem 0;
}
.footer-logo img {
  width: 300px;
  height: 18.75rem;
  object-fit: contain;
  flex-shrink: 0;
}
.footer-address, .footer-hours {
  font-size: clamp(0.9375rem, 0.9rem + 0.1vw, 1rem);
  line-height: 1.5;
}
.footer-address p, .footer-hours p { margin: 0 0 0.25rem; }
.footer-address a {
  text-decoration: underline;
}
.footer-hours { text-align: right; }

.footer-bottom {
  background: var(--brown);
  color: white;
  margin: 0;
  padding: 1.125rem 7%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: clamp(0.8125rem, 0.78rem + 0.1vw, 0.875rem);
}
@media (max-width: 1000px) {
  .footer-bottom {
    padding-left: 5%;
    padding-right: 5%;
  }
}
@media (max-width: 768px) {
  .footer-bottom {
    padding-left: 3%;
    padding-right: 3%;
  }
}
.footer-bottom a { color: inherit; }
.footer-social { display: flex; gap: 0.75rem; align-items: center; }
.footer-social a {
  display: flex;
  width: 30px; height: 1.875rem;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  text-decoration: none;
}
.footer-social a img {
  display: block;
}
.footer-social a:hover { background: rgba(255,255,255,0.16); }


/* ==================== Responsive ==================== */
@media (max-width: 1000px) {
  .mv-grid,
  .why-grid,
  .cta-grid {
    grid-template-columns: 1fr;
  }
  .programs-collage {
    flex-direction: column;
  }
}
@media (max-width: 1200px) {
  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.875rem;
  }
  .footer-inner > :nth-child(1),
  .footer-inner > :nth-child(2),
  .footer-inner > :nth-child(3) {
    margin: 0;
    padding: 0;
  }
  .footer-logo { justify-content: center; }
  .footer-logo img {
    width: 150px;
    height: 9.375rem;
  }
  .footer-hours { text-align: center; }
}

/* ==================== Footer container (1200px and below) ==================== */
/* Must stay after .footer-inner so it overrides its max-width: 85% */
@media (max-width: 1200px) {
  .footer-inner {
    max-width: 100%;
  }
}

/* ==================== Scroll reveal ==================== */
.reveal {
  opacity: 0;
  transform: translateY(2.5rem);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0s);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
