/*
    nekradni mi moj css
    nebud lenivy a urob si vlastny
    ODCHOOOOD
*/

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 130%;
    /*min-width: 500px;*/
    width: 100%;
    overflow-x: hidden;
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: rgba(204, 204, 204, 0.5);
}

header {
    grid-area: header;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;

    background-color: rgb(4, 157, 168);
    color: whitesmoke;
}

nav {
    margin: 5px auto;
    background-color: rgb(204, 204, 204);
    display: flex;
    padding: 15px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 4rem;
    border-radius: 250px;
    
    a {
        color: white;
        text-decoration: none;
        border-radius: 50px;
        padding: 10px;
        background-color: rgb(168, 168, 168);
        font-weight: bold;
        transition: 0.3s ease;
        &:hover {
            color: rgb(1, 118, 153);
            font-size: 1.25rem;
            rotate: -5deg;
        }
    }
}

main {
    grid-area: main;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

section {
    display: flex;
    flex-direction: column;
    align-items: center;

    margin: 5px 10px;
    min-width: 55vw;
    max-width: 1000px;
    width: calc(100% - 20px);
    border-radius: 10px;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

.rozvrh {
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    max-width: clamp(70%, 75%, 95%);
    padding: 5px;
    overflow: hidden;
    border-radius: 5px;
    border-collapse: collapse;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);

    & tr:nth-child(2n) {
        background-color: rgba(0, 0, 0, 0.125);
    }

    & td { 
        padding: 2px;
        border: 1px solid rgba(0, 0, 0, 0.1);
        text-align: center;
    }

    & thead th {
        background-color: rgb(4, 157, 168);
        color: white;
    }

    & th {
        padding: 2px;
    }
}

article {
    margin-bottom: 30px;
    border-bottom: 1px solid #f0f0f0;
    display: grid;
    grid-template-columns: 4fr 8% 5fr;
    grid-template-areas:
    "nadpis nadpis nadpis"
    "obsah . obrazky";

    width: 90%;
    padding: 10px;
    box-sizing: border-box;
    align-items: start;

    &:last-of-type {
        border-bottom: none;
    }

    &:not(:has(.obrazky)) {
        grid-template-columns: 1fr;
        grid-template-areas:
        "nadpis"
        "obsah";
    }

    &:not(:has(.obsah)) {
        grid-template-columns: 1fr;
        grid-template-areas:
        "nadpis"
        "obrazky";
    }
 
    & .nadpis {
        grid-area: nadpis;
    }

    & .obsah {
        width: 100%;
        grid-area: obsah;
        justify-content: space-around;
        align-items: flex-start;
    }
    
    & .obrazky {
        grid-area: obrazky;
        gap: 1rem;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        padding-left: 10px;
        flex-shrink: 1;

        & figure {
            margin: 0;
            text-align: center;
        }

        & img {
            max-width: 100%;
            height: auto;
        }
        
        & video {
            max-width: 100%;
        }

        & a:hover {
            transition: 0.3s ease;
        }
        
        & figcaption {
            font-size: 0.7rem;
            color: #666;
            margin-top: 5px;
        }
    }
}

.uvod {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    grid-template-areas:
        "obsah obrazky"
        "citat citat";
    gap: 30px;
    width: 90%;
    align-items: center;

    .obsah {
        grid-area: obsah;
        font-size: 1.15rem;
        line-height: 1.6;
        color: #333;
    }

    .obrazky {
        grid-area: obrazky;
        display: flex;
        justify-content: center;
        max-width: 100%;
    }

    
    .fotka {
        margin: 0;
        position: relative;
        display: inline-block;
        max-width: 100%;

        img {
            max-width: 100%;
            width: 260px;
            height: auto;
            border-radius: 20px;
            box-shadow: 0 10px 20px rgba(4, 157, 168, 0.15);
            transition: transform 0.4s ease, box-shadow 0.4s ease;
            border: 3px solid white; /* Biely okraj pre efekt fotky */
        }
    }

    .citat {
        grid-area: citat;
        margin: 20px 0 10px 0;
        padding: 20px;
        background: linear-gradient(135deg, rgba(4, 157, 168, 0.05) 0%, rgba(4, 157, 168, 0.01) 100%);
        border-left: 5px solid rgb(4, 157, 168);
        border-radius: 0 15px 15px 0;
        font-style: italic;
        font-size: 1.2rem;
        color: #2c3e50;
        font-weight: 500;
        text-align: left;
        box-shadow: inset 0 0 10px rgba(0,0,0,0.02);
    }
}


.praca-git {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    

    & img {
        width: 100%;
        height: auto;
        border-radius: 10px;
        
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
        transition: transform 0.3s ease, box-shadow 0.3s ease;

        &:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
        }
    }
}

/* HRY A KNIHY */
.cover {
    border-radius: 12px;
    padding: 25px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e0e0e0;

    &:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    }
}

.karticky {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;

    & .karticka {
        display: flex;
        flex-direction: column;
        align-items: flex-start /* center */;
        
        background-color: #ffffff;
        border: 1px solid #e0e0e0;
        border-radius: 12px;
        padding: 25px;
        flex: 1 1 300px; 
        max-width: 400px;
        min-height: 200px;
        box-sizing: border-box;
        
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
        transition: transform 0.3s ease, box-shadow 0.3s ease;

        &:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
        }

        & h3 {
            margin-top: 0;
            color: #2c3e50;
            font-size: 1.3rem;
        }

        & ul {
            margin: 10px 0 0 0;
            padding-left: 20px;
            color: #555555;
            
            & li {
                margin-bottom: 5px;
            }
        }
    }
}

.file-list {
    list-style: none;
    padding: 0;
    & li {
        margin-bottom: 8px;
        padding-left: 20px;
        position: relative;
    }
}

a {
    text-decoration: none;
    color: rgb(4, 157, 168);
    transition: 0.3s ease;

    &:not(:has(.cover)) {
        &:not(:has(img)) {
            &:hover {
                font-size: 1.2rem;
                display: inline-block;
                font-weight: bold;
            }
        }
    }
}

footer {
    width: 100%;
    padding: 3px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: auto;
    box-sizing: border-box;

    & .socials {
        display: flex;
        flex-direction: row;
        gap: 15px;
        align-items: center;
    }

    & .social {
        transition: 0.3s ease;
        &:hover {
            rotate: -15deg;
        }
    }
}

/* Zobrazenie na mobile */
@media screen and (max-width: 850px) {

    body {
        font-size: 1.1rem;
    }

    a:hover {
        font-size: 1.2rem;
    }

    nav {
        margin-left: auto;
        margin-right: auto;
        gap: 1rem;
        border-radius: 250px;
        padding: 25px;
        justify-content: center;

        & a {
            padding: 15px 25px;
            border-radius: 50px;
        }
    }
    
    section {
        min-width: 95%;
    }
    
    article {
        grid-template-columns: 1fr; /* Na malom okne - všetko pod seba */
        grid-template-areas: 
            "nadpis"
            "obsah"
            "obrazky";
        width: 100%;
        padding: 15px;
        box-sizing: border-box;
        
        & .obrazky {
            justify-content: center;
            flex-direction: row;
            flex-wrap: wrap;
        }
    }

    .uvod {
        grid-template-columns: 1fr;
        grid-template-areas:
            "obrazky"
            "obsah"
            "citat";
        text-align: center;

        .citat {
            border-left: none;
            border-top: 4px solid rgb(4, 157, 168);
            border-radius: 0 0 15px 15px;
            text-align: center;
        }
    }

    .rozvrh {
        width: 100%;
    }
}