/* ============================================
   DEB KABACHI SENIOR SCHOOL — Design System
   Tokens derived from official school crest
   ============================================ */

:root {
  /* Colors — pulled directly from the crest */
  --navy: #1B2856;
  --navy-deep: #121b3d;
  --royal: #1E5FD9;
  --royal-light: #4C82E8;
  --red: #E1251B;
  --cream: #F7F5F0;
  --cream-dim: #EFEBE1;
  --ink: #2A2A2A;
  --ink-soft: #5C5C5C;
  --white: #FFFFFF;
  --gold: #C9A227;

  /* Type */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-eyebrow: 'Source Sans 3', sans-serif;

  /* Layout */
  --max-width: 1180px;
  --radius: 4px;
  --shadow-soft: 0 4px 24px rgba(27, 40, 86, 0.08);
  --shadow-med: 0 8px 40px rgba(27, 40, 86, 0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--navy);
  font-weight: 600;
  line-height: 1.15;
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }

p { color: var(--ink-soft); }

.eyebrow {
  font-family: var(--font-eyebrow);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--red);
}

/* ===== RIBBON DIVIDER — signature element from the crest banner ===== */
.ribbon-divider {
  position: relative;
  height: 28px;
  margin: 0 auto;
  max-width: 340px;
}
.ribbon-divider svg { width: 100%; height: 100%; }

/* ===== HEADER / NAV ===== */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 3px solid var(--navy);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand img { height: 52px; width: 52px; }
.brand-text { font-family: var(--font-display); line-height: 1.1; }
.brand-text strong { display: block; color: var(--navy); font-size: 1.05rem; font-weight: 700; }
.brand-text span { display: block; color: var(--royal); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; }

nav.main-nav ul {
  display: flex;
  list-style: none;
  gap: 30px;
}
nav.main-nav a {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--navy);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}
nav.main-nav a:hover, nav.main-nav a.active {
  border-color: var(--red);
  color: var(--red);
}

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle span { display: block; width: 26px; height: 3px; background: var(--navy); margin: 5px 0; border-radius: 2px; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  nav.main-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--white);
    border-bottom: 3px solid var(--navy);
    display: none;
  }
  nav.main-nav.open { display: block; }
  nav.main-nav ul { flex-direction: column; gap: 0; padding: 10px 28px 20px; }
  nav.main-nav a { display: block; padding: 12px 0; border-bottom: 1px solid var(--cream-dim); }
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-med); background: #c41f16; }
.btn-outline { background: transparent; border-color: var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-light { background: var(--white); color: var(--navy); }
.btn-light:hover { transform: translateY(-2px); box-shadow: var(--shadow-med); }

/* ===== HERO — FULL-BLEED PHOTO CAROUSEL ===== */
.hero.hero-photo {
  position: relative;
  overflow: hidden;
  min-height: 640px;
  display: flex;
  align-items: center;
  color: var(--white);
}
.hero.hero-photo::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 8px;
  background: repeating-linear-gradient(90deg, var(--red) 0 40px, var(--royal) 40px 80px);
  z-index: 4;
}
.hero-stage { position: absolute; inset: 0; z-index: 0; }
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.3s ease;
}
.hero-slide.active { opacity: 1; z-index: 1; }
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
}
.hero-slide.active img {
  animation: heroKenBurns 5s ease-out forwards;
}
@keyframes heroKenBurns {
  from { transform: scale(1); }
  to { transform: scale(1.09); }
}
.hero-scrim-full {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(90deg, rgba(18,27,61,0.88) 0%, rgba(18,27,61,0.62) 45%, rgba(18,27,61,0.30) 100%),
              linear-gradient(0deg, rgba(18,27,61,0.55) 0%, rgba(18,27,61,0) 35%);
}
.hero-content {
  position: relative;
  z-index: 3;
  padding: 90px 0 80px;
  max-width: 640px;
}
.hero-eyebrow {
  color: var(--royal-light);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: 14px;
}
.hero h1 { color: var(--white); margin-bottom: 18px; }
.hero h1 em { color: var(--gold); font-style: normal; }
.hero p.lede { color: #C9D2EC; font-size: 1.12rem; max-width: 540px; margin-bottom: 30px; }
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-stats {
  display: flex; gap: 36px; margin-top: 44px; flex-wrap: wrap;
}
.hero-stats div strong {
  display: block; font-family: var(--font-display); font-size: 1.8rem; color: var(--white);
}
.hero-stats div span { color: #9FB0DA; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; }

.hero-dots {
  position: absolute;
  bottom: 22px;
  right: 5%;
  z-index: 4;
  display: flex;
  gap: 8px;
}
.hero-dots button {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}
.hero-dots button[aria-current="true"] {
  background: var(--gold);
  transform: scale(1.3);
}

@media (max-width: 900px) {
  .hero.hero-photo { min-height: 560px; }
  .hero-content { padding: 70px 0 60px; }
}

/* ===== PILLARS (Academics / Co-curricular / Practical) ===== */
.pillars {
  padding: 90px 0;
}
.section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.section-head .eyebrow { display: block; margin-bottom: 10px; }
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}
.pillar-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 38px 30px;
  box-shadow: var(--shadow-soft);
  border-top: 4px solid var(--royal);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pillar-card:nth-child(2) { border-top-color: var(--red); }
.pillar-card:nth-child(3) { border-top-color: var(--navy); }
.pillar-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-med); }
.pillar-icon { width: 48px; height: 48px; margin-bottom: 18px; }
.pillar-card h3 { margin-bottom: 10px; }
.pillar-card p { font-size: 0.95rem; }

