/**
 * GREEN. DIGITAL. SMART Forum 2026
 * Gallery Page Styles
 */

/* ============================================
   Page Hero
   ============================================ */
.gallery-hero {
    padding: 140px 5% 80px;
    text-align: center;
    background:
        radial-gradient(ellipse at top, rgba(74, 222, 128, 0.20) 0%, transparent 60%),
        radial-gradient(ellipse at bottom right, rgba(34, 211, 238, 0.15) 0%, transparent 60%),
        linear-gradient(135deg, var(--dark-green) 0%, #003d28 60%, #002a1a 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.gallery-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'><circle cx='20' cy='20' r='1' fill='rgba(255,255,255,0.08)'/></svg>");
    opacity: 0.6;
}

.gallery-hero > * { position: relative; z-index: 1; }

.gallery-hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.2rem;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50px;
    color: #4ade80;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

.gallery-hero h1 {
    font-size: 3.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #b7f4d4 60%, #4ade80 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.15;
}

.gallery-hero p {
    font-size: 1.15rem;
    opacity: 0.85;
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.6;
}

.gallery-hero-meta {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.gallery-hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.gallery-hero-stat strong {
    font-size: 2.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #4ade80 0%, #22d3ee 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gallery-hero-stat span {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.8;
}

/* ============================================
   Category Navigation (sticky)
   ============================================ */
.gallery-nav {
    position: sticky;
    top: 70px;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(0, 166, 81, 0.12);
    padding: 1rem 5%;
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.04);
}

.gallery-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    border: 2px solid transparent;
    background: var(--light-green);
    border-radius: 50px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.gallery-nav-btn i { color: var(--primary-green); transition: color 0.25s; }

.gallery-nav-btn em {
    font-style: normal;
    background: white;
    color: var(--primary-green);
    border-radius: 50px;
    padding: 0.1rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all 0.25s;
}

.gallery-nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 166, 81, 0.18);
}

.gallery-nav-btn.active {
    background: var(--gradient-green);
    color: white;
    border-color: var(--primary-green);
}

.gallery-nav-btn.active i,
.gallery-nav-btn.active em { color: var(--primary-green); }

.gallery-nav-btn.active em { background: white; }

/* ============================================
   Page wrapper
   ============================================ */
.gallery-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 5% 5rem;
}

/* ============================================
   Category section
   ============================================ */
.gallery-category {
    margin-bottom: 5rem;
    scroll-margin-top: 160px;
}

.gallery-category.is-hidden { display: none; }

.gallery-category-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem 1.75rem;
    background: linear-gradient(135deg, #ffffff 0%, #f4fbf7 100%);
    border: 1px solid rgba(0, 166, 81, 0.10);
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 5px 24px rgba(0, 166, 81, 0.05);
    position: relative;
    overflow: hidden;
}

.gallery-category-header::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 6px;
    background: var(--gradient-green);
}

.gallery-category.accent-digital .gallery-category-header::before {
    background: linear-gradient(180deg, var(--digital-blue) 0%, #0891b2 100%);
}

.gallery-category.accent-smart .gallery-category-header::before {
    background: linear-gradient(180deg, var(--smart-orange) 0%, #ea580c 100%);
}

.gallery-category-icon {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--gradient-green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 8px 20px rgba(0, 166, 81, 0.3);
}

.gallery-category.accent-digital .gallery-category-icon {
    background: linear-gradient(135deg, var(--digital-blue) 0%, #0891b2 100%);
    box-shadow: 0 8px 20px rgba(0, 188, 212, 0.3);
}

.gallery-category.accent-smart .gallery-category-icon {
    background: linear-gradient(135deg, var(--smart-orange) 0%, #ea580c 100%);
    box-shadow: 0 8px 20px rgba(247, 148, 29, 0.3);
}

.gallery-category-title { flex: 1; min-width: 0; }

.gallery-category-title h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: var(--text-dark);
}

.gallery-category-title p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin: 0;
}

.gallery-category-count {
    flex: 0 0 auto;
    text-align: center;
    padding: 0.5rem 1rem;
    border-radius: 14px;
    background: white;
    border: 1px solid rgba(0, 166, 81, 0.15);
}

.gallery-category-count span {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-green);
    line-height: 1;
}

.gallery-category.accent-digital .gallery-category-count span { color: var(--digital-blue); }
.gallery-category.accent-smart   .gallery-category-count span { color: var(--smart-orange); }

.gallery-category-count small {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    margin-top: 0.15rem;
}

/* ============================================
   Sub-group title
   ============================================ */
.gallery-group-title {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
    margin: 2rem 0 1rem;
    padding: 0.9rem 1.1rem;
    background: white;
    border-left: 4px solid var(--primary-green);
    border-radius: 0 12px 12px 0;
    box-shadow: 0 2px 12px rgba(0, 166, 81, 0.06);
}

.gallery-category.accent-digital .gallery-group-title { border-left-color: var(--digital-blue); }
.gallery-category.accent-smart   .gallery-group-title { border-left-color: var(--smart-orange); }

.gallery-group-title i {
    color: var(--primary-green);
    font-size: 1rem;
    padding-top: 0.2rem;
    flex: 0 0 auto;
}
.gallery-category.accent-digital .gallery-group-title i { color: var(--digital-blue); }
.gallery-category.accent-smart   .gallery-group-title i { color: var(--smart-orange); }

.gallery-group-title .gallery-group-count {
    margin-left: auto;
    background: var(--light-green);
    color: var(--primary-green);
    padding: 0.25rem 0.7rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    flex: 0 0 auto;
    align-self: center;
}

.gallery-category.accent-digital .gallery-group-title .gallery-group-count {
    background: rgba(0, 188, 212, 0.12);
    color: var(--digital-blue);
}
.gallery-category.accent-smart .gallery-group-title .gallery-group-count {
    background: rgba(247, 148, 29, 0.12);
    color: var(--smart-orange);
}

@media (max-width: 768px) {
    .gallery-group-title {
        font-size: 0.92rem;
        padding: 0.7rem 0.9rem;
        gap: 0.5rem;
    }
    .gallery-group-title .gallery-group-count { font-size: 0.7rem; padding: 0.2rem 0.55rem; }
}

/* ============================================
   Grid
   ============================================ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.gallery-item {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    overflow: hidden;
    background: #e8f0ec;
    cursor: zoom-in;
    transform: translateZ(0);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), filter 0.4s;
    will-change: transform;
}

.gallery-item:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
    z-index: 2;
}

.gallery-item:hover img {
    transform: scale(1.08);
    filter: saturate(1.1) brightness(1.05);
}

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 166, 81, 0.55) 0%, rgba(0, 188, 212, 0.55) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* ============================================
   Empty state
   ============================================ */
.gallery-empty {
    text-align: center;
    padding: 6rem 1rem;
    color: var(--text-light);
}

.gallery-empty i {
    font-size: 3rem;
    color: var(--primary-green);
    opacity: 0.3;
    margin-bottom: 1rem;
}

/* ============================================
   Lightbox
   ============================================ */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.94);
    display: none;
    flex-direction: column;
    user-select: none;
    -webkit-user-select: none;
}

