/* ============ БАЗОВЫЕ НАСТРОЙКИ ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --black: #000000;
    --white: #ffffff;
    --gray-dark: #333333;
    --gray: #666666;
    --gray-light: #999999;
    --gray-lighter: #cccccc;
    --gray-bg: #f5f5f5;
    --border: #e0e0e0;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #ffffff;
    color: #000000;
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 840px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ============ НАВИГАЦИЯ ============ */
nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    padding: 20px;
    border-bottom: 1px solid #000000;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav a {
    color: #000000;
    text-decoration: none;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: opacity 0.2s;
}

nav a:hover {
    opacity: 0.5;
}

nav a.active {
    text-decoration: underline;
    text-underline-offset: 5px;
    text-decoration-thickness: 1px;
}

.admin-link {
    font-size: 11px;
    letter-spacing: 1px;
    opacity: 0.7;
}

/* ============ ТИПОГРАФИКА ============ */
h1 {
    text-align: center;
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 60px 0 40px;
}

h2 {
    font-size: 20px;
    font-weight: 400;
    margin: 0 0 20px;
    letter-spacing: 0.5px;
    text-align: center;
}

p {
    text-align: center;
}

/* ============ ГЛАВНАЯ СТРАНИЦА ============ */
.hero {
    text-align: center;
    padding: 80px 20px;
    border-bottom: 1px solid #000000;
}

.hero h1 {
    margin: 0 0 15px;
    font-size: 32px;
}

.hero p {
    font-size: 14px;
    color: #666666;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.intro {
    text-align: center;
    padding: 60px 0;
}

.intro h2 {
    font-size: 16px;
    font-weight: 400;
    margin-bottom: 10px;
}

.intro p {
    color: #666666;
    font-size: 14px;
    margin-bottom: 30px;
}

.text-link {
    display: inline-block;
    color: #000000;
    text-decoration: none;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid #000000;
    padding-bottom: 3px;
    transition: opacity 0.2s;
}

.text-link:hover {
    opacity: 0.5;
}

.btn-primary {
    display: inline-block;
    background: none;
    border: 1px solid #000000;
    padding: 10px 25px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    color: #000000;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #000000;
    color: #ffffff;
}

/* ============ СТАТИСТИКА ============ */
.stats-preview {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid #e0e0e0;
    margin-top: 40px;
}

.stats-mini {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin: 20px 0 30px;
}

.stat-mini {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 28px;
    font-weight: 300;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #666666;
}

/* ============ КНОПКА СКАЧИВАНИЯ ============ */
.download-link {
    display: block;
    text-align: center;
    margin: 0 auto 20px;
    color: #000000;
    text-decoration: none;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: none;
    border-bottom: 1px solid #000000;
    padding: 0 0 3px;
    width: fit-content;
    cursor: pointer;
    background: none;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    transition: opacity 0.2s;
}

.download-link:hover {
    opacity: 0.5;
}

.download-link:disabled {
    opacity: 0.3;
    cursor: default;
}

/* ============ ПЕРЕКЛЮЧАТЕЛЬ СОРТИРОВКИ ============ */
.sort-control {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 0 0 30px;
}

.sort-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #666666;
}

.sort-link {
    background: none;
    border: none;
    border-bottom: 1px solid #000000;
    padding: 0 0 3px;
    cursor: pointer;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #000000;
    transition: opacity 0.2s;
}

.sort-link:hover {
    opacity: 0.5;
}

/* ============ ИНФОРМАЦИЯ О СТРАНИЦЕ ============ */
.page-info {
    text-align: center;
    font-size: 12px;
    color: #666666;
    letter-spacing: 1px;
    margin: 0 0 40px;
}

/* ============ КАРТОЧКА СТИХА ============ */
.poem-card {
    display: block;
    margin: 0 0 60px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 60px;
    overflow: hidden;
}

.poem-card:last-child {
    border-bottom: none;
}

