/* ===== БАЗОВЫЕ НАСТРОЙКИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Georgia', serif;
}

body {
    background-color: #f4f1ea;
    color: #2c2c2c;
    line-height: 1.6;
}
/* ===== ШАПКА ===== */
.header {
    text-align: center;
    padding: 60px 20px;
    background-color: #2c3e50;
    color: #fff;
}
/* Грантовая надпись */
.grant-info {
    font-size: 1.1rem;         /* Было 0.85rem — увеличили */
    font-style: italic;
    line-height: 1.5;
    max-width: 900px;          /* Чуть шире, чтобы влезало в 2-3 строки */
    margin: 0 auto 30px auto;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);  /* Линия чуть заметнее */
    opacity: 0.95;
    font-weight: 400;
}
.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    font-style: italic;
    font-size: 1.2rem;
    opacity: 0.8;
}

/* ===== СТАТЬЯ ===== */
.article-section {
    max-width: 900px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-radius: 8px;
}

.article-section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    border-bottom: 2px solid #dcdcdc;
    padding-bottom: 10px;
}

/* ===== ГАЛЕРЕЯ ===== */
.gallery-section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.gallery-section h2 {
    text-align: center;
    margin-bottom: 10px;
    color: #2c3e50;
}

.gallery-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-style: italic;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* Карточка работы */
.card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background-color: #eaeaea;
}

.card-body {
    padding: 15px;
    text-align: center;
}

.card-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.card-hint {
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
}

/* ===== МОДАЛЬНОЕ ОКНО ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    max-width: 1600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #c0392b;
}

#modalTitle {
    text-align: center;
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 1.4rem;
    line-height: 1.3;
}

/* ===== СЛАЙДЕР "ДО/ПОСЛЕ" ===== */
.slider-container {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    overflow: hidden;
    user-select: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    aspect-ratio: 16 / 10; /* Соотношение сторон */
    background: #f0f0f0;
}

.slider-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Вписываем картинку целиком */
    display: block;
    pointer-events: none;
}

.before-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%; /* Начальное положение ползунка - 50% */
    height: 100%;
    overflow: hidden;
    z-index: 2;
    border-right: 2px solid #fff;
}

.before-wrapper .slider-img {
    /* Важно: картинка "до" должна быть той же ширины, что и контейнер,
       чтобы она не сжималась при обрезке */
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
}

/* Ползунок */
.slider-handle {
    position: absolute;
    top: 0;
    left: 50%;
    height: 100%;
    width: 40px;
    transform: translateX(-50%);
    z-index: 3;
    cursor: ew-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* События ловим на контейнере */
}

.slider-circle {
    background: #fff;
    color: #2c3e50;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    border: 2px solid #2c3e50;
    pointer-events: auto;
}

/* Подписи под слайдером */
.slider-labels {
    display: flex;
    justify-content: space-between;
    max-width: 1400px;
    margin: 10px auto 0;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}
/* ===== ТЕКСТ СТАТЬИ ===== */
/* ===== ТЕКСТ СТАТЬИ ===== */
.article-text {
    font-size: 1.05rem;
    line-height: 1.85;
    color: #333;
}

.article-text p {
    margin-bottom: 22px;
    text-align: justify;
}

/* Буквица — большая первая буква */
.article-text .lead {
    font-size: 1.15rem;
    color: #2c3e50;
    margin-bottom: 30px;
    font-style: italic;
}

.article-text .lead::first-letter {
    font-size: 4rem;
    font-weight: bold;
    color: #2c3e50;
    float: left;
    line-height: 0.9;
    padding: 8px 15px 0 0;
    font-style: normal;
}

/* Подзаголовки */
.article-text h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin: 40px 0 20px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
    position: relative;
}

/* Акцентная полоска перед подзаголовком */
.article-text h3::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #c0392b;
    border-radius: 50%;
    margin-right: 12px;
    vertical-align: middle;
}

/* Выделенный блок (для факта про реставрацию) */
.article-text .highlight-box {
    background: #f9f6f0;
    border-left: 5px solid #c0392b;
    padding: 20px 25px;
    margin: 30px 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #444;
}

.article-text .highlight-box strong {
    color: #2c3e50;
    font-style: normal;
}

/* Список с маркерами */
.article-text ul {
    list-style: none;
    margin: 20px 0 25px 10px;
    padding: 0;
}

.article-text ul li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 12px;
}

.article-text ul li::before {
    content: "✦";
    position: absolute;
    left: 0;
    color: #c0392b;
    font-size: 1.1rem;
}

/* ===== АДАПТИВ ДЛЯ ТЕЛЕФОНОВ ===== */
@media (max-width: 600px) {
    .header h1 { font-size: 1.8rem; }
    .modal-content { padding: 15px; }
    .slider-container { aspect-ratio: 4 / 3; }
    .slider-circle { width: 30px; height: 30px; font-size: 1rem; }
}
/* ===== КАРТОЧКИ ХУДОЖНИКОВ ===== */
.artist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin: 30px 0 40px 0;
}

