﻿

#foto {
    margin: 0;
    padding: 20px;
    font-family: Arial, sans-serif;
    /*    background-color: #f9f9f9;*/
    text-align: center;
}

    #foto h1, main h2, main h3 {
        text-align: center;
        margin-bottom: 20px;
        font-weight: 600;
        color: #222;
    }

    #foto h1 {
        font-size: clamp(3.5rem, 3vw, 4rem);
        margin: 0 auto 100px auto; /* vystředí blok */
        padding-bottom: 5px;
        position: relative;
        display: table; /* šířka podle obsahu, ale chová se jako blok */
        line-height: 1.2;
    }

        #foto h1::after {
            content: "";
            position: absolute;
            left: 50%;
            bottom: -10px;
            height: 5px;
            width: 100%; /* přesně podle délky textu */
            background-color: #4CAF50;
            transform: translateX(-50%) scaleX(0);
            transform-origin: center;
            animation: underlineGrow 0.8s ease-out forwards;
        }


 @keyframes underlineGrow {
    to {
        transform: translateX(-50%) scaleX(1);
    }
}

#foto h2 {
    font-size: clamp(2rem, 1.8vw, 2.6rem);
    margin: -70px auto 100px auto; /* vystředí blok */
    padding-bottom: 5px;
    position: relative;
    display: table; /* šířka podle obsahu, ale chová se jako blok */
    line-height: 1.2;
}








/* Grid miniatur */ #foto .link-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    padding: 16px;
}
/* Box s odkazem a obrázkem */

#foto .link-box {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 5px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    margin-bottom:40px;
}

#foto .link-box:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

    #foto .link-box img {
        width: 100%;
        height: 140px;
/*        object-fit: cover;*/
        display: block;
    }
    /* Titulek pod obrázkem */

    #foto .link-box h3 {
        margin: 10px;
        font-size: 1rem;
        line-height: 1.2;
        text-align: center;
    }
/* Lightbox overlay (skryté výchozí) */

#foto .lightbox {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.85);
    opacity: 0;
    pointer-events: none;
    transform: scale(1.02);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 9999;
    padding: 20px;
}
    /* Zobrazit lightbox, když je cílem fragmentu (#id) */

    #foto .lightbox:target {
        opacity: 1;
        pointer-events: auto;
        transform: scale(1);
    }
    /* Obrázek v lightboxu */

    #foto .lightbox img {
        max-width: 90%;
        max-height: 80vh;
        box-shadow: 0 10px 30px rgba(0,0,0,0.6);
        border-radius: 6px;
    }
    /* Popisek */

    #foto .lightbox .caption {
        color: #fff;
        margin-top: 12px;
        text-align: center;
        font-size: 1.5rem;
    }
    /* Tlačítko zavřít (pouze vizuální, klikne na #) */

    #foto .lightbox .close {
        position: absolute;
        top: 18px;
        right: 18px;
        width: 36px;
        height: 36px;
        background: rgba(255,255,255,0.12);
        border-radius: 50%;
        display: block;
        text-indent: -9999px;
        transition: background 0.15s ease;
    }

        #foto .lightbox .close:hover {
            background: rgba(255,255,255,0.2);
        }
/* Responsivní úpravy */

@media (max-width: 480px) {
    #foto .link-box img {
        height: 110px;
    }

    #foto .lightbox img {
        max-width: 98%;
        max-height: 70vh;
    }
}




/* Zobrazit lightbox přes JS */
#foto .lightbox.open {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}
/* Vnitřní kontejner pro snazší detekci kliknutí mimo obrázek */

#foto .lightbox .lb-inner {
    position: relative;
    text-align: center;
    z-index: 2;
}
/* Zavírací křížek */

#foto .lb-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
}

    #foto .lb-close:hover {
        background: rgba(255,255,255,0.2);
    }
/* Šipky před a zpět */

#foto .lb-prev, .lb-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 200px;
    border: none;
    background: rgba(250,250,250,0.35);
    color: yellow;
    font-size: 100px;
    font-weight:bold;
    line-height: 1;
    border-radius: 6px;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

#foto .lb-prev {
    left: 18px;
}

#foto .lb-next {
    right: 18px;
}

#foto .lb-prev:hover, .lb-next:hover {
    background: rgba(0,0,0,0.5);
}
/* Zajistit, aby se šipky a křížek nezobrazovaly na malých obrazovkách příliš velké */

@media (max-width: 900px) {
    #foto .lb-prev, .lb-next {
        width: 48px;
        height: 100px;
        font-size: 50px;
    }

}



@media (max-width: 590px) {
    #foto .lb-prev, .lb-next {
        width: 40px;
        height: 56px;
        font-size: 26px;
    }

    #foto .lb-close {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}




@media (prefers-color-scheme: dark) {
    html {
        color: #e4e4e4;
        background-color: #121212;
    }

    main {
        background: linear-gradient(180deg, #0f172a, #1e293b);
        color: #e5e7eb;
        box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    }


        main h1, h2, h3, h4, p {
            color: #ffffff;
        }

  
}