/* Galerie CSS - Moderní design pro fotogalerii s opravou pro mobil */

main {
 padding: 0 !important;
     }

#galerie {
    max-width: 800px;
    margin: 0 auto !important; /* Důležité pro přepsání hlavního CSS */
    padding: 0 20px;    
    border-radius: 10px;      
    background: transparent;
    width: 100%;
    box-sizing: border-box;
}

/* Informační zprávy */
.info {
    background: #e6f3ff;
    border: 2px solid #0088cc;
    color: #006699;
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 5px;
    font-weight: bold;
}
.error {
    background: #ffe6e6;
    border: 2px solid #ff4444;
    color: #cc0000;
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 5px;
    font-weight: bold;
}

.success {
    background: #e6ffe6;
    border: 2px solid #44ff44;
    color: #006600;
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 5px;
    font-weight: bold;
}

#nadpis {
    background: transparent;
    padding: 5px 5px;
    border-radius: 10px 10px 0 0;
    margin: 10px 10px 10px 10px;
}

#nadpis h1 {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 30px;
    font-weight: 700;
    color: #da70d6 !important; /* Důležité pro přepsání hlavního CSS */
    text-align: center;
    text-shadow: none !important; /* Odstranit text-shadow z hlavního CSS */
}

#galerie h2 {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 25px;
    font-weight: 700;
    color: #28a745 !important;
    text-align: center;
    text-shadow: none !important;
}

/* Zpět navigace */
.zpet_navigace {
    margin-bottom: 5px;
    padding: 10px 0;
    text-align: center;
}

.zpet_btn {
    display: inline-block;
    padding: 10px 20px;
    background: #188a7e;
    color: white !important;
    text-decoration: none;
    border-radius: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.zpet_uvod {
    display: inline-block;
    padding: 10px 20px;
    background: #e21111;
    color: white !important;
    text-decoration: none;
    border-radius: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.zpet_btn:hover {
    background: #40e0d0;
    transform: translateY(-2px);    
    text-decoration: none;
    color: white !important;
}

/* Zobrazení jednotlivé fotky */
#zobraz {
    text-align: center;
    padding: 5px 0;
    background: transparent;
    border-radius: 10px;
    margin-bottom: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#zobraz img {
   /* max-height: 500px; */
   max-height: 50vh;
   max-width: 100%;
   width: auto;
   height: auto;   
   border-radius: 10px;
   box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2) !important;
   transition: transform 0.3s ease;
   margin: 0 auto !important;
   display: block !important;
}

#zobraz img:hover {
    transform: scale(1.02);
}

/* Navigace mezi fotkami */
#navigace {
    position: relative;
    height: auto; /* Změněno z 50px na auto pro mobil */
    min-height: 50px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border-radius: 25px;
    margin: 20px 0;
    flex-wrap: wrap; /* Povolí zalamování na mobilu */
    gap: 10px;
}

.predchozi, .dalsi {
    padding: 10px 20px;
    background: linear-gradient(135deg, #006699, #0088cc);
    color: white !important;
    text-decoration: none;
    border-radius: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 102, 153, 0.3);
    white-space: nowrap;
}

