* {
    box-sizing: border-box;
}

body {
    padding: 10px;
    background-color: #1E1B18;
    font-family: 'Inter', 'Roboto', sans-serif;
    color: #EAE0D5;
}

h1,
h2,
h3 {
    font-family: 'Poppins', sans-serif;
}

.active {
    background-color: #E0A75D;
}

/* Header */
header {
    padding: 50px;
    text-align: center;
    background-color: #2C2623;
    border-radius: 10px;
    box-shadow: 5px 5px 5px;
}

header h1 {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.hero-subtitle {
    font-size: 1.4rem;
    opacity: 0.9;
    margin-bottom: 25px;
    color: #B88746;
}

/* Nav */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #2C2623;
    padding: 10px 20px;
    margin-top: 20px;
    box-shadow: 5px 5px 5px;
    border-radius: 10px;
}

/* Error Button */
.error-btn {
    background-color: #8B2E2E;
    border: none;
}

.error-btn:hover {
    background-color: red;
}

.nav-links {
    display: flex;
    gap: 20px;
}

nav a {
    color: black;
    text-align: center;
    padding: 10px 20px;
    text-decoration: none;
    font-weight: bold;
    background-color: #B88746;
    border-radius: 10px;
    border: 2px solid #B88746;
    box-shadow: 3px 3px 3px;
}

nav a:hover {
    background-color: #E0A75D;
    transform: scale(1.03);
    transition: 0.2s ease;
}

/* Main */
main {
    display: flex;
    align-items: stretch;
    margin: 20px 0;

    background-color: #2C2623;
    border-radius: 10px;
    box-shadow: 5px 5px 5px;
}

aside {
    width: 220px;
    flex-shrink: 0;
    padding: 20px;
    /* Rozdělovací border */
    border-right: 2px solid rgba(234, 224, 213, 0.2);
}

aside>h2 {
    border-bottom: 1px solid rgba(234, 224, 213, 0.2);
}

button {
    height: 30px;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    background-color: #B88746;
    border: none;
    border-radius: 6px;
    
    text-align: start;
    color: black;
}

button:hover {
    background-color: #E0A75D;
    transform: scale(1.03);
    transition: 0.2s ease;
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 50px;
    padding-left: 10px;
}

section {
    flex: 1;
    padding: 20px;
}

#content-box p,
#content-box ul { /* Řešení pro to, aby mi to neomezovalo fetchnutá data */
    max-width: 800px;
    line-height: 1.6;
}

.closeup-img {
    display: none;
}

.show {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.8);

    display: flex;
    justify-content: center;
    align-items: center;
}

.show img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    border: 3px solid #B88746; 
    background-color: #1E1B18; /* tmavé pozadí pod obrázkem */
    padding: 5px;
}

/* Footer */
footer {
    background-color: #2C2623;
    text-align: center;
    margin-top: 20px;
    padding: 10px;
    box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.2);
    /* Jemnější zobrazení stínu */
    border-radius: 10px;
}

/* Zarovnání textu a ikonek */
footer p {
    margin: 0;
    /* Zrušení výchozího okraje odstavce */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    /* Zajistí, že se to na úzkých mobilech případně hezky zlomí */
}

/* Kdyby ikonka pořád o pixel uhýbala kvůli fontu, tohle ji dorovná */
footer p img {
    vertical-align: middle;
}

footer a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    gap: 6px;
}

footer a:hover {
    color: #E0A75D;
    transform: scale(1.03);
    transition: 0.2s ease;
}

.legal-info {
    font-size: 0.75rem;
    color: #888;
    /* Zašedlá barva, aby to nebilo do očí */
    margin-top: 10px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* ===============================
---------- CODE GALLERY ----------
=============================== */

.code-gallery {
    display: grid;
    /* Tohle je největší kouzlo: 
    Říká to "udělej sloupce, které mají minimálně 250px. 
       Pokud je místo, narvi je vedle sebe. Pokud místo není, hoď je pod sebe." */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px; /* Mezera mezi obrázky */
    margin-top: 30px;
    padding: 30px;
}

.code-gallery img {
    width: 100%; /* Obrázek se vždy přizpůsobí svému sloupečku */
    height: auto;
    border-radius: 8px; /* Jemně zakulacené rohy, ať to ladí */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); /* Hezký stín, aby karty "vystoupily" z pozadí */
    transition: transform 0.3s ease; /* Příprava na hover efekt */
    border: 4px solid #B88746;
}

/* Malý bonus pro ten "showcase" feel */
.code-gallery img:hover {
    transform: translateY(-5px); /* Při najetí myší fotka lehce poskočí nahoru */
    cursor: pointer;
    border: 4px solid #E0A75D;
}

/* ==============================
----- Responsive exceptions -----
============================== */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 10px;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
    }

    .error-btn {
        margin-top: 30px;
    }

    nav a {
        width: 100%;
    }

    main {
        flex-direction: column;
    }

    aside {
        width: 100%;
        border-right: none;
        border-bottom: 2px solid rgba(234, 224, 213, 0.7);
    }

    .btn-group {
        margin-bottom: 20px;
    }
}