﻿/* ============================================================
   Nyilvános galéria oldal
   ============================================================ */

/* ------------------------------------------------------------
   Ragasztott lábléc: rövid tartalomnál is a képernyő alján ül,
   hosszúnál a tartalom tolja lejjebb. Átfedés egyik esetben sincs.
   ------------------------------------------------------------ */

body.gp-page {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
}

body.gp-page > nav {
    flex: 0 0 auto;
}

body.gp-page > .gp-main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

body.gp-page > .gp-main > .gallery-page {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

body.gp-page > .gp-main > .gallery-page > .gp-grid-wrap {
    flex: 1 0 auto;
}

body.gp-page > footer {
    flex: 0 0 auto;
    margin-top: 0;
}

.gallery-page {
    --gp-green-900: #2A3F33;
    --gp-green-700: #344E41;
    --gp-green-600: #3A5A40;
    --gp-green-400: #588157;
    --gp-sand: #DAD7CD;
    --gp-paper: #F7F7F5;
    --gp-muted: #5F6D61;
    --gp-dark: #101610;
}

/* ---------------- Fejléc ---------------- */

.gallery-page .gp-hero {
    background-color: #fff;
    text-align: center;
    padding: 3rem 1.5rem 1.875rem;
}

.gallery-page .gp-kicker {
    font-size: .72rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--gp-green-400);
    margin: 0 0 .625rem;
    font-weight: 600;
}

.gallery-page .gp-hero h1 {
    margin: 0;
    font-size: clamp(1.875rem, 5vw, 2.5rem);
    font-weight: 700;
    color: var(--gp-green-700);
    letter-spacing: -.02em;
}

.gallery-page .gp-lead {
    margin: .75rem auto 0;
    max-width: 46rem;
    font-size: .95rem;
    color: var(--gp-muted);
    line-height: 1.7;
}

/* ---------------- Rács ---------------- */

.gallery-page .gp-grid-wrap {
    background-color: var(--gp-paper);
    padding: 1.875rem 1.5rem 3rem;
}

.gallery-page .gp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
    gap: 1.25rem;
    max-width: 82rem;
    margin: 0 auto;
}

.gallery-page .gp-card {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    border-radius: 1rem;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4 / 3;
    box-shadow: 0 1px 3px rgba(20, 30, 22, .12);
    transition: transform .25s ease, box-shadow .25s ease;
    text-align: left;
}

.gallery-page .gp-card:hover,
.gallery-page .gp-card:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 16px 30px -14px rgba(20, 30, 22, .5);
}

.gallery-page .gp-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-page .gp-card-cap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 2.25rem 1.125rem 1rem;
    background: linear-gradient(180deg, rgba(20, 30, 22, 0), rgba(20, 30, 22, .82));
    color: #fff;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.35;
}

.gallery-page .gp-card-count {
    position: absolute;
    top: .75rem;
    right: .75rem;
    z-index: 2;
    background-color: rgba(255, 255, 255, .93);
    color: var(--gp-green-900);
    border-radius: 999px;
    padding: .25rem .625rem;
    font-size: .66rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-.25rem);
    transition: opacity .22s ease, transform .22s ease;
}

.gallery-page .gp-card:hover .gp-card-count,
.gallery-page .gp-card:focus-visible .gp-card-count {
    opacity: 1;
    transform: none;
}

.gallery-page .gp-card-flag {
    position: absolute;
    top: .75rem;
    left: .75rem;
    z-index: 2;
    background-color: rgba(52, 78, 65, .9);
    color: #fff;
    border-radius: 999px;
    padding: .25rem .625rem;
    font-size: .62rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    font-weight: 600;
}

.gallery-page .gp-empty {
    text-align: center;
    color: var(--gp-muted);
    padding: 3rem 1rem;
    font-size: 1rem;
}

/* ---------------- Modál ---------------- */

.gp-modal {
    position: fixed;
    inset: 0;
    z-index: 1080;
    background-color: var(--gp-dark, #101610);
    color: #fff;
    display: flex;
    flex-direction: column;
    font-family: 'Montserrat', sans-serif;
}

.gp-modal[hidden] {
    display: none;
}

.gp-modal-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    flex: none;
}

.gp-modal-top h2 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
}

.gp-modal-sub {
    font-size: .75rem;
    color: rgba(255, 255, 255, .55);
    margin-top: .1875rem;
}

.gp-close {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .2);
    background-color: rgba(255, 255, 255, .06);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: grid;
    place-items: center;
    flex: none;
    padding: 0;
}

.gp-close:hover {
    background-color: rgba(255, 255, 255, .16);
}

.gp-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    padding: 1.25rem 1.5rem .5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gp-stage-inner {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 68rem;
    border-radius: .75rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gp-stage-inner > img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: .75rem;
}

.gp-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background-color: rgba(16, 22, 16, .6);
    color: #fff;
    font-size: 1.375rem;
    line-height: 1;
    display: grid;
    place-items: center;
    padding: 0;
}

.gp-arrow:hover {
    background-color: rgba(16, 22, 16, .85);
}

