:root {
    /* Основные цвета */
    --gold: #c5a059;
    --dark-blue: #0a1f3d;
    --bg-light: #fcfcfc;
    --text-main: #2c3e50;
    --text-muted: #888;
    --border-light: rgba(0, 0, 0, 0.05);

    /* Шрифты */
    --font-heading: 'Lora', serif;
    --font-body: 'Montserrat', sans-serif;

    /* Сетка и отступы (используй кратные 8) */
    --spacing-sm: 8px;
    --spacing-md: 24px;
    --spacing-lg: 40px;
    --spacing-xl: 60px;
    --radius-lg: 12px;
    --shadow-soft: 0 15px 40px rgba(0,0,0,0.08);
}

/* Для архива используем Flexbox */
.archive-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Центрирует карточки по горизонтали */
    gap: var(--spacing-lg);
}

.archive-grid .card {
    flex: 0 1 auto; /* Карточка не растягивается, а сохраняет свой размер */
    max-width: 350px; /* Ограничиваем максимальную ширину */
    min-width: 280px; /* Гарантируем читаемость на мобилках */
}

/* Общий стиль для всех кнопок и интерактивных ссылок */
.btn-home, .read-btn, .letter-btn {
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Состояние нажатия */
.btn-home:active, .read-btn:active, .letter-btn:active {
    transform: translateY(2px); /* Легкое «вдавление» кнопки */
    opacity: 0.8;
}

/* Состояние фокуса (для тех, кто пользуется клавиатурой) */
.btn-home:focus, .read-btn:focus {
    outline: 2px solid var(--gold);
    outline-offset: 4px;
}
body {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    background-color: #fcfcfc;
    color: var(--text-main);
    line-height: 1.8;
    overflow-x: hidden;
}

#header-placeholder {
    min-height: 80px; /* Зарезервированное место под шапку */
}

@keyframes fadeInPage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main {
    max-width: 1000px;
    margin: 32px auto;
    padding: 0 30px;
    animation: fadeInPage 0.6s ease-out forwards;
}

/* Header & Navigation */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 10px 0;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
}

.logo {
    display: flex;
    align-items: center;
}
.logo img {
    height: 75px;
    width: auto;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 35px;
    margin: 0;
    padding: 0;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    transition: color 0.3s ease;
}

nav ul li a:hover,
nav ul li a[aria-current="page"] {
    color: #c5a059;
}

/* Custom Underline Animation */
nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #c5a059;
    transition: width 0.3s ease;
}

nav ul li a:hover::after,
nav ul li a[aria-current="page"]::after {
    width: 100%;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.submenu {
    display: block;
    position: absolute;
    background-color: white;
    padding: 20px;
    list-style: none;
    top: 100%;
    left: 0;
    border: 1px solid #eee;
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    transform: translateY(10px);
}

.dropdown:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu li {
    margin-bottom: 8px;
}

.submenu li a {
    font-size: 0.8rem;
    text-transform: none;
}

/* Hero Section */
.hero {
    position: relative;
    height: 48vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(rgba(10, 31, 61, 0.8), rgba(10, 31, 61, 0.8)), 
                    url('https://images.unsplash.com/photo-1507608134956-3d96857f4c0a?auto=format&fit=crop&q=80&w=2000');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.2);
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 0 20px;
}

.hero .title {
    font-family: 'Lora', serif;
    font-size: clamp(3rem, 8vw, 6rem);
    margin: 0;
    font-weight: 700;
    letter-spacing: -2px;
}

.hero .subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.3rem;
    font-weight: 300;
    margin-top: 15px;
    letter-spacing: 4px;
    opacity: 0.9;
}

/* Content Styles */
main {
    width: auto;
    max-width: 1000px;
    margin: 32px auto;
    padding: 0 24px;
}

.section-title {
    font-family: 'Lora', serif;
    font-size: 2.5rem;
    margin-bottom: 60px;
    text-align: center;
    position: relative;
    padding-bottom: 20px;
    color: var(--text-main);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #c5a059;
}

.history-intro {
    font-size: 1.2rem;
    margin-bottom: 40px;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-main);
}

/* Minimal chronological list on the home page. */
.timeline-container {
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

.timeline-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 24px 0;
}

.timeline-item + .timeline-item {
    border-top: 1px solid rgba(44, 62, 80, 0.12);
}


