/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #DEE5DB;
    --color-secondary: #91AE7E;
    --color-tertiary: #B1BBAC;
    --color-accent: #91AE7E;
    --color-white: #ffffff;
    --color-dark: #333333;
    --color-text: #555555;
    
    --font-display: 'Red Hat Display', sans-serif;
    --font-text: 'Red Hat Text', sans-serif;
    
    --sidebar-width: 280px;
    --mobile-nav-height: 84px; /* increased for better tap targets */
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-text);
    background-color: var(--color-primary);
    color: var(--color-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Desktop Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--color-tertiary);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

/* Logo space */
.logo-container {
    margin-bottom: 2rem;
}

.logo {
    width: 160px;
    height: 160px;
    border-radius: 0; /* Make square instead of circular */
    object-fit: cover;
    border: 4px solid var(--color-secondary);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    margin-bottom: 2rem;
}

.nav-link {
    display: block;
    padding: 1rem 1.25rem;
    background: rgba(222, 229, 219, 0.6);
    color: var(--color-dark);
    text-decoration: none;
    border-radius: 14px; /* slightly rounder */
    text-align: center;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border: 1.5px solid rgba(0,0,0,0.06);
}

.nav-link:hover,
.nav-link.active {
    background: var(--color-secondary);
    color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(145, 174, 126, 0.35);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: auto;
}

.social-link img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.social-link:hover img {
    transform: scale(1.1);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-tertiary) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 4rem 2rem;
    position: relative;
}

.hero-content {
    margin-bottom: 4rem;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 300;
    color: var(--color-white);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

.gallery-container {
    background: var(--color-white);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    width: 100%;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem; /* a bit more breathing room */
}

.gallery-item {
    position: relative;
    display: block;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.gallery-item:hover {
    transform: scale(1.02);
}

.gallery-item img,
.gallery-video-thumb,
.video-thumbnail img,
.video-thumbnail-auto {
    width: 100%;
    height: 220px;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
    border-radius: 16px;
}

.video-thumbnail-auto {
    pointer-events: none; /* Prevent video controls from showing */
    background: #000; /* Black background to avoid white borders */
}

.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.play-button {
    color: white;
    font-size: 1.5rem;
    margin-left: 3px; /* Slight offset to center the triangle */
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.25); /* lighter for less clutter */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-icon {
    font-size: 2rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* About Sections */
.about-section {
    padding: 5rem 2rem;
}

.about-section:nth-child(even) {
    background: var(--color-white);
}

.about-section.organization {
    background: var(--color-secondary);
}

.alliance-banner {
    max-width: 960px;
    margin: -2.5rem auto 3rem;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 14px;
    text-align: center;
    font-family: var(--font-display);
    font-weight: 500;
    color: var(--color-white);
    letter-spacing: 0.03em;
    backdrop-filter: blur(6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.alliance-banner span {
    display: inline-block;
}

/* About Ieva Section - Change to primary color background */
#about-ieva {
    background: var(--color-primary) !important; /* Changed from tertiary to primary */
}

#about-ieva .about-text h2 {
    color: var(--color-dark); /* Change back to dark text on light background */
}

#about-ieva .about-text p {
    color: var(--color-text); /* Change back to normal text color */
}

.about-content {
    display: flex;
    align-items: center;
    gap: 4rem;
    max-width: 1000px;
    margin: 0 auto;
}

.about-content.reverse {
    flex-direction: row-reverse;
}

.about-image {
    flex-shrink: 0;
}

.about-image img {
    width: 350px;
    height: 350px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.about-text {
    flex: 1;
}

.about-text h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--color-dark);
}

.about-section.organization .about-text h2 {
    color: var(--color-white);
}

.about-text p {
    font-size: 1.15rem;
    line-height: 1.7;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.about-section.organization .about-text p {
    color: rgba(255, 255, 255, 0.95);
}

/* Activities Section */
.activities-section {
    padding: 5rem 2rem;
    background: var(--color-tertiary);
}

.section-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 3.25rem; /* a touch more spacing */
    color: var(--color-dark);
}

.activities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.activity-card {
    background: var(--color-white);
    border-radius: 18px;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: 0 10px 28px rgba(0,0,0,0.08);
    border: 2px solid transparent;
}

/* Contact Section */
.contact-section {
    padding: 5rem 2rem;
    background: var(--color-secondary); /* Change from white to secondary color */
}

.contact-section .section-title {
    color: var(--color-white); /* Make title white on colored background */
}

.contact-card-single {
    background: var(--color-white); /* Keep the card white for contrast */
    border-radius: 18px;
    padding: 2.5rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    max-width: 600px;
    margin: 0 auto;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(145, 174, 126, 0.2);
}

.contact-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.contact-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    object-fit: contain; /* Prevent squishing of icons */
}