.artist-card {
    background: #f9f6f0;
    border-left: 4px solid #2c3e50;
    padding: 20px 22px;
    border-radius: 0 8px 8px 0;
    transition: box-shadow 0.3s ease;
}

.artist-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.artist-card h4 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.artist-years {
    color: #c0392b;
    font-style: italic;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.artist-card p {
    font-size: 0.95rem;
    line-height: 1.7;
    text-align: justify;
    margin-bottom: 0;
}
/* ===== ПОДВАЛ ===== */
.footer {
    text-align: center;
    padding: 30px;
    background-color: #2c3e50;
    color: #fff;
    margin-top: 60px;
}
/*===== МОДАЛЬНОЕ ОКНО ФОТОГАЛЕРЕИ (23 фото) ===== */
#photoModal .modal-content {
    background: #fff;
    padding: 20px 25px 15px 25px;
    border-radius: 10px;
    max-width: 1100px;
    width: 100%;
    max-height: 95vh;
    overflow-y: auto;
    position: relative;
}

#photoModalTitle {
    font-size: 1.3rem;
    color: #c0392b;
    margin-bottom: 8px;
    font-style: normal;
}

.simple-image-wrapper {
    flex: 1;                   /* Занимает всё свободное место */
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    overflow: hidden;
}

.simple-image-wrapper img {
    max-width: 100%;
    max-height: 100%;          /* Фото не выходит за пределы окна */
    width: auto;
    height: auto;
    object-fit: contain;       /* Вписывается целиком */
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
/* ===== ИНФОРМАЦИЯ О РАБОТЕ В МОДАЛЬНОМ ОКНЕ ===== */
.photo-info {
    text-align: center;
    margin-bottom: 15px;
    padding: 0 40px;
}

#photoModalTitle {
    font-size: 1.4rem;
    color: #c0392b;
    margin-bottom: 8px;
    font-style: italic;
}

#photoModalAuthor {
    font-size: 1rem;
    color: #2c3e50;
    margin-bottom: 5px;
    font-weight: bold;
}

#photoModalInfo {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

.card-author {
    font-size: 0.9rem;
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 5px;
    line-height: 1.3;
}

.card-hint {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
    line-height: 1.3;
}

/* ===== НАВИГАЦИЯ СТРЕЛКАМИ ===== */
.simple-image-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.nav-arrow {
    background: rgba(44, 62, 80, 0.85);
    color: #fff;
    border: none;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding-bottom: 6px;
    font-family: 'Georgia', serif;
}

.nav-arrow:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.nav-arrow:active {
    transform: scale(0.95);
}

.photo-counter {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

@media (max-width: 600px) {
    .simple-image-wrapper {
        padding: 0;
    }

    .nav-arrow {
        display: none;
    }

    .photo-info {
        padding: 0 15px;
    }

    #photoModalTitle {
        font-size: 1.1rem;
    }
}
/* Подпись под карточкой реставрации — техника */
.card-technique {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 8px;
    line-height: 1.3;
}

/* Информация в модальном окне слайдера */
.modal-info {
    text-align: center;
    color: #2c3e50;
    font-size: 0.9rem;
    margin-top: 5px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.modal-info .modal-technique {
    color: #888;
    font-size: 0.85rem;
    font-style: italic;
}
/* ===== БЛОК С АДРЕСОМ И КАРТОЙ ===== */
.contacts-section {
    max-width: 1200px;
    margin: 60px auto 40px;
    padding: 0 20px;
}

.contacts-section h2 {
    text-align: center;
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 1.8rem;
}

.contacts-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 35px;
    font-style: italic;
    font-size: 1.1rem;
}

.contacts-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 30px;
    align-items: start;
}

.contacts-info {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.contact-item {
    margin-bottom: 25px;
}

.contact-item:last-child {
    margin-bottom: 0;
}

.contact-item h3 {
    font-size: 1.05rem;
    color: #c0392b;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e0e0e0;
}

.contact-item p {
    font-size: 0.95rem;
    color: #333;
    line-height: 1.7;
    font-feature-settings: "lnum" 1, "tnum" 1;
    font-variant-numeric: lining-nums tabular-nums;
}

.contact-item a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 700;
    font-feature-settings: "lnum" 1, "tnum" 1;
    font-variant-numeric: lining-nums tabular-nums;
    transition: color 0.2s;
}

.contact-item a:hover {
    color: #c0392b;
    text-decoration: underline;
}

.contacts-map {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    background: #f0f0f0;
    min-height: 400px;
}

.contacts-map > script,
.contacts-map > div,
.contacts-map > ymaps {
    display: block;
    width: 100%;
    height: 400px;
}

/* Адаптив */
@media (max-width: 900px) {
    .contacts-wrapper {
        grid-template-columns: 1fr;
    }
    .contacts-section h2 {
        font-size: 1.5rem;
    }
    .contacts-info {
        padding: 20px;
    }
    .contacts-map {
        min-height: 300px;
    }
}