
/* =========================================================
   ZENG EZA 8 PRIMARY SCHOOL
   COMPLETE RESPONSIVE OVERRIDES
   Add this at the VERY END of your stylesheet.
   Preserves the existing green, gold and cream branding.
========================================================= */

/* ---------- GLOBAL RESPONSIVE FIXES ---------- */

html {
    width: 100%;
    overflow-x: clip;
    scroll-padding-top: 90px;
}

body {
    width: 100%;
    min-width: 0;
    overflow-wrap: break-word;
}

img,
video,
iframe,
svg {
    max-width: 100%;
}

img,
video {
    height: auto;
}

input,
select,
textarea,
button {
    max-width: 100%;
    font: inherit;
}

.container,
.tk-about-container {
    width: min(1180px, 90%);
    margin-inline: auto;
}

section {
    min-width: 0;
    padding-block: clamp(48px, 8vw, 110px);
}

h1,
h2,
h3,
h4,
p {
    overflow-wrap: break-word;
}

h1 {
    font-size: clamp(2.25rem, 6vw, 7rem);
}

h2 {
    font-size: clamp(1.9rem, 4.5vw, 4rem);
}

p {
    max-width: 100%;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
    min-width: 0;
}

:focus-visible {
    outline: 3px solid var(--gold-light, #e2c832);
    outline-offset: 3px;
}

/* ---------- TABLETS AND SMALL LAPTOPS ---------- */

@media (max-width: 1024px) {

    /* Containers and spacing */

    .container,
    .tk-about-container {
        width: 90%;
    }

    section {
        padding-block: 65px;
    }

    /* Homepage hero */

    .hero {
        min-height: 760px;
        min-height: 90svh;
        background-position: center;
    }

    .hero-content {
        width: 90%;
        padding-top: 125px;
        padding-bottom: 180px;
    }

    .hero h1 {
        font-size: clamp(3.2rem, 8vw, 5.5rem);
        letter-spacing: -2px;
    }

    .hero-content > p {
        max-width: 620px;
        font-size: 16px;
    }

    .hero-scroll {
        margin-top: 40px;
    }

    .hero-bottom {
        left: 0;
        right: 0;
        justify-content: center;
        gap: clamp(20px, 5vw, 45px);
        padding: 24px 5%;
    }

    .hero-bottom strong {
        font-size: 24px;
    }

    /* Main content grids */

    .welcome-grid,
    .portal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 40px;
    }

    .welcome-photo img {
        height: 500px;
    }

    .why-grid,
    .highlight-grid,
    .life-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .academic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }

    .academic-card {
        height: 460px;
        min-width: 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 35px;
    }

    .stat:nth-child(2)::after {
        display: none;
    }

    .news-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .events-grid {
        grid-template-columns: 1fr;
    }

    .quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Facilities */

    .facility-header {
        grid-template-columns: 1fr 0.8fr;
        gap: 35px;
    }

    .facility-gallery {
        grid-template-columns: 1.5fr 1fr;
        grid-template-rows: repeat(2, 220px);
    }

    /* Gallery */

    .z8-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(3, 230px);
    }

    .z8-gallery-item.z8-gallery-featured {
        grid-row: span 2;
    }

    /* Additional About page navigation */

    .tk-main-nav {
        padding-inline: 4%;
    }

    .tk-logo {
        width: 78px;
        height: 78px;
    }

    .tk-nav-links ul {
        gap: 0;
    }

    .tk-nav-links ul li a {
        padding: 10px 8px;
        font-size: 10px;
    }
}

/* ---------- MOBILE AND TABLET ---------- */

