/* Responsive Styles for Turkana Preparatory School */

/* Mobile First Approach - Base styles for mobile devices */

/* General Mobile Optimizations */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Image Responsiveness */
img {
    max-width: 100%;
    height: auto;
}

/* Container Improvements */
.container, .container-fluid {
    padding-left: 15px;
    padding-right: 15px;
}

/* Large devices (desktops, less than 1200px) */
@media (max-width: 1199.98px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .about-section .display-5 {
        font-size: 2.2rem;
    }
    
    .hero-slide h1 {
        font-size: 2.5rem;
    }
    
    .facility-card, .program-card {
        margin-bottom: 2rem;
    }
}

/* Medium devices (tablets, less than 992px) */
@media (max-width: 991.98px) {
    /* Navbar Improvements */
    .navbar-collapse {
        background: rgba(255, 255, 255, 0.98);
        padding: 1rem;
        border-radius: 8px;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
        margin-top: 1rem;
    }
    
    .navbar-nav {
        padding: 1rem 0;
        text-align: center;
    }
    
    .nav-item {
        margin: 0.5rem 0;
    }
    
    .navbar-brand {
        font-size: 1.5rem;
    }
    
    .navbar-brand img {
        max-height: 40px;
    }
    
    /* Hero Section */
    .hero-section {
        text-align: center;
        padding: 3rem 0;
    }
    
    .hero-slide {
        min-height: 60vh;
        padding: 2rem 0;
    }
    
    .hero-slide h1 {
        font-size: 2.2rem;
        margin-bottom: 1rem;
    }
    
    .hero-slide .lead {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 300px;
        margin: 0.5rem 0;
    }
    
    /* About Section */
    .about-section img {
        margin-bottom: 2rem;
    }
    
    .feature-card {
        margin-bottom: 1.5rem;
    }
    
    /* Facilities Section */
    .facility-card {
        margin-bottom: 2rem;
    }
    
    .facility-card img {
        height: 200px;
        object-fit: cover;
    }
    
    /* Programs Section */
    .program-card {
        margin-bottom: 2rem;
    }
    
    .program-card img {
        height: 200px;
        object-fit: cover;
    }
    
    /* Achievements Section */
    .counter-box {
        margin-bottom: 1.5rem;
    }
    
    /* Testimonials */
    .testimonial-item {
        margin-bottom: 2rem;
    }
    
    /* Footer */
    footer {
        text-align: center;
    }
    
    footer .col-md-6, 
    footer .col-lg-4 {
        margin-bottom: 2rem;
    }
}

