/* =========================================================
   IV Schoolz - Public website styles
   Colours come from the school's logo (charcoal + gold) and
   the maroon school uniform. Change them here in :root.
   ========================================================= */

:root {
    --maroon: #8c1d2c;        /* uniform colour - main buttons */
    --maroon-dark: #6b1421;
    --gold: #c49a45;          /* logo gold */
    --gold-light: #e9d6a8;
    --charcoal: #2f2f38;      /* logo background - header & footer */
    --ink: #2a2630;           /* body text */
    --muted: #6d6672;
    --cream: #fbf6ee;
    --cream-dark: #f3eadb;
    --white: #ffffff;
    --line: #e8ded0;
    --radius: 14px;
    --shadow: 0 18px 40px rgba(60, 35, 25, 0.12);
    --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
    --sans: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
    margin: 0;
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.7;
    color: var(--ink);
    background: var(--white);
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--maroon); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 14px; color: var(--ink); }
h2 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -0.5px; }
h3 { font-size: 21px; }
p { margin: 0 0 14px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 14px 26px;
    border: 2px solid var(--maroon);
    border-radius: 999px;
    background: var(--maroon);
    color: #fff;
    font: inherit;
    font-weight: 800;
    font-size: 16px;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, transform .2s;
}
.btn:hover { background: var(--maroon-dark); border-color: var(--maroon-dark); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--maroon); }
.btn-outline:hover { background: var(--maroon); color: #fff; }
.btn-small { padding: 8px 18px; font-size: 14px; }
.btn-block { display: block; width: 100%; text-align: center; }

.label {
    display: inline-block;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--maroon);
}

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: var(--charcoal);
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.15);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 70px; }
.brand img { height: 44px; width: auto; }
.main-nav { display: flex; align-items: center; gap: 24px; }
.main-nav a { color: #ece6da; text-decoration: none; font-weight: 600; font-size: 15px; }
.main-nav a:hover { color: var(--gold); }
.main-nav .btn { background: var(--gold); border-color: var(--gold); color: var(--charcoal); }
.main-nav .btn:hover { background: var(--gold-light); border-color: var(--gold-light); }
.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 28px; cursor: pointer; }

/* ---------- Hero ---------- */
.hero { background: var(--cream); padding: 70px 0 90px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.hero h1 { font-size: clamp(38px, 5.4vw, 62px); letter-spacing: -1px; }
.hero h1 em { font-style: italic; color: var(--maroon); }
.hero p { font-size: 19px; color: #4c4550; max-width: 520px; }
.hero-buttons { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 18px; }
.hero-note { font-size: 15px; color: var(--muted); }
.hero-note::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2e9d57; margin-right: 8px; vertical-align: middle; }

/* Layered photo stack - the 3D depth comes from perspective + mouse movement in site.js */
.photo-stack { position: relative; height: 540px; perspective: 1200px; }
.layer {
    position: absolute; margin: 0;
    background: #fff; padding: 10px 10px 12px;
    border-radius: 6px;
    box-shadow: var(--shadow);
    transition: transform .25s ease-out;
    will-change: transform;
}
.layer img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; }
.layer figcaption { font-family: var(--serif); font-size: 15px; text-align: center; padding-top: 8px; color: var(--muted); }
.layer-main  { width: 58%; height: 86%; left: 22%; top: 2%;  --tilt: -2deg; transform: rotate(var(--tilt)); z-index: 2; }
.layer-main img { height: calc(100% - 30px); }
.layer-back  { width: 52%; height: 44%; left: 0;   top: 46%; --tilt: -7deg; transform: rotate(var(--tilt)); z-index: 1; }
.layer-front { width: 34%; height: 50%; right: 0;  top: 40%; --tilt: 5deg;  transform: rotate(var(--tilt)); z-index: 3; }