@media (max-width: 768px) {

    /* General spacing */

    .container,
    .tk-about-container {
        width: 90%;
    }

    section {
        padding-block: 55px;
    }

    .section-heading {
        display: block;
        margin-bottom: 32px;
    }

    .section-heading h2,
    .welcome-text h2,
    .facility-header h2,
    .portal-text h2 {
        font-size: clamp(2rem, 7vw, 3.2rem);
        line-height: 1.1;
        letter-spacing: -1px;
    }

    .section-heading p,
    .why-choose-intro,
    .academic-intro,
    .z8-gallery-intro {
        font-size: 15px;
        line-height: 1.75;
    }

    /* Hero */

    .hero {
        min-height: 850px;
        min-height: 100svh;
        align-items: center;
        background-position: 58% center;
    }

    .hero-content {
        width: 90%;
        padding-top: 125px;
        padding-bottom: 230px;
    }

    .hero-eyebrow {
        font-size: 11px;
        letter-spacing: 2px;
        margin-bottom: 18px;
    }

    .hero h1 {
        font-size: clamp(2.8rem, 11vw, 5rem);
        line-height: 1;
        letter-spacing: -1.5px;
        margin-bottom: 22px;
    }

    .hero-content > p {
        font-size: 15px;
        line-height: 1.75;
        margin-bottom: 26px;
    }

    .hero-buttons,
    .cta-buttons {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        width: 100%;
    }

    .hero-btn,
    .hero-btn-outline {
        justify-content: center;
        width: 100%;
        min-height: 48px;
        padding: 14px 18px;
        text-align: center;
    }

    .hero-scroll {
        margin-top: 32px;
    }

    .hero-bottom {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
        padding: 20px 5%;
    }

    .hero-bottom strong {
        font-size: clamp(18px, 4vw, 25px);
    }

    .hero-bottom span {
        font-size: 10px;
        line-height: 1.5;
    }

    /* Welcome */

    .welcome-grid,
    .portal-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .welcome-photo img {
        height: auto;
        aspect-ratio: 4 / 3;
        object-fit: cover;
    }

    .photo-label {
        left: 12px;
        bottom: 12px;
        padding: 14px;
        max-width: calc(100% - 24px);
    }

    .welcome-text .lead {
        font-size: 17px;
    }

    .welcome-text p {
        line-height: 1.8;
    }

    /* Cards */

    .why-grid,
    .highlight-grid,
    .life-grid,
    .academic-grid,
    .news-grid,
    .quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .why-card {
        padding: 26px 20px;
    }

    .why-icon,
    .highlight-icon {
        font-size: 26px;
        margin-bottom: 20px;
    }

    .why-card h3 {
        font-size: 18px;
    }

    .why-card p {
        font-size: 13px;
    }

    .highlight-card {
        min-height: 220px;
        padding: 22px;
    }

    .highlight-card.large {
        grid-column: 1 / -1;
        grid-row: auto;
        min-height: 340px;
    }

    .highlight-card.large img {
        height: 340px;
        min-height: 0;
    }

    .highlight-overlay {
        padding: 22px;
    }

    .highlight-overlay h3 {
        font-size: 23px;
    }

    .highlight-overlay p {
        font-size: 14px;
    }

    /* Stats */

    .stats {
        padding: 60px 5%;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 30px;
    }

    .stat {
        padding: 12px;
    }

    .stat:nth-child(2)::after {
        display: none;
    }

    .stat strong {
        font-size: clamp(2.3rem, 8vw, 4rem);
    }

    .stat p {
        font-size: 10px;
        letter-spacing: 1px;
        line-height: 1.6;
    }

    /* Academic cards */

    .academic-card {
        height: 390px;
    }

    .academic-content {
        padding: 22px;
    }

    .academic-content h3 {
        font-size: 23px;
    }

    .academic-content p {
        font-size: 13px;
    }

    .academic-image::after {
        background: linear-gradient(
            to top,
            rgba(0, 0, 0, 0.9),
            rgba(0, 0, 0, 0.15)
        );
    }

    /* Student life */

    .life-card {
        height: 350px;
    }

    .life-card > div {
        padding: 20px;
    }

    .life-card h3 {
        font-size: 22px;
    }

    .life-card p {
        font-size: 13px;
    }

    /* Facilities */

    .facility-header {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 28px;
    }

    .facility-header p {
        margin-bottom: 12px;
    }

    .facility-gallery {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 300px 180px;
        gap: 10px;
    }

    .facility-main {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .facility-caption {
        padding: 18px;
    }

    .facility-caption h3 {
        font-size: 21px;
    }

    .facility-small span {
        left: 12px;
        bottom: 12px;
        right: 10px;
        font-size: 12px;
    }

    /* News */

    .news-image {
        height: 210px;
    }

    .news-body {
        padding: 20px;
    }

    .news-body h3 {
        font-size: 19px;
    }

    .news-body p {
        font-size: 13px;
    }

    /* Events */

    .event-item {
        grid-template-columns: 65px minmax(0, 1fr) 22px;
        gap: 13px;
        padding: 16px;
    }

    .event-date {
        width: 65px;
        height: 70px;
    }

    .event-date strong {
        font-size: 23px;
    }

    .event-info h3 {
        font-size: 17px;
    }

    .event-info p {
        line-height: 1.6;
    }

    /* Gallery */

    .z8-gallery-preview {
        padding: 60px 0;
    }

    .z8-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(3, 180px);
        gap: 10px;
    }

    .z8-gallery-item.z8-gallery-featured {
        grid-row: span 2;
    }

    .z8-gallery-item::before {
        left: 12px;
        bottom: 14px;
        font-size: 10px;
    }

    .z8-gallery-featured::before {
        font-size: 11px;
    }

    .z8-gallery-button-wrap {
        margin-top: 30px;
    }

    .z8-gallery-button {
        max-width: 100%;
        padding: 14px 22px;
    }

    /* Quick access */

    .quick-card {
        min-height: 190px;
        padding: 24px;
    }

    .quick-card h3 {
        font-size: 19px;
        margin: 18px 0 10px;
    }

    .quick-card p {
        font-size: 13px;
    }

    .quick-card strong {
        right: 18px;
        bottom: 18px;
    }

    /* Portal */

    .portal-card {
        grid-template-columns: 35px minmax(0, 1fr) 20px;
        gap: 12px;
        padding: 18px;
    }

    .portal-card h3 {
        font-size: 16px;
    }

    .portal-card p {
        line-height: 1.6;
    }

    /* Final call to action */

    .final-cta {
        padding-inline: 5%;
    }

    .final-cta h2 {
        font-size: clamp(2.4rem, 9vw, 4.5rem);
        letter-spacing: -1.5px;
        line-height: 1.05;
    }

    .final-cta p {
        font-size: 15px;
        line-height: 1.75;
    }

    /* General school-page hero headings */

    .tk-about-hero-content {
        width: 100%;
        padding: 125px 5% 55px;
    }

    .tk-about-hero {
        min-height: 560px;
        min-height: 75svh;
    }

    .tk-about-cta {
        min-height: 0;
        padding: 70px 6%;
    }
}