@media (max-width: 860px) {
  .pillar-grid { grid-template-columns: 1fr; }
}

/* ===== ABOUT / WHY US STRIP ===== */
.strip {
  background: var(--white);
  padding: 80px 0;
}
.strip-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 60px;
  align-items: center;
}
.strip-grid.reverse { grid-template-columns: 1.1fr 0.9fr; }
.strip-grid.reverse .strip-visual { order: 2; }
.strip-visual {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 40px;
  border: 1px solid var(--cream-dim);
}
.motto-block {
  text-align: center;
}
.motto-block .crest-mini { width: 140px; margin: 0 auto 20px; }
.motto-block .motto-text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--navy);
}
ul.check-list { list-style: none; margin-top: 20px; }
ul.check-list li {
  padding-left: 32px;
  position: relative;
  margin-bottom: 14px;
  color: var(--ink-soft);
}
ul.check-list li::before {
  content: '✓';
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px;
  background: var(--royal);
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
}

@media (max-width: 860px) {
  .strip-grid, .strip-grid.reverse { grid-template-columns: 1fr; }
  .strip-grid.reverse .strip-visual { order: -1; }
}

/* ===== NEWS / CARDS ===== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.news-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease;
}
.news-card:hover { transform: translateY(-4px); }
.news-card .thumb {
  height: 170px;
  overflow: hidden;
}
.news-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.news-card .body { padding: 22px; }
.news-card .date {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--red); font-weight: 700; margin-bottom: 8px; display: block;
}
.news-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.news-card p { font-size: 0.9rem; }

@media (max-width: 860px) { .news-grid { grid-template-columns: 1fr; } }

/* ===== CTA BAND ===== */
.cta-band {
  background: var(--red);
  color: var(--white);
  padding: 60px 0;
  text-align: center;
}
.cta-band h2 { color: var(--white); margin-bottom: 14px; }
.cta-band p { color: #FFE1DE; max-width: 520px; margin: 0 auto 28px; }

/* ===== FOOTER ===== */
footer.site-footer {
  background: var(--navy-deep);
  color: #B8C2E0;
  padding: 64px 0 30px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 50px;
}
.footer-brand { display: flex; gap: 14px; align-items: flex-start; }
.footer-brand img { width: 56px; height: 56px; }
.footer-brand strong { color: var(--white); font-family: var(--font-display); font-size: 1.1rem; display: block; margin-bottom: 6px; }
.footer-brand p { font-size: 0.88rem; color: #92A0C9; }
footer h4 { color: var(--white); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 18px; font-family: var(--font-body); }
footer ul { list-style: none; }
footer ul li { margin-bottom: 10px; font-size: 0.92rem; }
footer ul li a:hover { color: var(--white); }
footer address { font-style: normal; font-size: 0.92rem; line-height: 1.8; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 0.82rem; color: #7385B5;
}

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ===== PAGE HEADER (interior pages) ===== */
.page-header {
  background: var(--navy);
  color: var(--white);
  padding: 56px 0 50px;
  text-align: center;
  position: relative;
}
.page-header::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 6px;
  background: repeating-linear-gradient(90deg, var(--red) 0 40px, var(--royal) 40px 80px);
}
.page-header h1 { color: var(--white); }
.breadcrumb { font-size: 0.85rem; color: #9FB0DA; margin-bottom: 14px; }
.breadcrumb a:hover { color: var(--white); }

/* ===== GENERIC CONTENT SECTIONS ===== */
.section { padding: 80px 0; }
.section-alt { background: var(--white); }
.two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 50px;
}
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

.sidebar-box {
  background: var(--cream);
  border: 1px solid var(--cream-dim);
  border-left: 4px solid var(--royal);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 24px;
}
.sidebar-box h4 { font-size: 0.95rem; margin-bottom: 12px; color: var(--navy); }
.sidebar-box ul { list-style: none; }
.sidebar-box ul li { padding: 8px 0; border-bottom: 1px solid var(--cream-dim); font-size: 0.92rem; }
.sidebar-box ul li:last-child { border-bottom: none; }

.map-full { margin-top: 70px; }
.map-full-head { text-align: center; max-width: 640px; margin: 0 auto 28px; }
.map-full-head .eyebrow { display: block; margin-bottom: 10px; }
.map-full-head p { color: var(--ink-soft); }
.map-full-frame {
  max-width: 760px;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-med);
  border: 1px solid var(--cream-dim);
}
.map-full-note {
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-style: italic;
  margin-top: 14px;
}