.timeline-item p {
    margin: 0;
    min-width: 0;
}

/* Team Cards */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 40px;
    margin-top: 50px;
}

.team-card {
    background: white;
    padding: 50px 30px;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid #c5a059;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.team-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 60px rgba(0,0,0,0.15);
    border-color: #c5a059;
}

.team-card h3 {
    font-family: 'Lora', serif;
    font-size: 1.6rem;
    margin: 0 0 15px 0;
    color: var(--text-main);
}

.team-card p {
    color: var(--text-main);
    font-size: 0.95rem;
}

/* Author Catalog Styles */
.alphabet-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 12px;
}

.letter-btn {
    width: 48px;
    height: 48px;
    border: 3px solid #e0e0e0;
    background: white;
    border-radius: 50%;
    font-family: 'Lora', serif;
    font-size: 1.6rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0px 0px;
}

.letter-btn:hover {
    border-color: #c5a059;
    color: #c5a059;
    background: #fcfcfc;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.letter-btn.active {
    background: #0a1f3d;
    color: white;
    border-color: #0a1f3d;
}

.author-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.author-card {
    padding: 8px 0px;
    background: white;
    border: 1px solid #c5a059;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.author-card:hover {
    border-color: #c5a059;
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

.author-card h3 {
    font-family: 'Lora', serif;
    margin: 0 0 10px 0;
    color: var(--text-main);
    font-size: 1.5rem;
}

.author-card p {
    font-size: 0.9rem;
    color: var(--text-main);
    margin: 0;
}

/* Publication Details Styles */
.publication-details {
    margin-top: 50px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.pub-card {
    background: white;
    padding: 50px;
    border-radius: 20px;
    border: 1px solid #eee;
    box-shadow: 0 20px 60px rgba(0,0,0,0.04);
}

.pub-card h3 {
    font-family: 'Lora', serif;
    font-size: 2.2rem;
    margin-bottom: 35px;
    color: var(--text-main);
    border-bottom: 2px solid #f9f9f9;
    padding-bottom: 20px;
}

.pub-list-styled {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pub-list-styled li {
    padding: 15px 0;
    border-bottom: 1px solid #f9f9f9;
    font-size: 1.1rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
}

.pub-list-styled li:last-child {
    border-bottom: none;
}

.pub-list-styled li::before {
    content: '•';
    color: #c5a059;
    margin-right: 15px;
    font-size: 1.4rem;
}

/* Archive Styles */
.view-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    animation: fadeIn 0.6s ease-out;
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 40px;
    margin-top: 40px;
}

.card {
    background: white;
    padding: 50px 30px;
    border-radius: 16px;
    border: 1px solid #c5a059;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    transition: all 0.4s ease;
    cursor: pointer;
    text-align: center;
}

.card:hover {
    transform: translateY(-5px);
    border-color: #c5a059;
    box-shadow: 0 25px 60px rgba(0,0,0,0.15);
}

.card h2 {
    font-family: 'Lora', serif;
    font-size: 1.6rem;
    margin: 0;
}

/* Issue Page Specific Styles */
.issue-title {
    font-family: 'Lora', serif;
    font-size: clamp(2.5rem, 8vw, 5rem);
    margin-bottom: 10px;
    text-align: center;
    color: var(--text-main);
}

.issue-subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 4px;
    text-align: center;
    margin-bottom: 80px;
    color: #888;
}

.issue-section {
    margin-bottom: 80px;
}
/* Исправление карточек номеров (кликабельность всей площади) */
.issue-card {
    position: relative;
    padding: 0; /* Убираем внутренние отступы родителя */
    overflow: hidden;
    height: 100%;
}

.issue-card a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 50px 0px; /* Возвращаем отступы ссылке */
    text-decoration: none;
    color: inherit;
    transition: background-color 0.3s ease;
}

.issue-card:hover a {
    background-color: #fcfcfc;
}

.section-header {
    font-family: 'Lora', serif;
    font-size: 2rem;
    border-bottom: 1px solid #c5a059;
    padding-bottom: 8px;
    margin-bottom: 8px;
    color: var(--text-main);
}

.item-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.item-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px 8px 32px;
    border-bottom: 1px solid #eee;
    transition: all 0.3s ease;
}

