/* Base styles for large screens */
section {
    width: 100vw;
    min-height: calc(100vh - 97px); /* Changed to min-height to ensure it takes at least the full viewport height */
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
    overflow-x: hidden;
}

.background {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #e4e4e4;
    width: 100%;
    min-height: calc(100vh - 97px); /* Changed to min-height to ensure it takes at least the full viewport height */
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow-x: hidden; /* Prevent horizontal scrolling */
    overflow-y: hidden; /* Prevent horizontal scrolling */
}

@media (max-width: 768px) {
    section {
        min-height: calc(100vh - 72px);
    }
}
.overlay .restricted {
    max-width: 900px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background-color: #eeeeee;
    color: rgb(82, 82, 82);
    z-index: 1;
    box-sizing: border-box;
    gap: 32px;
}

.overlay {
    max-width: 900px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background-color: #eeeeee;
    color: rgb(82, 82, 82);
    padding: 32px;
    margin: 32px;
    z-index: 1;
    box-sizing: border-box;
    gap: 32px;
}

.project-slider {
    max-width: 900px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    background-color: #eeeeee;
    color: rgb(82, 82, 82);
    z-index: 1;
    box-sizing: border-box;
    gap: 28px;
    position: relative;
    width: 100%;
    max-width: 900px;
    min-height: 0;
}

.project-slider .project {
    display: none;
}

.project-slider .project.active {
    display: flex;
}

.project-nav-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.project-dots {
    display: flex;
    gap: 8px;
}

.project-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #bbb;
    display: inline-block;
    transition: background 0.2s, transform 0.2s;
    cursor: pointer;
}

.project-dot.active {
    background: #525252;
    transform: scale(1.3);
}

.project-nav {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    transform: none;
    background: none; /* brak tła */
    border: none;
    font-size: 2rem;
    padding: 8px 8px;
    cursor: pointer;
    z-index: 2;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.project-nav:hover {
    opacity: 1;
}

.project-nav.prev {
    left: 0;
}

.project-nav.next {
    right: 0;
}

.title {
    text-align: center;
}

.title h3 {
    margin: 0px
}

.project {
    display: flex;
    flex-direction: row;
    align-items: flex-start; /* zmiana ze stretch na flex-start */
    justify-content: center; /* Wyśrodkuj elementy w poziomie */
    gap: 32px;
}

.project .images,
.project .text {
    flex: 1 1 0;
    width: 50%;
    box-sizing: border-box;
    min-width: 0;
    min-height: 0;
}

.project .text {
    display: flex;
    flex-direction: column;
    align-items: center;      /* wyśrodkuj w poziomie */
    justify-content: center;  /* wyśrodkuj w pionie */
    text-align: center;
    word-wrap: break-word;
    line-height: 1.5;
    /* height: 100%;  usuń tę linię */
}

.overlay img {
    max-width: 100%; /* Make image responsive */

}

h4 {
    margin: 0;
    font-size: 15px;
}

.images {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.text {
    line-height: 1.5;
    text-align: center;
    word-wrap: break-word;
    background-color: rgb(245, 245, 245);
    padding: 28px;
    /* height: 100%;  usuń tę linię */
    gap: 14px;  
}

.text p {
    font-size: 14px;
    margin:0;
    font-weight: 600;
}

hr {
    width: 100%;
    margin: 0;
}

.description {
    text-align: left;
    margin: 0;
    padding: 0;
    color: #444;
    width: 100%;
    max-width: 100%;
}

.description strong {
    font-weight: 600;
}

img {
    cursor: pointer; /* Change cursor to pointing finger icon */
}

/* Upewnij się, że obrazek nie przekracza kontenera */
.project .images img {
    width: 100%;
    height: auto; /* zmiana z 100% na auto */
    object-fit: contain; /* zmiana z cover na contain */
    max-height: 600px;
    display: block;
}

/* Modal styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Black with opacity */
}

.modal img {
    cursor: default; /* Keep default cursor for images inside the modal */
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh; /* Ensure the image does not exceed the viewport height */
    object-fit: contain; /* Ensure the image scales properly */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Center the image */
    transition: transform 0.2s cubic-bezier(.4,2,.6,1), box-shadow 0.2s;
    cursor: zoom-in;
    /* Usuwamy object-fit: contain, bo transform przejmuje kontrolę */
}

.modal-content:active,
.modal-content.grabbing {
    cursor: grabbing !important;
}

@keyframes zoom {
    from {transform: scale(0)}
    to {transform: scale(1)}
}

.modal-caption {
    display: none;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

#password-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    width: 100%;
}

#password-form label {
    color: #525252;
}

#password-form input {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 14px;
    padding: 10px;
    border: 1px solid #cccccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.restricted-password-input {
    width: 230px !important;
    min-width: unset !important;
    max-width: 100%;
    box-sizing: border-box;
}

@media screen and (max-width: 768px) {
    #password-form input {
        min-width: 200px;
    }
    
}

#password-form input:focus {
    border: 1px solid #999999;
    outline: none;
}

#password-form input::placeholder {
    color: #999999;
    opacity: 1;
}

#password-form button {
    padding: 10px 20px;
    background-color: #525252;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#password-form button:hover {
    background-color: rgb(32, 32, 32);
}


@media (max-width: 768px) {
    .project {
        flex-direction: column;
        gap: 16px;
        max-height: none;
    }
    .project .images,
    .project .text {
        width: 100%;
        min-width: 0;
        min-height: unset;
    }
    .project .images img {
        width: 100%;
        height: auto;
        max-height: 70vw;
        object-fit: contain;
    }
    .overlay {
        max-width: 100vw;
        margin: 32px;
        padding: 32px;
    }
}

.modal-nav-wrapper {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none; /* pozwala kliknąć tylko przyciski, nie cały wrapper */
    z-index: 1101;
    transform: translateY(-50%);
}

.modal-nav {
    background: none; /* brak tła */
    border: none;
    color: #f1f1f1;
    font-size: 2.5rem;
    padding: 12px 20px;
    cursor: pointer;
    transition: opacity 0.2s;
    pointer-events: auto;
}

.modal-nav:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .modal-nav-wrapper {
        display: none;
    }
}


