/* Layout Styles - Grid Sections and Page Structure */

/* Header Layout */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 var(--space-md);
}

.nav__brand {
    flex-shrink: 0;
}

.nav__title {
    font-size: var(--text-2xl);
    margin: 0;
    color: var(--color-primary);
}

.nav__links {
    display: flex;
    list-style: none;
    margin: 0;
    gap: var(--space-lg);
}

.nav__link {
    font-weight: var(--weight-medium);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-base);
    transition: all var(--transition-fast);
}

.nav__link:hover,
.nav__link:focus {
    background-color: var(--color-bg-light);
    text-decoration: none;
}

/* Mobile Navigation */
@media (max-width: 767px) {
    .nav {
        flex-direction: column;
        height: auto;
        padding: var(--space-md);
        gap: var(--space-md);
    }
    
    .nav__links {
        gap: var(--space-md);
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav__link {
        padding: var(--space-xs) var(--space-sm);
        font-size: var(--text-sm);
    }
}

/* Main Content Layout */
.main {
    padding-top: var(--space-md);
}

/* Section Spacing */
section {
    padding: var(--space-xl) 0;
}

section:first-child {
    padding-top: var(--space-xl);
}

/* About Section Layout */
.about {
    background-color: var(--color-bg-light);
}

.about__content {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
    align-items: start;
}

@media (min-width: 768px) {
    .about__content {
        grid-template-columns: 300px 1fr;
        gap: var(--space-3xl);
    }
}

.about__photo {
    display: flex;
    justify-content: center;
}

.about__details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

/* Stats Section Layout */
.stats {
    background-color: var(--color-bg);
}

.stats__title {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.stats__cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.stats__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.achievements {
    max-width: 800px;
    margin: 0 auto;
}

.achievements__title {
    text-align: center;
    margin-bottom: var(--space-lg);
}

/* Desktop: Side-by-side layout for achievement categories */
@media (min-width: 900px) {
    .achievements {
        display: flex;
        gap: var(--space-3xl);
        max-width: 1200px;
        align-items: flex-start;
    }
    
    .achievements__category {
        flex: 1;
    }
    
    .achievements__title {
        text-align: left;
        margin-bottom: var(--space-md);
    }
}

/* Photos Section Layout */
.photos {
    background-color: var(--color-bg-light);
}

.photos__title {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.photos__gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
    max-width: 1200px;
    margin: 0 auto;
}

/* Desktop: Force 4 columns for all 4 images on same row */
@media (min-width: 1200px) {
    .photos__gallery {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1100px;
    }
}

/* Large tablets/small desktop: Force 4 columns with smaller width */
@media (min-width: 1024px) and (max-width: 1199px) {
    .photos__gallery {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1000px;
        gap: var(--space-md);
    }
}

/* Mobile: Horizontal scroll gallery with snap */
@media (max-width: 599px) {
    .photos__gallery {
        display: flex;
        gap: var(--space-lg);
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        padding-bottom: var(--space-lg);
        margin-bottom: var(--space-md);
        -webkit-overflow-scrolling: touch;
        /* Hide scrollbar on webkit browsers */
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }
    
    .photos__gallery::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }
    
    /* Add scroll indicators */
    .photos__gallery::before {
        content: "← Swipe to see more photos →";
        position: absolute;
        bottom: -40px;
        left: 50%;
        transform: translateX(-50%);
        font-size: var(--text-xs);
        color: var(--color-text-muted);
        white-space: nowrap;
        pointer-events: none;
    }
    
    /* Position relative for the indicator */
    .photos {
        position: relative;
        /* padding-bottom: calc(var(--space-3xl) + 60px); */
    }
}

/* Tablet: 2 columns */
@media (min-width: 768px) and (max-width: 1023px) {
    .photos__gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Video Section Layout */
.video {
    background-color: var(--color-bg);
}

.video__title {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.video__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--space-xl);
    max-width: 1200px;
    margin: 0 auto;
}

/* Mobile: Stack videos vertically */
@media (max-width: 899px) {
    .video__grid {
        grid-template-columns: 1fr;
        max-width: 600px;
    }
}

.video__container {
    max-width: 100%;
    margin: 0;
}

.video__container:last-child {
    margin-bottom: 0;
}

.video__wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    margin-bottom: var(--space-lg);
}

.video__iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
}

.video__caption {
    text-align: center;
    color: var(--color-text-light);
    margin: 0;
}

/* Footer Layout */
.footer {
    background-color: var(--color-bg-dark);
    color: var(--color-bg);
    padding: var(--space-2xl) 0;
}

.footer__content {
    text-align: center;
}

.footer__title {
    color: var(--color-bg);
    margin-bottom: var(--space-lg);
}

.contact__text {
    margin-bottom: var(--space-md);
    color: var(--color-text-muted);
}

.contact__details {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.contact__link {
    color: var(--color-accent);
    font-weight: var(--weight-medium);
}

.contact__link:hover,
.contact__link:focus {
    color: var(--color-bg);
}

.contact__separator {
    color: var(--color-text-muted);
}

@media (max-width: 480px) {
    .contact__details {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .contact__separator {
        display: none;
    }
}