.item-card:hover {
    background: #fcfcfc;
    transform: translateX(4px);
    border-left: 8px solid #c5a059;
    box-shadow: 8px 8px 16px rgba(0,0,0,0.2);
}

.item-info {
    flex: 1;
}

.item-author {
    font-family: 'Lora', serif;
    font-size: 1.5rem;
    margin: 0 0 0px 0;
    color: var(--text-main);
    font-weight: 700;
}

.item-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    margin: 0;
    color: var(--text-main);
    font-weight: 400;
}

.read-btn {
    padding: 10px 20px;
    background: #0a1f3d;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.read-btn:hover {
    background: #c5a059;
    transform: translateY(-2px);
}

.loading-text {
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    color: #888;
    padding: 100px;
}

/* Trailing content must not enlarge the shared 32px footer gap. */
.issue-section:last-child,
.home-page .editorial-text {
    margin-bottom: 0;
}

/* Fill short pages and keep the footer below long content. PDF-only views
   have no footer placeholder and retain their independent viewport layout. */
body:has(> #footer-placeholder) {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

body:has(> #footer-placeholder) > main {
    flex: 0 0 auto;
    width: calc(100% - 48px);
    margin-bottom: 32px;
}

body.announcement-page:has(> #footer-placeholder) > main {
    width: 100%;
}

#header-placeholder,
#footer-placeholder {
    flex-shrink: 0;
}

#footer-placeholder {
    margin-top: auto;
}

/* Footer Styles */
.footer-simple {
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    height: 96px;
    min-height: 96px;
    padding: 0 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    margin: 0;
    background-color: #fcfcfc;
}

.footer-simple p {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    color: #888;
}
/* Исправление кнопок навигации в архиве (стиль меню) */
.back-btn {
    display: inline-block;
    margin-bottom: 0px; /* Увеличенный отступ снизу до карточек */
    padding: 0;
    background: transparent;
    border: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-main);
    cursor: pointer;
    transition: color 0.3s ease;
}

.content-wrapper {
    margin-top: 20px; 
}


.back-btn:hover {
    color: #c5a059;
}

/* Shared navigation and responsive page layout. */
a { color: var(--text-main); }
.main-header nav, .main-header nav * { box-sizing: border-box; }
.main-header nav { gap: 24px; }
.logo a { display: flex; text-decoration: none; }
.nav-links[hidden], .nav-toggle[hidden] { display: none; }
.nav-toggle { display: none; }
.nav-links a:focus-visible, .logo a:focus-visible, .nav-toggle:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 4px;
}
.contacts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 100%; margin: 40px auto; }
.team-card, .card-inner { min-width: 0; }
.team-card p { overflow-wrap: anywhere; }
@media (max-width: 1100px) {
    .main-header nav { flex-wrap: wrap; gap: 0; padding: 0 24px; }
    .main-header .logo img { height: 60px; max-width: 100%; object-fit: contain; }
    .main-header .nav-links { flex: 0 0 100%; flex-direction: column; gap: 0; margin-top: 12px; padding: 8px 0; border-top: 1px solid var(--border-light); }
    .main-header .nav-links li { width: 100%; }
    .main-header .nav-links a { display: block; width: 100%; padding: 12px 8px; min-height: 44px; overflow-wrap: anywhere; }
    .main-header .nav-links a::after { bottom: 6px; }
    .main-header nav[data-nav-ready] .nav-toggle {
        display: inline-flex; align-items: center; justify-content: center; gap: 8px;
        min-width: 44px; min-height: 44px; margin-left: auto; padding: 8px 12px;
        border: 1px solid var(--text-main); border-radius: 6px; background: transparent;
        color: var(--text-main); font: 600 .85rem/1.4 'Montserrat', sans-serif; cursor: pointer;
    }
    .nav-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
    .nav-toggle-close, .nav-toggle[aria-expanded="true"] .nav-toggle-lines { display: none; }
    .nav-toggle[aria-expanded="true"] .nav-toggle-close { display: block; }
}
@media (max-width: 700px) {
    .contacts-grid { grid-template-columns: minmax(0, 1fr); }
    .team-grid { gap: 24px; }
    .team-card { padding: 32px 20px; }
    .timeline-item { grid-template-columns: minmax(0, 1fr); row-gap: 8px; }
    .error-container { height: auto; min-height: 40vh; padding: 24px 0; }
}
