/* Gallery-specific styles. Shared base/nav styles remain in style.css. */

@media only screen and (max-height: 600px) and (orientation: landscape) {
    body.gallery-page {
        padding-top: 0 !important;
    }
    body.gallery-page .gallery-fullscreen {
        height: 100vh;
    }
}

.gallery-page {
    background:
        linear-gradient(rgba(124, 174, 166, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 174, 166, 0.035) 1px, transparent 1px),
        #121716 !important;
    background-size: 36px 36px;
}

.gallery-header {
    position: relative;
    z-index: 2;
    padding: 82px 20px 18px;
    color: var(--white);
    text-align: center;
}

.gallery-header h1 {
    margin: 0;
    color: var(--white);
    font: 500 clamp(34px, 5vw, 64px)/1.08 Georgia, "Times New Roman", serif;
    letter-spacing: 0.08em;
    text-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
}

.gallery-header p {
    margin: 12px 0 0;
    color: rgba(244, 234, 219, 0.7);
    font: 600 13px/1.5 "Courier New", Courier, monospace;
    letter-spacing: 0.08em;
}

.gallery-container {
    text-align: center;
    justify-content: center;
    position: relative;
    display: flex;
    max-width: 100vw;
    overflow: hidden;
    margin: 0 auto;
    padding: 0;
    flex: 1 1 auto;
    min-height: 0;
    background: #121716;
}

.gallery-slides {
    text-align: center;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 0;
    background: #121716;
}

.gallery-slides img {
    display: block;
    vertical-align: middle;
    max-height: 100%;
    max-width: 100%;
    border-radius: 0;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.48);
}

.gallery-prev,
.gallery-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    padding: 0;
    color: #f4eadb;
    background: rgba(17, 18, 16, 0.46);
    border: 1px solid rgba(244, 234, 219, 0.24);
    backdrop-filter: blur(10px);
    font-weight: bold;
    font-size: 34px;
    border-radius: 50%;
    user-select: none;
    -webkit-user-select: none;
    z-index: 10;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.gallery-prev:hover,
.gallery-next:hover {
    transform: translateY(-50%) scale(1.06);
    background: rgba(20, 19, 17, 0.68);
    border-color: rgba(124, 174, 166, 0.58);
}

.gallery-next {
    right: 22px;
}

.gallery-prev {
    left: 22px;
}

.gallery-caption-container {
    text-align: center;
    background: #121716;
    padding: 8px 16px 10px;
    height: auto;
    width: 100%;
    color: rgba(244, 234, 219, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-caption-container p {
    margin: 0;
    font: 600 13px/1.4 "Courier New", Courier, monospace;
    letter-spacing: 0.08em;
}

.gallery-thumbnail-row {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 6px;
    padding: 10px 10px 14px;
    background: rgba(17, 18, 16, 0.72);
    border-top: 1px solid rgba(244, 234, 219, 0.08);
}

.gallery-thumbnail-column {
    width: 100%;
    box-sizing: border-box;
}

.gallery-thumbnail {
    opacity: 0.58;
    width: 100%;
    height: 100%;
    cursor: pointer;
    display: block;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: opacity 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.gallery-thumbnail.active,
.gallery-thumbnail:hover {
    opacity: 1;
    border-color: rgba(197, 139, 130, 0.82);
    transform: translateY(-2px);
}

.gallery-fullscreen {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100vw;
    position: relative;
}

.gallery-fullscreen::before {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top, rgba(124, 174, 166, 0.16), transparent 38%);
    pointer-events: none;
}

@media screen and (max-width: 800px) {
    .gallery-thumbnail-row {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media screen and (max-width: 600px) {
    .gallery-prev,
    .gallery-next {
        width: 42px;
        height: 42px;
        font-size: 24px;
    }

    .gallery-prev {
        left: 10px;
    }

    .gallery-next {
        right: 10px;
    }

    .gallery-fullscreen {
        min-height: 100vh;
    }

    .gallery-container {
        flex: 0 0 auto;
        min-height: 0;
    }

    .gallery-slides {
        height: auto;
    }

    .gallery-slides img {
        width: 100%;
        height: auto;
        max-height: none;
    }

    .gallery-header {
        padding: 82px 14px 14px;
    }

    .gallery-header p {
        font-size: 11px;
    }

}

/* Legacy gallery index styles, kept for any remaining local index page. */
.gallery-index-row:after {
    content: "";
    display: table;
    clear: both;
}

.gallery-index-column {
    float: left;
    width: 45%;
    margin: 2.5%;
    margin-top: 20px;
}

.gallery-index-column img {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
}

.gallery-index-textbg {
    padding: 10px 0px;
    text-align: center;
}

@media screen and (max-width: 800px) {
    .gallery-index-column {
        width: 90%;
        margin: 5%;
        margin-top: 5vh;
    }
}
