/* ============================================
Под знаком ИХТИС - Главные стили
============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #17a2b8;
    --primary-dark: #138496;
    --primary-light: #5cb8c4;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--text-dark);
    background: var(--bg-light);
    line-height: 1.6;
}

/* ============================================
Header
============================================ */

.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: var(--shadow);
    position: relative;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo-circle {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    padding: 12px;
    flex-shrink: 0;
}

.logo-circle img {
    width: 155%;
    height: 155%;
    object-fit: contain;
    display: block;
}

.site-title {
    flex: 1;
}

.site-title h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    letter-spacing: 1px;
}

.site-subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 300;
    letter-spacing: 2px;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.donate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    text-decoration: none;
    color: #fff;
    background-color: #d96875;
    border: 2px solid #d96875;
    transition: all 0.3s;
    cursor: pointer;
    user-select: none;
    text-align: center;
}

.donate-btn:hover,
.donate-btn:focus {
    background-color: #ec838d;
    border-color: #ec838d;
    outline: none;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.donate-btn:active {
    background-color: #c85a68;
    border-color: #c85a68;
    color: #fff;
}

/* ============================================
App Download Button (Стили приложения)
============================================ */
.app-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem; /* Отступ между иконкой телефона и текстом */
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    text-decoration: none;
    color: #ffffff;
    /* Полупрозрачный фон для элегантного сочетания с градиентом шапки */
    background-color: rgba(255, 255, 255, 0.15); 
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    transition: all 0.3s;
    cursor: pointer;
    user-select: none;
    text-align: center;
}

.app-btn:hover,
.app-btn:focus {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    outline: none;
}

.app-btn:active {
    transform: translateY(0);
    background-color: rgba(255, 255, 255, 0.1);
}

/* ============================================
Buttons
============================================ */

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent; /* чтобы все кнопки были одного размера */
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.2; /* фиксируем высоту текста */
    text-align: center;
}

.btn-white {
    background: white;
    color: var(--primary-color);
    border-color: white;
}