/* ===== ACADEMICS / SUBJECT GRID ===== */
.subject-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.subject-card {
  background: var(--white);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.subject-card .tag {
  flex-shrink: 0;
  width: 40px; height: 40px;
  background: var(--cream);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; color: var(--royal);
}
@media (max-width: 600px) { .subject-grid { grid-template-columns: 1fr; } }

/* ===== GALLERY ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.gallery-item:hover img { transform: scale(1.06); }
.gallery-cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 8px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--white);
  background: linear-gradient(0deg, rgba(18,27,61,0.82), rgba(18,27,61,0));
}
@media (max-width: 860px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }

.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 36px; justify-content: center;
}
.filter-btn {
  padding: 9px 20px;
  border-radius: 999px;
  border: 2px solid var(--cream-dim);
  background: var(--white);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.filter-btn.active, .filter-btn:hover { border-color: var(--royal); color: var(--royal); }

/* ===== ADMISSIONS STEPS ===== */
.steps {
  counter-reset: step;
}
.step-item {
  display: flex;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--cream-dim);
}
.step-item:last-child { border-bottom: none; }
.step-num {
  counter-increment: step;
  flex-shrink: 0;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.2rem;
}

/* ===== FORM (Contact) ===== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.form-grid .full { grid-column: 1 / -1; }
label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--navy);
  margin-bottom: 8px;
}
input, textarea, select {
  width: 100%;
  padding: 13px 14px;
  border: 2px solid var(--cream-dim);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--white);
  transition: border-color 0.2s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--royal);
}
textarea { resize: vertical; min-height: 130px; }

@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

.contact-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 60px;
}
.contact-info-card {
  background: var(--white);
  padding: 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.contact-info-card .icon-circle {
  width: 52px; height: 52px;
  background: var(--cream);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
@media (max-width: 860px) { .contact-info-grid { grid-template-columns: 1fr; } }


/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* Photo lightbox */
img.is-lightboxable {
  cursor: zoom-in;
  transition: filter 0.2s ease;
}
img.is-lightboxable:hover,
img.is-lightboxable:focus-visible {
  filter: brightness(1.06);
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(18, 27, 61, 0.92); /* navy-deep, translucent */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}
.lightbox-overlay.is-open {
  opacity: 1;
  visibility: visible;
}
.lightbox-figure {
  max-width: min(92vw, 1200px);
  max-height: 92vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.lightbox-img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox-caption {
  color: var(--cream);
  font-size: 0.92rem;
  text-align: center;
  max-width: 70ch;
}
.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(247, 245, 240, 0.12);
  color: var(--cream);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.lightbox-close:hover { background: rgba(247, 245, 240, 0.22); }

body.lightbox-lock { overflow: hidden; }

@media (max-width: 640px) {
  .lightbox-overlay { padding: 16px; }
  .lightbox-close { top: 12px; right: 12px; }
}
