/* ==========================================================================
   De Kroon Primary School - Stylesheet
   Theme: Royal Blue (#1e3a8a) & Gold (#f5b301) - inspired by "De Kroon" (The Crown)
   ========================================================================== */

/* ---------- Reset & Base ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1e3a8a;          /* Royal Blue */
    --primary-dark: #14266b;
    --secondary: #f5b301;        /* Gold */
    --secondary-dark: #d99a00;
    --accent: #60a5fa;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-grey: #f3f4f6;
    --white: #ffffff;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --topbar-height: 40px;
    --mainnav-height: 70px;
    --header-height: calc(var(--topbar-height) + var(--mainnav-height));
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Open Sans', 'Segoe UI', Tahoma, sans-serif;
    color: var(--text-dark);
    line-height: 1.65;
    background: var(--white);
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Merriweather', Georgia, serif;
    color: var(--primary);
    line-height: 1.3;
}

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

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

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Top Bar ---------- */
.topbar {
    background: var(--primary-dark);
    color: var(--white);
    height: var(--topbar-height);
    font-size: 0.85rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.topbar-inner {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.topbar-left img {
    height: 26px;
    width: auto;
}

.topbar-right {
    display: flex;
    gap: 22px;
}

.topbar-right span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.topbar-right i {
    color: var(--secondary);
}

/* ---------- Main Navigation ---------- */
.mainnav {
    background: var(--white);
    height: var(--mainnav-height);
    box-shadow: var(--shadow);
    position: fixed;
    width: 100%;
    top: var(--topbar-height);
    z-index: 999;
}

.mainnav-inner {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand img {
    height: 50px;
}

.brand-text {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
}

.brand-text small {
    display: block;
    font-size: 0.7rem;
    color: var(--secondary-dark);
    font-weight: 400;
    margin-top: 2px;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--primary);
    cursor: pointer;
}

.nav-menu {
    display: flex;
    gap: 2px;
    flex-wrap: nowrap;
}

.nav-menu li a {
    display: block;
    padding: 10px 12px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
    border-radius: 4px;
    transition: all 0.25s ease;
    position: relative;
    white-space: nowrap;
}

.nav-menu li a::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 4px;
    height: 2px;
    background: var(--secondary);
    transform: scaleX(0);
    transition: transform 0.25s ease;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    color: var(--primary);
}

.nav-menu li a:hover::after,
.nav-menu li a.active::after {
    transform: scaleX(1);
}

/* Spacer to offset fixed header on inner pages */
main.page {
    padding-top: var(--header-height);
}

/* ---------- Hero / Banner Carousel ---------- */
.hero {
    position: relative;
    height: 100vh;
    margin-top: var(--header-height);
    overflow: hidden;
    scroll-margin-top: var(--header-height);
}

.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.55), rgba(0, 0, 0, 0.45));
}

.hero-slide.active {
    opacity: 1;
}

.hero-content {
    position: relative;
    color: var(--white);
    text-align: center;
    padding: 0 20px;
    max-width: 900px;
    z-index: 2;
}

.hero-content h1 {
    color: var(--white);
    font-size: clamp(1.8rem, 5vw, 3.4rem);
    margin-bottom: 18px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.hero-content p {
    font-size: clamp(1rem, 2vw, 1.3rem);
    margin-bottom: 28px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.hero-btn {
    display: inline-block;
    padding: 12px 32px;
    background: var(--secondary);
    color: var(--primary-dark);
    font-weight: 700;
    border-radius: 30px;
    transition: all 0.3s ease;
    border: 2px solid var(--secondary);
}

.hero-btn:hover {
    background: transparent;
    color: var(--white);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: var(--white);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 5;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-arrow:hover {
    background: var(--secondary);
    border-color: var(--secondary);
    color: var(--primary-dark);
}

.hero-arrow.prev { left: 24px; }
.hero-arrow.next { right: 24px; }

.hero-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 5;
}

.hero-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hero-dot.active {
    background: var(--secondary);
    width: 32px;
    border-radius: 6px;
}

/* ---------- Page Header (inner pages) ---------- */
.page-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    padding: 70px 0 50px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: -10%;
    width: 120%;
    height: 80px;
    background: var(--white);
    border-radius: 50%;
}

.page-header h1 {
    color: var(--white);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    position: relative;
    z-index: 2;
}

.page-header p {
    margin-top: 10px;
    font-size: 1.05rem;
    opacity: 0.92;
    position: relative;
    z-index: 2;
}

/* ---------- Sections ---------- */
section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    margin-bottom: 14px;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--secondary);
    margin: 12px auto 0;
    border-radius: 2px;
}