.btn-white:hover {
    background: var(--bg-light);
    border-color: var(--bg-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.btn-outline {
    background: transparent;
    color: white;
    border-color: white;
}

.btn-outline:hover {
    background: white;
    color: var(--primary-color);
    border-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.btn-search {
    background: var(--primary-color);
    color: white;
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-search:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-view {
    background: var(--primary-color);
    color: white;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.btn-view:hover {
    background: var(--primary-dark);
}

/* ============================================
   Hero Slider
   ============================================ */
.hero-slider {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 2rem 1.4rem;;
}

.slider-container {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    pointer-events: none;
}

.slide.active {
    opacity: 1;
    pointer-events: auto;
}

.slide-link {
    display: block;
    width: 100%;
    height: 100%;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 4px;
    font-size: 2.5rem;
    line-height: 1;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: auto;
    padding: 0;
    margin: 0;
}

.slider-container:hover .slider-arrow {
    opacity: 1;
}

.slider-arrow:hover {
    background: rgba(0, 0, 0, 0.6);
}

.slider-arrow.prev {
    left: 20px;
}

.slider-arrow.next {
    right: 20px;
}

/* Индикаторы */
.slider-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.indicator {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.indicator:hover {
    background: rgba(255, 255, 255, 0.8);
}

.indicator.active {
    width: 32px;
    background: white;
}


/* ============================================
Search and Filters
============================================ */

.search-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    padding: 0.5rem 2rem 2rem;
}

.search-bar {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.search-input-wrapper {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filters {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5 равных колонок */
    gap: 0.8rem; /* компактнее */
    align-items: start;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group-period {
    grid-column: 1 / 2;
    grid-row: 2;
}

.filter-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-size: 0.9rem;
    display: block;
}

.filter-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: border 0.3s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ============================================
Stats Bar
============================================ */

.stats-bar {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-count {
    font-size: 1.1rem;
    color: var(--text-light);
}

.results-count strong {
    color: var(--primary-color);
    font-size: 1.3rem;
}

/* ============================================
Artifacts Grid
============================================ */

.artifacts-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

.artifacts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 колонки на десктопе */
    gap: 2rem;
}

.artifact-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    width: 100%;
    min-height: 500px; /* минимум, но может расти */
    height: 100%; /* заполняет всю строку grid */
    display: flex;
    flex-direction: column;
}

.artifacts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    /* Добавь это: */
    grid-template-rows: 1fr; /* все карточки одной высоты */
    align-items: stretch; /* растягиваем по высоте */
}


.artifact-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.artifact-image {
    width: 100%;
    height: 200px; /* фиксированная высота изображения */
    flex-shrink: 0;
    background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 2.5rem;
    overflow: hidden;
    position: relative;
}

.artifact-image img,
.artifact-image canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.artifact-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-height: 250px;
    display: flex;
    flex-direction: column;
}

.artifact-type {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    align-self: flex-start;
}

.artifact-title {
    font-family: 'Open Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0.5rem 0;
    line-height: 1.35;
    overflow: visible;
    max-height: 6rem;
}

.artifact-identifier {
    font-family: 'Open Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #444444; /* чуть темнее и контрастнее */
    margin-left: 0.35rem;
}


.artifact-meta {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-light);
    font-size: 0.8rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meta-icon {
    font-size: 0.95rem;
    flex-shrink: 0;
}


.artifact-description {
    color: #555;
    line-height: 1.5;
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    overflow: visible;
    max-height: 7rem;
}

.artifact-footer {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

/* планшет: 2 колонки */
@media (max-width: 1024px) {
    .artifacts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* мобильный: 1 колонка */
@media (max-width: 640px) {
    .artifacts-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
Empty State
============================================ */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.empty-state p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* ============================================
Footer
============================================ */

.footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--primary-light);
}

.footer-section a {
    color: inherit; 
    text-decoration: none; 
}

.footer-section a:hover {
    text-decoration: underline; 
    color: inherit;
}


.footer-section p {
    line-height: 1.8;
    opacity: 0.9;
}

.footer-bottom {
    max-width: 1400px;
    margin: 2rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    opacity: 0.7;
}

/* ============================================
Кнопка сброса фильтров
============================================ */

.btn-reset-filters {
    background: #95a5a6;
    color: white;
    padding: 0.75rem 1.5rem;
    border: 2px solid #95a5a6;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    opacity: 0.7;
}

.btn-reset-filters:hover {
    background: #7f8c8d;
    border-color: #7f8c8d;
    opacity: 1;
    text-decoration: none;
}

.btn-reset-filters.active {
    background: #e74c3c;
    border-color: #e74c3c;
    opacity: 1;
}

.btn-reset-filters.active:hover {
    background: #c0392b;
    border-color: #c0392b;
}

.filters-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 1.5rem;
    gap: 1rem;
}

.active-filters-count {
    color: #6c757d;
    font-size: 0.9rem;
}

.active-filters-count strong {
    color: #17a2b8;
}

/* ============================================
Range Slider - компактная версия
============================================ */

.century-range-filter {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.century-inputs {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.century-input {
    padding: 0.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.85rem;
    text-align: center;
    font-weight: 600;
    transition: border 0.3s;
    width: 60px;
}

.century-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.century-input::placeholder {
    color: #bdc3c7;
    font-size: 0.8rem;
}

.century-input:first-of-type {
    margin-right: auto;
}

.century-input:last-of-type {
    margin-left: auto;
}

.century-separator {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-light);
    font-weight: 600;
    font-size: 1rem;
    pointer-events: none;
}

.century-slider-track {
    position: relative;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin: 0.3rem 0;
}

.century-slider-range {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    border-radius: 2px;
    pointer-events: none;
}

.century-slider-thumb {
    position: absolute;
    width: 100%;
    height: 4px;
    top: 0;
    left: 0;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

.century-slider-thumb::-webkit-slider-runnable-track {
    height: 4px;
    background: transparent;
}

.century-slider-thumb::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
    margin-top: -6px;
}

.century-slider-thumb::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.century-slider-thumb::-webkit-slider-thumb:active {
    transform: scale(1.05);
    background: var(--primary-color);
}

/* Firefox */
.century-slider-thumb::-moz-range-track {
    height: 4px;
    background: transparent;
}

.century-slider-thumb::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
}

.century-slider-thumb::-moz-range-thumb:hover {
    transform: scale(1.1);
}

.century-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: 500;
}

/* ============================================
   Responsive Design
============================================ */

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .logo-section {
        display: flex;
        flex-direction: column;      /* Вертикальное расположение */
        align-items: center;
        justify-content: center;
        width: 100%;
        gap: 0.75rem;
    }

    .logo-circle {
        width: 70px;
        height: 70px;
    }

    .site-title {
        text-align: center;
        width: 100%;
    }

    .site-title h1 {
        font-size: 1.75rem;
        white-space: normal;
        margin-bottom: 0.25rem;
    }

    .site-subtitle {
        font-size: 0.9rem;
        display: block;
        margin-top: 0;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
        gap: 0.8rem;
        margin-top: 0.5rem;
    }
    
    .header-actions .btn,
    .header-actions .donate-btn,
    .header-actions .app-btn{
        width: 100% !important;
        padding: 1rem 1.5rem !important;
        font-size: 1rem !important;
        min-height: 50px;
        justify-content: center;
    }
    
    
    /* Очень маленькие экраны */
    @media (max-width: 480px) {
        .logo-circle {
            width: 60px;
            height: 60px;
        }
        .site-title h1 {
            font-size: 1.65rem;
        }
        .site-subtitle {
            font-size: 0.85rem;
        }
    }
    
    #pdf-canvas {
        width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        max-width: 100vw !important;
        display: block;
    }

    .site-title h1 {
        font-size: 1.8rem;
    }

    .site-subtitle {
        font-size: 0.9rem;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .search-input-wrapper {
        flex-direction: column;
    }

    .logo-circle {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .filter-group-period {
        grid-column: 1;
        grid-row: auto;
    }

    .filters-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-reset-filters {
        width: 100%;
        text-align: center;
    }
    
}

/* ============================================
Кнопки избранного
============================================ */

.artifact-image {
    position: relative;
}

.favorite-btn-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.favorite-btn-icon .heart {
    font-size: 1.5rem;
    color: #bdc3c7;
    transition: all 0.3s;
}

.favorite-btn-icon:hover {
    transform: scale(1.1);
    background: white;
}

.favorite-btn-icon:hover .heart {
    color: #e74c3c;
}

.favorite-btn-icon.active .heart {
    color: #e74c3c;
    animation: heartbeat 0.6s;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1.1); }
}

/* Полная кнопка избранного */

.favorite-btn-full {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    transition: all 0.3s;
}

.favorite-btn-full .heart {
    font-size: 1.3rem;
    color: #bdc3c7;
    transition: all 0.3s;
}

.favorite-btn-full:hover {
    border-color: #e74c3c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.2);
}

.favorite-btn-full:hover .heart {
    color: #e74c3c;
}

.favorite-btn-full.active {
    background: #fee;
    border-color: #e74c3c;
}

.favorite-btn-full.active .heart {
    color: #e74c3c;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* ============================================
Модальное окно
============================================ */

.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 3rem;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: #ecf0f1;
    color: var(--text-dark);
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.modal-content h2 {
    font-family: 'Playfair Display', serif;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.modal-content p {
    color: #7f8c8d;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.btn-modal {
    flex: 1;
    padding: 1rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    text-align: center;
}

.btn-modal.primary {
    background: var(--primary-color);
    color: white;
}

.btn-modal.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-modal:not(.primary) {
    background: #ecf0f1;
    color: var(--text-dark);
}

.btn-modal:not(.primary):hover {
    background: #bdc3c7;
}

/* ============================================
Уведомления
============================================ */

.notification {
    position: fixed;
    top: -100px;
    right: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    font-weight: 600;
    z-index: 10001;
    transition: all 0.3s;
}

.notification.show {
    top: 2rem;
}

.notification-success {
    border-left: 4px solid #27ae60;
    color: #27ae60;
}

.notification-error {
    border-left: 4px solid #e74c3c;
    color: #e74c3c;
}

.notification-info {
    border-left: 4px solid #3498db;
    color: #3498db;
}

@media (max-width: 768px) {
    .item-header {
        flex-direction: column;
        align-items: stretch;
    }

    .favorite-btn-full {
        width: 100%;
        justify-content: center;
    }
}

/* PDF Canvas */

canvas {
    display: block;
    background: #f5f5f5;
}

.artifact-image canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Пагинация */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 3rem;
    padding-bottom: 3rem;
}

.pagination-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}
.pagination-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}


