/* ============================
   Globální styl
============================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'EB Garamond', serif;
    line-height: 1.6;
    background-color: #fff;
    color: #1e1e1e;
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    flex-direction: column;
}

/* ============================
   Dark mode
============================ */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1e1e1e;
        color: #fff;
    }
}

/* ============================
   Header
============================ */
header {
    width: 100%;
    background-color: inherit;
    padding: 1rem 2rem;
    z-index: 100;
    position: relative;
}

.container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    text-decoration: none;
    color: inherit;
    font-weight: 400;
    font-size: 1.5rem;
    font-family: 'EB Garamond', serif;
}

/* Menu */
nav {
    position: relative;
}

.menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    font-family: 'EB Garamond', serif;
}

.menu li a {
    text-decoration: none;
    color: inherit;
    font-weight: 400;
    transition: color 0.3s;
    font-family: 'EB Garamond', serif;
}

.menu li a:hover,
.menu li a.active {
    color: #fddc5c;
}

/* Burger menu */
.burger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: currentColor;
    transition: all 0.3s;
}

/* ============================
   Sekce stránky
============================ */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.hero, .about, .portfolio, .texts, .about-me {
    text-align: center;
    padding: 4rem 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.hero h1, .portfolio h1, .texts h1, .about-me h1 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.hero p, .about p, .portfolio p, .texts p, .about-me p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    word-spacing: 0.06em;
}

/* Obrázek pro index */
.hero-image {
    width: 35%;
    height: auto;
}

/* ============================
   Footer
============================ */
footer {
    text-align: center;
    padding: 1rem 2rem;
    font-size: 0.9rem;
    color: inherit;
    background-color: inherit;
    margin-top: auto;
    font-family: 'EB Garamond', serif;
}

/* ============================
   Portfolio
============================ */
.portfolio-filters, .text-filters {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 1rem;
    margin-top: 0; /* posunuto nahoru */
    margin-bottom: 2rem;
    font-family: 'EB Garamond', serif;
    transition: font-size 0.3s;
}

.portfolio-filters button, .text-filters button {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    color: inherit;
    transition: color 0.3s;
    white-space: nowrap;
}

.portfolio-filters button:hover, .portfolio-filters button.active,
.text-filters button:hover, .text-filters button.active {
    color: #fddc5c;
}

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

.gallery-item {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1/1;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.photo-name {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    color: #fddc5c;
    font-size: 0.9rem;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    font-family: 'EB Garamond', serif;
}

/* ============================
   Lightbox
============================ */
.lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.lightbox-inner {
    position: relative; /* pro caption */
    display: inline-block;
}

.lightbox-img {
    display: block;
    max-width: 90vw;
    max-height: 80vh;
}

.lightbox-caption {
    position: absolute;
    bottom: -1.5rem; /* pod fotkou */
    right: 0;
    color: #fddc5c;
    font-size: 1rem;
    font-family: 'EB Garamond', serif;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    white-space: nowrap;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    color: #fddc5c;
    cursor: pointer;
}

/* ============================
   Texty
============================ */
.text-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
}

/* ============================
   Responzivita
============================ */
@media (max-width: 768px) {

    .menu {
        position: absolute;
        top: 100%;
        right: 0;
        background-color: #fff;
        color: #1e1e1e;
        flex-direction: column;
        width: 200px;
        display: none;
        padding: 1rem;
        gap: 1rem;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        font-family: 'EB Garamond', serif;
        z-index: 2000;
    }

    @media (prefers-color-scheme: dark) {
        .menu {
            background-color: #1e1e1e;
            color: #fff;
        }
    }

    .menu.show {
        display: flex;
    }

    .burger {
        display: flex;
    }

    .hero-image {
        width: 90%;
    }

    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Zmenšování písma filtrovníku místo zalamování */
    .portfolio-filters, .text-filters {
        font-size: 0.9rem;
        gap: 0.5rem;
    }

    .portfolio-filters button, .text-filters button {
        padding: 0.4rem 0.8rem;
    }

    /* Zvětšení loga na mobilech */
    .logo a {
        font-size: 1.8rem;
    }
}

@media (min-width: 1200px) {
    .gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================
   Styl textů (poezie / próza)
============================ */
.text-container {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

/* Každý textový blok */
.text-item {
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding-bottom: 1.5rem;
    font-family: 'EB Garamond', serif;
    transition: all 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    .text-item {
        border-color: rgba(255,255,255,0.1);
    }
}

/* Název textu */
.text-item h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: inherit;
}

/* Ukázka textu */
.text-preview {
    font-size: 0.7rem;
    line-height: 1.6;
    color: inherit;
    white-space: pre-line;
}

/* Tlačítka "Číst celé" / "Zpět" */
.text-item button {
    display: inline-block;
    margin-top: 0.6rem;
    padding: 0;
    background: none;
    border: none;
    color: inherit;
    font-family: 'EB Garamond', serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.text-item button:hover {
    color: #fddc5c;
}

/* Plný text po rozkliknutí */
.text-full {
    font-size: 0.7rem;
    line-height: 1.7;
    color: inherit;
    white-space: pre-line;
    margin-top: 0.6rem;
}

/* Responsivní úpravy */
@media (max-width: 768px) {
    .text-container {
        gap: 2rem;
        padding: 0 1rem;
    }

    .text-item h2 {
        font-size: 1.1rem;
    }

    .text-preview, .text-full {
        font-size: 0.85rem;
    }

    .text-item button {
        font-size: 0.8rem;
    }
}

/* Speciální barva textu pro fotku 0039 */
.gallery-item.special-text .photo-name {
    color: #d3d3d3 !important;
}
/* Světle šedý popisek i v lightboxu */
.lightbox.special-text-active .lightbox-caption {
    color: #d3d3d3 !important;
}

