/*
 * Elton Junior School — Main Stylesheet
 * Purpose: responsive layout, typography, colour, navigation, cards, fees,
 * gallery and enquiry form. Keep behaviour in script.js.
 * Maintenance: change shared design tokens in :root; keep section styles grouped.
 */

/* 1. Design tokens */
:root {
  --primary-red: #D91E2A;
  --primary-red-dark: #B01520;
  --navy: #162447;
  --bg-light: #F8FAFC;
  --text-dark: #1E293B;
  --text-muted: #64748B;
  --white: #FFFFFF;
  --border: #E2E8F0;
  --success-bg: #DCFCE7;
  --success-text: #166534;
  --focus-color: #FCD34D;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, .06);
  --shadow-md: 0 10px 25px rgba(15, 23, 42, .08);
  --radius: 12px;
  --container-width: 1140px;
}

/* 2. Reset and global defaults */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  min-width: 320px;
  font-family: "Inter", sans-serif;
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.6;
}
h1, h2, h3, h4 { font-family: "Poppins", sans-serif; line-height: 1.25; color: var(--navy); }
p { overflow-wrap: break-word; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
address { font-style: normal; }
.container { width: 100%; max-width: var(--container-width); margin-inline: auto; padding-inline: 20px; }
.skip-link {
  position: absolute; top: 0; left: -9999px; z-index: 2000;
  padding: 12px 16px; background: var(--white); color: var(--navy);
  border: 2px solid var(--primary-red); border-radius: 6px;
}
.skip-link:focus { top: 12px; left: 12px; }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus-color); outline-offset: 3px;
}

/* 3. Announcement bar */
.top-bar { position: relative; padding-block: 8px; background: var(--navy); color: var(--white); font-size: .85rem; }
.top-bar .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 20px; }
.top-bar span strong { color: var(--focus-color); }

/* 4. Header, brand and navigation */
.site-header, header {
  position: sticky; top: 0; z-index: 1000; background: var(--white);
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.navbar { position: relative; display: flex; justify-content: space-between; align-items: center; min-height: 76px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { width: 52px; height: 52px; flex: 0 0 auto; object-fit: contain; }
.brand-text { min-width: 0; }
.brand-name, .brand-text h1 { display: block; color: var(--primary-red); font-size: 1.05rem; font-weight: 800; letter-spacing: .3px; line-height: 1.3; }
.brand-motto, .brand-text p { display: block; color: var(--navy); font-size: .75rem; font-weight: 600; }
.navbar nav { min-width: 0; }
.nav-links { display: flex; align-items: center; gap: 20px; list-style: none; }
.nav-links a { display: inline-block; color: var(--text-dark); font-size: .9rem; font-weight: 500; transition: color .2s ease; }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--primary-red); }
.mobile-toggle {
  display: none; align-items: center; justify-content: center; width: 44px; height: 44px;
  flex: 0 0 auto; background: transparent; color: var(--navy);
  border: 1px solid var(--border); border-radius: 8px; font-size: 1.6rem;
}

