/* Faces page specific styles */
.faces-page {
    display: block;
    padding: 40px 20px;
}

.page-title {
    text-align: center;
    font-size: 36px;
    margin-bottom: 40px;
    color: #fff;
    font-family: 'Georgia', serif;
}

/* Логотип коллекции */
.collection-intro {
    text-align: center;
    margin-bottom: 40px;
}

.intro-logo {
    max-width: 400px;
    height: auto;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.intro-logo:hover {
    transform: scale(1.05);
}

/* Подколлекции */
.subcollections {
    display: flex;
    flex-direction: row;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.subcollection-link {
    display: inline-block;
    text-decoration: none;
}

.subcollection-logo {
    height: 360px;
    width: auto;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.subcollection-logo:hover {
    transform: scale(1.05);
}

.subcollection-link:hover .subcollection-logo {
    transform: scale(1.05);
}

@media (max-width: 1024px) {
    .subcollection-logo {
        height: 280px;
    }
}

@media (max-width: 768px) {
    .subcollections {
        flex-direction: column;
    }
    
    .subcollection-logo {
        height: 200px;
    }
}

.faces-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    max-width: 1600px;
    margin: 0 auto;
}

.face-item {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.face-item:hover {
    transform: scale(1.05);
}

.face-item img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    display: block;
}

.face-item .face-name {
    text-align: center;
    padding: 10px 5px;
    font-size: 14px;
    color: #ccc;
    font-family: 'Georgia', serif;
}

/* Аудио-иконка под фигурой */
.face-item .audio-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 5px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.face-item .audio-icon:hover {
    transform: scale(1.1);
}

.face-item .speaker-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    margin-bottom: 4px;
}

.face-item .audio-label {
    font-size: 11px;
    color: #aaa;
    text-align: center;
    font-family: 'Georgia', serif;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    overflow-y: auto;
}

.modal-content {
    background-color: #111;
    margin: 2% auto;
    padding: 30px;
    width: 90%;
    max-width: 1200px;
    border-radius: 8px;
    position: relative;
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #ccc;
}

.modal-body {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.modal-image {
    flex: 0 0 350px;
}

.modal-image img {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    display: block;
}

/* Аудио-блок в модальном окне */
.modal-audio-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 5px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.modal-audio-block:hover {
    transform: scale(1.05);
}

.modal-speaker-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 8px;
}

.modal-audio-label {
    font-size: 15px;
    color: #ddd;
    text-align: center;
    font-family: 'Arial', sans-serif;
}

/* Встроенный аудиоплеер */
.modal-audio-inline {
    padding: 10px 5px;
    text-align: center;
    width: 100%;
}

.audio-inline-player {
    width: 100%;
    max-width: 280px;
    margin-top: 5px;
}

/* Видео-блок в модальном окне */
.modal-video-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 5px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.modal-video-block:hover {
    transform: scale(1.05);
}

.modal-video-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 8px;
}

.modal-video-label {
    font-size: 15px;
    color: #ddd;
    text-align: center;
    font-family: 'Arial', sans-serif;
}

/* Превью с двумя изображениями (Шахрияр и Шехерезада) */
.modal-previews-double {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    padding: 15px;
    background: #222;
    border-radius: 4px;
    justify-content: center;
    align-items: flex-start;
}

.modal-previews-double .preview-large {
    flex: 0 0 auto;
    text-align: center;
}

.modal-previews-double .preview-large img {
    width: 300px;
    height: 400px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
    margin-bottom: 10px;
}

.modal-previews-double .preview-small {
    flex: 0 0 auto;
    text-align: center;
    align-self: flex-end;
}

.modal-previews-double .preview-small img {
    width: 200px;
    height: 280px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
    margin-bottom: 10px;
}

.modal-previews-double .preview-caption {
    font-size: 12px;
    color: #aaa;
    font-family: 'Georgia', serif;
    text-align: center;
    display: block;
}

/* Большое превью (Шахрияр - вариант) */
.modal-single-large-preview {
    margin: 5px auto 5px auto;
    padding: 0;
    text-align: center;
    width: fit-content;
}

.modal-single-large-preview .variant-preview {
    display: inline-block;
    text-align: center;
}

.modal-single-large-preview .variant-preview img {
    width: 400px;
    height: 560px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
    margin: 0 auto 3px auto;
}

.modal-single-large-preview .preview-caption {
    font-size: 13px;
    color: #aaa;
    font-family: 'Georgia', serif;
    text-align: center;
    display: block;
    margin-top: 2px;
}

/* Биография на всю ширину для Шахрияр и Шехерезада */
.modal-body.full-width-text {
    display: flex;
    flex-direction: column;
}

.modal-body.full-width-text .modal-image {
    width: 100%;
    margin-bottom: 20px;
}

.modal-body.full-width-text .modal-info {
    width: 100%;
    margin-top: 0;
}

.modal-body.full-width-text .modal-biography {
    width: 100%;
    max-width: 100%;
}