/* ============ ФЛЕКС-ОБЁРТКА ============ */
.poem-flex-wrapper {
    display: flex;
    align-items: center;      /* ← Центрирование по вертикали */
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.poem-flex-wrapper .poem-content {
    flex: 1;
    min-width: 0;
}

/* ============ ИЛЛЮСТРАЦИЯ СПРАВА ============ */
.poem-illustration-side {
    flex: 1;                    /* ← Занимает оставшееся место */
    flex-shrink: 0;
    min-width: 150px;
    max-width: 300px;
    cursor: pointer;
    text-align: center;
    display: flex;
    align-items: center;        /* ← Центрирование по вертикали */
    align-self: stretch;        /* ← Растягивается на высоту контейнера */
}

.poem-illustration-side img {
    display: block;
    width: 100%;
    height: 100%;               /* ← Высота равна высоте контейнера */
    max-height: 100%;
    object-fit: contain;        /* ← Сохраняет пропорции */
    transition: opacity 0.3s;
}

.poem-illustration-side img:hover {
    opacity: 0.8;
}

/* ============ КОНТЕНТ СТИХА ============ */
.poem-content {
    display: block;
    max-width: 500px;
    width: 100%;
}

.poem-content h2.real-title {
    text-align: left;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 15px;
}

/* Дата по левому краю */
.poem-date {
    text-align: left;
    font-size: 11px;
    color: #999999;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.poem-date time {
    font-style: normal;
}

/* ============ БЛОК ТЕКСТА ============ */
.poem-text-block {
    display: flex;
    justify-content: flex-start;
    width: 100%;
}

.poem-text {
    background: #f0f0f0;
    padding: 30px 40px;
    text-align: left;
    width: fit-content;
    max-width: 100%;
}

.poem-text p {
    margin: 0 0 8px;
    font-size: 15px;
    line-height: 1.8;
    font-weight: 300;
    text-align: left;
}

.poem-text p:last-child {
    margin-bottom: 0;
}

/* ============ ПАГИНАЦИЯ ============ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 60px 0;
    flex-wrap: wrap;
}

.page-button {
    background: none;
    border: none;
    color: #000000;
    cursor: pointer;
    font-size: 12px;
    letter-spacing: 1px;
    padding: 5px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    transition: opacity 0.2s;
    text-decoration: none;
}

.page-button:hover {
    opacity: 0.5;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.active-page {
    font-weight: bold;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.page-dots {
    color: #999999;
    font-size: 12px;
}

/* ============ ЛАЙТБОКС ============ */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
}

.lightbox-content button {
    position: absolute;
    top: -30px;
    right: 0;
    background: none;
    border: none;
    color: #000000;
    font-size: 18px;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.2s;
}

.lightbox-content button:hover {
    opacity: 0.5;
}

/* ============ СТРАНИЦА ВХОДА ============ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
}

.login-container {
    width: 100%;
    max-width: 350px;
    padding: 20px;
}

.login-box {
    text-align: center;
}

.login-box h1 {
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin: 0 0 10px;
}

.login-subtitle {
    font-size: 12px;
    color: #666666;
    margin-bottom: 40px;
    text-align: center;
}

.form-group {
    margin-bottom: 25px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #666666;
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 0;
    border: none;
    border-bottom: 1px solid #000000;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    background: transparent;
    color: #000000;
    outline: none;
    border-radius: 0;
}

.form-group input:focus,
.form-group textarea:focus {
    border-bottom-color: #666666;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
    text-align: left;
}

.error-message {
    font-size: 12px;
    color: #000000;
    border: 1px solid #000000;
    padding: 10px;
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: 1px;
}

.login-button {
    display: block;
    width: 100%;
    background: none;
    border: 1px solid #000000;
    padding: 12px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 3px;
    cursor: pointer;
    color: #000000;
    transition: all 0.2s;
}

.login-button:hover {
    background: #000000;
    color: #ffffff;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 30px;
    font-size: 12px;
    color: #666666;
    text-decoration: none;
    letter-spacing: 1px;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 0.5;
}

/* ============ АДМИН-ПАНЕЛЬ ============ */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 200px;
    border-right: 1px solid #000000;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    background: #ffffff;
}

.admin-logo {
    margin-bottom: 40px;
}

.admin-logo h2 {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 5px;
    text-align: left;
}

