/* ============================================================
   Galeria — premium (public + admin management)
   gold/forest theme · lightbox2 zostaje z CDN w _Layout
   ============================================================ */

/* ── public page shell ── */
.gallery-page {
    width: 100%;
}

.gallery-hero {
    text-align: center;
    margin-bottom: 1.75rem;
    padding: 1.5rem 1.2rem 1.35rem;
    background: linear-gradient(145deg, rgba(15, 48, 30, 0.55), rgba(5, 26, 16, 0.35));
    border: 1px solid color-mix(in oklab, var(--color-gold, #c9a24e) 28%, transparent);
    border-radius: 16px;
}

    .gallery-hero .kicker {
        display: inline-block;
        margin-bottom: 0.55rem;
        padding: 4px 14px;
        border-radius: 999px;
        border: 1px solid rgba(201, 162, 78, 0.4);
        background: rgba(201, 162, 78, 0.12);
        color: var(--color-gold-soft, #e5c46d);
        font-family: var(--font-display, Cinzel, serif);
        font-size: 0.72rem;
        letter-spacing: 0.16em;
        text-transform: uppercase;
    }

    .gallery-hero h1,
    .gallery-heading {
        margin: 0;
        color: var(--color-gold-soft, #f3dda0);
        font-family: var(--font-display, Cinzel, serif);
        font-weight: 500;
        font-size: clamp(1.5rem, 3vw, 2rem);
        text-align: center;
    }

.gallery-heading {
    margin: 0 0 1.5rem;
}

.gallery-heading--sub {
    margin: 2.25rem 0 1rem;
    font-size: 1.25rem;
    color: var(--color-gold-soft, #e5c46d);
    font-family: var(--font-display, Cinzel, serif);
    font-weight: 500;
    text-align: center;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid color-mix(in oklab, var(--color-gold, #c9a24e) 28%, transparent);
}

.gallery-hero .lede {
    margin: 0.45rem 0 0;
    color: color-mix(in oklab, var(--color-cream, #f3ecda) 72%, transparent);
    font-style: italic;
    font-size: 1rem;
}

.gallery-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: color-mix(in oklab, var(--color-cream, #f3ecda) 70%, transparent);
    font-style: italic;
}

.gallery-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.1rem;
    padding: 0.45rem 0.9rem;
    border-radius: 9px;
    border: 1px solid color-mix(in oklab, var(--color-gold, #c9a24e) 32%, transparent);
    background: color-mix(in oklab, var(--color-gold, #c9a24e) 8%, transparent);
    color: var(--color-gold-soft, #e5c46d);
    text-decoration: none;
    font-family: var(--font-display, Cinzel, serif);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

    .gallery-back:hover {
        background: color-mix(in oklab, var(--color-gold, #c9a24e) 18%, transparent);
        border-color: color-mix(in oklab, var(--color-gold, #c9a24e) 55%, transparent);
        color: var(--color-gold, #c9a24e);
    }

.gallery-count {
    text-align: center;
    margin: -0.6rem 0 1.25rem;
    color: color-mix(in oklab, var(--color-cream, #f3ecda) 65%, transparent);
    font-size: 0.9rem;
}

/* ── album / category grid ── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.15rem;
}

.gallery-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    border: 1px solid color-mix(in oklab, var(--color-gold, #c9a24e) 24%, transparent);
    background: linear-gradient(160deg, rgba(12, 40, 24, 0.72), rgba(6, 22, 14, 0.55));
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

    .gallery-card:hover {
        border-color: color-mix(in oklab, var(--color-gold, #c9a24e) 52%, transparent);
        transform: translateY(-3px);
        box-shadow: 0 14px 32px rgba(0, 0, 0, 0.42);
    }

.gallery-card--hidden {
    opacity: 0.55;
}

    .gallery-card--hidden::after {
        content: "";
        position: absolute;
        inset: 0;
        background: repeating-linear-gradient( -45deg, transparent, transparent 6px, rgba(0, 0, 0, 0.08) 6px, rgba(0, 0, 0, 0.08) 12px );
        pointer-events: none;
        z-index: 1;
    }

.gallery-card__thumb {
    margin: 10px 10px 0;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid color-mix(in oklab, var(--color-gold, #c9a24e) 18%, transparent);
    background: #06150e;
}

    .gallery-card__thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform 0.45s ease;
    }

.gallery-card:hover .gallery-card__thumb img {
    transform: scale(1.06);
}

.gallery-card__title {
    padding: 0.85rem 0.85rem 1rem;
    color: var(--color-cream, #f3ecda);
    font-family: var(--font-display, Cinzel, serif);
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-align: center;
    line-height: 1.35;
}

.gallery-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(120, 40, 40, 0.85);
    border: 1px solid color-mix(in oklab, #c45c5c 50%, transparent);
    color: #f0c0c0;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ── photo tiles (public) ── */
.gallery-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.85rem;
}

.gallery-photo {
    position: relative;
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid color-mix(in oklab, var(--color-gold, #c9a24e) 22%, transparent);
    background: #06150e;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

    .gallery-photo:hover {
        border-color: color-mix(in oklab, var(--color-gold, #c9a24e) 55%, transparent);
        transform: translateY(-2px);
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
    }

    .gallery-photo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform 0.45s ease;
    }

    .gallery-photo:hover img {
        transform: scale(1.07);
    }

    .gallery-photo::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.35));
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

    .gallery-photo:hover::after {
        opacity: 1;
    }

.gallery-photo--video::before {
    content: "▶";
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid color-mix(in oklab, var(--color-gold, #c9a24e) 45%, transparent);
    color: var(--color-gold-soft, #e5c46d);
    font-size: 0.95rem;
    pointer-events: none;
}

/* ============================================================
   ADMIN / MANAGEMENT
   ============================================================ */

.gallery-admin {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

    .gallery-admin .gallery-heading {
        text-align: left;
        margin-bottom: 1.25rem;
    }

.gallery-admin-nav {
    margin-bottom: 1.25rem;
}

    .gallery-admin-nav a {
        color: var(--color-gold-soft, #e5c46d);
        text-decoration: none;
        font-size: 0.9rem;
        border-bottom: 1px solid transparent;
        transition: border-color 0.2s, color 0.2s;
    }

        .gallery-admin-nav a:hover {
            color: var(--color-gold, #c9a24e);
            border-bottom-color: color-mix(in oklab, var(--color-gold, #c9a24e) 50%, transparent);
        }

/* buttons */
.gallery-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    border-radius: 9px;
    border: 1px solid color-mix(in oklab, var(--color-gold, #c9a24e) 38%, transparent);
    background: color-mix(in oklab, var(--color-gold, #c9a24e) 10%, transparent);
    color: var(--color-gold-soft, #e5c46d);
    font-family: var(--font-display, Cinzel, serif);
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
    white-space: nowrap;
}

    .gallery-btn:hover {
        background: color-mix(in oklab, var(--color-gold, #c9a24e) 22%, transparent);
        border-color: color-mix(in oklab, var(--color-gold, #c9a24e) 60%, transparent);
        color: var(--color-gold, #c9a24e);
    }

.gallery-btn--primary {
    background: linear-gradient(135deg, #c9a24e, #a88435);
    border-color: #d4b05a;
    color: #1a1208;
    font-weight: 600;
}

    .gallery-btn--primary:hover {
        background: linear-gradient(135deg, #d4b05a, #c9a24e);
        color: #0d0a04;
    }

.gallery-btn--danger {
    border-color: color-mix(in oklab, #c45c5c 55%, transparent);
    background: color-mix(in oklab, #8b3030 25%, transparent);
    color: #f0b0b0;
}

    .gallery-btn--danger:hover {
        background: color-mix(in oklab, #8b3030 45%, transparent);
        border-color: #c45c5c;
        color: #ffd0d0;
    }

.gallery-btn--small {
    padding: 0.32rem 0.65rem;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
}

/* admin cards */
.gallery-card--admin {
    cursor: default;
}

    .gallery-card--admin:hover {
        transform: none;
    }

    .gallery-card--admin .gallery-card__thumb {
        cursor: pointer;
    }

    .gallery-card--admin .gallery-card__title {
        text-decoration: none;
        color: var(--color-cream, #f3ecda);
    }

        .gallery-card--admin .gallery-card__title:hover {
            color: var(--color-gold-soft, #e5c46d);
        }

.gallery-card__drag {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid color-mix(in oklab, var(--color-gold, #c9a24e) 30%, transparent);
    color: var(--color-gold-soft, #e5c46d);
    font-size: 0.95rem;
    cursor: grab;
    user-select: none;
    line-height: 1;
}

    .gallery-card__drag:active {
        cursor: grabbing;
    }

.gallery-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0 0.75rem 0.85rem;
    margin-top: auto;
}

    .gallery-card__actions .gallery-btn {
        flex: 1 1 auto;
        min-width: 0;
    }

.gallery-inline-form {
    display: inline;
    margin: 0;
    padding: 0;
}

    .gallery-inline-form .gallery-btn {
        width: 100%;
    }

.gallery-grid--sortable .gallery-card.sortable-ghost,
.gallery-photo-grid .gallery-photo-card.sortable-ghost {
    opacity: 0.4;
    border-style: dashed;
}

/* photo admin grid */
.gallery-photo-grid--admin {
    margin-top: 1.5rem;
}

.gallery-photo-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    border: 1px solid color-mix(in oklab, var(--color-gold, #c9a24e) 22%, transparent);
    background: linear-gradient(160deg, rgba(12, 40, 24, 0.72), rgba(6, 22, 14, 0.55));
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}

    .gallery-photo-card img,
    .gallery-photo-card > a img {
        width: 100%;
        aspect-ratio: 1;
        object-fit: cover;
        display: block;
    }

    .gallery-photo-card > a {
        display: block;
        overflow: hidden;
    }

    .gallery-photo-card .gallery-card__actions {
        padding: 0.55rem 0.5rem 0.65rem;
    }

    .gallery-photo-card .gallery-card__drag {
        top: 6px;
        left: 6px;
    }

/* forms */
.gallery-add-forms {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.gallery-add-form,
.gallery-form-card {
    padding: 1.25rem 1.35rem;
    border-radius: 14px;
    border: 1px solid color-mix(in oklab, var(--color-gold, #c9a24e) 26%, transparent);
    background: linear-gradient(160deg, rgba(12, 40, 24, 0.65), rgba(6, 22, 14, 0.5));
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

    .gallery-add-form label,
    .gallery-form-card label {
        display: block;
        margin-bottom: 0.4rem;
        color: var(--color-gold-soft, #e5c46d);
        font-family: var(--font-display, Cinzel, serif);
        font-size: 0.82rem;
        letter-spacing: 0.04em;
    }

.gallery-add-form__row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

    .gallery-add-form__row .gallery-input {
        flex: 1 1 160px;
    }

    .gallery-add-form__row .gallery-btn {
        flex: 0 0 auto;
    }

.gallery-input {
    width: 100%;
    padding: 0.55rem 0.85rem;
    border-radius: 9px;
    border: 1px solid color-mix(in oklab, var(--color-gold, #c9a24e) 30%, transparent);
    background: rgba(4, 18, 12, 0.7);
    color: var(--color-cream, #f3ecda);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

    .gallery-input:focus {
        border-color: color-mix(in oklab, var(--color-gold, #c9a24e) 65%, transparent);
        box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-gold, #c9a24e) 18%, transparent);
    }

    .gallery-input::placeholder {
        color: color-mix(in oklab, var(--color-cream, #f3ecda) 40%, transparent);
    }

.gallery-form-card {
    max-width: 480px;
    margin: 0 auto;
}

    .gallery-form-card p {
        color: color-mix(in oklab, var(--color-cream, #f3ecda) 85%, transparent);
        margin: 0 0 1.1rem;
        line-height: 1.5;
    }

        .gallery-form-card p strong {
            color: var(--color-gold-soft, #e5c46d);
        }

.gallery-form-card__preview {
    display: block;
    max-width: 100%;
    max-height: 220px;
    margin: 0 auto 1.15rem;
    border-radius: 10px;
    border: 1px solid color-mix(in oklab, var(--color-gold, #c9a24e) 28%, transparent);
    object-fit: contain;
    background: #06150e;
}

.gallery-form-card label + .gallery-input,
.gallery-form-card label + .gallery-checkbox {
    margin-bottom: 1rem;
}

.gallery-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.25rem;
}

.gallery-form-card--danger {
    border-color: color-mix(in oklab, #c45c5c 40%, transparent);
    background: linear-gradient(160deg, rgba(50, 18, 18, 0.55), rgba(20, 8, 8, 0.45));
}

    .gallery-form-card--danger .gallery-heading {
        color: #f0b0b0;
    }

.gallery-checkbox {
    display: flex !important;
    align-items: center;
    gap: 0.55rem;
    color: var(--color-cream, #f3ecda) !important;
    font-family: inherit !important;
    font-size: 0.95rem !important;
    letter-spacing: 0 !important;
    cursor: pointer;
}

    .gallery-checkbox input {
        width: 1.05rem;
        height: 1.05rem;
        accent-color: var(--color-gold, #c9a24e);
    }

/* dropzone upload */
.gallery-dropzone-form {
    margin-bottom: 1.75rem;
    padding: 1.25rem 1.35rem;
    border-radius: 14px;
    border: 1px solid color-mix(in oklab, var(--color-gold, #c9a24e) 26%, transparent);
    background: linear-gradient(160deg, rgba(12, 40, 24, 0.65), rgba(6, 22, 14, 0.5));
}

.gallery-form-row {
    margin-bottom: 1rem;
}

    .gallery-form-row label {
        display: block;
        margin-bottom: 0.4rem;
        color: var(--color-gold-soft, #e5c46d);
        font-family: var(--font-display, Cinzel, serif);
        font-size: 0.82rem;
        letter-spacing: 0.04em;
    }

.gallery-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 140px;
    margin: 0.75rem 0 1.1rem;
    padding: 1.5rem 1rem;
    border-radius: 12px;
    border: 2px dashed color-mix(in oklab, var(--color-gold, #c9a24e) 40%, transparent);
    background: color-mix(in oklab, var(--color-gold, #c9a24e) 6%, transparent);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    text-align: center;
}

    .gallery-dropzone:hover,
    .gallery-dropzone.is-dragover {
        border-color: color-mix(in oklab, var(--color-gold, #c9a24e) 70%, transparent);
        background: color-mix(in oklab, var(--color-gold, #c9a24e) 14%, transparent);
    }

.gallery-dropzone__icon {
    font-size: 1.75rem;
    line-height: 1;
}

.gallery-dropzone__text {
    color: color-mix(in oklab, var(--color-cream, #f3ecda) 75%, transparent);
    font-size: 0.92rem;
}

.gallery-dropzone__preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    justify-content: center;
}

    .gallery-dropzone__preview img {
        width: 64px;
        height: 64px;
        object-fit: cover;
        border-radius: 6px;
        border: 1px solid color-mix(in oklab, var(--color-gold, #c9a24e) 30%, transparent);
    }

/* responsive */
@media (max-width: 560px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .gallery-card__thumb {
        margin: 8px 8px 0;
        border-radius: 8px;
    }

    .gallery-card__title {
        padding: 0.65rem 0.55rem 0.75rem;
        font-size: 0.8rem;
    }

    .gallery-photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
    }

    .gallery-add-form__row {
        flex-direction: column;
    }

        .gallery-add-form__row .gallery-btn {
            width: 100%;
        }

    .gallery-card__actions {
        flex-direction: column;
    }
}