.modal-body.full-width-text .modal-biography p {
    text-align: left;
    line-height: 1.8;
    width: 100%;
}
.modal-preview-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 5px;
    margin-top: 20px;
}

.modal-preview-block:hover {
    transform: none;
}

.modal-preview-img {
    width: 45% !important;
    max-width: 180px;
    object-fit: contain;
    border-radius: 0;
    margin-bottom: 6px;
    border: 1px solid #fff;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.modal-preview-img:hover {
    transform: scale(1.05);
}

/* Превью без рамки (для утраченных работ) */
.modal-preview-img.no-border {
    border: none !important;
}

/* Подпись под превью */
.modal-preview-caption {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 20px;
}

.modal-preview-caption p {
    font-size: 14px;
    color: #aaa;
    font-family: 'Georgia', serif;
    font-style: italic;
}

.modal-preview-label {
    font-size: 14px;
    color: #ccc;
    text-align: center;
    font-family: 'Georgia', serif;
}

.modal-info {
    flex: 1;
    min-width: 300px;
}

.modal-info h2 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #fff;
}

.modal-title {
    font-size: 16px;
    color: #aaa;
    margin-bottom: 10px;
    font-style: italic;
}

.modal-years {
    font-size: 14px;
    color: #888;
    margin-bottom: 20px;
}

.modal-author {
    margin-bottom: 15px;
    font-size: 14px;
}

.modal-topic {
    margin-top: 60px;
    margin-bottom: 15px;
    padding-top: 20px;
    border-top: 2px solid #444;
    font-size: 16px;
    line-height: 1.8;
}

.modal-author strong,
.modal-topic strong {
    color: #fff;
}

.modal-author span,
.modal-topic span {
    color: #ccc;
    white-space: pre-wrap;
}

.modal-biography {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.modal-biography p {
    font-size: 20px;
    line-height: 1.6;
    color: #ddd;
    margin: 0 0 15px 0;
}

.modal-biography p:last-child {
    margin-bottom: 0;
}

.modal-biography a.bio-link {
    color: #4a90d9;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-biography a.bio-link:hover {
    color: #7ab8ff;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 1400px) {
    .faces-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .faces-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .modal-body {
        flex-direction: column;
    }
    
    .modal-image {
        flex: none;
        width: 100%;
    }
}

@media (max-width: 600px) {
    .faces-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .face-item img {
        height: 150px;
    }
}

/* Модальное окно "Рождение коллекции" */
.modal-intro-content {
    max-width: 800px;
}

.modal-intro-body {
    padding: 20px;
}

/* Видео-блок в модальном окне "Рождение коллекции" */
.modal-intro-video {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 5px;
    cursor: pointer;
    transition: transform 0.3s ease;
    margin-bottom: 20px;
}

.modal-intro-video:hover {
    transform: scale(1.05);
}

.modal-intro-video-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 8px;
}

.modal-intro-video-label {
    font-size: 15px;
    color: #ddd;
    text-align: center;
    font-family: 'Arial', sans-serif;
}

.modal-intro-text {
    font-size: 16px;
    line-height: 1.8;
    color: #ddd;
    white-space: pre-wrap;
}

.intro-text {
    font-size: 16px;
    line-height: 1.8;
    color: #ddd;
    white-space: pre-wrap;
    text-align: center;
    margin: 20px auto;
    max-width: 800px;
    padding: 0 20px;
}

.intro-text a {
    color: #4a90d9;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.3s ease;
}

.intro-text a:hover {
    color: #7ab8ff;
    text-decoration: none;
}

/* Аудио-блок в модальном окне "Гром победы" */
.modal-intro-audio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.modal-intro-audio-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 10px;
}

.modal-intro-audio-label {
    font-size: 16px;
    color: #ccc;
    font-family: 'Georgia', serif;
    text-align: center;
}

.modal-intro-text a.bio-link {
    color: #4a90d9;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-intro-text a.bio-link:hover {
    color: #7ab8ff;
    text-decoration: none;
}

/* Модальное окно для превью (Пампата) */
.modal-preview-content {
    max-width: 900px;
}