.contact-info {
    display: flex;
    flex-direction: column;
}

.contact-label {
    font-size: 0.9rem;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.contact-link {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: var(--color-dark);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 55px;
    height: 55px;
    background: var(--color-secondary);
    border: none;
    border-radius: 50%;
    color: var(--color-white);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(145, 174, 126, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--color-tertiary);
    transform: translateY(-3px);
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(177, 187, 172, 0.88); /* translucent tertiary */
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-top: 2px solid var(--color-secondary);
    padding: 0.6rem 0.5rem calc(0.6rem + env(safe-area-inset-bottom));
    z-index: 2000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 0.65rem 0.75rem;
    color: var(--color-dark);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 8px;
    min-height: 48px; /* meet tap target */
    margin: 0 0.25rem; /* visual separation */
    background: rgba(222, 229, 219, 0.75);
    border: 1.5px solid rgba(0,0,0,0.06);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.mobile-nav-link.active,
.mobile-nav-link:hover {
    background: var(--color-secondary);
    color: var(--color-white);
    box-shadow: 0 8px 18px rgba(145, 174, 126, 0.35);
}

/* Mobile Header */
.mobile-header {
    display: none; /* Hidden by default on desktop */
    background: var(--color-tertiary);
    padding: 0.85rem 1rem; /* slightly tighter vertically, wider horizontally */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1500;
    align-items: center;
    justify-content: space-between;
}

.mobile-header .logo-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mobile-header .logo {
    width: 50px;
    height: 50px;
    border-radius: 10px; /* soften */
    object-fit: cover;
    border: 2px solid var(--color-secondary);
}

.mobile-header h1 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--color-dark);
    font-weight: 600;
    margin: 0;
}

.mobile-header .social-links {
    display: flex;
    gap: 0.5rem;
    margin: 0;
}

.mobile-header .social-link img {
    width: 28px;
    height: 28px;
}

/* Poster Sections Updated */
/* Adaptive poster sections without frame/border; background color via color-* class */
.poster-section { padding:2.5rem 0; display:flex; align-items:center; justify-content:center; position:relative; }
/* Disable legacy forced full-height */
.poster-section.full-height-section { min-height:unset; height:auto; }
/* Keep selector to prevent fallback injection, but strip styling */
.poster-section .poster-container { display:flex; align-items:center; justify-content:center; flex-direction:column; gap:1rem; width:100%; max-width:1400px; padding:0; background:transparent; border:none; box-shadow:none; }
.poster-section .poster-link { display:flex; width:100%; height:100%; align-items:center; justify-content:center; text-decoration:none; }
/* Aspect wrapper enforces intrinsic ratio while never exceeding viewport height */
.poster-section .poster-aspect-wrapper { --poster-ar:0.707; aspect-ratio:var(--poster-ar); width:min(100%, calc((100vh - 5rem) * var(--poster-ar))); max-height:calc(100vh - 5rem); display:flex; align-items:center; justify-content:center; }
.poster-section .poster-aspect-wrapper img { width:100%; height:100%; object-fit:contain; object-position:center; }
/* Hover subtle scale */
.poster-section .poster-link:hover img { transform:scale(1.02); transition:transform .5s ease; }
/* Color backgrounds */
.poster-section.color-tertiary { background:var(--color-tertiary) !important; }
.poster-section.color-secondary { background:var(--color-secondary) !important; }
.poster-section.color-primary { background:var(--color-primary) !important; }
\.poster-section.color-secondary { background:var(--color-accent) !important; }
/* Fallback */
.poster-section:not(.color-tertiary):not(.color-secondary):not(.color-primary):not(.color-accent){ background:var(--color-tertiary); }
/* Mobile tweaks */
@media (max-width:768px){
  .poster-section { padding:1.5rem 0; }
  .poster-section .poster-aspect-wrapper { width:100%; max-height:75vh; }
}
/* End Poster Sections Updated */
/* Legacy poster markup support (no aspect wrapper present yet) */
.poster-section .poster-container, 
.poster-section .poster-link { background:transparent !important; border:none !important; box-shadow:none !important; padding:0 !important; }
.poster-section img.poster-image { display:block; width:100%; height:auto; max-height:calc(100vh - 5rem); object-fit:contain; object-position:center; margin:0 auto; border:none !important; box-shadow:none !important; background:transparent !important; }
.poster-section.full-height-section img.poster-image { max-height:calc(100vh - 5rem); }
/* Constrain overly wide images on very landscape screens to keep approx poster ratio */
@media (min-aspect-ratio: 4/3) { 
  .poster-section img.poster-image { width:min(100%, calc((100vh - 5rem) * 0.707)); }
}
@media (max-width:768px){
  .poster-section img.poster-image { max-height:75vh; width:100%; }
}
/* End legacy poster markup support */