.zpet {
    padding: 10px 20px;
    background: linear-gradient(135deg, #ff6b35, #ff8c42);
    color: white !important;
    text-decoration: none;
    border-radius: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(255, 107, 53, 0.3);
    order: 0;
    white-space: nowrap;
}

.predchozi:hover, .dalsi:hover {
    background: linear-gradient(135deg, #0088cc, #00aaff);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 102, 153, 0.4);
    color: white !important;
    text-decoration: none !important;
}

.zpet:hover {
    background: linear-gradient(135deg, #ff8c42, #ffab42);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 107, 53, 0.4);
    color: white !important;
    text-decoration: none !important;
}

.pocet {
    background: white;
    padding: 8px 15px;
    border-radius: 15px;
    font-weight: bold;
    color: #006699;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

/* Přehled roků */
.roky_prehled {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-top: 30px;
    padding-bottom: 90px; /* aby poslední řádek nezajížděl pod fixní zápatí (40px) */
}

.rok_item {
    background: transparent;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.rok_item h2 {
    color: #fd7e14 !important; 
}    

.rok_item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.rok_item a {
    display: block;
    text-decoration: none !important;
    color: inherit;
    margin-top: 10px;
}

.rok_item a:hover {
    text-decoration: none !important;
}

.rok_item img {
    width: 90% !important;
    height: 180px !important;
    min-height: 150px;        
    object-fit: cover;
    transition: transform 0.3s ease;
    margin: 0 auto !important;
    display: block !important;
    box-shadow: none !important;
}

.rok_item:hover img {
    transform: scale(1.05);
}

.rok_item h2 {
    padding: 20px 25px 10px;
    margin: 0 !important;
    color: #006699 !important;
    font-size: 24px;
    font-weight: 600;
    text-shadow: none !important;
}

.pocet_alb {
    display: block;
    padding: 0 25px 20px;
    color: #666;
    font-style: italic;
}

/* Přehled alb v roce */
.album_item {
    background: transparent;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.album_item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.album_item a {
    display: block;
    text-decoration: none !important;
    color: inherit;
}

.album_item a:hover {
    text-decoration: none !important;
}

.album_item img {
    width: 90% !important;
    height: 180px !important;
    min-height: 150px;        
    object-fit: cover;
    transition: transform 0.3s ease;
    margin: 0 auto !important;
    display: block !important;
    box-shadow: none !important;
}

.album_item h3 {
    padding: 5px;
    margin: 0 !important;
    color: #fd7e14 !important;
    text-align: center;
    font-size: 18px;
    text-shadow: none !important;
}

.pocet_fotek {
    display: block;
    padding: 0 20px 15px;
    color: #666;
    font-size: 14px;
}

/* Galerie náhledů */
.nahled_galerie {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
    padding-bottom: 90px; /* aby poslední řádek nezajížděl pod fixní zápatí (40px) */
}

.nahled_item {
    background: transparent;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.nahled_item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.nahled_item a {    
    display: block;
    text-decoration: none !important;
}

.nahled_item a:hover {
    text-decoration: none !important;
}

.nahled_item img {
    width: 90% !important;
    height: 160px !important;
    object-fit: cover;
    transition: transform 0.3s ease;
    margin: 0 auto !important;
    display: block !important;
    box-shadow: none !important;
}

.nahled_item:hover img {
    transform: scale(1.1);
}

/* Placeholder pro chybějící obrázky */
.no_image {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #e0e0e0, #f0f0f0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-weight: bold;
    font-size: 16px;
}

/* Responzivní design */
@media (max-width: 768px) {
    
    #galerie {
        margin: 0 !important;
        padding: 10px !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    #nadpis {
        margin: 5px 0 !important;
        padding: 5px !important;
    }
    
    #nadpis h1 {
        font-size: 22px !important;
        margin: 0 !important;
        padding: 10px 0 !important;
    }

    #galerie h2 {
        font-size: 20px !important;
        margin: 10px 0 !important;
        padding: 5px 0 !important;
    }
    
    .roky_prehled {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        margin-top: 20px;
    }
    
    .nahled_galerie {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin-top: 20px;
    }
         

    #navigace {
        background: transparent !important;
        flex-direction: row;
        justify-content: center;
        align-items: flex-start;
        flex-wrap: wrap;
        height: auto !important;
        min-height: auto !important;
        padding: 15px 10px !important;
        gap: 10px;
        margin: 15px 0;
    }
    
       
    .zpet, .zpet_btn {
        order: 0;
        flex-basis: 100%;
        text-align: center;
        margin-bottom: 10px;
        padding: 10px 20px !important;
        font-size: 14px !important;
    }
    
    .predchozi, .dalsi {
        order: 1;
        flex: 1;
        max-width: 45%;
        min-width: 120px;
        text-align: center;
        padding: 10px 15px;
        font-size: 14px;
        margin: 0;
    }
    
    .pocet {
        order: 2;
        flex-basis: 100%;    /* Vynutí odřádkování */
        text-align: center;  /* Vycentruje obsah */
        margin-top: 10px ;        
        display: inline-block !important;
        width: auto !important;
        margin-left: 120px !important;
        margin-right: 120px !important;
    }
    
    .pocet > * {
        display: inline-block;  /* Inline blok pro obsah */
        padding: 8px 15px;
        border-radius: 15px;
        background: white;
        color: #006699;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        font-weight: bold;
        white-space: nowrap;
    }

    
    #zobraz img {
        max-height: 250px !important;
        max-width: 95% !important;
        margin: 0 auto !important;
        display: block !important;
    }

    .rok_item img, .album_item img {
        width: 100% !important;
        max-width: 100% !important;
        height: 120px !important;
        min-height: 120px;
        object-fit: cover;
    }

    .rok_item h2 {
        font-size: 16px !important;
        padding: 10px 5px 5px !important;
    }

    .pocet_alb {
        padding: 0 5px 10px !important;
        font-size: 12px;
    }

    .nahled_item img {
        width: 100% !important;
        height: 120px !important;
        object-fit: cover;
    }
}

@media (max-width: 480px) {
    #galerie {
        padding: 5px !important;
    }
    
    .roky_prehled {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .rok_item img, .album_item img {
        height: 100px !important;  /* Pro ještě menší displeje */
        min-height: 100px;
    }
    
    .nahled_item img {
        height: 100px !important;
    }
    
    .nahled_galerie {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .rok_item h2 {
        font-size: 14px !important;
        padding: 8px 3px 3px !important;
    }

    .pocet_alb {
        padding: 0 3px 8px !important;
        font-size: 11px;
    }
    
    .zpet_btn {
        padding: 8px 16px !important;
        font-size: 13px !important;
    }

    #nadpis h1 {
        font-size: 18px !important;
    }

    #galerie h2 {
        font-size: 16px !important;
    }

    .predchozi, .dalsi {
        padding: 8px 12px;
        font-size: 12px;
    }

    .pocet {
        padding: 6px 12px;
        font-size: 13px;
    }
}
/* ===================================================================== */
/* Celoobrazovkový prohlížeč fotek (fullscreen lightbox)                 */
/* ===================================================================== */

/* Nápověda pod fotkou na dotykových zařízeních (vkládá JS) */
.swipe-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 90%;
    margin: 8px auto 0;
    padding: 10px 18px;
    background: linear-gradient(135deg, #006699, #0088cc);
    color: #fff;
    border-radius: 22px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 102, 153, 0.35);
    box-sizing: border-box;
}

