/* ===========================
   MOZAIKA NÁHLEDŮ V ČLÁNKU
   =========================== */

.smart-gallery-wrapper {
    width: 100%;
}

.smart-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    grid-auto-rows: 110px;
    gap: 6px;
}

/* Základ dlaždice – všechny stejné, žádné velké dlaždice */
.smart-gallery-thumb {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    cursor: pointer;
}

.smart-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s, box-shadow 0.2s;
}

.smart-gallery-thumb:hover img {
    transform: scale(1.03);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

/* Responzivita mozaiky */
@media (max-width: 900px) {
    .smart-gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        grid-auto-rows: 100px;
    }
}

@media (max-width: 600px) {
    .smart-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 90px;
    }
}

/* ===========================
   STRÁNKA S JEDNOU FOTKOU
   =========================== */

.smart-gallery-page-wrapper {
    max-width: 1000px;
    margin: 20px auto;
    padding: 0 10px;
    box-sizing: border-box;
}

.smart-gallery-page-back {
    margin-bottom: 10px;
    font-size: 14px;
}

.smart-gallery-page-back a {
    text-decoration: none;
    color: #0073aa;
}

.smart-gallery-page-back a:hover {
    text-decoration: underline;
}

/* velká fotka + šipky */
.smart-gallery-page-main {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    margin-bottom: 8px;
}

.smart-gallery-page-main-inner {
    position: relative;
    display: inline-block;
}

.smart-gallery-page-main-img {
    max-width: 100%;
    max-height: 70vh;
    height: auto;
    border-radius: 4px;
    cursor: zoom-in;
}

/* šipky – odkazy */
.smart-gallery-page-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    text-decoration: none;
    background: rgba(0,0,0,0.4);
    color: #fff;
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.smart-gallery-page-prev {
    left: 8px;
}

.smart-gallery-page-next {
    right: 8px;
}

.smart-gallery-page-arrow:hover {
    background: rgba(0,0,0,0.6);
}

/* index "Foto X / Y" */
.smart-gallery-page-index {
    font-size: 13px;
    margin-bottom: 6px;
    text-align: right;
    color: #666;
}

/* všechny náhledy pod obrázkem – mřížka */
.smart-gallery-page-bottom-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 6px;
    margin-top: 8px;
}

.smart-gallery-page-bottom-thumb img {
    display: block;
    width: 100%;
    height: auto;
    cursor: pointer;
    border-radius: 3px;
    opacity: 0.7;
    transition: opacity 0.2s, box-shadow 0.2s, transform 0.2s;
}

.smart-gallery-page-bottom-thumb img:hover {
    opacity: 1;
    transform: scale(1.03);
}

.smart-gallery-page-bottom-thumb.is-active img {
    opacity: 1;
    box-shadow: 0 0 0 2px #0073aa;
}

/* ===========================
   INFO PANEL PŘES FOTKU
   =========================== */

.smart-gallery-info-toggle {
    position: absolute;
    left: 10px;
    bottom: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.65);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.smart-gallery-info-panel {
    position: absolute;
    left: 10px;
    bottom: 10px;
    max-width: 65%;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
    transform: translateY(110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.smart-gallery-info-panel.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.smart-gallery-info-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.smart-gallery-info-text {
    font-weight: 400;
}

/* ===========================
   LIGHTBOX – originální velikost
   =========================== */

.smart-gallery-lightbox {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
}

.smart-gallery-lightbox[data-active="true"] {
    display: block;
}

.smart-gallery-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.8);
}

/* box přes celé okno – vystředění obsahu */
.smart-gallery-lightbox-inner {
    position: fixed;
    inset: 0;
    margin: 0;
    padding: 20px;               /* malý okraj od okna */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

/* rámeček kolem fotky – na ten se váže křížek */
.smart-gallery-lightbox-frame {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* FIT DO OKNA – nikdy nepřeteče, jen se zmenší */
.smart-gallery-lightbox-img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 4px;
}

/* X je vždy vpravo nahoře PŘÍMO NA FOTCE */
.smart-gallery-lightbox-close {
    position: absolute;
    top: 8px;
    right: 8px;
    border: none;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    font-size: 22px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* jistota, že tam X opravdu bude */
.smart-gallery-lightbox-close::before {
    content: '×';
    font-size: 22px;
    line-height: 1;
}

/* responzivita */
@media (max-width: 768px) {
    .smart-gallery-page-wrapper {
        margin: 15px auto;
        padding: 0 8px;
    }

    .smart-gallery-info-panel {
        max-width: 80%;
    }
}