.admin-logo p {
    font-size: 10px;
    color: #666666;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: left;
}

.admin-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-nav a {
    color: #000000;
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 1px;
    transition: opacity 0.2s;
    cursor: pointer;
    text-align: left;
}

.admin-nav a:hover {
    opacity: 0.5;
}

.admin-nav a.active {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.admin-footer {
    display: flex;
    flex-direction: column;
    gap: 15px;
    font-size: 11px;
}

.admin-footer a {
    color: #666666;
    text-decoration: none;
    letter-spacing: 1px;
    transition: opacity 0.2s;
    text-align: left;
}

.admin-footer a:hover {
    opacity: 0.5;
}

.logout-btn {
    background: none;
    border: none;
    color: #000000;
    cursor: pointer;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 11px;
    letter-spacing: 1px;
    text-align: left;
    padding: 0;
    transition: opacity 0.2s;
}

.logout-btn:hover {
    opacity: 0.5;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.admin-content {
    flex: 1;
    margin-left: 200px;
    padding: 60px 80px;
}

.admin-section h1 {
    text-align: left;
    font-size: 18px;
    margin: 0 0 50px;
}

/* ============ СТАТИСТИКА (АДМИНКА) ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
}

.stat-card {
    border-top: 1px solid #000000;
    padding-top: 15px;
}

.stat-icon {
    display: none;
}

.stat-value {
    font-size: 24px;
    font-weight: 300;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #666666;
}

/* ============ ТОП СТИХОВ ============ */
.top-poems-list {
    max-width: 500px;
}

.top-poem-item {
    display: flex;
    align-items: baseline;
    gap: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.top-poem-rank {
    font-size: 12px;
    color: #666666;
    min-width: 20px;
}

.top-poem-info {
    display: flex;
    justify-content: space-between;
    flex: 1;
    font-size: 13px;
}

.top-poem-info span {
    color: #666666;
    font-size: 12px;
}

/* ============ СПИСОК СТИХОВ (АДМИНКА) ============ */
.poems-toolbar {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.poems-toolbar input {
    flex: 1;
    border: none;
    border-bottom: 1px solid #000000;
    padding: 10px 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 13px;
    outline: none;
    background: transparent;
}

.admin-poem-item {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 20px 0;
    border-bottom: 1px solid #e0e0e0;
}

.admin-poem-thumb {
    display: none;
}

.admin-poem-info {
    flex: 1;
}

.admin-poem-info h3 {
    font-size: 13px;
    font-weight: 400;
    margin-bottom: 5px;
    text-align: left;
}

.admin-poem-info p {
    font-size: 11px;
    color: #666666;
    text-align: left;
}

.admin-poem-stats {
    display: flex;
    gap: 20px;
    font-size: 11px;
    color: #666666;
    margin-top: 5px;
}

.admin-poem-actions {
    display: flex;
    gap: 15px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #000000;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    transition: opacity 0.2s;
    padding: 0;
}

.btn-icon:hover {
    opacity: 0.5;
}

/* ============ ФОРМА ============ */
.poem-form {
    max-width: 600px;
}

.title-preview {
    margin-top: 10px;
    font-size: 12px;
    color: #666666;
    text-align: left;
}

.auto-badge {
    font-style: italic;
    color: #999999;
}

#image-preview img {
    max-width: 200px;
    margin-top: 15px;
    display: block;
}

/* ============ КНОПКИ ФОРМ ============ */
.btn-secondary {
    background: none;
    border: none;
    color: #000000;
    cursor: pointer;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 11px;
    letter-spacing: 1px;
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: opacity 0.2s;
}

.btn-secondary:hover {
    opacity: 0.5;
}

.btn-danger {
    background: none;
    border: none;
    color: #000000;
    cursor: pointer;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 11px;
    letter-spacing: 1px;
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: opacity 0.2s;
}

.btn-danger:hover {
    opacity: 0.5;
}

/* ============ НАСТРОЙКИ ============ */
.settings-form {
    margin-bottom: 40px;
}

.settings-form h2 {
    text-align: left;
    font-size: 14px;
    margin-bottom: 20px;
}

.danger-zone {
    border-top: 1px solid #000000;
    padding-top: 30px;
}

/* ============ ПОДВАЛ ============ */
footer {
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid #e0e0e0;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #666666;
}

/* ============ АДАПТИВНОСТЬ ============ */
@media (max-width: 768px) {
    nav {
        gap: 12px;
        flex-wrap: wrap;        /* ← ПЕРЕНОС НА НОВУЮ СТРОКУ */
        padding: 12px 10px;     /* ← Меньшие отступы */
    }
    
    nav a {
        font-size: 11px;        /* ← Меньший шрифт */
        letter-spacing: 1px;
    }

    .poem-flex-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }

    .poem-illustration-side {
        width: 150px;
        margin-top: 20px;
    }

    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid #000000;
        padding: 20px;
    }

    .admin-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 15px;
    }

    .admin-content {
        margin-left: 0;
        padding: 40px 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .hero h1 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    nav a {
        font-size: 11px;
        letter-spacing: 1px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .poem-text p {
        font-size: 14px;
    }
}

/* ============ БУКВЕННОЕ ============ */
.letter-card {
    display: block;
    margin: 0 0 60px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 60px;
}

.letter-card:last-child {
    border-bottom: none;
}

.letter-content {
    max-width: 600px;
    margin: 0 auto;
}

.letter-content h2.real-title {
    text-align: left;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.letter-text {
    text-align: justify;        /* ← Выравнивание по ширине */
    text-align-last: left;      /* ← Последняя строка — по левому краю */
}

.letter-text p {
    text-align: justify;
    text-align-last: left;
    margin-bottom: 20px;
    font-size: 15px;
    line-height: 1.8;
    font-weight: 300;
    text-indent: 30px;          /* ← Красная строка (отступ первой строки) */
}

.letter-text p.no-indent {
    text-indent: 0;    /* Без красной строки */
}

.letter-text p:last-child {
    margin-bottom: 0;
}

.letter-list p {
    margin-bottom: 5px;        /* ← Маленький отступ */
    text-indent: 30px;            /* Красная строка для списка */
}

/* Иллюстрация в буквенном */
.letter-illustration {
    margin: 20px 0;
    text-align: center;
    cursor: pointer;
}

.letter-illustration img {
    max-width: 100%;
    max-height: 300px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ============ ЛОГОТИПЫ В ХЕРО ============ */
.hero-logo-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.hero-logo {
    width: 120px;      /* Было 60 → стало 120 (в 2 раза больше) */
    height: 120px;
    object-fit: cover;
    flex-shrink: 0;
}

.logo-left {
    transform: rotate(180deg); /* Поворот по горизонтали */
}

.logo-right {
    /* Обычное справа */
}

.hero-logo-row h1 {
    margin: 0;
    font-size: 32px;
}

/* ============ ПОДВАЛ ============ */
footer {
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid #e0e0e0;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #666666;
}

.footer-contacts {
    margin-bottom: 15px;
}

.footer-contacts a {
    color: #000000;
    text-decoration: none;
    border-bottom: 1px solid #000000;
    padding-bottom: 2px;
    transition: opacity 0.2s;
}

.footer-contacts a:hover {
    opacity: 0.5;
}

.footer-socials {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-socials a {
    color: #000000;
    text-decoration: none;
    border-bottom: 1px solid #000000;
    padding-bottom: 2px;
    transition: opacity 0.2s;
}

.footer-socials a:hover {
    opacity: 0.5;
}

footer p {
    margin-top: 20px;
}

/* ============ АДАПТИВНОСТЬ ДЛЯ ЛОГО ============ */
@media (max-width: 600px) {
    .hero-logo-row {
        gap: 15px;
    }

    .hero-logo {
        width: 80px;    /* Было 40 → стало 80 (в 2 раза больше) */
        height: 80px;
    }

    .hero-logo-row h1 {
        font-size: 24px;
    }
}

/* Кнопка поделиться */
.share-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #999;
    padding: 0 5px;
    transition: opacity 0.2s;
    vertical-align: middle;
    font-family: inherit;
}

.share-icon-btn:hover {
    opacity: 0.5;
}

/* Кнопка поделиться */
.share-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #999;
    padding: 0 5px;
    transition: opacity 0.2s;
    vertical-align: middle;
    font-family: inherit;
}

.share-icon-btn:hover {
    opacity: 0.5;
}

/* ============ РИСУНКИ ============ */
.art-card {
    display: block;
    margin: 0 0 60px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 40px;
    text-align: center;
}

.art-card:last-child {
    border-bottom: none;
}

.art-image {
    cursor: pointer;
    text-align: center;
    margin-bottom: 15px;
}

.art-image img {
    max-width: 100%;
    max-height: 600px;
    height: auto;
    display: block;
    margin: 0 auto;
    transition: opacity 0.3s;
}

.art-image img:hover {
    opacity: 0.9;
}

.art-caption {
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 5px;
    text-align: center;
}

.art-date {
    font-size: 11px;
    color: #999;
    letter-spacing: 1px;
    text-align: center;
}

/* ============ РИСУНКИ: СЕТКА ============ */
.art-feed {
    display: block;
}

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

.art-card-grid {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
    cursor: pointer;
    position: relative;
}

.art-card-grid .art-image {
    margin-bottom: 0;
    height: 200px;
    overflow: hidden;
}

.art-card-grid .art-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Подпись при наведении в сетке */
.art-card-grid::after {
    content: attr(data-caption);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.3s;
    text-align: center;
}

.art-card-grid:hover::after {
    opacity: 1;
}

/* Адаптивность */
@media (max-width: 768px) {
    .art-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .art-card-grid .art-image {
        height: 150px;
    }
}

/* ============ ШАПКА С ЛОГО ============ */
.art-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 60px 0 40px;
}

.art-hero h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.art-logo {
    width: 120px;
    height: 120px;
    object-fit: cover;
    flex-shrink: 0;
}

.art-logo-left {
    filter: invert(1); /* Негатив */
}

.art-logo-right {
    /* Обычный */
}

/* Адаптивность */
@media (max-width: 600px) {
    .art-logo {
        width: 80px;
        height: 80px;
    }

    .art-hero h1 {
        font-size: 22px;
    }

    .art-hero {
        gap: 15px;
    }
}

/* ============ СТРАНИЦА 404 ============ */
.error-page {
    text-align: center;
    padding: 80px 0;
}

.error-page h1 {
    font-size: 72px;
    font-weight: 300;
    margin-bottom: 20px;
}

.error-page p {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.error-page .text-link {
    margin: 0 5px;
}

/* ============ КНОПКА НАВЕРХ ============ */
.scroll-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: #fff;
    border: 1px solid #000;
    cursor: pointer;
    font-size: 18px;
    color: #000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 500;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top-btn:hover {
    background: #000;
    color: #fff;
}

/* ============ ДВИГАЮЩЕЕСЯ — БЕЗ НАЛОЖЕНИЙ ============ */
.dvizh-scattered {
    position: relative;
    min-height: 600px;
    width: 100%;
    overflow: hidden;
    padding: 40px 20px;
}

.dvizh-card-scattered {
    cursor: pointer;
    transition: transform 0.3s;
}

.dvizh-card-scattered:hover {
    transform: scale(1.3) !important;
    z-index: 1000 !important;
}

.dvizh-card-scattered video {
    max-width: 240px;
    max-height: 240px;
    display: block;
    object-fit: cover;
    border-radius: 2px;
}

@media (max-width: 600px) {
    .dvizh-scattered {
        min-height: 400px;
    }
    
    .dvizh-card-scattered video {
        max-width: 240px;
        max-height: 240px;
    }
}

/* ============ МАТЕРИЯ (PHYS) ============ */
.phys-card {
    display: block;
    margin: 0 0 60px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 40px;
    text-align: center;
    position: relative;
}

.phys-card:last-child {
    border-bottom: none;
}

/* Обёртка для галереи и стрелок */
.phys-gallery-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 100%;
    gap: 15px;
}

/* Горизонтальная прокрутка */
.phys-gallery {
    flex: 1;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 20px;
    margin: 0;
    padding: 20px 10px;
    justify-content: flex-start;
    align-items: center;
    max-width: 640px;       /* ← Было 620, стало 640 (больше на 20px) */
    margin: 0 auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.phys-gallery::-webkit-scrollbar {
    display: none;
}

/* Ползунок появляется только при прокрутке (мобильные) */
.phys-gallery.scrolling {
    scrollbar-width: thin;
    scrollbar-color: #000 #f0f0f0;
}

.phys-gallery.scrolling::-webkit-scrollbar {
    display: block;
    height: 4px;
}

.phys-gallery.scrolling::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 2px;
}

.phys-gallery.scrolling::-webkit-scrollbar-thumb {
    background: #000;
    border-radius: 2px;
}

.phys-image-wrap {
    cursor: pointer;
    flex-shrink: 0;
    min-width: 200px;
}

.phys-image-wrap img {
    width: 300px;
    height: 300px;
    max-width: none;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s;
    border-radius: 2px;
}

.phys-image-wrap img:hover {
    opacity: 0.8;
}

.phys-title {
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.phys-date {
    font-size: 11px;
    color: #999;
    letter-spacing: 1px;
}

/* Стрелки (только на ПК) */
.phys-arrow {
    width: 60px;               /* 1/5 от 300px = 60px */
    height: 60px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    transition: opacity 0.2s;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

.phys-arrow:hover {
    opacity: 0.7;
}

.phys-arrow-left {
    color: #ccc;
    pointer-events: none;
}

.phys-arrow-right {
    color: #000;
}

/* Активная левая стрелка */
.phys-arrow-left.active {
    color: #000;
    pointer-events: auto;
}

/* Мобильная версия — без стрелок */
@media (max-width: 768px) {
    .phys-arrow {
        display: none;
    }
    
    .phys-image-wrap img {
        width: 180px;
        height: 180px;
    }
    
    .phys-gallery {
        gap: 10px;
        padding: 15px 5px;
    }
}

/* Неактивная правая стрелка */
.phys-arrow-right.disabled {
    color: #ccc;
    pointer-events: none;
}

/* ============ ПОИСК ============ */
.search-section {
    margin: 40px 0;
    text-align: center;
}

.search-input {
    width: 100%;
    max-width: 400px;
    padding: 12px 0;
    border: none;
    border-bottom: 1px solid #000;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    outline: none;
    background: transparent;
    text-align: center;
    margin-bottom: 20px;
}

.search-input::placeholder {
    color: #999;
    letter-spacing: 1px;
}

.search-results {
    max-width: 400px;
    margin: 0 auto;
    text-align: left;
}

.search-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
    text-decoration: none;
    color: #000;
    transition: opacity 0.2s;
}

.search-result:hover {
    opacity: 0.6;
}

.search-type {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    min-width: 60px;
}

.search-title {
    font-size: 13px;
}

.search-empty {
    font-size: 12px;
    color: #999;
    text-align: center;
    padding: 20px;
}

.error-buttons {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 40px;
    flex-wrap: wrap;
}

/* ============ МОБИЛЬНЫЙ ПОИСК ============ */
@media (max-width: 600px) {
    .search-section {
        margin: 30px 0;
    }
    
    .search-input {
        max-width: 100%;
        font-size: 16px;  /* ← Крупнее, чтобы не было зума на iOS */
        padding: 12px 10px;
    }
    
    .search-results {
        max-width: 100%;
    }
    
    .search-result {
        padding: 12px 10px;
        gap: 12px;
    }
    
    .search-type {
        min-width: 50px;
        font-size: 9px;
    }
    
    .search-title {
        font-size: 14px;
    }
}

/* мобильный 404 */
@media (max-width: 600px) {
    .error-buttons {
        flex-direction: column;    /* ← Кнопки друг под другом */
        gap: 15px;
        margin-top: 30px;
        padding: 0 20px;
    }
    
    .error-buttons .btn-primary {
        display: block;
        width: 100%;
        text-align: center;
        padding: 14px 20px;
        font-size: 13px;
    }
}