/* Основная структура */
.element {
    background-color: var(--white);
    display: flex;
    flex-direction: row;
    justify-content: center;
    width: 100%;
}

.div {
    background-color: var(--white);
    width: 1440px;
    max-width: 100%;
    height: auto;
    position: relative;
    margin: 0 auto;
}

/* Шапка */
.header {
    display: flex;
    width: 1280px;
    max-width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 0 100px;
    margin: 35px auto 0;
}

.theatre-by {
    font-family: "Montserrat-Bold", Helvetica;
    font-weight: 700;
    color: var(--black);
    font-size: 19px;
    letter-spacing: 0;
    line-height: normal;
}

.menu {
    display: flex;
    align-items: center;
    gap: 38px;
}

.menu-link {
    font-family: var(--mont-poit-font-family);
    font-weight: var(--mont-poit-font-weight);
    color: var(--gray);
    font-size: var(--mont-poit-font-size);
    letter-spacing: var(--mont-poit-letter-spacing);
    line-height: var(--mont-poit-line-height);
    font-style: var(--mont-poit-font-style);
}

.menu-link.active {
    font-family: "Montserrat-Regular", Helvetica;
    font-weight: 400;
    color: var(--black);
    font-size: 18px;
    letter-spacing: 0;
    line-height: normal;
}

/* Главный заголовок и изображение */
.overlap-group {
    display: flex;
    flex-direction: row;
    align-items: flex-start; /* Align items to the top */
    justify-content: flex-start; /* Align content to the left */
    width: 1280px;
    max-width: 100%;
    margin: 85px auto 0;
    padding: 0 100px;
    gap: 30px; /* Adds spacing between photo and text */
}

.mask {
    width: 411px;
    height: 458px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0; /* Prevent image from shrinking */
}

.main-title-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px; /* Reduced gap between name and birth date */
    width: auto; /* Allow text to take only needed width */
    max-width: 870px;
}

.main-title-text {
    font-family: var(--mont-h1-font-family);
    font-weight: var(--mont-h1-font-weight);
    color: var(--black);
    font-size: var(--mont-h1-font-size);
    line-height: var(--mont-h1-line-height);
    letter-spacing: var(--mont-h1-letter-spacing);
    font-style: var(--mont-h1-font-style);
}

.main-description {
    width: 585px;
    max-width: 100%;
    font-family: "Montserrat-Regular", Helvetica;
    font-weight: 400;
    color: var(--black);
    font-size: 24px;
    line-height: 34.8px;
    letter-spacing: 0;
}

/* Секция деталей актера */
.actor-details-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 50px;
    width: 1280px;
    max-width: 100%;
    margin: 50px auto 0;
    padding: 0 100px 50px;
}

.section-title {
    font-family: var(--mont-h2-font-family);
    font-weight: var(--mont-h2-font-weight);
    color: var(--black);
    font-size: var(--mont-h2-font-size);
    text-align: center;
    line-height: var(--mont-h2-line-height);
    letter-spacing: var(--mont-h2-letter-spacing);
    font-style: var(--mont-h2-font-style);
    margin-bottom: 20px; /* Spacing below subtitles */
}

.roles-section {
    width: 100%;
    max-width: 800px;
}

.roles-list {
    list-style-type: disc;
    padding-left: 20px;
    font-family: "Montserrat-Regular", Helvetica;
    font-size: 16px;
    color: var(--black);
    line-height: 1.5;
}

.no-roles {
    font-family: var(--mont-regul-font-family);
    color: var(--gray);
    font-size: var(--mont-regul-font-size);
    line-height: var(--mont-regul-line-height);
    letter-spacing: var(--mont-regul-letter-spacing);
    text-align: center;
}

.spectacle-photos-section {
    width: 100%;
    max-width: 800px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); /* Increased min width for larger images */
    gap: 20px;
}

.photo-card {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.photo-image {
    width: 100%;
    height: 180px; /* Increased height for larger spectacle photos */
    object-fit: cover;
}

/* Lightbox styles */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 10px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--white);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}

.lightbox-close:hover {
    color: var(--gray);
}

/* Футер */
.footer {
    width: 100%;
    margin-top: auto;
    background-color: transparent;
    border-top: 2px solid var(--light-gray);
    padding: 0;
    display: flex;
    align-items: flex-end;
}

.footer-content-wrapper {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: clamp(1rem, 2vw, 1.25rem);
    width: 100%;
    flex-wrap: wrap;
    padding: clamp(1rem, 2vw, 1.25rem) clamp(4.75rem, 7.5vw, 5.5625rem);
}

