body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'Alata', sans-serif;
    overflow-x: hidden;
    background-image: url(/imghome/tlo.png);
    background-size: contain;
}

header {
    background-color: #8cbadc; 
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    height: 10vh;
    box-shadow: 0 8px 6px -6px #5788ab;
    z-index: 10;
    font-size: 1.2rem;
}

#logo-container {
    display: flex;
    align-items: center;
}

#logo {
    width: 50px;
    margin: 0 20px;
}

nav {
    flex-grow: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 0;
    justify-content: flex-start; 
}

nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

nav ul li a {
    text-decoration: none;
    color: white;
    font-weight: bold;
    transition: all 0.3s ease;
    padding: 10px 20px; 
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}

nav ul li a:hover, nav ul li a:focus {
    background-color: rgba(255, 255, 255, 0.2); 
    border-radius: 50px; 
}

#contact-socials {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#contact-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

#contact-info p, 
#contact-info a {
    align-items: center;
    margin: 0; 
    border-radius: 50px;
}

#mail {
    background-color: #ffc759;
    border: 1px solid #ffc759;
    padding: 10px 30px;
    border-radius: 50px;
    transition: background-color 0.3s ease;
}

#mail:hover {
    background-color: white;
    border: 1px solid white;
    color: #ffc759;
    text-shadow: none;
}

#contact-info p {
    margin: 0 15px;
}

#contact-info i {
    margin-right: 8px; 
}

#contact-info span {
    display: inline;
}

#contact-info a {
    text-decoration: none; 
    color: inherit;
    padding: 0; 
}

nav ul {
    list-style-type: none;
    padding: 0;
}

nav ul li {
    position: relative;
    display: inline-block;
}

.school-section {
    margin: 20px 0;
}

.school-section h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    margin-top: 40px;
    font-size: 2rem;
}

.subjects-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    width: 80%;
    margin: auto
}

.subject-link {
    position: relative;
    display: inline-block;
    width: 250px; 
    height: 150px;
    margin: 10px; 
    overflow: hidden; 
    border-radius: 15px; 
}

.subject-image {
    width: 100%;
    height: 100%; 
    display: block; 
    border-radius: 15px; 
    object-fit: cover;
    object-position: center;
}

.subject-link span {
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    width: 100%; 
    text-align: center; 
    color: white; 
    pointer-events: none;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
    font-size: 1.25rem
}

footer {
    text-align: center;
    padding: 20px;
    color: white; 
}

footer a {
    color: white
}

img {
    transition: transform 0.3s ease-in-out; 
}

img:hover {
    transform: scale(1.1); 
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px); /* Dodaje lekkie przesunięcie, by uzyskać efekt "pojawiania się" */
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.subject-link {
  opacity: 0; /* Ustawia początkową przezroczystość elementów na 0 */
  animation: fadeIn 1s ease forwards; /* Używa animacji fadeIn z czasem trwania 1s */
}

/* Ustawianie różnych opóźnień dla każdej karty, aby pojawiły się kolejno */
.subject-link:nth-child(1) { animation-delay: 0.2s; }
.subject-link:nth-child(2) { animation-delay: 0.4s; }
.subject-link:nth-child(3) { animation-delay: 0.6s; }
.subject-link:nth-child(4) { animation-delay: 0.8s; }
.subject-link:nth-child(5) { animation-delay: 1s; }
.subject-link:nth-child(6) { animation-delay: 1.2s; }
.subject-link:nth-child(7) { animation-delay: 1.4s; }
.subject-link:nth-child(8) { animation-delay: 1.6s; }

@media (max-width: 768px) {
    * {
        margin: 0;
        padding: 0;
    }
}


@media (max-width: 930px) {
    header {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 20px;
        height: auto
    }

    #logo-container {
        margin-bottom: 10px; 
    }

    #contact-socials {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 20px;
    }

    nav {
        order: 2; 
        margin: auto
    }

    nav ul {
        display: flex;
        flex-wrap: wrap; 
        justify-content: center;
        padding: 0;
        margin: 0;
        list-style-type: none;
    }

    nav ul li {
        margin: 5px; 
        font-size: 1.25rem;
    }

    #contact-info {
        display: flex;
        flex-wrap: wrap; 
        justify-content: center;
        gap: 10px; 
        font-size: 0.8rem;
        margin: auto;
    }
}

@media (min-width: 930px) and (max-width: 1600px) {  
  header {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: auto;
    }

    #logo-container {
        flex-basis: auto; 
        justify-content: flex-start; 
        margin-top: 10px;
    }

    nav {
        width: 100%;
        justify-content: center;
        padding: 0;
        margin-top: 20px;
    }

    nav ul {
        justify-content: center;
    }

    nav ul li {
        padding: 0 10px;
        font-size: 1.3rem;
        text-align: 
    }

    #contact-socials {
        width: 100%; 
        justify-content: space-evenly; 
        flex-direction: row;
        margin-top: 20px; 
    }

    #contact-info {
        justify-content: center;
    }

    #contact-info p, 
    #contact-info a {
        display: block; 
    }
}
    
@media (max-width: 930px) {
    header {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 20px;
        height: auto
    }

    #logo-container {
        margin-bottom: 10px; 
    }

    #contact-socials {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 20px;
    }

    nav {
        order: 2; 
        margin: auto
    }

    nav ul {
        display: flex;
        flex-wrap: wrap; 
        justify-content: center;
        padding: 0;
        margin: 0;
        list-style-type: none;
    }

    nav ul li {
        margin: 5px; 
        font-size: 1.25rem;
    }

    #contact-info {
        display: flex;
        flex-wrap: wrap; 
        justify-content: center;
        gap: 10px; 
        font-size: 0.8rem;
        margin: auto;
    }
}

@media (min-width: 930px) and (max-width: 1600px) {  
  header {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: auto;
    }

    #logo-container {
        flex-basis: auto; 
        justify-content: flex-start; 
        margin-top: 10px;
    }

    nav {
        width: 100%;
        justify-content: center;
        padding: 0;
        margin-top: 20px;
    }

    nav ul {
        justify-content: center;
    }

    nav ul li {
        padding: 0 10px;
        font-size: 1.3rem;
        text-align: 
    }

    #contact-socials {
        width: 100%; 
        justify-content: space-evenly; 
        flex-direction: row;
        margin-top: 20px; 
    }

    #contact-info {
        justify-content: center;
    }

    #contact-info p, 
    #contact-info a {
        display: block; 
    }
}