/* ================= ПОДКЛЮЧЕНИЕ ВАШИХ ЛОКАЛЬНЫХ ШРИФТОВ ================= */
@font-face {
    font-family: 'GentiumBookPlus';
    src: url('/fonts/GentiumBookPlus-Regular_0.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'GentiumBookPlus';
    src: url('/fonts/GentiumBookPlus-Italic_0.ttf') format('truetype');
    font-weight: normal;
    font-style: italic;
}
@font-face {
    font-family: 'Cambria';
    src: url('/fonts/cambria.ttc') format('truetype');
    font-weight: normal;
}
@font-face {
    font-family: 'Cambria';
    src: url('/fonts/cambriab.ttf') format('truetype');
    font-weight: bold;
}
@font-face {
    font-family: 'Ceremoni';
    src: url('/fonts/Ceremoni.TTF') format('truetype');
}

/* ================= БАЗОВЫЕ ПЕРЕМЕННЫЕ И СБРОС ================= */
:root {
    --bg-color: #f3f3ec;
    --header-bg: #e5e5dc; /* Обновленный цвет для градиента */
    --text-color: #333333;
    --accent-green: #528c4b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'GentiumBookPlus', 'PT Serif', serif; 
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column; 
    position: relative; /* Важно для позиционирования угловой графики */
}

/* ================= ФОНОВАЯ ГРАФИКА (ПОВЕРХ ВСЕГО) ================= */
.bg-decor {
    position: absolute;
    z-index: 200; /* Выше шапки и футера! */
    width: 400px; 
    height: 400px;
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none; /* Пропускаем клики сквозь картинки */
    opacity: 0.95;
}

/* Прижимаем к абсолютным краям документа */
.top-left { top: 0; left: 0; background-image: url('/images/visual/upper_graphics.gif'); background-position: top left; z-index: 90;}
.top-right { top: 0; right: 0; background-image: url('/images/visual/upper_graphics.gif'); background-position: top right; transform: scaleX(-1);  z-index: 90;}
.bottom-left { bottom: 0; left: 0; background-image: url('/images/visual/lower_graphics.gif'); background-position: bottom left;  transform: scaleX(-1); z-index: 90;}
.bottom-right { bottom: 0; right: 0; background-image: url('/images/visual/lower_graphics.gif'); background-position: bottom right;  z-index: 90;}

/* ================= ШАПКА И НАВИГАЦИЯ ================= */
.site-header {
    /* Мягкий градиент вместо жесткого фона и рамок */
    background: linear-gradient(to bottom, var(--header-bg) 0%, rgba(243, 243, 236, 0) 100%);
    padding-top: 15px;
    padding-bottom: 30px; 
    position: relative;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-wrap: wrap; 
    justify-content: center;
    gap: 40px;
}

.nav-links li a {
    font-family: 'Cambria', 'PT Serif', serif;
    text-decoration: none;
    color: var(--text-color);
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: color 0.3s;
    font-weight: bold;
}

.nav-links li a:hover {
    color: var(--accent-green);
}

/* ================= ЦЕНТРАЛЬНЫЙ КОНТЕНТ ================= */
.content-area {
    flex-grow: 1;
    width: 100%;
    position: relative;
    z-index: 50; /* Контент ниже шапки и графики */
}

.page-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 20px 80px;
}

.main-title {
    font-family: 'Ceremoni', 'Pinyon Script', cursive;
    font-size: 4.5rem;
    text-align: center;
    margin: 0 0 10px 0;
    font-weight: normal;
    color: #4a4a4a;
}

.flourish {
    text-align: center;
    margin: 5px 0 15px;
    opacity: 0.6;
}

.author-name {
    font-family: 'Cambria', 'PT Serif', serif;
    text-align: center;
    font-size: 1.4rem;
    margin-bottom: 60px;
    font-weight: normal;
}

/* ================= ИНФОРМАЦИЯ О КНИГЕ ================= */
.book-info {
    display: flex;
    gap: 40px;
    margin-bottom: 60px;
    align-items: flex-start;
}

.book-cover {
    flex: 0 0 350px;
    position: relative;
    z-index: 60;
}

.book-cover img {
    width: 100%;
    border: 5px solid white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.book-text {
    flex: 1;
    font-size: 1.1rem;
}

.book-text p {
    margin-bottom: 20px;
}

.links {
    margin-top: 30px;
}

.links a {
    color: var(--accent-green);
    text-decoration: none;
    font-weight: bold;
}

.links a:hover {
    text-decoration: underline;
}

/* ================= СЕТКА ГАЛЕРЕИ ================= */
.gallery-section {
    margin-top: 60px;
}

.gallery-title {
    font-family: 'Cambria', 'PT Serif', serif;
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 40px;
    font-weight: normal;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 30px;
}

.gallery-item {
    display: flex;
    flex-direction: column;
}

.gallery-item img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item img:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.gallery-item figcaption {
    font-family: 'Cambria', 'PT Serif', serif;
    margin-top: 15px;
    font-size: 1.1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #555;
}

/* ================= ПОДВАЛ ================= */
.site-footer {
    /* Мягкий градиент для подвала */
    background: linear-gradient(to top, var(--header-bg) 0%, rgba(243, 243, 236, 0) 100%);
    text-align: center;
    padding: 40px 20px 20px; 
    font-family: 'Cambria', 'PT Serif', serif;
    font-size: 0.9rem;
    position: relative;
    z-index: 100;
}

/* ================= МОДАЛЬНОЕ ОКНО ================= */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0; top: 0; width: 100%; height: 100%; 
    background-color: rgba(0,0,0,0.9); 
    justify-content: center; align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    border: 5px solid white;
    border-radius: 2px;
}
.nav-links li a.home-link {
    color: var(--accent-green);
    text-shadow: 0 0 14px yellowgreen;
}
.close-btn {
    position: absolute;
    top: 20px; right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* ================= АДАПТИВНОСТЬ (МОБИЛЬНЫЕ) ================= */
@media (max-width: 768px) {
    .bg-decor { width: 220px; height: 220px; }
    
    .main-title { font-size: 3rem; margin-top: 10px; }

    .nav-links { gap: 15px 20px; }
    .nav-links li a { font-size: 12px; }

    .book-info { flex-direction: column; align-items: center; }
    .book-cover { flex: 0 0 auto; width: 80%; max-width: 350px; }

    .gallery-grid { grid-template-columns: 1fr; gap: 30px; }
    .gallery-item img { height: 250px; }
}