/* Mobile Styles */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }
    
    .sidebar {
        display: none;
    }
    
    .mobile-header {
        display: flex;
    }
    
    .main-content {
        margin-left: 0;
        padding-bottom: var(--mobile-nav-height);
    }
    
    .mobile-nav {
        display: flex;
    }
    
    /* Hide back to top button on mobile */
    .back-to-top {
        display: none;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .gallery-container {
        margin: 0 1rem;
        padding: 1.5rem;
        overflow: hidden;
        border-radius: 18px;
    }
    
    .gallery-grid {
        display: flex;
        overflow-x: auto;
        gap: 1rem;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }
    
    .gallery-item {
        flex: 0 0 auto;
        scroll-snap-align: center;
        width: 78vw; /* slightly narrower for breathing room */
        max-width: 320px;
        min-width: 240px;
        border-radius: 18px;
    }
    
    .gallery-item img {
        height: 260px; /* reduce from 400px - less clutter */
    }
    
    /* Hide scrollbar but keep functionality */
    .gallery-grid::-webkit-scrollbar {
        display: none;
    }
    
    .gallery-grid {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    
    .about-content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
    
    .about-content.reverse {
        flex-direction: column;
    }
    
    .about-image img {
        width: 240px;
        height: 240px;
        border-radius: 18px;
    }
    
    .about-text h2 {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }
    
    .about-text p {
        font-size: 1.05rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .activities-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .activity-card {
        padding: 2rem 1.5rem;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .section-container {
        padding: 0 1.25rem;
    }
    
    .about-section,
    .activities-section,
    .contact-section {
        padding: 3.5rem 1rem; /* a bit more spacing for clarity */
    }
    
    .hero-section {
        padding: 3rem 1rem;
    }
    
    /* Mobile video sizing fix */
    .gallery-item img,
    .video-thumbnail-auto {
        height: 260px; /* reduce from 400px - less clutter */
        object-fit: cover;
        object-position: center;
        border-radius: 18px;
    }
    
    /* Simple GLightbox mobile video centering */
    .glightbox-clean .gcontainer {
        padding: 0 !important;
    }
    
    .glightbox-clean .gslide-video {
        height: 90vh !important;
        width: 95vw !important;
        margin: 5vh auto !important;
        position: relative !important;
    }
    
    .glightbox-clean .gvideo-wrapper {
        height: 100% !important;
        padding-bottom: 0 !important;
    }
    
    .glightbox-clean .gvideo {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }
    
    /* Force GLightbox mobile video sizing with higher specificity */
    .glightbox-clean .gcontainer .gslide .gslide-video {
        height: 90vh !important;
        width: 95vw !important;
        max-height: 90vh !important;
        max-width: 95vw !important;
        margin: 5vh auto !important;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
    }
    
    .glightbox-clean .gcontainer .gslide .gslide-video .gvideo-wrapper {
        height: 100% !important;
        width: 100% !important;
        padding-bottom: 0 !important;
        position: relative !important;
    }
    
    .glightbox-clean .gcontainer .gslide .gslide-video .gvideo-wrapper .gvideo {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
    }
    
    /* Override any GLightbox default positioning */
    .glightbox-clean .gslide-media {
        position: static !important;
        transform: none !important;
        top: auto !important;
        left: auto !important;
        margin: 0 !important;
    }

    /* Mobile: contact links as clear buttons for better tap targets */
    .contact-item .contact-link {
        display: inline-block;
        margin-top: 0.25rem;
        padding: 0.6rem 0.9rem;
        background: #fff;
        color: var(--color-dark);
        border: 1px solid rgba(0, 0, 0, 0.08);
        border-radius: 12px;
        font-weight: 600;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
    }

    /* Tighter line-height for wrapped labels inside mobile nav */
    .mobile-nav-link span { line-height: 1.2; }
}

/* Smooth scrolling and animations */
@media (prefers-reduced-motion: no-preference) {
    .nav-link,
    .activity-card,
    .contact-card,
    .gallery-item img {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* Focus styles for accessibility */
.nav-link:focus,
.mobile-nav-link:focus,
.contact-link:focus,
.back-to-top:focus {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
    border-radius: 12px;
}