.pagination-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ddd;
    border-radius: 8px;
    text-decoration: none;
    color: #2c3e50;
    font-weight: 600;
    transition: all 0.3s;
}

.pagination-number:hover {
    border-color: #17a2b8;
    color: #17a2b8;
    background: #f8f9fa;
}

.pagination-number.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: transparent;
}



.pagination-dots {
    color: #999;
    padding: 0 5px;
}

/* Жёстко фиксируем 3 колонки на десктопе поверх всего */
@media (min-width: 1025px) {
    .artifacts-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

.artifact-title .artifact-identifier {
    font-family: 'Open Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #444444 !important; 
    margin-left: 0.35rem;
}

/* Мобильная адаптация страницы артефакта */
@media (max-width: 768px) {
    .viewer-container {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .viewer-media {
        order: 1;
    }

    .manuscript-info {
        order: 2;
        margin-bottom: 1.5rem;
    }

    .manuscript-info h1,
    .manuscript-info h2 {
        font-size: 1.4rem;
        line-height: 1.3;
        word-break: break-word;
    }

    .manuscript-info p {
        font-size: 0.95rem;
    }

    .pdf-controls {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .pdf-controls button {
        flex: 1 1 45%;
        font-size: 0.9rem;
        padding: 0.5rem;
    }

    #pdf-canvas {
        max-width: 100%;
        height: auto !important;
    }
    
    .hero-slider {
        padding: 0 1rem 1.5rem;
        padding: 1.5rem 1rem 1rem;
    }

    .slider-container {
        height: 200px;
        border-radius: 12px;
    }

    .slider-arrow {
        display: none; /* Полностью убираем кнопки */
    }

    .slider-indicators {
        bottom: 15px;
        gap: 8px;
    }

    .indicator {
        width: 10px;
        height: 10px;
    }

    .indicator.active {
        width: 24px;
    }
    .slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(20px);
    transform: scale(1.1); /* чтобы края размытия не были видны */
    z-index: -1;
    }
    .slide img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
        position: relative;
        z-index: 1;
    }
}

@media (max-width: 480px) {
    .slider-container {
        height: 160px;
    }

    .slider-arrow {
        width: 35px;
        height: 35px;
        font-size: 1.8rem;
    }
}