.lightbox.is-open { display: flex; animation: lightboxFadeIn 0.25s ease; }

@keyframes lightboxFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 4rem 5rem 1rem;
    position: relative;
}

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.lightbox-img.is-ready { opacity: 1; }

.lightbox-loader {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    gap: 0.4rem;
}

.lightbox.is-loading .lightbox-loader { display: flex; }
.lightbox.is-loading .lightbox-img    { opacity: 0; }

.lightbox-loader > div {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-green);
    animation: lbBounce 1s infinite ease-in-out;
}
.lightbox-loader > div:nth-child(2) { background: var(--digital-blue); animation-delay: 0.15s; }
.lightbox-loader > div:nth-child(3) { background: var(--smart-orange); animation-delay: 0.3s; }

@keyframes lbBounce {
    0%, 80%, 100% { transform: scale(0.5); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.lightbox-bar {
    flex: 0 0 auto;
    padding: 1rem 2rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: white;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
    flex-wrap: wrap;
}

.lightbox-caption {
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.92;
    flex: 1;
    min-width: 0;
}

.lightbox-counter {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.4rem 0.9rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.lightbox-counter .lb-current { color: #4ade80; font-weight: 700; }

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.lightbox-close { top: 1.2rem; right: 1.2rem; }
.lightbox-prev  { top: 50%; left: 1.2rem;  transform: translateY(-50%); }
.lightbox-next  { top: 50%; right: 1.2rem; transform: translateY(-50%); }

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--primary-green);
    border-color: var(--primary-green);
    transform: scale(1.08);
}
.lightbox-prev:hover { transform: translateY(-50%) scale(1.08); }
.lightbox-next:hover { transform: translateY(-50%) scale(1.08); }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 992px) {
    .gallery-teaser-inner { grid-template-columns: 1fr; gap: 2.5rem; }
    .gallery-teaser-collage { grid-auto-rows: 120px; }
    .gallery-hero h1 { font-size: 2.4rem; }
}

@media (max-width: 768px) {
    .gallery-hero { padding: 110px 5% 60px; }
    .gallery-hero h1 { font-size: 1.9rem; }
    .gallery-hero p { font-size: 1rem; }
    .gallery-hero-meta { gap: 1.75rem; margin-top: 2rem; }
    .gallery-hero-stat strong { font-size: 1.7rem; }

    .gallery-nav {
        top: 60px;
        padding: 0.75rem 4%;
        gap: 0.4rem;
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        scrollbar-width: none;
    }
    .gallery-nav::-webkit-scrollbar { display: none; }
    .gallery-nav-btn { font-size: 0.82rem; padding: 0.55rem 0.95rem; }

    .gallery-page { padding: 2rem 4% 3rem; }
    .gallery-category { margin-bottom: 3rem; }

    .gallery-category-header {
        flex-wrap: wrap;
        gap: 0.9rem;
        padding: 1.2rem 1.2rem 1.2rem 1.5rem;
    }
    .gallery-category-icon { width: 46px; height: 46px; font-size: 1.1rem; }
    .gallery-category-title h2 { font-size: 1.2rem; }
    .gallery-category-title p  { font-size: 0.85rem; }
    .gallery-category-count    { padding: 0.4rem 0.75rem; }
    .gallery-category-count span { font-size: 1.2rem; }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.4rem;
    }

    .lightbox-stage   { padding: 3.5rem 0.5rem 0.5rem; }
    .lightbox-close   { width: 42px; height: 42px; top: 0.75rem; right: 0.75rem; }
    .lightbox-prev    { width: 42px; height: 42px; left: 0.5rem; }
    .lightbox-next    { width: 42px; height: 42px; right: 0.5rem; }
    .lightbox-bar     { padding: 0.75rem 1rem 1rem; }
    .lightbox-caption { font-size: 0.85rem; }
}

@media (max-width: 480px) {
    .gallery-hero h1 { font-size: 1.6rem; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}