.section-title p {
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
}

.bg-grey {
    background: var(--bg-grey);
}

/* ---------- Two Column Layout ---------- */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.two-col img {
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.two-col h3 {
    font-size: 1.6rem;
    margin-bottom: 16px;
}

.two-col p {
    margin-bottom: 14px;
    color: var(--text-light);
}

.value-list {
    margin-top: 20px;
}

.value-list li {
    padding: 8px 0 8px 30px;
    position: relative;
    color: var(--text-dark);
}

.value-list li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--secondary);
    position: absolute;
    left: 0;
    top: 8px;
}

/* ---------- Card Grid ---------- */
.grid-3, .grid-4 {
    display: grid;
    gap: 28px;
}

.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.card-body {
    padding: 22px;
}

.card-body h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.card-body p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.card-body ul {
    margin-top: 10px;
    padding-left: 18px;
}

.card-body ul li {
    list-style: disc;
    color: var(--text-light);
    font-size: 0.92rem;
    padding: 3px 0;
}

/* ---------- Advantages ---------- */
.advantage-card {
    text-align: center;
    background: var(--white);
    padding: 40px 26px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border-top: 4px solid var(--secondary);
}

.advantage-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.advantage-card .icon-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 22px;
    color: var(--secondary);
    font-size: 2rem;
}

.advantage-card h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.advantage-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ---------- School Life Gallery ---------- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    cursor: pointer;
}

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

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(30, 58, 138, 0.9) 0%, transparent 60%);
    color: var(--white);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay h4 {
    color: var(--white);
    font-size: 1.15rem;
    margin-bottom: 6px;
}

.gallery-overlay p {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.9);
}

/* ---------- Admissions ---------- */
.process-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    margin-top: 40px;
}

.step {
    text-align: center;
    position: relative;
    padding: 30px 18px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--secondary);
    color: var(--primary-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.3rem;
    margin: 0 auto 16px;
}

.step h4 {
    font-size: 1.05rem;
    margin-bottom: 10px;
}

.step p {
    font-size: 0.9rem;
    color: var(--text-light);
}

.info-table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
    background: var(--white);
    box-shadow: var(--shadow);
    border-radius: 12px;
    overflow: hidden;
}

.info-table th,
.info-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.info-table th {
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
}

.info-table tr:last-child td {
    border-bottom: none;
}

.info-table tr:hover {
    background: var(--bg-light);
}

/* ---------- Staff ---------- */
.staff-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 26px;
}

.staff-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    text-align: center;
}

.staff-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.staff-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.staff-body {
    padding: 22px 18px;
}

.staff-body h4 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.staff-title {
    color: var(--secondary-dark);
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.staff-bio {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 12px;
    line-height: 1.55;
}

.staff-email {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
}

.staff-email:hover {
    color: var(--secondary-dark);
}

/* ---------- Contact ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 40px;
}

.contact-info {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    padding: 40px 32px;
    border-radius: 12px;
}

.contact-info h3 {
    color: var(--white);
    margin-bottom: 22px;
    font-size: 1.4rem;
}

.contact-info ul li {
    display: flex;
    gap: 14px;
    margin-bottom: 22px;
    align-items: flex-start;
}

.contact-info i {
    color: var(--secondary);
    font-size: 1.2rem;
    margin-top: 4px;
}

.contact-info strong {
    display: block;
    margin-bottom: 4px;
}

.contact-info span {
    opacity: 0.9;
    font-size: 0.95rem;
}

.contact-form {
    background: var(--white);
    padding: 40px 32px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.contact-form h3 {
    margin-bottom: 22px;
    font-size: 1.4rem;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.92rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.25s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.btn-submit {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 13px 36px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    background: var(--secondary);
    color: var(--primary-dark);
    transform: translateY(-2px);
}

.map-wrapper {
    margin-top: 40px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.map-wrapper iframe {
    width: 100%;
    height: 400px;
    border: 0;
    display: block;
}

/* ---------- Stat Counter ---------- */
.stats {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    padding: 60px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    text-align: center;
}

.stat-num {
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--secondary);
    font-family: 'Merriweather', serif;
    margin-bottom: 8px;
}