/* Small devices (landscape phones, less than 768px) */
@media (max-width: 767.98px) {
    /* Typography */
    h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    .display-3 {
        font-size: 2.5rem;
    }
    
    .display-5 {
        font-size: 2rem;
    }
    
    .lead {
        font-size: 1.1rem;
        line-height: 1.5;
    }
    
    /* Navbar */
    .navbar-brand {
        font-size: 1.3rem;
    }
    
    .navbar-brand img {
        max-height: 35px;
    }
    
    /* Hero Section */
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-slide {
        min-height: 50vh;
        padding: 1.5rem 0;
    }
    
    .hero-slide h1 {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }
    
    .hero-slide .lead {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-buttons .btn {
        font-size: 0.9rem;
        padding: 0.75rem 1.5rem;
    }
    
    /* Buttons */
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    
    /* Sections */
    section {
        padding: 2.5rem 0;
    }
    
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .py-6 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
    
    .py-7 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    .py-lg-8 {
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }
    
    /* Cards */
    .card {
        margin-bottom: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Facilities and Programs */
    .facility-card img,
    .program-card img {
        height: 180px;
    }
    
    /* Achievements */
    .counter-box {
        padding: 1.5rem 1rem;
        margin-bottom: 1rem;
    }
    
    .counter-box h2 {
        font-size: 2rem;
    }
    
    .counter-box h5 {
        font-size: 0.9rem;
    }
    
    /* Testimonials */
    .testimonial-item {
        margin-bottom: 1.5rem;
        padding: 0 1rem;
    }
    
    .testimonial-item .bg-light {
        padding: 1.5rem;
    }
    
    /* Footer */
    footer {
        padding: 2rem 0 1rem;
        text-align: center;
    }
    
    footer .btn-social {
        margin: 0.25rem;
    }
    
    /* Contact Form */
    .contact-form .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Gallery */
    .portfolio-item {
        margin-bottom: 1rem;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    /* Typography */
    h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    .display-3 {
        font-size: 2rem;
    }
    
    .display-5 {
        font-size: 1.75rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    /* Navbar */
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .navbar-brand img {
        max-height: 30px;
    }
    
    /* Hero Section */
    .hero-section {
        padding: 1.5rem 0;
    }
    
    .hero-slide {
        min-height: 45vh;
        padding: 1rem 0;
    }
    
    .hero-slide h1 {
        font-size: 1.6rem;
        margin-bottom: 0.75rem;
    }
    
    .hero-slide .lead {
        font-size: 0.95rem;
        margin-bottom: 1.25rem;
    }
    
    .hero-buttons .btn {
        display: block;
        width: 100%;
        margin: 0.5rem 0;
        font-size: 0.85rem;
        padding: 0.75rem 1rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
    
    /* Sections */
    section {
        padding: 2rem 0;
    }
    
    .py-5 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
    
    .py-6 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    /* Cards */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .feature-card {
        padding: 1rem 0.75rem;
    }
    
    /* Facilities and Programs */
    .facility-card img,
    .program-card img {
        height: 150px;
    }
    
    /* Achievements */
    .counter-box {
        padding: 1rem 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .counter-box h2 {
        font-size: 1.75rem;
    }
    
    .counter-box h5 {
        font-size: 0.8rem;
    }
    
    .counter-box i {
        font-size: 2rem;
    }
    
    /* Testimonials */
    .testimonial-item {
        margin-bottom: 1rem;
        padding: 0 0.5rem;
    }
    
    .testimonial-item .bg-light {
        padding: 1rem;
    }
    
    .testimonial-item img {
        width: 50px;
        height: 50px;
    }
    
    /* Form Elements */
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on focus in mobile */
        padding: 0.75rem;
    }
    
    /* Contact Form */
    .contact-form {
        margin-bottom: 2rem;
    }
    
    /* Footer */
    footer {
        padding: 1.5rem 0 1rem;
    }
    
    footer .btn-social {
        width: 35px;
        height: 35px;
        font-size: 0.8rem;
    }
    
    /* Padding and Margins */
    .px-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .px-5 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Badges */
    .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Gallery */
    .portfolio-item {
        margin-bottom: 0.75rem;
    }
    
    /* Page Headers */
    .page-header {
        padding: 2rem 0;
    }
    
    .page-header h1 {
        font-size: 1.75rem;
    }
}

/* Very Small Devices (iPhone SE, etc.) */
@media (max-width: 375px) {
    /* Typography */
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    .display-3 {
        font-size: 1.75rem;
    }
    
    .display-5 {
        font-size: 1.5rem;
    }
    
    /* Navbar */
    .navbar-brand {
        font-size: 1.1rem !important;
    }
    
    .navbar-brand img {
        max-height: 25px;
    }
    
    /* Hero Section */
    .hero-section {
        padding: 1rem 0;
    }
    
    .hero-slide {
        min-height: 40vh;
        padding: 0.75rem 0;
    }
    
    .hero-slide h1 {
        font-size: 1.4rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-slide .lead {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .hero-buttons .btn {
        font-size: 0.8rem;
        padding: 0.6rem 0.8rem;
    }
    
    /* Buttons */
    .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .btn-lg {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }
    
    /* Cards */
    .card-body {
        padding: 0.5rem;
    }
    
    .feature-card {
        padding: 0.75rem 0.5rem;
    }
    
    /* Achievements */
    .counter-box {
        padding: 0.75rem 0.5rem;
    }
    
    .counter-box h2 {
        font-size: 1.5rem;
    }
    
    .counter-box h5 {
        font-size: 0.75rem;
    }
    
    .counter-box i {
        font-size: 1.75rem;
    }
    
    /* Footer */
    footer .btn-social {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }
    
    /* Sections */
    .py-5 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    .py-6 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
}

/* Landscape Orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: 2rem 0;
    }
    
    .hero-slide {
        min-height: 50vh;
        padding: 1rem 0;
    }
    
    .hero-slide h1 {
        font-size: 1.5rem;
    }
    
    .hero-slide .lead {
        font-size: 0.9rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Touch devices */
    .btn {
        min-height: 44px; /* Apple's recommended touch target size */
        min-width: 44px;
    }
    
    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .btn-social {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .card:hover {
        transform: none;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .navbar-brand img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .card:hover {
        transform: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    /* This can be expanded if dark mode is implemented */
    .bg-light {
        background-color: #f8f9fa !important;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        padding: 0.5in;
        font-size: 12pt;
        color: #000;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        font-weight: normal;
    }
}
