/* --- Základní nastavení --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Poppins', sans-serif;
    background-color: #121212;
    color: #ffffff;
    overflow: hidden;
}

/* --- Hlavní kontejner s mřížkou --- */
.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    height: 100vh;
    gap: 5px;
}

/* --- Jednotlivé klikatelné sekce --- */
.grid-item {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: #ffffff;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
}

/* --- Přidání konkrétních obrázků pro každou sekci --- */
.item-1 { background-image: url('img/jaj.jpg'); }
.item-2 { background-image: url('img/studio.jpg'); }
.item-3 { background-image: url('img/fotok5.jpg'); }
.item-4 { background-image: url('img/3dportfolio.jpg'); }


/* --- Překryvná vrstva pro ztmavení obrázku --- */
.grid-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.85);
    transition: background-color 0.4s ease;
    z-index: 1;
}

/* --- Obsah (text) musí být nad překryvnou vrstvou --- */
.grid-item .content {
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

.grid-item h2 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    /* PŘIDÁNO: Stín pro hlavní nadpis pro lepší čitelnost */
    text-shadow: 0px 2px 8px rgba(0, 0, 0, 0.8);
}

.grid-item p {
    font-size: 1rem;
    font-weight: 300;
    color: #b3b3b3;

}

/* --- EFEKT PŘI NAJETÍ MYŠÍ (HOVER) --- */
.grid-item:hover::before {
    background-color: rgba(0, 0, 0, 0.10);
}

.grid-item:hover .content {
    transform: scale(1.05);
}


/* --- Patička --- */
footer {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: #555;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 15px;
    border-radius: 15px;
    z-index: 10;
}

/* --- Responzivita pro mobilní zařízení (šířka do 768px) --- */
@media (max-width: 768px) {
    html, body {
        overflow: auto;
    }

    .grid-container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr 1fr 1fr;
        height: auto;
        min-height: 100vh;
    }

    .grid-item {
        min-height: 40vh;
    }

    .grid-item h2 {
        font-size: 2rem;
    }
    
    footer {
        position: relative;
        transform: none;
        left: auto;
        bottom: auto;
        text-align: center;
        width: 100%;
        padding: 15px 0;
        margin-top: -5px;
        border-radius: 0;
        background-color: #1e1e1e;
    }
}