/* =========================================================
   Galerie (galerie.php) – styly jen pro tuto stránku.
   Společné styly (menu, tlačítka, kontakt, patička) jsou
   v style.css.
   ========================================================= */

/* Drobné rozdíly proti společným stylům (zachování původního vzhledu galerie) */
.page-header .divider {
    margin: 1.5rem auto 0;
}

.load-more-wrapper .hero-cta {
    margin: 0;
}

/* ── Filtrační lišta ── */
.filter-bar {
    position: sticky;
    top: 80px;
    z-index: 900;
    background: rgba(245, 237, 227, 0.97);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(201, 169, 97, 0.25);
    padding: 1rem 4rem;
}

.filter-inner {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-label {
    font-family: 'Work Sans', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--burnt-sienna);
    white-space: nowrap;
    font-weight: 400;
}

.filter-inner select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 1px solid rgba(201, 169, 97, 0.4);
    color: var(--charcoal);
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.95rem;
    padding: 0.45rem 2rem 0.45rem 0.8rem;
    cursor: pointer;
    border-radius: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23C9A961' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    transition: border-color 0.3s ease, color 0.3s ease;
    min-width: 140px;
}

.filter-inner select:hover,
.filter-inner select:focus {
    border-color: var(--gold);
    outline: none;
    color: var(--burnt-sienna);
}

.filter-inner select option {
    background: var(--deep-cream);
    color: var(--charcoal);
}

.filter-separator {
    width: 1px;
    height: 24px;
    background: rgba(201, 169, 97, 0.3);
    flex-shrink: 0;
}

/* Řazení select – vizuálně odlišený */
.filter-inner select.sort-select {
    border-color: rgba(160, 82, 45, 0.3);
}

.btn-reset {
    margin-left: auto;
    padding: 0.45rem 1.2rem;
    background: transparent;
    border: 1px solid rgba(201, 169, 97, 0.4);
    color: var(--gold);
    font-family: 'Work Sans', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-reset:hover {
    background: var(--gold);
    color: white;
    border-color: var(--gold);
}

/* Počítadlo výsledků */
.results-count {
    font-family: 'Work Sans', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 1px;
    color: #999;
    white-space: nowrap;
}

/* ── Nadpis stránky ── */
.page-header {
    padding: 5rem 4rem 2rem;
    max-width: 1600px;
    margin: 80px auto 0;
    text-align: center;
    animation: fadeIn 1s ease-out;
}

.page-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 400;
    color: var(--charcoal);
    margin-bottom: 1rem;
}

.page-header p {
    font-family: 'Work Sans', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--burnt-sienna);
    font-weight: 300;
}

/* ── Mřížka galerie ── */
.gallery-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 3rem 4rem 6rem;
}

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

.load-more-wrapper {
    text-align: center;
    margin: 40px 0;
    width: 100%;
    clear: both;
}

/* ── Karta obrazu ── */
.obraz-karta {
    background: white;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.4s ease,
                opacity 0.3s ease;
    animation: fadeIn 0.5s ease-out both;
}

.obraz-karta:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 50px rgba(0,0,0,0.13);
}

.obraz-karta.hidden {
    display: none;
}

.karta-obrazek {
    width: 100%;
    aspect-ratio: 3/4; 
    background: #1e1e1e; /* ZDE: Nastavena elegantní tmavá barva */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.karta-obrazek img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Odznak stavu */
.stav-badge {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    padding: 0.25rem 0.7rem;
    font-family: 'Work Sans', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 500;
    border-radius: 1px;
}

.stav-badge.dostupne  { background: rgba(74, 140, 74, 0.9);  color: white; }

.stav-badge.rezervovano { background: rgba(201, 169, 97, 0.9); color: white; }

.stav-badge.prodano   { background: rgba(100, 100, 100, 0.8); color: white; }

/* Info pod obrázkem */
.karta-info {
    padding: 1.2rem 1.4rem 1.4rem;
    border-top: 1px solid rgba(201, 169, 97, 0.15);
}

.karta-nazev {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--charcoal);
    margin-bottom: 0.5rem;
    font-style: italic;
}

.karta-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 1rem;
    margin-bottom: 0.8rem;
}

.karta-meta span {
    font-family: 'Work Sans', sans-serif;
    font-size: 0.75rem;
    color: #888;
    letter-spacing: 0.5px;
}

.karta-cena {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    color: var(--burnt-sienna);
    font-weight: 500;
}