.swipe-hint .sh-sipka {
    font-size: 15px;
    flex: 0 0 auto;
}

.swipe-hint .sh-vlevo  { animation: shSipkaVlevo 1.5s ease-in-out infinite; }
.swipe-hint .sh-vpravo { animation: shSipkaVpravo 1.5s ease-in-out infinite; }

@keyframes shSipkaVlevo {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(-7px); }
}

@keyframes shSipkaVpravo {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(7px); }
}

/* Overlay přes celou obrazovku */
#fs-overlay {
    display: none;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;      /* mobil: bez plochy schované pod adresním řádkem */
    max-width: 100vw;
    overflow: hidden;
    z-index: 99999;
    background: #000;
    user-select: none;
    touch-action: none;  /* nutné, aby fungoval vlastní swipe a pinch */
}

#fs-overlay.open {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Když je overlay v nativním fullscreenu prohlížeče */
#fs-overlay:fullscreen,
#fs-overlay:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

#fs-overlay .fs-stage {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0 70px;        /* místo po stranách pro šipky */
    box-sizing: border-box;
}

/* !important přebije globální pravidla pro <img> z hlavního CSS webu,
   která jinak fotku roztáhnou přes celou obrazovku */
#fs-overlay .fs-img {
    max-width: calc(100vw - 150px) !important;
    max-height: 95vh !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    object-fit: contain;
    display: block !important;
    margin: 0 auto !important;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6) !important;
    touch-action: none;
    -webkit-user-drag: none;
}