.footer-left-column {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 28.9375rem;
    align-items: flex-start;
    gap: clamp(0.75rem, 1.5vw, 1.25rem);
    flex-grow: 1;
}

.footer-logo {
    align-self: stretch;
    font-family: "Montserrat-Bold", Helvetica;
    font-weight: 700;
    color: var(--black);
    font-size: var(--num-font-size);
    letter-spacing: 0;
    line-height: normal;
    word-break: break-word;
}

.footer-nav {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 2vw, 2.9375rem);
    width: 100%;
    flex-wrap: wrap;
}

.footer-right-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(0.75rem, 1.5vw, 1.25rem);
}

.social-icons-group {
    width: auto;
    height: 1.625rem;
    display: flex;
    gap: clamp(0.75rem, 1.5vw, 1.5rem);
    align-items: center;
    justify-content: flex-start;
}

.VK, .telegram, .you-tube {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
}

.you-tube {
    width: 1.625rem;
    height: 1.625rem;
}

.copyright-text {
    font-family: var(--mont-poit-font-family);
    font-weight: var(--mont-poit-font-weight);
    color: var(--gray);
    font-size: var(--mont-poit-font-size);
    letter-spacing: var(--mont-poit-letter-spacing);
    line-height: var(--mont-poit-line-height);
    white-space: nowrap;
}

/* Медиа-запросы */
@media (max-width: 1024px) {
    .header, .overlap-group, .actor-details-section {
        padding: 0 60px;
    }

    .footer-content-wrapper {
        padding: clamp(1rem, 2vw, 1.25rem) clamp(4.75rem, 7.5vw, 5.5625rem);
    }

    .mask {
        width: 300px;
        height: 350px;
    }

    .main-title-section {
        width: auto;
    }

    .main-description {
        width: 100%;
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Adjusted for smaller screens */
    }

    .photo-image {
        height: 150px; /* Adjusted height for smaller screens */
    }

    .section-title {
        margin-bottom: 15px; /* Adjusted spacing for smaller screens */
    }

    .lightbox-close {
        top: 15px;
        right: 20px;
        font-size: 36px;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
        padding: 0 40px;
    }

    .menu {
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .overlap-group {
        flex-direction: column;
        align-items: center;
        margin: 150px auto 0;
        padding: 0 40px;
        gap: 20px;
    }

    .mask {
        width: 250px;
        height: 300px;
    }

    .main-title-section {
        align-items: center;
        text-align: center;
        width: 100%;
    }

    .main-description {
        font-size: 20px;
        line-height: 28px;
    }

    .actor-details-section {
        margin: 30px auto 0;
        padding: 0 40px 30px;
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); /* Adjusted for smaller screens */
    }

    .photo-image {
        height: 120px; /* Adjusted height for smaller screens */
    }

    .section-title {
        margin-bottom: 12px; /* Adjusted spacing for smaller screens */
    }

    .footer-content-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        padding: clamp(1rem, 2vw, 1.25rem) clamp(4.75rem, 7.5vw, 5.5625rem);
    }

    .footer-left-column, .footer-right-column {
        align-items: center;
    }

    .footer-left-column {
        width: 100%;
    }

    .lightbox-close {
        top: 10px;
        right: 15px;
        font-size: 32px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0 35px;
    }

    .theatre-by {
        font-size: 16px;
    }

    .menu-link {
        font-size: 14px;
    }

    .menu-link.active {
        font-size: 16px;
    }

    .overlap-group {
        margin: 100px auto 0;
        padding: 0 35px;
    }

    .mask {
        width: 200px;
        height: 250px;
    }

    .main-title-text {
        font-size: 24px;
    }

    .main-description {
        font-size: 16px;
        line-height: 22px;
    }

    .actor-details-section {
        margin: 20px auto 0;
        padding: 0 35px 20px;
        gap: 30px;
    }

    .section-title {
        font-size: 20px;
        margin-bottom: 10px; /* Adjusted spacing for smaller screens */
    }

    .roles-list {
        font-size: 14px;
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); /* Adjusted for smaller screens */
    }

    .photo-image {
        height: 100px; /* Adjusted height for smaller screens */
    }

    .footer-content-wrapper {
        gap: 15px;
        padding: clamp(1rem, 2vw, 1.25rem) clamp(4.75rem, 7.5vw, 5.5625rem);
    }

    .footer-nav {
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .footer-logo {
        font-size: 24px;
    }

    .copyright-text {
        font-size: 12px;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 28px;
    }
}