/* ============================================
   Kenyan Girls' High School Website
   Responsive Stylesheet
   ============================================ */

/* ============================================
   Large Desktop (1200px and above)
   ============================================ */
@media (min-width: 1200px) {
    .container {
        padding: 0 var(--spacing-xl);
    }
}

/* ============================================
   Desktop / Small Desktop (992px - 1199px)
   ============================================ */
@media (max-width: 1199px) {
    .highlights-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tracks-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .values-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xl);
    }
    
    .footer-brand {
        grid-column: 1 / -1;
        max-width: 100%;
        text-align: center;
    }
    
    .footer-brand p {
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .footer-social {
        justify-content: center;
    }
}

/* ============================================
   Tablet (768px - 991px)
   ============================================ */
@media (max-width: 991px) {
    /* Typography adjustments */
    html {
        font-size: 15px;
    }
    
    /* Header adjustments */
    .header-top-content {
        justify-content: center;
        text-align: center;
    }
    
    .header-contact {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .header-social {
        width: 100%;
        justify-content: center;
        margin-top: var(--spacing-sm);
    }
    
    /* Navigation - Mobile Toggle */
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background-color: var(--white);
        flex-direction: column;
        padding: 80px var(--spacing-lg) var(--spacing-lg);
        box-shadow: var(--shadow-lg);
        transition: right var(--transition-normal);
        z-index: 1000;
        gap: 0;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-link {
        display: block;
        padding: var(--spacing-md) 0;
        font-size: 1.125rem;
        border-bottom: 1px solid var(--light-gray);
        width: 100%;
    }
    
    .nav-link::after {
        display: none;
    }
    
    /* Mobile menu overlay */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-normal);
        z-index: 999;
    }
    
    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Hero adjustments */
    .hero {
        margin-top: 100px;
        height: 70vh;
        min-height: 500px;
    }
    
    .carousel-control {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
    
    .carousel-control.prev {
        left: var(--spacing-md);
    }
    
    .carousel-control.next {
        right: var(--spacing-md);
    }
    
    .carousel-content {
        padding: var(--spacing-md);
    }
    
    .carousel-content p {
        font-size: 1.125rem;
    }
    
    /* Highlights */
    .highlights {
        margin-top: -60px;
    }
    
    .highlights-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
    
    .highlight-card {
        min-height: 280px;
    }
    
    .highlight-content {
        padding: var(--spacing-lg);
    }
    
    .highlight-card h4 {
        font-size: 1.25rem;
    }
    
    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
        max-width: 600px;
        margin: 0 auto;
    }
    
    .feature-card {
        display: flex;
        flex-direction: column;
    }
    
    .feature-header {
        padding: var(--spacing-md) var(--spacing-lg);
    }
    
    .feature-image {
        height: 250px;
    }
    
    /* About Page - Vision & Mission Redesigned */
    .vision-mission-redesign {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .vm-background,
    .values-background {
        background-attachment: scroll;
    }
    
    .vision-mission {
        grid-template-columns: 1fr;
    }
    
    /* Page Header Hero */
    .page-header-hero {
        height: 350px;
        margin-top: 100px;
    }
    
    .page-header-hero h1 {
        font-size: 2.5rem;
    }
    
    /* About Intro Grid */
    .about-intro-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        text-align: center;
    }
    
    .about-intro-title h2 {
        font-size: 2rem;
    }
    
    .page-header-content {
        text-align: center;
        padding-left: 0;
    }
    
    /* NEW: About Intro Wrapper - Tablet */
    .about-intro-wrapper {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .about-intro-left {
        position: relative;
        top: auto;
        text-align: center;
    }
    
    .about-intro-left h2 {
        font-size: 2.5rem;
    }
    
    .title-accent {
        margin: 0 auto;
    }
    
    .about-intro-right {
        padding-left: 0;
        border-left: none;
        border-top: 1px solid #e8e4df;
        padding-top: var(--spacing-xl);
    }
    
    /* NEW: Vision & Mission Cards - Tablet */
    .vm-cards-wrapper {
        flex-direction: column;
        gap: 0;
    }
    
    .vm-divider {
        padding: var(--spacing-lg) 0;
    }
    
    .vm-divider span {
        width: 100px;
        height: 1px;
    }
    
    /* NEW: Principal Card - Tablet */
    .principal-section-new {
        padding: 4rem 0;
    }
    
    .principal-section-new::before {
        height: 40px;
    }
    
    .principal-card {
        padding: 2rem 2.5rem;
    }
    
    .principal-quote-mark {
        font-size: 5rem;
        top: 1rem;
        left: 1.5rem;
    }
    
    .principal-content blockquote p {
        font-size: 1.125rem;
    }
    
    /* NEW: Values Grid Clean - Tablet */
    .values-section-clean {
        padding: 4rem 0 5rem;
    }
    
    .values-section-clean::before {
        height: 40px;
    }
    
    .values-grid-clean {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
    
    .values-grid-clean .value-card-clean:nth-child(5),
    .values-grid-clean .value-card-clean:nth-child(6),
    .values-grid-clean .value-card-clean:nth-child(7) {
        grid-column: auto;
    }
    
    .values-grid-clean .value-card-clean:last-child {
        grid-column: 1 / -1;
    }
    
    /* Core Values Redesigned */
    .values-grid-new {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .values-grid-new .value-card:last-child {
        grid-column: 1 / -1;
    }
    
    .values-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* CBE Pathways */
    .tracks-grid {
        grid-template-columns: 1fr;
    }
    
    /* CBE Pathways - New Design */
    .cbe-intro-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .cbe-intro-left .title-accent {
        margin: 0 auto;
    }
    
    .tracks-grid-new {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tracks-grid-new.two-cards {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
    }
    
    /* Pathways 3-Column Layout */
    .pathways-columns {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .pathway-column {
        max-width: 500px;
        margin: 0 auto;
        width: 100%;
    }
    
    /* Uniforms Gallery */
    .uniforms-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Student Life */
    .life-block {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .life-block-reverse {
        direction: ltr;
    }
    
    .life-image {
        order: -1;
    }
    
    .life-image img {
        height: 280px;
    }
    
    .sports-grid,
    .activities-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Updates */
    .updates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Contact */
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
    
    .contact-info {
        order: 2;
    }
    
    .contact-form-wrapper {
        order: 1;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .footer-column h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .footer-column {
        text-align: center;
    }
    
    .footer-links a {
        justify-content: center;
    }
    
    .footer-contact-item {
        justify-content: center;
    }
}

/* ============================================
   Mobile (576px - 767px)
   ============================================ */
@media (max-width: 767px) {
    html {
        font-size: 14px;
    }
    
    /* Section padding */
    .section {
        padding: var(--spacing-xl) 0;
    }
    
    .container {
        padding: 0 var(--spacing-md);
    }
    
    /* Header */
    .header-top {
        display: none;
    }
    
    .header-main {
        padding: var(--spacing-sm) 0;
    }
    
    .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .logo-title {
        font-size: 1rem;
    }
    
    .logo-subtitle {
        font-size: 0.625rem;
    }
    
    .nav-menu {
        width: 100%;
        right: -100%;
    }
    
    /* Hero */
    .hero {
        margin-top: 70px;
        height: 60vh;
        min-height: 450px;
    }
    
    .carousel-content h1 {
        font-size: 1.75rem;
    }
    
    .carousel-content p {
        font-size: 1rem;
        margin-bottom: var(--spacing-md);
    }
    
    .carousel-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .carousel-buttons .btn {
        width: 100%;
        max-width: 280px;
    }
    
    .carousel-control {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .carousel-indicators {
        bottom: var(--spacing-md);
    }
    
    .carousel-indicator {
        width: 10px;
        height: 10px;
    }
    
    /* Highlights */
    .highlights {
        margin-top: -40px;
    }
    
    .highlights-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .highlight-card {
        min-height: 260px;
    }
    
    .highlight-content {
        padding: var(--spacing-lg);
    }
    
    .highlight-card h4 {
        font-size: 1.25rem;
    }
    
    /* Features */
    .features-grid {
        max-width: 100%;
    }
    
    .feature-card {
        display: flex;
        flex-direction: column;
    }
    
    .feature-header {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .feature-icon {
        width: 40px;
        height: 40px;
    }
    
    .feature-icon svg {
        width: 22px;
        height: 22px;
    }
    
    .feature-header-text h4 {
        font-size: 1rem;
    }
    
    .feature-image {
        height: 200px;
    }
    
    .feature-content {
        padding: var(--spacing-md);
    }
    
    /* Page Header */
    .page-header {
        margin-top: 70px;
        padding: var(--spacing-xl) 0;
    }
    
    /* Page Header Hero */
    .page-header-hero {
        height: 300px;
        margin-top: 70px;
    }
    
    .page-header-hero h1 {
        font-size: 2rem;
    }
    
    .page-header-subtitle {
        font-size: 0.75rem;
        letter-spacing: 2px;
    }
    
    .page-header-content {
        padding-bottom: var(--spacing-lg);
    }
    
    /* About Intro */
    .about-intro-section,
    .principal-message-section {
        padding: var(--spacing-xl) 0;
    }
    
    .about-intro-title h2 {
        font-size: 1.75rem;
    }
    
    .about-intro-content p {
        font-size: 1rem;
    }
    
    /* NEW: About Intro Section - Mobile */
    .about-intro-section-new {
        padding: 3rem 0 3.5rem;
    }
    
    .about-intro-left h2 {
        font-size: 2rem;
    }
    
    .about-intro-right .lead-text {
        font-size: 1.0625rem;
    }
    
    /* NEW: Vision & Mission - Mobile */
    .vm-section-clean {
        padding: 3.5rem 0;
    }
    
    .vm-card-clean {
        padding: var(--spacing-lg);
        text-align: center;
    }
    
    .vm-card-clean h3 {
        font-size: 1.25rem;
    }
    
    /* NEW: Principal Section - Mobile */
    .principal-section-new {
        padding: 3.5rem 0;
    }
    
    .principal-section-new::before {
        display: none;
    }
    
    .principal-card {
        padding: 1.75rem 1.5rem;
    }
    
    .principal-card::before {
        height: 3px;
    }
    
    .principal-quote-mark {
        font-size: 4rem;
        top: 0.5rem;
        left: 0.75rem;
    }
    
    .principal-content {
        padding-left: 0;
    }
    
    .principal-content blockquote p {
        font-size: 1.0625rem;
        line-height: 1.85;
    }
    
    .principal-footer {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }
    
    .principal-info h3 {
        font-size: 1.125rem;
    }
    
    /* NEW: Values Grid - Mobile */
    .values-section-clean {
        padding: 3.5rem 0 4rem;
    }
    
    .values-section-clean::before {
        display: none;
    }
    
    .values-grid-clean {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .values-grid-clean .value-card-clean:nth-child(5),
    .values-grid-clean .value-card-clean:nth-child(6) {
        grid-column: auto;
    }
    
    .values-grid-clean .value-card-clean:last-child {
        grid-column: 1 / -1;
    }
    
    .value-card-clean {
        padding: 1.25rem 1rem;
    }
    
    .value-card-clean h4 {
        font-size: 1rem;
    }
    
    .value-card-clean p {
        font-size: 0.875rem;
    }
    
    /* Motto */
    .motto-text {
        font-size: 1.75rem;
    }
    
    /* Values - New Design */
    .values-grid-new {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-md);
    }
    
    .value-card-inner {
        padding: var(--spacing-lg);
    }
    
    .value-number {
        font-size: 2rem;
    }
    
    .value-icon-new {
        width: 50px;
        height: 50px;
    }
    
    .value-icon-new svg {
        width: 24px;
        height: 24px;
    }
    
    /* Vision Mission - New Design */
    .vm-card-header {
        padding: var(--spacing-md) var(--spacing-lg);
    }
    
    .vm-card-body {
        padding: var(--spacing-lg);
    }
    
    .vm-card-body h3 {
        font-size: 1.125rem;
    }
    
    /* Values - Legacy */
    .values-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    .value-item {
        padding: var(--spacing-md);
    }
    
    /* Updates */
    .updates-grid {
        grid-template-columns: 1fr;
    }
    
    /* Contact Form */
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .contact-info,
    .contact-form-wrapper {
        padding: var(--spacing-lg);
    }
    
    /* Map */
    .map-container {
        height: 300px;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-brand {
        margin-bottom: var(--spacing-lg);
    }
    
    .footer-column {
        margin-bottom: var(--spacing-lg);
    }
    
    .footer-links a:hover {
        padding-left: 0;
    }
}

/* ============================================
   Small Mobile (up to 575px)
   ============================================ */
@media (max-width: 575px) {
    html {
        font-size: 13px;
    }
    
    /* Hero */
    .hero {
        min-height: 400px;
    }
    
    .carousel-content h1 {
        font-size: 1.5rem;
    }
    
    .carousel-content p {
        font-size: 0.9375rem;
    }
    
    /* Values - Stack on smallest screens */
    .values-grid-new {
        grid-template-columns: 1fr;
    }
    
    .values-grid-new .value-card:last-child {
        grid-column: auto;
    }
    
    .values-grid {
        grid-template-columns: 1fr;
    }
    
    /* NEW: Values Grid Clean - Small Mobile */
    .values-grid-clean {
        grid-template-columns: 1fr;
        gap: 0.875rem;
    }
    
    .values-grid-clean .value-card-clean:nth-child(5),
    .values-grid-clean .value-card-clean:nth-child(6),
    .values-grid-clean .value-card-clean:nth-child(7) {
        grid-column: auto;
    }
    
    .value-card-clean {
        padding: 1.25rem;
    }
    
    /* NEW: About Intro - Small Mobile */
    .about-intro-section-new {
        padding: 2.5rem 0;
    }
    
    .about-intro-left h2 {
        font-size: 1.75rem;
    }
    
    .section-label {
        font-size: 0.75rem;
    }
    
    /* NEW: Vision & Mission - Small Mobile */
    .vm-section-clean {
        padding: 2.5rem 0;
    }
    
    .vm-card-clean h3 {
        font-size: 1.125rem;
    }
    
    .vm-card-label {
        font-size: 0.6875rem;
    }
    
    /* NEW: Principal - Small Mobile */
    .principal-section-new {
        padding: 2.5rem 0;
    }
    
    .principal-card {
        padding: 1.5rem 1.25rem;
        border-radius: 10px;
    }
    
    .principal-quote-mark {
        font-size: 3rem;
    }
    
    .principal-content blockquote p {
        font-size: 1rem;
    }
    
    .principal-info h3 {
        font-size: 1rem;
    }
    
    /* NEW: Values - Small Mobile */
    .values-section-clean {
        padding: 2.5rem 0 3rem;
    }
    
    /* CBE Pathways */
    .pathway-header {
        flex-direction: column;
        text-align: center;
    }
    
    .pathway-header h2 {
        font-size: 1.5rem;
    }
    
    .track-header {
        flex-direction: column;
        text-align: center;
    }
    
    /* CBE Pathways - New Design */
    .cbe-intro-section {
        padding: 3rem 0;
    }
    
    .cbe-intro-left .intro-title {
        font-size: 1.75rem;
    }
    
    .cbe-intro-right p {
        font-size: 1rem;
    }
    
    .pathway-section-new {
        padding: 3rem 0;
    }
    
    .pathway-header-new {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .pathway-number-new {
        margin: 0 auto;
    }
    
    .pathway-title-group h2 {
        font-size: 1.5rem;
    }
    
    .tracks-grid-new,
    .tracks-grid-new.two-cards {
        grid-template-columns: 1fr;
    }
    
    .track-card-header {
        padding: 1.5rem;
    }
    
    .track-subjects-new {
        padding: 1.5rem;
    }
    
    /* Pathways 3-Column - Mobile */
    .pathways-grid-section {
        padding: 2.5rem 0;
    }
    
    .pathway-column-header {
        padding: 1.5rem;
    }
    
    .pathway-column-header h3 {
        font-size: 1.25rem;
    }
    
    .pathway-tracks {
        padding: 1.25rem;
    }
    
    /* Uniforms Gallery - Mobile */
    .uniforms-section {
        padding: 3rem 0;
    }
    
    .uniforms-section .section-header h2 {
        font-size: 1.5rem;
    }
    
    .uniforms-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .uniform-info {
        padding: 0.75rem;
    }
    
    .uniform-info h4 {
        font-size: 0.75rem;
    }
    
    .uniform-info p {
        font-size: 0.6875rem;
    }
    
    /* Lightbox - Mobile */
    .lightbox-nav {
        font-size: 1.75rem;
        padding: 0.5rem;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        top: 15px;
        right: 20px;
        font-size: 2rem;
    }
    
    /* Student Life - Mobile */
    .life-section {
        padding: 2rem 0;
    }
    
    .life-content h2 {
        font-size: 1.375rem;
    }
    
    .life-image img {
        height: 220px;
    }
    
    .sports-grid,
    .activities-grid {
        grid-template-columns: 1fr;
        gap: 0.625rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-buttons .btn {
        width: 100%;
        max-width: 280px;
    }
    
    /* Buttons */
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9375rem;
    }
    
    .btn-lg {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
    
    /* Section Headers */
    .section-header h2::after {
        width: 60px;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .header,
    .footer,
    .carousel-control,
    .carousel-indicators,
    .btn,
    .nav-toggle,
    .nav-menu {
        display: none !important;
    }
    
    .hero {
        margin-top: 0;
        height: auto;
        min-height: auto;
    }
    
    .carousel-slide {
        position: relative;
        opacity: 1;
        visibility: visible;
    }
    
    .carousel-slide:not(:first-child) {
        display: none;
    }
    
    .carousel-overlay {
        display: none;
    }
    
    .carousel-content {
        position: relative;
        transform: none;
        color: var(--black);
    }
    
    .carousel-content h1,
    .carousel-content p {
        color: var(--black);
    }
    
    .section {
        page-break-inside: avoid;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    a {
        text-decoration: underline;
    }
}

/* ============================================
   High Contrast Mode Support
   ============================================ */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000066;
        --secondary-color: #996600;
        --accent-color: #006600;
    }
    
    .btn {
        border-width: 3px;
    }
    
    .nav-link::after {
        height: 3px;
    }
}

/* ============================================
   Reduced Motion Support
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .carousel-slide {
        transition: none;
    }
    
    .scroll-animate {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   Dark Mode Support (optional enhancement)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* 
    Note: For a school website, we typically don't implement dark mode
    as it should maintain consistent branding. However, this is where
    dark mode styles would go if needed in the future.
    */
}

/* ============================================
   Landscape Orientation on Mobile
   ============================================ */
@media (max-width: 991px) and (orientation: landscape) {
    .hero {
        height: auto;
        min-height: 400px;
    }
    
    .carousel-content {
        padding: var(--spacing-md);
    }
    
    .carousel-content h1 {
        font-size: 1.5rem;
        margin-bottom: var(--spacing-sm);
    }
    
    .carousel-content p {
        margin-bottom: var(--spacing-sm);
    }
    
    .carousel-buttons {
        flex-direction: row;
    }
    
    .carousel-buttons .btn {
        width: auto;
    }
}

/* ============================================
   Touch Device Optimizations
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects that don't work well on touch */
    .highlight-card:hover,
    .feature-card:hover,
    .track-card:hover,
    .update-card:hover,
    .value-item:hover {
        transform: none;
    }
    
    /* Make touch targets larger */
    .nav-link {
        padding: var(--spacing-md) 0;
    }
    
    .carousel-control {
        width: 50px;
        height: 50px;
    }
    
    .carousel-indicator {
        width: 14px;
        height: 14px;
    }
}

/* ============================================
   Focus Visible Styles for Keyboard Navigation
   ============================================ */
@media (scripting: enabled) {
    :focus:not(:focus-visible) {
        outline: none;
    }
}
