/* === KNOWLEDGE EXCHANGE LANDING PAGE - MOBILE FIRST === */

/* CSS Variables for Colors and Fonts */
:root {
    --dark-teal: #0e3c44;
    --gold: #fcb900;
    --soft-teal: #8acbc0;
    --light-grey: #f4f4f4;
    --white: #ffffff;
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Lato', sans-serif;
}

/* === MOBILE FIRST BASE STYLES (320px-767px) === */

/* General Body Styles */
body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--dark-teal);
    line-height: 1.6;
}

/* Mobile-first Typography */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--dark-teal);
    margin-top: 0;
}

h1 {
    font-size: 2.5rem;  /* Mobile: 40px */
}

h2 {
    font-size: 2rem;  /* Mobile: 32px */
    text-align: center;
    margin-bottom: 2rem;
}

p {
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: var(--soft-teal);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;  /* Mobile: breathing room */
}

/* Header & Navigation - Mobile First */
header {
    background: var(--white);
    padding: 1rem 0;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 1000;
}

header nav {
    display: flex;
    flex-direction: column;  /* Mobile: stacked */
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

header .logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-teal);
}

header nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;  /* Mobile: allow wrapping */
    justify-content: center;
    gap: 1rem;
}

header nav ul li a {
    color: var(--dark-teal);
    font-weight: 700;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1rem;  /* Touch-friendly: 44x44px minimum */
    min-height: 44px;
}

header nav ul li a:hover {
    color: var(--soft-teal);
}

/* Hide login button on mobile */
header nav > .btn {
    display: none;
}

/* Button Styles - Touch-optimized */
.btn {
    padding: 0.75rem 1.5rem;  /* Ensures 44x44px minimum */
    border-radius: 5px;
    font-family: var(--font-heading);
    font-weight: 700;
    text-align: center;
    min-height: 44px;  /* iOS/Android touch target */
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--gold);
    color: var(--dark-teal);
}

/* Desktop hover effects only */
@media (hover: hover) and (pointer: fine) {
    .btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    }
}

/* Touch feedback for mobile */
.btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn-large {
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

/* Hero & CTA Sections - Mobile First */
#hero, #cta {
    background: url('https://images.unsplash.com/photo-1522202176988-66273c2fd55f?q=80&w=2071&auto=format&fit=crop') no-repeat center center/cover;
    color: var(--white);
    text-align: center;
    padding: 5rem 0;  /* Mobile: reduced padding */
    position: relative;
}

#hero::before, #cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--dark-teal);
    opacity: 0.8;
}

#hero .container, #cta .container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#hero h1 {
    font-size: 2.5rem;  /* Mobile: 40px */
    color: var(--white);
    margin-bottom: 1rem;
    line-height: 1.2;
}

#hero p {
    font-size: 1.1rem;  /* Mobile: slightly smaller */
    max-width: 600px;
    margin: 0 auto 2rem auto;
    line-height: 1.6;
}

/* Hero logo image */
#hero .hero-logo {
    max-width: 400px;
    width: 100%;
    height: auto;
    margin: 1.5rem auto;
    display: block;
}

#cta {
    background-image: url('https://images.unsplash.com/photo-1556761175-5973dc0f32e7?q=80&w=1932&auto=format&fit=crop');
    padding: 4rem 0;  /* Mobile: reduced */
}

#cta h2 {
    color: var(--white);
    font-size: 2rem;  /* Mobile */
}

/* Benefits Section - Mobile First */
#benefits {
    padding: 4rem 0;  /* Mobile: reduced from 6rem */
    background: var(--light-grey);
}

.benefits-grid {
    display: grid;
    grid-template-columns: 1fr;  /* Mobile: single column */
    gap: 2rem;
    text-align: center;
}

.benefit-card h3 {
    color: var(--dark-teal);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

/* Subjects Section - Mobile First */
#subjects {
    padding: 4rem 0;  /* Mobile: reduced from 6rem */
}

#subjects .subtitle {
    text-align: center;
    max-width: 700px;
    margin: -1rem auto 3rem auto;
    line-height: 1.6;
}

#subjects h3 {
    font-size: 1.8rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--soft-teal);
    display: inline-block;
}

.subjects-grid {
    display: grid;
    grid-template-columns: 1fr;  /* Mobile: single column */
    gap: 1.5rem;
}