/* ── Prázdný stav ── */
.prazdny-stav {
    display: none;
    text-align: center;
    padding: 6rem 2rem;
    color: #bbb;
    grid-column: 1 / -1;
}

.prazdny-stav.visible { display: block; }

.prazdny-stav svg {
    width: 48px;
    height: 48px;
    stroke: #ccc;
    margin-bottom: 1.5rem;
}

.prazdny-stav p {
    font-family: 'Work Sans', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* =========================================================
1. ZÁKLAD: POČÍTAČ (Desktop - 2 sloupce, vše viditelné)
========================================================= */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(43, 38, 33, 0.92);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
    box-sizing: border-box;
}

.lightbox.open { 
    display: flex; 
}

.lightbox-inner {
    background: var(--deep-cream);
    max-width: 900px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 40px 120px rgba(0,0,0,0.5);
    max-height: 90vh;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.lightbox-img {
    background: #1e1e1e;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    height: min(80vh, 720px);
}

.lightbox-img .karta-obrazek {
    aspect-ratio: auto;
    height: 100%;
}

.lightbox-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.lightbox-detail {
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
}

.lightbox-detail .lb-nazev {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 400;
    font-style: italic;
    color: var(--charcoal);
    margin-bottom: 0.5rem;
}

.lightbox-detail .lb-stav {
    margin-bottom: 2rem;
}

.lightbox-detail table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.lightbox-detail table tr {
    border-bottom: 1px solid rgba(201, 169, 97, 0.15);
}

.lightbox-detail table td {
    padding: 0.6rem 0;
    font-size: 0.95rem;
}

.lightbox-detail table td:first-child {
    font-family: 'Work Sans', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #aaa;
    width: 40%;
}

.lightbox-detail table td:last-child {
    color: var(--charcoal);
}

.lb-cena-velka {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    color: var(--burnt-sienna);
    margin-bottom: 2rem;
}

.lb-btn {
    display: inline-block;
    padding: 0.9rem 2rem;
    border: 2px solid var(--gold);
    color: var(--gold);
    font-family: 'Work Sans', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    background: transparent;
    transition: all 0.4s ease;
    text-decoration: none;
    text-align: center;
}

.lb-btn:hover { 
    background: var(--gold); 
    color: white; 
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: white;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0.5rem;
    transition: opacity 0.3s;
    z-index: 2001;
}

.lightbox-close:hover { 
    opacity: 0.6; 
}

/* =========================================================
2. TABLETY A MOBILY (Displeje pod 1024px)
Žádný !important, přepisujeme kaskádou.
Zobrazí se pouze Obrázek + Tlačítko.
========================================================= */
@media (max-width: 1024px) {
    .lightbox {
        padding: 0.75rem;
    }

    .lightbox-inner {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 560px;
        max-height: 94vh;
        max-height: 94dvh;
        overflow-y: auto;            /* celá karta se v případě potřeby scrolluje */
        -webkit-overflow-scrolling: touch;
    }

    .lightbox-img {
        flex: 0 0 auto;
        min-height: 0;
        height: 50vh;
        height: 50dvh;
        padding: 0.75rem;
        box-sizing: border-box;
    }

    .lightbox-detail {
        padding: 1.25rem 1.25rem 1.5rem;
        justify-content: flex-start;
        align-items: stretch;
        overflow: visible;
    }

    .lightbox-detail .lb-nazev { font-size: 1.4rem; margin-bottom: 0.4rem; }
    .lightbox-detail .lb-stav  { margin-bottom: 1rem; }
    .lightbox-detail table     { margin-bottom: 1rem; }
    .lightbox-detail table td  { padding: 0.45rem 0; font-size: 0.9rem; }
    .lb-cena-velka             { font-size: 1.6rem; margin-bottom: 1rem; }

    .lb-btn {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .lightbox-close {
        top: 0.6rem;
        right: 0.6rem;
        width: 2.4rem;
        height: 2.4rem;
        padding: 0;
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.5);
    }
}

/* Telefon na šířku: málo výšky → obraz a informace vedle sebe */
@media (max-width: 1024px) and (max-height: 520px) and (orientation: landscape) {
    .lightbox-inner {
        display: grid;
        grid-template-columns: 1fr 1fr;
        max-width: 900px;
        overflow: hidden;
    }

    .lightbox-img {
        height: auto;
    }

    .lightbox-detail {
        overflow-y: auto;
        max-height: 94vh;
        max-height: 94dvh;
    }
}

/* Zvětšení obrazu přes celou obrazovku */
.lightbox-img {
    position: relative;
    cursor: zoom-in;
}

.lb-zoom-hint {
    position: absolute;
    right: 0.8rem;
    bottom: 0.8rem;
    padding: 0.3rem 0.7rem;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-family: 'Work Sans', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 2px;
    pointer-events: none;
}

.zoom-viewer {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(15, 13, 11, 0.97);
}

.zoom-viewer.open { display: block; }

.zoom-stage {
    position: absolute;
    inset: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    cursor: zoom-in;
}

.zoom-stage.zoomed   { cursor: grab; }

.zoom-stage.dragging { cursor: grabbing; }

.zoom-stage img {
    flex: none;
    display: block;
    transform-origin: center center;
    will-change: transform;
    -webkit-user-drag: none;
    pointer-events: none;
}

.zoom-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 3001;
    width: 2.6rem;
    height: 2.6rem;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

.zoom-close:hover { background: rgba(255, 255, 255, 0.3); }

.zoom-hint {
    position: absolute;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    z-index: 3001;
    padding: 0.4rem 0.9rem;
    background: rgba(0, 0, 0, 0.55);
    color: rgba(255, 255, 255, 0.85);
    font-family: 'Work Sans', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 1px;
    text-align: center;
    border-radius: 2px;
    pointer-events: none;
    animation: zoomHintFade 0.6s ease 4s forwards;
}

@keyframes zoomHintFade { to { opacity: 0; } }

/* ---------------------------------------------------------
   Responzivita – jen galerie
   --------------------------------------------------------- */
@media (max-width: 1200px) {
    .filter-bar { padding: 1rem 2rem; }
    .gallery-wrapper { padding: 3rem 2rem 6rem; }
    .page-header { padding: 5rem 2rem 2rem; }
}

@media (max-width: 768px) {
    .filter-inner { gap: 0.6rem; }
    .filter-inner select { min-width: 110px; font-size: 0.85rem; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.2rem; }
    .page-header h1 { font-size: 2.2rem; }
    .filter-separator { display: none; }
}


/* Hledání podle názvu (vzhled shodný s ostatními filtry) */
.filter-inner .filter-search {
    min-width: 200px;
    padding: 0.45rem 0.8rem;
    border: 1px solid rgba(201, 169, 97, 0.4);
    background: transparent;
    color: var(--charcoal);
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.95rem;
    border-radius: 0;
    transition: border-color 0.3s ease;
}

.filter-inner .filter-search::placeholder {
    color: #8a7f73;
}

.filter-inner .filter-search:hover,
.filter-inner .filter-search:focus {
    outline: none;
    border-color: var(--gold);
}

/* Poznámka u díla (např. u autorské repliky) */
.karta-pozn {
    margin-top: 0.3rem;
    font-family: 'Work Sans', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--burnt-sienna);
}