/* 5. Buttons and labels */
.btn {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  padding: 12px 22px; border: 2px solid transparent; border-radius: 8px;
  font-size: .92rem; font-weight: 600; text-align: center; line-height: 1.4;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.btn-primary { background: var(--primary-red); color: var(--white) !important; }
.btn-primary:hover { background: var(--primary-red-dark); transform: translateY(-1px); }
.btn-outline { background: transparent; border-color: var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.full-width { width: 100%; }
.badge {
  display: inline-block; max-width: 100%; margin-bottom: 16px; padding: 6px 14px;
  background: #FEE2E2; color: var(--primary-red); border-radius: 50px;
  font-size: .78rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
}

/* 6. Hero */
.hero { padding: 60px 0 76px; background: linear-gradient(135deg, #FFF5F5 0%, #F1F5F9 100%); border-bottom: 1px solid var(--border); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 44px; align-items: center; }
.hero-content { min-width: 0; }
.hero h1 { margin-bottom: 16px; font-size: clamp(2rem, 3.2vw, 2.65rem); font-weight: 800; overflow-wrap: anywhere; }
.hero h1 span { color: var(--primary-red); }
.hero p { max-width: 540px; margin-bottom: 26px; color: var(--text-muted); font-size: 1.02rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-image-card { min-width: 0; padding: 12px; background: var(--white); border-radius: 16px; box-shadow: var(--shadow-md); }
.hero-image-card img { width: 100%; height: 350px; object-fit: cover; object-position: center 45%; border-radius: 10px; }
.hero-caption { margin-top: 10px; color: var(--text-muted); font-size: .84rem; font-weight: 500; text-align: center; }

/* 7. Highlight cards */
.highlights { position: relative; z-index: 2; margin-top: -36px; }
.highlights-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.highlight-card { padding: 22px; background: var(--white); border-top: 4px solid var(--primary-red); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.highlight-card.navy { border-top-color: var(--navy); }
.highlight-card h2, .highlight-card h3 { margin-bottom: 6px; font-size: 1.08rem; }
.highlight-card p { color: var(--text-muted); font-size: .88rem; }

/* 8. Shared section spacing and headings */
section { padding-block: 72px; }
.section-header { max-width: 700px; margin: 0 auto 44px; text-align: center; }
.section-header h2 { margin-bottom: 10px; font-size: clamp(1.65rem, 3vw, 2rem); }
.section-header p { color: var(--text-muted); font-size: .98rem; }

/* 9. About */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 44px; align-items: center; }
.about-img { overflow: hidden; border: 6px solid var(--bg-light); border-radius: 16px; box-shadow: var(--shadow-md); }
.about-img img { width: 100%; height: 400px; object-fit: cover; object-position: top center; }
.about-content { min-width: 0; }
.about-content h2, .about-content h3 { margin-bottom: 14px; font-size: 1.7rem; }
.about-content p { margin-bottom: 14px; color: var(--text-muted); }
.checklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; list-style: none; }
.checklist li { display: flex; align-items: flex-start; gap: 8px; color: var(--navy); font-size: .9rem; font-weight: 600; }
.checklist li::before { display: inline-flex; flex: 0 0 22px; align-items: center; justify-content: center; width: 22px; height: 22px; background: #FEE2E2; color: var(--primary-red); border-radius: 50%; content: "✓"; font-size: .8rem; font-weight: 800; }

/* 10. Academic programmes */
.academics { background: var(--bg-light); }
.programs-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.program-card { min-width: 0; padding: 28px 24px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); transition: transform .2s ease, box-shadow .2s ease; }
.program-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.program-tag { display: inline-block; margin-bottom: 12px; padding: 4px 10px; background: #FFF1F2; color: var(--primary-red); border-radius: 6px; font-size: .75rem; font-weight: 700; }
.program-card h3 { margin-bottom: 10px; font-size: 1.2rem; }
.program-card p { color: var(--text-muted); font-size: .9rem; }

/* 11. Fees and uniforms */
.fees-section { background: var(--white); border-bottom: 1px solid var(--border); }
.fees-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: start; }
.fee-card { min-width: 0; padding: 24px; background: var(--bg-light); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.fee-card-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 10px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 2px solid var(--border); }
.fee-card-header h3 { min-width: 0; font-size: 1.12rem; }
.pill { padding: 4px 8px; background: #DCFCE7; color: #166534; border-radius: 6px; font-size: .72rem; font-weight: 700; }
.price-tag { flex: 0 0 auto; padding: 4px 12px; background: var(--primary-red); color: var(--white); border-radius: 8px; font-family: "Poppins", sans-serif; font-size: 1.05rem; font-weight: 700; white-space: nowrap; }
.fee-list { list-style: none; }
.fee-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.fee-list li:last-child { border-bottom: none; }
.fee-list li > div { min-width: 0; }
.fee-list strong { display: block; color: var(--navy); font-size: .95rem; }
.fee-list small { display: block; color: var(--text-muted); font-size: .78rem; }
.fee-list .price { flex: 0 0 auto; color: var(--primary-red); font-family: "Poppins", sans-serif; font-size: 1.05rem; font-weight: 700; white-space: nowrap; }
.transport-row { padding: 12px 10px !important; margin: 8px -10px 0; background: #FFF1F2; border-radius: 8px; }
.sub-note { margin-bottom: 14px; color: var(--text-muted); font-size: .82rem; }
.uniform-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; list-style: none; }
.uniform-items li { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; min-width: 0; padding: 7px 9px; background: var(--white); border: 1px solid var(--border); border-radius: 6px; font-size: .8rem; overflow-wrap: anywhere; }
.uniform-items strong { flex: 0 0 auto; color: var(--navy); white-space: nowrap; }

/* 12. Campus gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.gallery-card, .gallery-item { min-width: 0; overflow: hidden; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.gallery-card img, .gallery-item img { width: 100%; height: 310px; object-fit: cover; }
.gallery-card figcaption, .gallery-caption { padding: 16px 20px; }
.gallery-card h3, .gallery-caption h4 { margin-bottom: 6px; font-size: 1.05rem; }
.gallery-card p, .gallery-caption p { color: var(--text-muted); font-size: .88rem; }

/* 13. Enquiry section and contact details */
.enquiry-section, .contact-section { background: var(--navy); color: var(--white); }
.enquiry-grid, .contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 44px; align-items: start; }
.enquiry-content, .contact-info { min-width: 0; }
.enquiry-content h2, .contact-info h2 { margin-bottom: 14px; color: var(--white); font-size: 1.95rem; }
.enquiry-content > p, .contact-info > p { margin-bottom: 24px; color: #CBD5E1; }
.enquiry-content .badge { color: var(--primary-red); }
.contact-details > div, .info-box { margin-bottom: 14px; padding: 16px 20px; background: rgba(255, 255, 255, .07); border-left: 4px solid var(--primary-red); border-radius: 10px; }
.contact-details h3, .info-box h4 { margin-bottom: 4px; color: var(--white); font-size: .95rem; }
.contact-details p, .contact-details address, .info-box p { color: #E2E8F0; font-size: .92rem; }
.contact-details a:hover, .info-box a:hover { color: var(--focus-color); text-decoration: underline; }

/* 14. Enquiry form */
.enquiry-form-card, .enquiry-card { min-width: 0; padding: 32px; background: var(--white); color: var(--text-dark); border-radius: 16px; box-shadow: var(--shadow-md); }
.enquiry-form-card h3, .enquiry-card h3 { margin-bottom: 6px; font-size: 1.4rem; }
.enquiry-form-card > p, .enquiry-card > p { margin-bottom: 20px; color: var(--text-muted); font-size: .88rem; }
.form-group { min-width: 0; margin-bottom: 16px; }
.form-group label, .form-group legend { display: block; margin-bottom: 5px; color: var(--navy); font-size: .84rem; font-weight: 600; }
.form-group input:not([type="radio"]), .form-group select, .form-group textarea { display: block; width: 100%; min-height: 44px; padding: 10px 13px; background: var(--white); color: var(--text-dark); border: 1px solid #CBD5E1; border-radius: 8px; font-family: inherit; font-size: .92rem; }
.form-group textarea { min-height: 110px; resize: vertical; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary-red); outline: 2px solid rgba(217, 30, 42, .15); outline-offset: 1px; }
fieldset.form-group { min-width: 0; padding: 0; border: 0; }
.form-group legend { width: 100%; }
.radio-option { display: flex !important; align-items: flex-start; gap: 10px; margin-top: 10px; font-weight: 400 !important; cursor: pointer; }
.radio-option input[type="radio"] { width: 18px; height: 18px; min-height: 18px; flex: 0 0 18px; margin-top: 3px; accent-color: var(--primary-red); }
.form-status { margin-top: 14px; padding: 12px; border-radius: 8px; font-size: .88rem; overflow-wrap: anywhere; }
.form-status:empty { display: none; }
.form-status.success { display: block; background: var(--success-bg); color: var(--success-text); border: 1px solid #86EFAC; }
.form-status a { display: inline-block; margin-top: 8px; color: #14532D; font-weight: 700; text-decoration: underline; }
.form-status a:focus-visible { outline-color: #166534; }
.form-disclaimer { margin-top: 14px; color: var(--text-muted); font-size: .78rem; }
.enquiry-form-card button[type="submit"], .enquiry-card button[type="submit"] { width: 100%; }

/* 15. Footer */
.site-footer, footer { padding: 30px 0; background: #0F172A; color: #CBD5E1; font-size: .88rem; text-align: center; }
.site-footer p + p, footer p + p { margin-top: 6px; }
.site-footer strong, footer strong { color: var(--white); }
.site-footer a:hover, footer a:hover { color: var(--focus-color); text-decoration: underline; }

/* 16. Tablet layout */
@media (max-width: 1024px) {
  .navbar { gap: 14px; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: .84rem; }
  .brand-name, .brand-text h1 { font-size: .95rem; }
  .hero-grid, .about-grid { gap: 28px; }
  .fees-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fee-card:first-child { grid-column: 1 / -1; }
  .highlights-grid { gap: 14px; }
  .highlight-card { padding: 18px; }
}

/* 17. Mobile navigation and layouts */
@media (max-width: 760px) {
  html { scroll-padding-top: 76px; }
  .container { padding-inline: 18px; }
  .navbar { min-height: 76px; }
  .brand { gap: 9px; }
  .brand img { width: 44px; height: 44px; }
  .brand-name, .brand-text h1 { font-size: .88rem; }
  .brand-motto, .brand-text p { font-size: .7rem; }
  .mobile-toggle { display: inline-flex; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 1001;
    flex-direction: column; align-items: stretch; gap: 0;
    max-height: calc(100vh - 100px); max-height: calc(100dvh - 100px); overflow-y: auto;
    padding: 12px 18px 18px; background: var(--white); border: 1px solid var(--border);
    border-top: 0; border-radius: 0 0 12px 12px; box-shadow: var(--shadow-md);
  }
  .nav-links.active { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; width: 100%; padding: 12px 8px; font-size: .95rem; }
  .nav-links .btn { margin-top: 8px; padding: 12px; }
  .hero { padding: 44px 0 60px; }
  .hero-grid, .about-grid, .enquiry-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .hero h1 { font-size: clamp(1.85rem, 7vw, 2.4rem); }
  .hero-image-card img { height: clamp(220px, 65vw, 350px); }
  .highlights { margin-top: -26px; }
  .highlights-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  section { padding-block: 54px; }
  .section-header { margin-bottom: 30px; }
  .about-img img { height: clamp(240px, 65vw, 380px); }
  .programs-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .fees-grid { grid-template-columns: minmax(0, 1fr); }
  .fee-card:first-child { grid-column: auto; }
  .gallery-grid { grid-template-columns: minmax(0, 1fr); }
  .gallery-card img, .gallery-item img { height: clamp(220px, 65vw, 340px); }
  .checklist { grid-template-columns: minmax(0, 1fr); }
  .uniform-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .enquiry-form-card, .enquiry-card { padding: 24px 20px; }
}

/* 18. Small phones */
@media (max-width: 380px) {
  .container { padding-inline: 14px; }
  .top-bar { font-size: .78rem; }
  .brand img { width: 38px; height: 38px; }
  .brand-name, .brand-text h1 { font-size: .76rem; }
  .brand-motto, .brand-text p { font-size: .66rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .fee-card { padding: 18px 14px; }
  .fee-list li { gap: 8px; }
  .uniform-items { grid-template-columns: minmax(0, 1fr); }
  .enquiry-form-card, .enquiry-card { padding: 20px 15px; }
}

/* 19. Reduced motion: honour the visitor's OS preference. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .program-card:hover, .btn-primary:hover { transform: none; }
}