/* Nápověda k dotykovému ovládání (vypisuje JS na dotykových zařízeních) */
#fs-overlay .fs-hint {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    background: rgba(0, 0, 0, 0.65);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 0.5s ease;
    z-index: 10;
}

#fs-overlay .fs-close {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 44px;
    height: 44px;
    font-size: 28px;
    line-height: 1;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s ease;
}

#fs-overlay .fs-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
    font-size: 40px;
    line-height: 1;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s ease;
}

#fs-overlay .fs-prev { left: 20px; }
#fs-overlay .fs-next { right: 20px; }

#fs-overlay .fs-close:hover,
#fs-overlay .fs-nav:hover {
    background: rgba(255, 255, 255, 0.30);
}

#fs-overlay .fs-pocet {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 16px;
    border-radius: 15px;
    font-weight: bold;
    z-index: 10;
}

/* Na mobilu se listuje tažením – šipky pryč a fotka využije celou šířku. */
@media (max-width: 768px) {
    /* Tlačítka Předchozí / Další nahrazuje tažení prstem */
    #navigace .predchozi,
    #navigace .dalsi { display: none !important; }

    #navigace { justify-content: center; }

    .pocet {
        margin-left: auto !important;
        margin-right: auto !important;
        margin-top: 0 !important;
    }

    #fs-overlay .fs-nav { display: none; }

    #fs-overlay .fs-stage {
        padding: 0;              /* žádné místo po stranách pro šipky */
    }

    #fs-overlay .fs-img {
        max-width: 100vw !important;
        max-height: 100dvh !important;
        border-radius: 0;
        box-shadow: none !important;
    }

    #fs-overlay .fs-close {
        top: 10px;
        right: 10px;
        width: 48px;
        height: 48px;
        font-size: 32px;
    }

    #fs-overlay .fs-pocet {
        bottom: 15px;
    }
}

/* ===================================================================== */
/* Úvodní stránka: velké dlaždice posledních roků + Archiv (menší)       */
/* Přesunuto z inline <style> v galerie.php, ať je CSS na jednom místě.  */
/* ===================================================================== */

/* Menší dlaždice pro starší období (Archiv) */
.roky_prehled_male {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 4px;
}
.roky_prehled_male .rok_item { width: 150px; }
.roky_prehled_male .rok_item img,
.roky_prehled_male .rok_item .no_image {
    width: 100% !important;
    height: 120px !important;
    min-height: 120px !important;
    object-fit: cover;
}
#galerie .roky_prehled_male .rok_item h2 { font-size: 18px !important; margin-top: 6px !important; }

/* Kontejner velkých dlaždic - řídí mezeru nad nadpisem Archiv */
.roky_prehled_velke { margin-bottom: 0 !important; padding-bottom: 44px !important; }
.roky_prehled_velke .rok_item { margin-bottom: 0 !important; }

/* Nadpis "Archiv" - stejná velikost jako "Fotogalerie radioklubu" (#nadpis h1) */
.archiv_nadpis {
    text-align: center;
    color: #da70d6;
    font-size: 30px;
    font-weight: 700;
    margin: 10px 0 10px;
}

@media (max-width: 768px) {
    .archiv_nadpis { font-size: 22px; }
    .roky_prehled_male .rok_item { width: 110px; }
    .roky_prehled_male .rok_item img,
    .roky_prehled_male .rok_item .no_image { height: 85px !important; min-height: 85px !important; }
    #galerie .roky_prehled_male .rok_item h2 { font-size: 13px !important; padding: 8px 2px 4px !important; }
}

@media (max-width: 480px) {
    .archiv_nadpis { font-size: 18px; }
    .roky_prehled_male { gap: 8px; }
    .roky_prehled_male .rok_item { width: 96px; }
    .roky_prehled_male .rok_item img,
    .roky_prehled_male .rok_item .no_image { height: 70px !important; min-height: 70px !important; }
    #galerie .roky_prehled_male .rok_item h2 { font-size: 11px !important; padding: 6px 1px 3px !important; }
}