@media (max-width: 768px) {
    .filter-inner .filter-search { min-width: 100%; }
}

/* Úvodní text pod nadpisem galerie */
.gallery-intro {
    max-width: 820px;
    margin: 2rem auto 0;
    text-align: center;
}

.gallery-intro p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 1rem;
    /* přebíjí velká písmena z .page-header p */
    font-family: 'Cormorant Garamond', serif;
    letter-spacing: 0;
    text-transform: none;
    font-weight: 400;
}


/* ---------------------------------------------------------
   Ukázka z tvorby (3 obrazy pod úvodním textem)
   --------------------------------------------------------- */
.gallery-showcase {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1100px;
    margin: 3rem auto 0;
}

.showcase-item {
    display: block;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: center;
    font: inherit;
    color: inherit;
}

.showcase-img {
    display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 2px;
    background: var(--soft-tan);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

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

.showcase-item:hover .showcase-img img,
.showcase-item:focus-visible .showcase-img img {
    transform: scale(1.04);
}

.showcase-name {
    display: block;
    margin-top: 1rem;
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: var(--charcoal);
}

.showcase-meta {
    display: block;
    margin-top: 0.2rem;
    font-family: 'Work Sans', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--burnt-sienna);
}

.showcase-btn {
    margin-top: 2.5rem;
}

@media (max-width: 900px) {
    .gallery-showcase {
        grid-template-columns: 1fr;
        max-width: 420px;
        gap: 2rem;
    }

    .showcase-img { aspect-ratio: 4 / 3; }
}