/* ---------- Highlights band ---------- */
.highlights { background: var(--charcoal); color: #e9e3d8; padding: 46px 0; }
.highlight .num { font-family: var(--serif); color: var(--gold); font-size: 15px; }
.highlight h3 { color: #fff; margin: 6px 0 8px; }
.highlight p { color: #c9c1b4; font-size: 15px; margin: 0; }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-cream { background: var(--cream); }
.section-dark { background: var(--charcoal); color: #e9e3d8; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark .label { color: var(--gold); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 48px; }
.section-head p { color: var(--muted); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }

/* ---------- About ---------- */
.about-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.ticks { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.ticks li { padding-left: 28px; position: relative; font-weight: 600; }
.ticks li::before { content: ''; position: absolute; left: 0; top: 8px; width: 16px; height: 9px; border-left: 3px solid var(--maroon); border-bottom: 3px solid var(--maroon); transform: rotate(-45deg); }

/* ---------- 3D tilt (done in site.js) ---------- */
.tilt { transition: transform .2s ease-out; transform-style: preserve-3d; will-change: transform; }

/* ---------- Event cards ---------- */
.event-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 8px 24px rgba(60, 35, 25, 0.08); border: 1px solid var(--line); }
.event-card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.event-text { padding: 18px 20px 20px; }
.event-text p { font-size: 15px; color: var(--muted); margin: 0; }

/* ---------- Gallery ---------- */
.gallery { columns: 4 220px; column-gap: 14px; }
.gallery-item {
    display: block; width: 100%; margin: 0 0 14px; padding: 0; border: 0;
    position: relative; overflow: hidden; border-radius: 10px; cursor: zoom-in; background: var(--cream-dark);
    break-inside: avoid;
}
.gallery-item img { width: 100%; height: auto; transition: transform .5s; }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-item span {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6)); color: #fff;
    font-size: 14px; font-weight: 700; text-align: left; opacity: 0; transition: opacity .3s;
}
.gallery-item:hover span, .gallery-item:focus span { opacity: 1; }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(20, 18, 22, 0.92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: 6px; }
.lightbox p { color: #fff; margin-top: 12px; font-family: var(--serif); font-size: 18px; }
.lightbox-close { position: absolute; top: 14px; right: 20px; background: none; border: 0; color: #fff; font-size: 42px; cursor: pointer; line-height: 1; }

/* ---------- Campuses ---------- */
.campus-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; max-width: 900px; margin: 0 auto; }
.campus-card { background: #393943; border: 1px solid #4a4a55; border-radius: var(--radius); padding: 30px; }
.campus-card p { color: #d6cfc4; margin-bottom: 6px; }
.campus-card a { color: var(--gold-light); }
.campus-no { font-size: 13px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold); }
.campus-card h3 { margin-top: 6px; }
.link-arrow { display: inline-block; margin-top: 10px; font-weight: 800; text-decoration: none; }

/* ---------- News ---------- */
.news-card { background: var(--cream); border-radius: var(--radius); padding: 28px; border: 1px solid var(--line); }
.news-card .date { display: block; font-size: 13px; font-weight: 800; color: var(--maroon); margin-bottom: 10px; }
.news-card p { color: #4c4550; font-size: 16px; margin: 0; }

/* ---------- Admission & forms ---------- */
.admission-photo { margin: 10px 0 24px; }
.admission-photo img { width: 100%; max-width: 420px; aspect-ratio: 1 / 1; object-fit: cover; object-position: top; border-radius: 50% 50% var(--radius) var(--radius); box-shadow: var(--shadow); }
.steps { padding-left: 22px; margin: 0; }
.steps li { margin-bottom: 8px; }

.form-card { background: #fff; border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.form-card h3 { margin-bottom: 18px; }
.form-card label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 16px; }
.form-card input, .form-card select, .form-card textarea {
    display: block; width: 100%; margin-top: 6px; padding: 12px 14px;
    border: 1px solid #d9cfc0; border-radius: 10px; background: #fffdf9;
    font: inherit; font-size: 16px; color: var(--ink);
}
.form-card input:focus, .form-card select:focus, .form-card textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 700; font-size: 15px; }
.alert-success { background: #e3f4e8; color: #1e6b3a; }
.alert-error { background: #fbe4e6; color: #8c1d2c; }

/* ---------- Contact ---------- */
.contact-list { list-style: none; padding: 0; margin: 10px 0 24px; }
.contact-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.contact-list b { display: inline-block; min-width: 110px; color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: 1px; }
.map { width: 100%; height: 240px; border: 0; border-radius: var(--radius); }

/* ---------- Footer ---------- */
.site-footer { background: var(--charcoal); color: #c9c1b4; padding: 56px 0 20px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 30px; }
.footer-logo { width: 100%; max-width: 360px; border-radius: 6px; }
.site-footer h4 { color: #fff; font-size: 18px; }
.site-footer a { color: #e3d9c6; }
.site-footer div > a { display: block; text-decoration: none; margin-bottom: 8px; }
.site-footer a:hover { color: var(--gold); }
.copyright {
    max-width: 1180px; margin: 40px auto 0; padding: 20px 20px 0; border-top: 1px solid #45454f; font-size: 14px;
    display: flex; justify-content: space-between; gap: 10px 24px; flex-wrap: wrap;
}
.dev-credit a { color: var(--gold) !important; font-weight: 700; text-decoration: none; display: inline !important; margin: 0 !important; }
.dev-credit a:hover { text-decoration: underline; }
@media (max-width: 640px) { .copyright { justify-content: center; text-align: center; } }

/* ---------- WhatsApp floating button ---------- */
.whatsapp-float {
    position: fixed; right: 18px; bottom: 18px; z-index: 60;
    width: 56px; height: 56px; border-radius: 50%;
    display: grid; place-items: center;
    background: #25d366; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

/* ---------- Gentle reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

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

/* ---------- Tablet ---------- */
@media (max-width: 980px) {
    .hero-grid, .two-col { grid-template-columns: 1fr; gap: 44px; }
    .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
    .photo-stack { height: 460px; max-width: 560px; width: 100%; margin: 0 auto; }

    .nav-toggle { display: block; position: relative; z-index: 60; }
    .main-nav {
        position: fixed; top: 0; right: 0; bottom: 0; width: 270px;
        flex-direction: column; align-items: stretch; gap: 4px; padding: 90px 28px;
        background: var(--charcoal); transform: translateX(100%); transition: transform .3s;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
    }
    .main-nav.open { transform: none; }
    .main-nav a:not(.btn) { padding: 11px 0; font-size: 17px; border-bottom: 1px solid #45454f; }
    .main-nav .btn { margin-top: 16px; text-align: center; }
}

/* ---------- Phone ---------- */
@media (max-width: 640px) {
    body { font-size: 16px; }
    .container { padding: 0 16px; }
    .section { padding: 64px 0; }
    .hero { padding: 40px 0 60px; }
    .hero p { font-size: 17px; }
    .brand img { height: 38px; }
    .grid-3, .grid-4, .form-row, .footer-grid, .ticks { grid-template-columns: 1fr; }
    .highlights .grid-4 { grid-template-columns: 1fr 1fr; gap: 22px 16px; }
    .photo-stack { height: 380px; }
    .gallery { columns: 2; column-gap: 10px; }
    .gallery-item { margin-bottom: 10px; }
    .gallery-item span { opacity: 1; font-size: 12px; padding: 18px 8px 6px; }
    .form-card { padding: 22px; }
    .contact-list b { display: block; }
    .event-card img { aspect-ratio: 4 / 3; }
}