.modal-preview-body {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.modal-preview-image {
    flex: 0 0 350px;
}

.modal-preview-image img {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    display: block;
    border: 1px solid #fff;
}

.modal-preview-image img.no-border {
    border: none !important;
}

.modal-preview-info {
    flex: 1;
    min-width: 300px;
}

.modal-preview-info h2 {
    font-size: 28px;
    margin-bottom: 5px;
    color: #fff;
    font-family: 'Georgia', serif;
}

.modal-preview-title {
    font-style: italic;
    color: #aaa;
    margin-bottom: 15px;
    font-size: 16px;
    font-family: 'Georgia', serif;
}

.modal-preview-info p {
    font-size: 15px;
    line-height: 1.8;
    color: #ddd;
    white-space: pre-wrap;
}

.modal-preview-info p:first-line {
    font-weight: bold;
    color: #aaa;
}

/* Модальное окно для аудио */
.modal-audio-content {
    max-width: 500px;
}

.modal-audio-body {
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.audio-modal-label {
    font-size: 18px;
    color: #fff;
    font-family: 'Georgia', serif;
    margin-bottom: 20px;
    text-align: center;
}

.audio-player {
    width: 100%;
    max-width: 400px;
}

/* Модальное окно для видео */
.modal-video-content {
    max-width: 800px;
}

.modal-video-body {
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.video-modal-label {
    font-size: 18px;
    color: #fff;
    font-family: 'Georgia', serif;
    margin-bottom: 20px;
    text-align: center;
}

.video-player {
    width: 100%;
    max-width: 640px;
}

/* Модальное окно "Портрет полка" */
.modal-portrait-content {
    max-width: 1000px;
    z-index: 1001;
}

.modal-portrait-body {
    padding: 30px;
}

.modal-portrait-title {
    font-size: 32px;
    margin-bottom: 30px;
    color: #fff;
    font-family: 'Georgia', serif;
    text-align: center;
}

.portrait-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Модальное окно "Путь русского офицера" */
.modal-officer-content {
    max-width: 1000px;
    z-index: 1001;
}

.modal-officer-body {
    padding: 30px;
}

.modal-officer-title {
    font-size: 32px;
    margin-bottom: 30px;
    color: #fff;
    font-family: 'Georgia', serif;
    text-align: center;
}

/* Модальные окна для таблиц */
.modal-tables-content {
    max-width: 1200px;
    background: #1a1a1a;
    border: 1px solid #333;
}

.modal-tables-body {
    padding: 20px;
}

.modal-tables-title {
    font-size: 24px;
    color: #fff;
    text-align: center;
    margin-bottom: 30px;
    font-family: 'Georgia', serif;
}

.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 10px;
}

.table-item {
    cursor: pointer;
    transition: transform 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
    border-radius: 4px;
}

.table-item:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.1);
}

.table-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* Модальное окно для просмотра одной таблицы */
.modal-table-image-content {
    max-width: 90%;
    background: #1a1a1a;
    border: 1px solid #333;
}

.modal-table-image-body {
    padding: 20px;
    text-align: center;
}

.modal-table-image-body img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

/* Ссылка на таблицы */
.tables-link {
    color: #4a9eff;
    text-decoration: underline;
    cursor: pointer;
}

.tables-link:hover {
    color: #6eb4ff;
}

/* Модальные окна для пьесы */
.modal-play-characters-content {
    max-width: 900px;
    background: #1a1a1a;
    border: 1px solid #333;
}

.modal-play-characters-body {
    padding: 20px;
}

.modal-play-characters-title {
    font-size: 24px;
    color: #fff;
    text-align: center;
    margin-bottom: 10px;
    font-family: 'Georgia', serif;
}

.modal-play-characters-author {
    font-size: 16px;
    color: #aaa;
    text-align: center;
    margin-bottom: 20px;
    font-family: 'Georgia', serif;
    font-style: italic;
}

.modal-play-characters-description {
    font-size: 15px;
    line-height: 1.8;
    color: #ddd;
    text-align: left;
    margin-bottom: 30px;
    font-family: 'Georgia', serif;
    white-space: pre-wrap;
}

.play-characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 20px;
    padding: 10px;
}

.play-character-item {
    cursor: pointer;
    transition: transform 0.3s ease;
    text-align: center;
}

.play-character-item:hover {
    transform: scale(1.05);
}

.play-character-item img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    display: block;
    margin-bottom: 8px;
}

.play-character-name {
    font-size: 14px;
    color: #ccc;
    font-family: 'Georgia', serif;
}

/* Модальное окно для просмотра персонажа */
.modal-play-character-content {
    max-width: 1200px;
    background: #1a1a1a;
    border: 1px solid #333;
}

.modal-play-character-body {
    display: flex;
    flex-direction: row;
    gap: 30px;
    padding: 20px;
    align-items: flex-start;
}

.modal-play-character-figure {
    flex: 0 0 250px;
    text-align: center;
}

.modal-play-character-figure img {
    max-width: 100%;
    max-height: 350px;
    object-fit: contain;
    display: block;
}

.modal-play-character-text {
    flex: 1;
    min-width: 300px;
}

.modal-play-character-text h2 {
    font-size: 24px;
    color: #fff;
    margin-bottom: 20px;
    font-family: 'Georgia', serif;
}

.modal-play-character-text p {
    font-size: 16px;
    line-height: 1.8;
    color: #ddd;
    white-space: pre-wrap;
}

.modal-play-character-sketch {
    flex: 0 0 250px;
    text-align: center;
}

.modal-play-character-sketch img {
    max-width: 100%;
    max-height: 350px;
    object-fit: contain;
    display: block;
}

/* Адаптивность для мобильных */
@media (max-width: 900px) {
    .modal-play-character-body {
        flex-direction: column;
    }
    
    .modal-play-character-figure,
    .modal-play-character-text,
    .modal-play-character-sketch {
        flex: none;
        width: 100%;
    }
    
    .modal-play-character-sketch {
        display: none !important;
    }
}

.officer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
