/* Font Face */
@font-face {
    font-family: 'Lavishly Yours';
    src: url('fonts/LavishlyYours-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* 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;
    /* Scrollbar palette (imported from public build) */
    --scrollbar-track: transparent;
    --scrollbar-thumb: rgba(0, 0, 0, 0.35);
    --scrollbar-thumb-hover: rgba(0, 0, 0, 0.5);
    --scrollbar-radius: 6px;
    
    --font-display: 'Red Hat Display', sans-serif;
    --font-text: 'Red Hat Text', sans-serif;
    
    --sidebar-width: 280px;
    --mobile-nav-height: 57px;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden; /* ensure no horizontal scroll */
}

body {
    font-family: var(--font-text);
    background-color: var(--color-primary);
    color: var(--color-dark);
    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;
    object-fit: cover;
    filter: drop-shadow(0 5px 10px var(--color-dark));
}

.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: 12px;
    text-align: center;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

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

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: auto;
    max-width: 152px;
    justify-content: center;
}

.social-link {
    display: block;
    line-height: 0;
    width: 40px;
    height: 40px;
}

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

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

/* Sidebar Alianse button - exact image size, no rounding/padding */
.alianse-button {
    display: block; /* full row like other buttons */
    width: 100%; /* match sidebar button width */
    margin: 0;
}
.alianse-button img {
    display: block;
    width: 100% !important; /* scale image to fill button width */
    height: auto !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transition: none !important;
}
.alianse-button:hover img { /* disable hover lift */
    transform: none !important;
    box-shadow: none !important;
}