/* ---------- SMALL MOBILE: 480px AND BELOW ---------- */

@media (max-width: 480px) {

    .container,
    .tk-about-container {
        width: 90%;
    }

    section {
        padding-block: 45px;
    }

    .section-heading h2,
    .welcome-text h2,
    .facility-header h2,
    .portal-text h2 {
        font-size: 2rem;
        letter-spacing: -0.7px;
    }

    /* Hero */

    .hero {
        min-height: 820px;
        min-height: 100svh;
    }

    .hero-content {
        padding-top: 115px;
        padding-bottom: 225px;
    }

    .hero h1 {
        font-size: clamp(2.65rem, 12vw, 3.6rem);
    }

    .hero-eyebrow {
        font-size: 10px;
        letter-spacing: 1.5px;
    }

    .hero-bottom {
        gap: 8px;
        padding: 16px 4%;
    }

    .hero-bottom strong {
        font-size: 19px;
    }

    .hero-bottom span {
        font-size: 9px;
    }

    /* One-column layouts for comfortable reading */

    .why-grid,
    .highlight-grid,
    .life-grid,
    .academic-grid,
    .news-grid,
    .quick-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .why-card,
    .highlight-card,
    .quick-card {
        padding: 26px;
    }

    .highlight-card.large,
    .highlight-card.large img {
        min-height: 300px;
        height: 300px;
    }

    .academic-card {
        height: 410px;
    }

    .life-card {
        height: 360px;
    }

    .news-image {
        height: 230px;
    }

    .news-body {
        padding: 22px;
    }

    /* Facilities */

    .facility-gallery {
        grid-template-columns: 1fr;
        grid-template-rows: 260px 190px 190px;
    }

    .facility-main {
        grid-column: auto;
    }

    /* Events */

    .event-item {
        grid-template-columns: 55px minmax(0, 1fr);
        gap: 12px;
        padding: 14px;
    }

    .event-date {
        width: 55px;
        height: 62px;
    }

    .event-date strong {
        font-size: 21px;
    }

    .event-arrow {
        display: none;
    }

    .event-info h3 {
        font-size: 16px;
    }

    .event-info > span {
        font-size: 9px;
    }

    /* Gallery */

    .z8-gallery-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 210px 155px 155px;
        gap: 8px;
    }

    .z8-gallery-item.z8-gallery-featured {
        grid-row: span 2;
    }

    /* Portal */

    .portal-card {
        grid-template-columns: 28px minmax(0, 1fr);
        gap: 10px;
        padding: 15px;
    }

    .portal-card strong {
        display: none;
    }

    /* About and CTA headings */

    .tk-about-hero-content h1 {
        font-size: clamp(2.3rem, 10vw, 3.5rem);
        letter-spacing: -1px;
    }

    .tk-about-cta-content h2 {
        font-size: clamp(2.3rem, 10vw, 3.5rem);
        letter-spacing: -1px;
    }

    .tk-about-cta-content p {
        font-size: 14px;
        line-height: 1.75;
    }

    /* Buttons */

    .z8-gallery-button,
    .tk-about-cta-button {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

/* ---------- VERY SMALL PHONES ---------- */

@media (max-width: 360px) {

    .container,
    .tk-about-container {
        width: 92%;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-bottom strong {
        font-size: 17px;
    }

    .hero-bottom span {
        font-size: 8px;
    }

    .hero-bottom {
        gap: 5px;
    }

    .z8-gallery-grid {
        grid-template-rows: 180px 140px 140px;
    }

    .event-item {
        grid-template-columns: 48px minmax(0, 1fr);
        gap: 10px;
        padding: 10px;
    }

    .event-date {
        width: 48px;
        height: 56px;
    }

    .event-date strong {
        font-size: 19px;
    }

    .tk-about-hero-content {
        padding-inline: 4%;
    }
}

/* ---------- FORMS, TABLES AND EMBEDDED CONTENT ---------- */

@media (max-width: 768px) {

    /* Form layouts */

    .gallery-submit-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .gallery-submit-form {
        padding: clamp(20px, 5vw, 32px);
    }

    .gallery-share-section,
    .gallery-submit-section {
        padding: 55px 5%;
    }

    .gallery-share-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .gallery-share-card {
        padding: 25px 18px;
    }

    /* Prevent wide tables from breaking the page */

    table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Embeds */

    iframe {
        max-width: 100%;
    }

    /* Avoid fixed-width form controls */

    input,
    select,
    textarea {
        width: 100%;
    }

    input[type="checkbox"],
    input[type="radio"],
    input[type="file"] {
        width: auto;
    }

    /* Long content */

    pre,
    code {
        overflow-wrap: anywhere;
    }
}

@media (max-width: 480px) {

    .gallery-share-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- ACCESSIBILITY ---------- */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

  
  .tk-about-cta {
    min-height: 0;
    padding: 68px 22px;
  }

  .tk-about-cta-content .tk-about-eyebrow {
    justify-content: center;
  }

  .tk-about-cta-content h2 {
    font-size: clamp(2.15rem, 10vw, 3.2rem);
    letter-spacing: -0.8px;
    line-height: 1.05;
  }

  .tk-about-cta-content p {
    margin: 20px auto 25px;
    font-size: 14px;
    line-height: 1.75;
  }

  .tk-about-cta-button {
    max-width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 21px;
    font-size: 12px;
  }


/* Small phones */
@media (max-width: 380px) {
  .tk-about-intro,
  .tk-purpose-section,
  .tk-head-section,
  .tk-leadership-section,
  .tk-facilities-section,
  .tk-policies-section {
    padding: 44px 0;
  }

  .tk-history-section {
    padding: 44px 0;
  }

  .tk-staff-section {
    padding: 48px 0;
  }

  .tk-about-intro-content h2,
  .tk-head-message h2,
  .tk-section-heading h2 {
    font-size: 1.85rem;
  }

  .tk-about-image-frame {
    height: 260px;
  }

  .tk-head-image-frame {
    height: 285px;
  }

  .tk-staff-card > img {
    height: 245px;
  }

  .tk-leader-image {
    height: 290px;
  }

  .tk-facility-card {
    min-height: 290px;
  }

  .tk-policy-item {
    grid-template-columns: 28px minmax(0, 1fr) 16px;
    gap: 8px;
  }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .tk-about-image-frame img,
  .tk-purpose-card,
  .tk-leader-card,
  .tk-leader-image img,
  .tk-staff-card,
  .tk-staff-card > img,
  .tk-facility-image img,
  .tk-policy-item,
  .tk-policy-arrow,
  .tk-about-cta-button,
  .tk-about-cta-button span {
    animation: none !important;
    transition: none !important;
  }

  .tk-about-image-frame:hover img,
  .tk-purpose-card:hover,
  .tk-purpose-card-featured,
  .tk-purpose-card-featured:hover,
  .tk-leader-card:hover,
  .tk-leader-card:hover .tk-leader-image img,
  .tk-staff-card:hover,
  .tk-staff-card:hover > img,
  .tk-facility-card:hover .tk-facility-image img,
  .tk-policy-item:hover,
  .tk-policy-item:hover .tk-policy-arrow,
  .tk-about-cta-button:hover,
  .tk-about-cta-button:hover span {
    transform: none !important;
  }
}
