.gallery-back-link {
    font-family: 'Montserrat', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 600;
    display: inline-block;
    padding: 12px 22px;
    border: 1px solid var(--accent);
    border-radius: 999px;
    color: var(--white);
    text-decoration: none;
    transition: 0.3s ease;
}
.gallery-back-link:hover {
    background: rgba(0, 171, 162, 0.14);
    color: var(--white);
}
.gallery-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}
.gallery-empty {
    text-align: center;
    font-family: 'Montserrat', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: rgba(255, 255, 255, 0.72);
    padding: 40px 20px;
    border: 1px dashed rgba(0, 171, 162, 0.28);
    border-radius: 18px;
}
.gallery-folder-card {
    text-decoration: none;
    color: var(--white);
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 180px;
}
.gallery-folder-card:hover {
    color: var(--white);
}
.gallery-folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    justify-items: center;
    gap: 20px;
}
.gallery-folder-meta h2,
.gallery-folder-meta h3 {
    font-size: 0.95rem;
    margin-bottom: 6px;
}
.gallery-folder-meta p {
    font-family: 'Montserrat', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.8rem;
}
.gallery-folder-preview {
    position: absolute;
    inset: 24px 10px 10px 10px;
    border-radius: 12px;
    overflow: hidden;
    transform: rotate(-2deg);
    box-shadow: 0 14px 24px rgba(0, 0, 0, 0.38);
}
.gallery-folder-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.gallery-folder-tab {
    position: absolute;
    top: 0;
    left: 14px;
    width: 64px;
    height: 20px;
    border-radius: 0 0 12px 12px;
    background: linear-gradient(180deg, rgba(0, 171, 162, 0.95), rgba(0, 171, 162, 0.55));
}
.gallery-folder-visual {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(0, 171, 162, 0.18), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(0, 171, 162, 0.22);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.32);
    padding: 10px;
}
.gallery-hero {
    padding-top: 120px;
    padding-bottom: 35px;
}
.gallery-hero .hero-subtitle {
    max-width: 760px;
}
.gallery-image-card {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    cursor: pointer;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(0, 171, 162, 0.18);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.32);
    background: rgba(255, 255, 255, 0.03);
}
.gallery-image-card:hover img {
    transform: scale(1.04);
}
.gallery-image-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.gallery-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 4000;
}
.gallery-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(4px);
}
.gallery-modal-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 18px 22px;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.88));
    text-align: center;
    z-index: 2;
}
.gallery-modal-caption h3 {
    font-size: 1rem;
    margin-bottom: 4px;
}
.gallery-modal-caption p {
    font-family: 'Montserrat', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.9rem;
}
.gallery-modal-close,
.gallery-modal-nav {
    position: absolute;
    border: 0;
    cursor: pointer;
    color: var(--white);
    background: rgba(0, 0, 0, 0.55);
    transition: 0.2s ease;
}
.gallery-modal-close:hover,
.gallery-modal-nav:hover {
    background: rgba(0, 171, 162, 0.75);
}
.gallery-modal-close {
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 2rem;
    line-height: 1;
    z-index: 2;
}
.gallery-modal-nav {
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    font-size: 2rem;
    z-index: 2;
}
.gallery-modal-next {
    right: 14px;
}
.gallery-modal-panel {
    position: relative;
    width: min(92vw, 1200px);
    height: min(88vh, 900px);
    margin: 5vh auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 22px;
    overflow: hidden;
    background: rgba(10, 10, 10, 0.96);
    border: 1px solid rgba(0, 171, 162, 0.25);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
}
.gallery-modal-panel img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #0b0b0b;
}
.gallery-modal-prev {
    left: 14px;
}
.gallery-modal.is-open {
    display: block;
}
.gallery-section {
    padding: 10px 8% 90px;
}
.gallery-section .container {
    max-width: 1200px;
    margin: 0 auto;
}
.gallery-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}
/* Gallery Page Styles */

.gallery-page {
    background: var(--black);
    color: var(--white);
}
body.gallery-modal-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .gallery-hero {
        padding-top: 104px;
        padding-bottom: 24px;
    }

    .gallery-section {
        padding: 8px 5% 70px;
    }

    .gallery-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 20px;
    }

    .gallery-folder-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .gallery-folder-card {
        width: 100%;
        max-width: 190px;
        justify-self: center;
    }

    .gallery-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .gallery-modal-panel {
        width: 94vw;
        height: 74vh;
        margin-top: 10vh;
    }

    .gallery-modal-nav {
        width: 46px;
        height: 46px;
        font-size: 1.6rem;
    }
}
@media (max-width: 600px) {
    .gallery-hero {
        padding-top: 88px;
        padding-bottom: 16px;
        text-align: center;
    }

    .gallery-hero h1 {
        font-size: 1rem !important;
        margin-top: 0;
        margin-left: auto;
        margin-right: auto;
        line-height: 1.1;
        width: 100%;
        max-width: 100%;
        padding: 0 10px;
        white-space: nowrap;
        word-break: normal;
        overflow-wrap: normal;
        letter-spacing: 0.01em;
        text-align: center;
    }

    .gallery-hero .hero-subtitle {
        font-size: 1rem;
        line-height: 1.45;
        padding: 0 6px;
    }

    .gallery-section {
        padding: 0 4% 56px;
    }

    .gallery-folder-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        max-width: 220px;
        margin: 0 auto;
    }

    .gallery-folder-card {
        width: 100%;
        max-width: none;
    }

    .gallery-folder-meta h2,
    .gallery-folder-meta h3 {
        font-size: 0.88rem;
    }

    .gallery-folder-meta p {
        font-size: 0.75rem;
    }

    .gallery-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .gallery-image-card img {
        aspect-ratio: 4 / 5;
    }

    .gallery-modal-panel {
        width: 94vw;
        height: 68vh;
        margin-top: 14vh;
        border-radius: 18px;
    }

    .gallery-modal-close {
        width: 40px;
        height: 40px;
    }

    .gallery-modal-prev {
        left: 8px;
    }

    .gallery-modal-next {
        right: 8px;
    }
}
@media (max-width: 420px) {
    .gallery-hero h1 {
        font-size: 0.9rem !important;
        padding: 0 8px;
    }

    .gallery-detail-grid {
        grid-template-columns: 1fr;
    }

    .gallery-image-card img {
        aspect-ratio: 1 / 1;
    }
}