.stat-label {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    opacity: 0.92;
}

/* ---------- CTA Banner ---------- */
.cta {
    background: var(--secondary);
    padding: 50px 0;
    text-align: center;
}

.cta h2 {
    color: var(--primary-dark);
    margin-bottom: 14px;
    font-size: clamp(1.4rem, 3vw, 2rem);
}

.cta p {
    color: var(--primary-dark);
    margin-bottom: 22px;
    font-size: 1.05rem;
}

.cta a {
    display: inline-block;
    padding: 12px 32px;
    background: var(--primary);
    color: var(--white);
    border-radius: 30px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.cta a:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ---------- Footer ---------- */
footer {
    background: #0f1d4d;
    color: rgba(255, 255, 255, 0.85);
    padding: 60px 0 0;
    font-size: 0.92rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-col h4 {
    color: var(--white);
    margin-bottom: 18px;
    font-size: 1.05rem;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 36px;
    height: 2px;
    background: var(--secondary);
}

.footer-col ul li {
    margin-bottom: 9px;
}

.footer-col ul li a {
    color: rgba(255, 255, 255, 0.75);
    transition: color 0.25s ease;
}

.footer-col ul li a:hover {
    color: var(--secondary);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.footer-brand img { height: 50px; }

.footer-brand strong {
    color: var(--white);
    font-family: 'Merriweather', serif;
    font-size: 1.1rem;
}

.social-links {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

.social-links a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--secondary);
    color: var(--primary-dark);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 22px 0;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
}

.footer-bottom a {
    color: rgba(255, 255, 255, 0.75);
    margin-left: 14px;
}

.footer-bottom a:hover { color: var(--secondary); }

/* ---------- Back to Top ---------- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 46px;
    height: 46px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
    box-shadow: var(--shadow-lg);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--secondary);
    color: var(--primary-dark);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 992px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .staff-grid { grid-template-columns: repeat(3, 1fr); }
    .process-steps { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .contact-grid { grid-template-columns: 1fr; }
    .two-col { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 768px) {
    .topbar-right { gap: 12px; font-size: 0.78rem; }
    .topbar-right .label { display: none; }

    .nav-toggle { display: block; }

    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow-lg);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
        gap: 0;
    }

    .nav-menu.open { max-height: 500px; }

    .nav-menu li {
        border-bottom: 1px solid var(--bg-grey);
    }

    .nav-menu li:last-child { border-bottom: none; }

    .nav-menu li a {
        padding: 14px 8px;
        display: block;
    }

    .brand-text { font-size: 0.95rem; }
    .brand-text small { display: none; }

    section { padding: 60px 0; }

    .grid-3, .gallery-grid { grid-template-columns: 1fr; }
    .staff-grid { grid-template-columns: repeat(2, 1fr); }

    .hero-arrow { width: 38px; height: 38px; font-size: 1rem; }
    .hero-arrow.prev { left: 12px; }
    .hero-arrow.next { right: 12px; }
}

@media (max-width: 480px) {
    .topbar-right span { gap: 4px; }
    .footer-grid { grid-template-columns: 1fr; }
    .stats-grid, .process-steps { grid-template-columns: 1fr; }
    .staff-grid { grid-template-columns: 1fr; }
    .container { padding: 0 16px; }
}