/* Alianse motto text */
.alianse-motto {
    font-family: 'Lavishly Yours', cursive;
    color: #91AE7E;
    font-size: 2.2rem;
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

/* Mobile Alianse button - exact image size, no rounding/padding */
.alianse-button-mobile {
    display: none; /* shown on mobile in media query */
    width: auto;
    margin: 0;
}
.alianse-button-mobile img {
    display: block;
    /* remove width:auto !important; height:auto !important; to avoid conflicts */
    border-radius: 0 !important;
    box-shadow: none !important;
    transition: none !important;
}

/* 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: #9db38f;
    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;
}

.hero-categories {
    background: var(--color-primary);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    max-width: 1000px;
    width: 100%;
}

.hero-category-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-bottom: 1px solid rgba(123, 36, 41, 0.12);
}

.hero-category-btn {
    padding: 1rem;
    background: transparent;
    border: none;
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-text);
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

@media (min-width: 768px) {
    .hero-category-btn { border-left: 1px solid rgba(123, 36, 41, 0.12); }
}

.hero-category-btn:first-child {
    border-left: none;
}

/* Category-specific hover/active colors */
.hero-category-btn[data-target="all"]:hover,
.hero-category-btn[data-target="all"]:focus-visible { background: #f6e4e3; /* soft green tint from palette */ color: #5c1f22; }
.hero-category-btn[data-target="all"].active { background: #eac8c5; color: #4a1719; box-shadow: inset 0 -3px 0 #91AE7E; }

.hero-category-btn[data-target="pasakumi"]:hover,
.hero-category-btn[data-target="pasakumi"]:focus-visible { background: #e5e9e6; /* tertiary-inspired neutral */ color: #2f3734; }
.hero-category-btn[data-target="pasakumi"].active { background: #cfd6d0; color: #242c29; box-shadow: inset 0 -3px 0 #B1BBAC; }

.hero-category-btn[data-target="galerija"]:hover,
.hero-category-btn[data-target="galerija"]:focus-visible { background: #dbe7d2; /* secondary-driven tint */ color: #243729; }
.hero-category-btn[data-target="galerija"].active { background: #c4d7b7; color: #1b2d20; box-shadow: inset 0 -3px 0 #91AE7E; }

.hero-category-btn[data-target="posti"]:hover,
.hero-category-btn[data-target="posti"]:focus-visible { background: #e5e9e6; /* tertiary-inspired neutral */ color: #2f3734; }
.hero-category-btn[data-target="posti"].active { background: #f3f3f3; color: #242c29; box-shadow: inset 0 -3px 0 #fff; }

.hero-category-panels {
    padding: 1.5rem;
    padding-right: 12px;
    height: 540px; /* fixed height for tab content */
}

.hero-category-panel {
    display: none;
    height: 100%;
    width: 100%;
}

.hero-category-panel.active {
    display: flex;
    justify-content: flex-start;
    align-items: stretch;
}

.hero-category-placeholder {
    margin: 0;
    font-size: 1.05rem;
    color: var(--color-dark);
    text-align: center;
    padding: 1.25rem;
    background: rgba(222, 229, 219, 0.55);
    border-radius: 12px;
}

.gallery-container {
    overflow: hidden; /* prevent hover effects from overlapping the border */
    position: relative;
    max-width: none;
    width: 100%;
    height: 100%;
}

/* Clean, responsive gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    max-height: 100%;
    overflow-y: auto;
    padding-right: 8px; /* room for scrollbar */
    width: 100%;
}

.gallery-item {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 14px;
    background: transparent; /* avoid dark background showing in rounded corners */
    transition: transform .18s ease, box-shadow .18s ease;
    border: 2px solid var(--color-tertiary);
    box-sizing: border-box;
}

.gallery-item:hover {
    transform: none; /* keep shadow effect only */
}

/* Media fills and consistent squares */
.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 100%;
    display: block;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform .35s ease;
    border-radius: 0 !important;
}

.gallery-item:hover img,
.gallery-item:hover video {
    transform: scale(1.03);
}

/* Subtle hover veil instead of emoji */
.gallery-item::after {
    content: "";
    position: absolute;
    inset: 2px; /* leave space for the 2px border */
    background: radial-gradient(120% 120% at 50% 50%, rgba(255,255,255,.12) 0%, rgba(0,0,0,0) 55%),
                linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.06));
    opacity: 0;
    transition: opacity .2s ease;
    pointer-events: none;
    border-radius: 12px; /* parent 14px radius minus 2px inset/border */
}

.events-gallery-grid {
    position: relative;
}

.events-gallery-item {
    position: relative;
}

.badge {
    position: absolute;
    width: 100%;
    bottom: 0;
    left: 0;
    background: #e5e9e6;
    color: #2f3734;
    padding: 6px 10px;
    font-size: 1rem;
    letter-spacing: 0.01em;
    pointer-events: none;
}

.badge--galerija {
    background: #c4d7b7;
    color: #1b2d20;
}

.badge--pasakumi {
    background: #eac8c5;
    color: #4a1719;
}

.badge--posti {
    background: #cfd6d0;
    color: #242c29;
}

.badge--default {
    background: #e5e9e6;
    color: #2f3734;
}

/* Reusable scrollbar utilities (from public) */
.scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
.scrollbar-thin::-webkit-scrollbar { width: 8px; height: 8px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; border-radius: var(--scrollbar-radius); }
.scrollbar-thin::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: var(--scrollbar-radius); }
.scrollbar-thin::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

.scrollbar-narrow {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
.scrollbar-narrow::-webkit-scrollbar { width: 6px; height: 6px; }
.scrollbar-narrow::-webkit-scrollbar-track { background: transparent; border-radius: var(--scrollbar-radius); }
.scrollbar-narrow::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: var(--scrollbar-radius); }
.scrollbar-narrow::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

.scrollbar-mini {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
.scrollbar-mini::-webkit-scrollbar { width: 4px; height: 4px; }
.scrollbar-mini::-webkit-scrollbar-track { background: transparent; border-radius: 2px; }
.scrollbar-mini::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.2); border-radius: 2px; }

.scrollbar-hide { scrollbar-width: none; -ms-overflow-style: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* Apply scrollbars to key scrollers */
.hero-category-panels,
.gallery-grid,
.gallery-modal-description,
.gallery-modal-thumbnails {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
.hero-category-panels::-webkit-scrollbar,
.gallery-grid::-webkit-scrollbar,
.gallery-modal-description::-webkit-scrollbar,
.gallery-modal-thumbnails::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.hero-category-panels::-webkit-scrollbar-track,
.gallery-grid::-webkit-scrollbar-track,
.gallery-modal-description::-webkit-scrollbar-track,
.gallery-modal-thumbnails::-webkit-scrollbar-track {
    background: transparent;
    border-radius: var(--scrollbar-radius);
}
.hero-category-panels::-webkit-scrollbar-thumb,
.gallery-grid::-webkit-scrollbar-thumb,
.gallery-modal-description::-webkit-scrollbar-thumb,
.gallery-modal-thumbnails::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: var(--scrollbar-radius);
}
.hero-category-panels::-webkit-scrollbar-thumb:hover,
.gallery-grid::-webkit-scrollbar-thumb:hover,
.gallery-modal-description::-webkit-scrollbar-thumb:hover,
.gallery-modal-thumbnails::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* Gallery modal (ported from public) */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 4vh 3vw;
}

.gallery-modal.active {
    display: flex;
}

.gallery-modal-content {
    background: #DEE5DB;
    border-radius: 0.6vw;
    width: 100%;
    max-width: 1200px;
    height: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 32px rgba(120, 150, 102, 0.18), 0 2px 8px rgba(0,0,0,0.08);
    border: 1.5px solid #b7cdb0;
    padding: 0;
}

.gallery-modal-main-row { min-height: 0; }
.gallery-modal-left { min-height: 0; }
.gallery-modal-text { min-height: 0; }

.gallery-modal-main-row {
    display: flex;
    padding: 1rem 1.25rem 1.25rem 1.25rem;
    overflow: hidden;
    gap: 1.5rem;
}
.gallery-modal-text {
    flex: 1 1 0;
    position: relative;
    z-index: 1;
    overflow-y: auto;
}

.gallery-modal-thumbnails {
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    max-height: 95%;
}

.gallery-modal-image {
    max-height: 100% !important;
}
.gallery-modal-image img {
    max-height: 100%;
    width: 100%;
    object-fit: contain;
}

.gallery-modal-description {
    flex: 1 1 auto;
    display: block;
    overflow-y: auto;
    position: relative;
    padding-right: 0.6rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.gallery-modal-description::-webkit-scrollbar { display: none; }

.gallery-modal-description-scrollbar {
    position: absolute;
    top: 1.2rem;
    bottom: 1.5rem;
    right: 0.6rem;
    width: 8px;
    background: transparent;
    border-radius: 50px;
    z-index: 20;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    scrollbar-width: none;
}
.gallery-modal-description-scrollbar::-webkit-scrollbar { width: 0; height: 0; }
.gallery-modal-description-scrollbar .scrollbar-track {
    position: absolute;
    inset: 0;
    background: transparent;
    border-radius: 6px;
}
.gallery-modal-description-scrollbar .scrollbar-thumb {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(0,0,0,0.35);
    border-radius: 999px;
    min-height: 24px;
    touch-action: none;
    will-change: transform, height;
    transition: background 0.15s;
}
.gallery-modal-description-scrollbar .scrollbar-thumb:hover,
.gallery-modal-description-scrollbar .scrollbar-thumb:active {
    background: rgba(0,0,0,0.5);
}

.gallery-modal-header-box {
    width: 100%;
    padding: 24px 0 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: none;
    border-bottom: 1px solid #0000001a;
    background-color: #8caa76;
}

.gallery-modal-title {
    font-size: 1.5rem;
    font-weight: 850;
    color: #4a5568;
    text-align: center;
    margin-bottom: 1vh;
    margin-top: -1rem;
    letter-spacing: 0.01em;
}

.gallery-modal-main-row {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.gallery-modal-left {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    width: 55% !important;
    height: 100% !important;
    padding: 0 !important;
    box-sizing: border-box;
    gap: 1rem;
    background: transparent !important;
}

.gallery-modal-thumbnails {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    margin-top: 0.5rem !important;
    background: transparent !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-shrink: 0;
    width: 140px;
}
.gallery-modal-thumbnails::-webkit-scrollbar { display: none; }

.gallery-modal-image {
    order: 1 !important;
    width: 100% !important;
    max-width: 620px !important;
    height: 100% !important;
    max-height: 600px !important;
    overflow: hidden !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: center !important;
}

@media (min-width: 1750px) {
    .gallery-modal-image {
        max-width: 800px !important;
        margin: 0 auto !important;
    }
    
    .gallery-modal-left {
        justify-content: center !important;
    }
}

.gallery-modal-img {
    display: block !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
}

.gallery-modal-thumbnail {
    border-radius: 0.6vw !important;
    cursor: pointer;
    object-fit: cover;
    transition: opacity 0.2s;
}
.gallery-modal-thumbnail:hover { opacity: 0.8; }
.gallery-modal-thumbnail.selected { border: 2px solid #91AE7E; }
.gallery-modal-thumbnails .gallery-modal-thumbnail { transition: filter 0.2s ease, opacity 0.2s ease; }
.gallery-modal-thumbnails .gallery-modal-thumbnail:not(.selected) { filter: brightness(0.55) saturate(0.95) !important; }
.gallery-modal-thumbnails .gallery-modal-thumbnail.selected { filter: none !important; }

.gallery-modal-thumbnail.is-video { position: relative; }
.gallery-modal-thumbnail.is-video .thumb-play-icon {
    position: absolute;
    inset: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.gallery-modal-thumbnail.is-video .thumb-play-icon::before {
    content: '';
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.9);
    display: inline-block;
}
.gallery-modal-thumbnail.is-video .thumb-play-icon::after {
    content: '';
    position: absolute;
    width: 0; height: 0;
    border-left: 10px solid rgba(255, 255, 255, 0.95);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    transform: translate(2px, 0);
}

.gallery-modal-text {
    display: flex;
    flex-direction: column;
    gap: 1vh;
    padding: 1.2rem 1.25rem 1.5rem;
    background: rgba(255,255,255,0.8);
    border-left: 1px solid #00000012;
    border-radius: 0.6vw;
}

.gallery-modal-description p {
    font-size: 1rem;
    line-height: 1.5;
}

.gallery-modal-date {
    font-size: 1rem;
    font-weight: 600;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-date-text {
    padding: 6px 10px;
    background: #f3f5f1;
    border-radius: 10px;
    color: #475569;
}

.gallery-modal-main-close {
    position: absolute;
    right: 18px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 5;
}
.gallery-modal-main-close:hover { background: rgba(0,0,0,0.75); }

/* Mobile tweaks */
@media (max-width: 768px) {
    .gallery-modal-main-row {
        flex-direction: column;
        padding: 0.5rem;
    }
    .gallery-modal-left {
        width: 100% !important;
        flex-direction: column !important;
        gap: 0.75rem;
    }
    .gallery-modal-image {
        max-width: 100% !important;
        max-height: 400px !important;
    }
    .gallery-modal-thumbnails {
        flex-direction: row !important;
        flex-wrap: wrap;
    }
}

.gallery-item:hover::after {
    opacity: .6;
}

/* Remove old overlays/icons if still present */
.gallery-overlay,
.gallery-icon,
.video-play-overlay {
    display: none !important;
}

/* Accessibility */
.gallery-item:focus-visible {
    outline: 2px solid #8ab4f8;
    outline-offset: 3px;
}

/* Gallery dots indicator */
.gallery-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px 0 0;
}

.gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

@media (min-width: 769px) {
    .gallery-dots { display: none !important; }
}

.gallery-dot.active {
    background: var(--color-secondary);
    transform: scale(1.2);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .gallery-item,
    .gallery-item img,
    .gallery-item video {
        transition: none !important;
    }
}

/* Remove fixed heights from legacy rules */
.gallery-item img,
.gallery-video-thumb,
.video-thumbnail img,
.video-thumbnail-auto {
    /* override legacy fixed sizing */
    height: 100%;
    border-radius: 0 !important;
}

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

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

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

/* 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);
}

.alianse-info-box {
    margin-top: 1.25rem;
    background: rgba(255,255,255,0.15);
    padding: 0.85rem 1rem;
    border: 2px solid rgba(255,255,255,0.35);
    border-radius: 14px;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #fff;
    backdrop-filter: blur(4px);
}
.alianse-info-box a {
    color: #fff;
    font-weight: 600;
    text-decoration: underline;
}
.alianse-info-box a:hover,
.alianse-info-box a:focus-visible {
    text-decoration: none;
}

.section-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--color-dark);
}

/* 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-content {
    display: flex;
    gap: 2rem;
    align-items: stretch;
    justify-content: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

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

.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: 1rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

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

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

.contact-map-wrapper {
    flex: 0 0 560px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.contact-map {
    flex: 1 1 auto;
    min-height: 400px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.contact-map iframe {
    width: 100%;
    flex: 1 1 auto;
    min-height: 400px;
    border: none;
    display: block;
}

.map-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
    width: 100%;
    justify-content: center;
    align-items: center;
}

.map-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    white-space: nowrap;
    line-height: 1.1;
    box-sizing: border-box;
    padding: 0.9rem 1.2rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    flex: 1 1 auto; /* grow to fill while respecting intrinsic width for ratio */
    min-width: 0;
}

.map-action-btn.view-point {
    background: var(--color-accent);
    color: #fff;
}

.map-action-btn.view-point:hover {
    transform: translateY(-1px);
}

.map-action-btn.view-map {
    background: #fff;
    color: var(--color-accent);
}

.map-action-btn.view-map:hover {
    transform: translateY(-1px);
}

/* 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: var(--color-tertiary);
    border-top: 2px solid var(--color-secondary);
    padding: 0.5rem;
    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.5rem;
    color: var(--color-dark);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.mobile-nav-link.active,
.mobile-nav-link:hover {
    background: var(--color-secondary);
    color: var(--color-white);
}

/* Mobile Header */
.mobile-header {
    display: none; /* Hidden by default on desktop */
    background: var(--color-tertiary);
    padding: 1rem;
    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;
    flex: 1;
    min-width: 0;
}

.mobile-header .logo {
    width: 50px;
    height: 50px;
    object-fit: cover;
    flex-shrink: 0;
}

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

.mobile-header .social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    width: 100px;
    justify-content: center;
    flex-shrink: 0;
}

.mobile-header .social-link {
    display: block;
    line-height: 0;
    width: 28px;
    height: 28px;
}

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

/* Mobile Styles */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }
    
    .sidebar {
        display: none;
    }
    
    .mobile-header {
        display: flex;
    }
    
    .main-content {
        margin-left: 0;
        padding-bottom: 0;
    }
    
    .mobile-nav {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        gap: 0.5rem;
        padding: 0.35rem 0.5rem; /* slimmer */
        height: auto; /* shrink to content */
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }
    .mobile-nav::-webkit-scrollbar { display: none; }
    .mobile-nav { scrollbar-width: none; }

    .mobile-nav-link {
        flex: 0 0 auto; /* do not stretch */
        min-width: auto;
        padding: 0 0.9rem;
        height: 44px; /* one line tap target */
        line-height: 1; /* tighten */
        font-size: 0.8rem; /* smaller text to fit one line */
        white-space: nowrap; /* prevent wrapping */
        scroll-snap-align: center;
    }

    .mobile-nav-link span { display: inline-block; pointer-events: none; }
    
    /* 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;
        padding: 0;
        border: none;
        overflow: visible;
        background: transparent;
        height: auto;
    }
    
    .gallery-grid {
        display: flex;
        overflow-x: auto;
        gap: 1rem;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        padding: 0;
        align-items: stretch;
    }
    
    .gallery-dots {
        display: flex;
    }
    
    .gallery-item {
        flex: 0 0 auto;
        scroll-snap-align: center;
        width: 82.7vw;
    }
    
    /* Ensure square thumbnails on mobile without fixed heights */
    .gallery-item img,
    .gallery-item video,
    .video-thumbnail-auto {
        height: auto !important;
        aspect-ratio: 1 / 1;
        border-radius: 0 !important;
    }
    
    /* 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: 280px;
        height: 280px;
    }
    
    .about-text h2 {
        font-size: 2rem;
    }
    
    .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 1rem;
    }
    
    .about-section,
    .activities-section,
    .contact-section {
        padding: 3rem 1rem;
    }
    
    .contact-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .contact-info {
        align-items: center;
        text-align: center;
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .contact-item {
        justify-content: center;
    }
    
    .contact-map-wrapper {
        width: 100%;
        flex: 1 1 auto;
        min-height: 400px;
        height: auto;
        display: flex;
        flex-direction: column;
    }
    
    .contact-map {
        flex: 1 1 auto;
        min-height: 400px;
    }
    
    .contact-map iframe {
        min-height: 400px;
        flex: 1 1 auto;
    }
    
    .map-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .map-action-btn {
        width: 100%;
    }

    .map-action-btn.view-point {
        display: none;
    }
    
    .hero-section {
        padding: 3rem 1rem;
    }
    
    .hero-categories {
        margin-top: 1.5rem;
    }
    
    .hero-category-bar {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-category-btn {
        font-size: 0.95rem;
        padding: 0.85rem;
    }

.hero-category-btn[data-target="all"] {
    border-right: 1px solid rgba(123, 36, 41, 0.12);
    border-bottom: 1px solid rgba(123, 36, 41, 0.12);
}

.hero-category-btn[data-target="pasakumi"] {
    border-bottom: 1px solid rgba(123, 36, 41, 0.12);
}

.hero-category-btn[data-target="posti"] {
    border-right: 1px solid rgba(123, 36, 41, 0.12);
}

    .hero-category-panels {
        padding: 1rem;
        height: auto;
    }
    
    .hero-category-panel.active {
        align-items: flex-start;
        justify-content: flex-start;
        height: auto;
    }
    
    /* Mobile video sizing fix */
    .gallery-item img,
    .video-thumbnail-auto {
        height: 400px;
        object-fit: cover;
        object-position: center;
    }
    
    /* 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;
    }

    .alianse-button-mobile {
        display: block;
        width: 100dvw !important; /* exact device viewport width */
        max-width: 100dvw !important;
        margin-left: calc(50% - 50dvw);
        margin-right: calc(50% - 50dvw);
    }
    .alianse-button-mobile img {
        width: 100% !important;
        height: auto !important;
        display: block;
    }

    .contact-section {
        padding-bottom: calc(var(--mobile-nav-height) + 3rem);
    }
    .contact-card-single {
        padding: 1rem;
        width: 100%;
    }
}

/* 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;
}

/* Auto-injected poster fallback (legacy, accent removed) */
.poster-section{display:flex;align-items:center;justify-content:center;position:relative;padding:2.5rem 0;}
.poster-section .poster-container{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:1rem;width:100%;}
.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;}
.poster-section.color-tertiary{background:var(--color-tertiary,#B1BBAC)!important;}
.poster-section.color-secondary{background:var(--color-secondary,#91AE7E)!important;}
.poster-section.color-primary{background:var(--color-primary,#DEE5DB)!important;}
@media (max-width:768px){.poster-section{padding:1.5rem 0;}.poster-section .poster-aspect-wrapper{width:100%;max-height:75vh;}}
/* End auto-injected poster fallback */
