/**
 * Dotekománie Base - Gallery Grid Styles
 * Podpora pro Light Mode i Dark Mode (.dark), mobil i desktop
 */

.dt-gallery-grid {
    display: grid;
    gap: 8px;
    width: 100%;
    margin: 24px 0;
    box-sizing: border-box;
}

/* 4 a více fotek: Desktop 4 sloupce v 1 řádku (kompaktní filmstrip) */
.dt-gallery-grid.dt-gallery-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Mobilní zobrazení: 2x2 matice pro dotykové displeje */
#mobile .dt-gallery-grid.dt-gallery-4 {
    grid-template-columns: repeat(2, 1fr);
}

/* 2 fotky: 2 stejné sloupce */
.dt-gallery-grid.dt-gallery-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* 3 fotky: 3 sloupce na desktopu */
.dt-gallery-grid.dt-gallery-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* 1 fotka: Celá šířka */
.dt-gallery-grid.dt-gallery-1 {
    grid-template-columns: 1fr;
}
.dt-gallery-grid.dt-gallery-1 .dt-gallery-tile {
    aspect-ratio: 16 / 9;
}

/* Jednotlivá dlaždice */
.dt-gallery-tile {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 4px;
    background-color: var(--color-gray-100, #f9f9f9);
    border: 1px solid var(--color-gray-300, #e0e0e0);
    text-decoration: none !important;
    outline: none;
    box-sizing: border-box;
    transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
    cursor: pointer;
}

/* Obrázek uvnitř dlaždice */
.dt-gallery-tile .dt-gallery-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    transition: transform 300ms ease;
}

/* Hover efekt na běžné dlaždici */
.dt-gallery-tile:hover {
    border-color: var(--color-primary, #d91536);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.dt-gallery-tile:hover .dt-gallery-img {
    transform: scale(1.03);
}

/* Reset globálních stylů odkazů v článku pro galerii */
article .dt-gallery-grid a,
.dt-gallery-grid a,
.dt-gallery-grid .dt-gallery-tile {
    background-image: none !important;
    background-color: var(--color-gray-100, #f9f9f9) !important;
    text-decoration: none !important;
}

.dt-gallery-tile-more {
    cursor: pointer;
}

.dt-gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.72) !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    z-index: 2;
    transition: background-color 200ms ease;
    padding: 8px;
    box-sizing: border-box;
    text-align: center;
}

.dt-gallery-more-count {
    font-family: var(--font-condensed, "HelveticaNeue-CondensedBold", "Roboto Condensed", sans-serif) !important;
    font-size: 30px;
    font-weight: 700;
    color: #ffffff !important;
    line-height: 1;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.dt-gallery-more-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: var(--color-primary, #d91536) !important;
    background-image: none !important;
    color: #ffffff !important;
    font-family: var(--font-condensed, "HelveticaNeue-CondensedBold", "Roboto Condensed", sans-serif) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 4px 10px !important;
    border-radius: 4px !important;
    border: none !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35) !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    max-width: 92% !important;
    transition: background-color 200ms ease, transform 200ms ease;
}

.dt-gallery-tile-more:hover .dt-gallery-overlay {
    background: rgba(15, 23, 42, 0.84) !important;
}

.dt-gallery-tile-more:hover .dt-gallery-more-badge {
    background-color: var(--color-primary-hover, #a9394c) !important;
    transform: translateY(-1px);
}

/* ==========================================================================
   DARK MODE (.dark / html.dark)
   ========================================================================== */
.dark .dt-gallery-tile,
html.dark .dt-gallery-tile,
.dark article .dt-gallery-grid a,
html.dark article .dt-gallery-grid a,
.dark .dt-gallery-grid .dt-gallery-tile,
html.dark .dt-gallery-grid .dt-gallery-tile {
    background-color: #1a1a1a !important;
    border-color: #2e2e2e !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.dark .dt-gallery-tile:hover,
html.dark .dt-gallery-tile:hover,
.dark article .dt-gallery-grid a:hover,
html.dark article .dt-gallery-grid a:hover {
    border-color: var(--color-primary-dark, #d24a61) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.dark .dt-gallery-overlay,
html.dark .dt-gallery-overlay {
    background: rgba(0, 0, 0, 0.78);
}

.dark .dt-gallery-tile-more:hover .dt-gallery-overlay,
html.dark .dt-gallery-tile-more:hover .dt-gallery-overlay {
    background: rgba(0, 0, 0, 0.88);
}

.dark .dt-gallery-more-badge,
html.dark .dt-gallery-more-badge {
    background-color: var(--color-primary-dark, #d24a61) !important;
    background-image: none !important;
}

.dark .dt-gallery-tile-more:hover .dt-gallery-more-badge,
html.dark .dt-gallery-tile-more:hover .dt-gallery-more-badge {
    background-color: #b5384e !important;
}

/* ==========================================================================
   MOBILNÍ OPTIMALIZACE (#mobile / malá zařízení)
   ========================================================================== */
#mobile .dt-gallery-grid {
    gap: 6px;
    margin: 18px 0;
}

#mobile .dt-gallery-grid.dt-gallery-3 {
    grid-template-columns: repeat(2, 1fr);
}
#mobile .dt-gallery-grid.dt-gallery-3 .dt-gallery-tile:first-child {
    grid-column: span 2;
    aspect-ratio: 16 / 9;
}

#mobile .dt-gallery-more-count {
    font-size: 28px;
}

#mobile .dt-gallery-more-badge {
    font-size: 10px !important;
    padding: 3px 8px !important;
    letter-spacing: 0.3px !important;
}

/* ==========================================================================
   SKRYTÍ TECHNICKÉHO TITULKU V ZÁHLAVÍ SWIPEBOXU PŘI PROHLÍŽENÍ
   ========================================================================== */
#swipebox-title {
    display: none !important;
}