.subject-card {
    background: var(--white);
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;  /* Mobile: stack vertically */
    gap: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.subject-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    line-height: 1.4;
    color: var(--dark-teal);
}

.subject-content {
    flex: 1;  /* Content takes available space */
}

.subject-content p {
    margin: 0;
    font-size: 0.95rem;  /* Mobile: slightly smaller for readability */
    line-height: 1.6;
    color: var(--dark-teal);
}

.subject-card .btn {
    align-self: stretch;  /* Mobile: full-width button */
    margin-top: auto;  /* Push button to bottom */
}

/* Desktop hover effects */
@media (hover: hover) and (pointer: fine) {
    .subject-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }
}

/* Testimonials Section - Mobile First */
#testimonials {
    background-color: var(--soft-teal);
    padding: 4rem 0;  /* Mobile: reduced from 6rem */
    color: var(--dark-teal);
}

#testimonials h2 {
    color: var(--white);
}

.testimonial {
    max-width: 750px;
    margin: 0 auto 2rem auto;
    text-align: center;
    padding: 0 1rem;  /* Mobile: breathing room */
}

.testimonial blockquote {
    font-size: 1.1rem;  /* Mobile: slightly smaller */
    font-style: italic;
    margin: 0 0 1rem 0;
    border: none;
    padding: 0;
    line-height: 1.6;
}

.testimonial cite {
    font-weight: 700;
    font-style: normal;
    font-size: 0.95rem;  /* Mobile: slightly smaller */
}

/* Footer - Mobile First */
footer {
    background-color: var(--dark-teal);
    color: var(--white);
    padding: 2rem 0 1rem;  /* Mobile: reduced padding */
    text-align: center;
}

footer a {
    color: var(--gold);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;  /* Touch-friendly */
    min-height: 44px;
}

footer p {
    margin: 0.5rem 0;
    font-size: 0.9rem;  /* Mobile: slightly smaller */
}

/* === RESPONSIVE BREAKPOINTS === */

/* Small phones: Improve grid at 400px */
@media (min-width: 400px) {
    .subjects-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* Tablet: 768px - 1024px */
@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }
    
    /* Typography scaling */
    h1 { font-size: 3rem; }  /* Tablet: 48px */
    h2 { font-size: 2.5rem; }  /* Tablet: 40px */
    
    /* Header horizontal layout */
    header nav { flex-direction: row; }
    header nav > .btn { display: inline-flex; }
    
    /* Hero larger sizing */
    #hero, #cta { padding: 7rem 0; }
    #hero h1 { font-size: 3rem; }
    #hero p { font-size: 1.2rem; }
    #cta h2 { font-size: 2.5rem; }
    
    /* Benefits 2-column */
    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }
    
    /* Sections more padding */
    #benefits, #subjects, #testimonials { padding: 5rem 0; }
    
    /* Subject content text slightly larger on tablet */
    .subject-content p {
        font-size: 1rem;  /* Tablet: standard body size */
    }
    
    /* Testimonials larger text */
    .testimonial blockquote { font-size: 1.25rem; }
    .testimonial cite { font-size: 1rem; }
    
    footer { padding: 2.5rem 0 1.5rem; }
    footer p { font-size: 1rem; }
}

/* Desktop: 1025px+ */
@media (min-width: 1025px) {
    /* Typography maximum */
    h1 { font-size: 3.5rem; }  /* Desktop: 56px */
    h2 { font-size: 2.8rem; }  /* Desktop: 44.8px */
    
    /* Hero maximum */
    #hero, #cta { padding: 8rem 0; }
    #hero h1 { font-size: 3.5rem; }
    #hero p { font-size: 1.25rem; }
    #cta { padding: 6rem 0; }
    #cta h2 { font-size: 2.8rem; }
    
    /* Benefits 3-column */
    .benefits-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3rem;
    }
    
    /* Sections maximum padding */
    #benefits, #subjects, #testimonials { padding: 6rem 0; }
    footer { padding: 3rem 0 2rem; }
}

/* Large Desktop: 1920px+ */
@media (min-width: 1920px) {
    .container { max-width: 1400px; }
}

/* === ACCESSIBILITY & PERFORMANCE === */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn { border: 2px solid currentColor; }
}