.gp-arrow.gp-prev {
    left: .875rem;
}

.gp-arrow.gp-next {
    right: .875rem;
}

.gp-counter {
    position: absolute;
    bottom: .875rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    background-color: rgba(16, 22, 16, .66);
    border-radius: 999px;
    padding: .3125rem .8125rem;
    font-size: .72rem;
    color: #fff;
}

/* bélyegkép sáv */

.gp-strip {
    display: flex;
    gap: .5625rem;
    padding: 1rem 1.5rem 1.375rem;
    overflow-x: auto;
    flex: none;
    scrollbar-width: thin;
}

.gp-thumb {
    position: relative;
    flex: none;
    width: 5.25rem;
    height: 3.625rem;
    border-radius: .5rem;
    overflow: hidden;
    border: 2px solid transparent;
    opacity: .55;
    cursor: pointer;
    padding: 0;
    background: none;
    transition: opacity .18s ease;
}

.gp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gp-thumb:hover {
    opacity: .85;
}

.gp-thumb.is-active {
    border-color: #A3B18A;
    opacity: 1;
}

.gp-thumb.is-pair::after {
    content: "\21C4"; /* ⇄ - előtte/utána pár jelölése */
    position: absolute;
    right: .1875rem;
    bottom: 0;
    font-size: .75rem;
    line-height: 1.2;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
}

/* ---------------- Előtte / utána csúszka ---------------- */

/* A doboz méretét az "előtte" kép aránya adja, így nincs üres sáv a csúszka mellett. */
.gp-ba {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: .75rem;
    overflow: hidden;
    user-select: none;
    touch-action: pan-y;
    cursor: ew-resize;
    background-color: #0B0F0B;
}

.gp-ba-layer {
    position: absolute;
    inset: 0;
}

.gp-ba-layer img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gp-ba-top {
    clip-path: inset(0 0 0 50%);
}

.gp-ba-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    background-color: #fff;
    z-index: 6;
    transform: translateX(-1.5px);
    box-shadow: 0 0 12px rgba(0, 0, 0, .5);
    border: none;
    padding: 0;
    cursor: ew-resize;
}

.gp-ba-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2.875rem;
    height: 2.875rem;
    border-radius: 50%;
    background-color: #fff;
    color: var(--gp-green-700, #344E41);
    display: grid;
    place-items: center;
    font-size: 1.0625rem;
    box-shadow: 0 3px 14px rgba(0, 0, 0, .45);
}

.gp-ba-tag {
    position: absolute;
    top: .875rem;
    z-index: 5;
    background-color: rgba(16, 22, 16, .72);
    color: #fff;
    border-radius: 999px;
    padding: .3125rem .8125rem;
    font-size: .66rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    font-weight: 600;
    pointer-events: none;
}

.gp-ba-tag.gp-ba-before {
    left: .875rem;
}

.gp-ba-tag.gp-ba-after {
    right: .875rem;
}

.gp-ba-hint {
    position: absolute;
    bottom: .875rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    background-color: rgba(16, 22, 16, .66);
    border-radius: 999px;
    padding: .3125rem .875rem;
    font-size: .72rem;
    color: rgba(255, 255, 255, .85);
    pointer-events: none;
}

body.gp-modal-open {
    overflow: hidden;
}

/* ---------------- Reszponzív ---------------- */

@media (max-width: 767.98px) {
    .gallery-page .gp-grid-wrap {
        padding: 1.25rem 1rem 2.5rem;
    }

    .gallery-page .gp-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .gp-modal-top {
        padding: .75rem 1rem;
    }

    .gp-modal-top h2 {
        font-size: 1rem;
    }

    .gp-stage {
        padding: .75rem .75rem .25rem;
    }

    .gp-strip {
        padding: .75rem 1rem 1rem;
    }

    .gp-thumb {
        width: 4rem;
        height: 3rem;
    }

    .gp-arrow {
        width: 2.375rem;
        height: 2.375rem;
        font-size: 1.125rem;
    }

    .gp-ba-knob {
        width: 2.375rem;
        height: 2.375rem;
        font-size: .875rem;
    }

    .gp-ba-hint {
        font-size: .66rem;
    }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .gallery-page .gp-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (hover: none) {
    .gallery-page .gp-card-count {
        opacity: 1;
        transform: none;
    }
}

/* ------------------------------------------------------------
   Főoldali változat: a referenciák szakasz eddigi négyoszlopos
   ritmusát tartja, de ugyanazokkal a kártyákkal és modállal.
   ------------------------------------------------------------ */

.gallery-page .gp-grid.gp-grid-home {
    grid-template-columns: repeat(4, 1fr);
    max-width: none;
}

@media (max-width: 1199.98px) {
    .gallery-page .gp-grid.gp-grid-home {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575.98px) {
    .gallery-page .gp-grid.gp-grid-home {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-page .gp-card,
    .gallery-page .gp-card-count {
        transition: none;
    }

    .gallery-page .gp-card:hover,
    .gallery-page .gp-card:focus-visible {
        transform: none;
    }
}
