/* ======================================================= */
/* 0. ПОДКЛЮЧЕНИЕ ШРИФТОВ */
/* ======================================================= */
@font-face {
  font-family: 'Monomakh';
  src: url('fonts/Monomakh-Regular.woff2') format('woff2'),
       url('fonts/Monomakh-Regular.woff') format('woff');
  font-weight: normal; font-style: normal; font-display: swap;
}

/* ======================================================= */
/* 1. ОБЩИЕ СТИЛИ */
/* ======================================================= */
html { scroll-behavior: smooth; }
body { 
    margin: 0; 
    font-family: 'Playfair Display', serif; 
    background-color: #fdfaf5; 
    overflow-x: hidden;
}
:root { 
    --text-color-main: #4E342E; 
    --text-color-secondary: #6D4C41; 
    --accent-color: #8D6E63;
}
* {
    box-sizing: border-box;
}

/* ======================================================= */
/* 2. БОКОВАЯ НАВИГАЦИЯ */
/* ======================================================= */
.side-nav {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 1000;
}
.side-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.side-nav li {
    margin: 12px 0;
}
.side-nav .nav-dot {
    display: block;
    width: 12px;
    height: 12px;
    background-color: rgba(78, 52, 46, 0.3);
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
}
.side-nav .nav-dot:hover {
    background-color: var(--text-color-main);
    transform: scale(1.2);
}
.side-nav .nav-dot.active {
    background-color: var(--text-color-main);
    transform: scale(1.5);
}
.side-nav .nav-dot::before {
    content: attr(data-tooltip);
    position: absolute;
    top: 50%;
    right: 150%;
    transform: translateY(-50%);
    background-color: var(--text-color-main);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.side-nav .nav-dot:hover::before {
    opacity: 1;
    visibility: visible;
}

/* ======================================================= */
/* 3. БАЗОВЫЕ СТИЛИ КОМПОНЕНТОВ */
/* ======================================================= */
.fullscreen-block { 
    min-height: 100vh; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    background-size: cover; 
    background-position: center; 
    padding: 80px 40px; 
    box-sizing: border-box; 
    background-image: url('images/background-parchment.jpg'); 
    background-attachment: fixed;
}
.content { 
    text-align: center; 
    width: 100%; 
    max-width: 1200px; 
}
.layout-two-columns, .image-gallery-columns { 
    display: flex; 
    gap: 40px; 
    width: 100%;
}
.text-column { 
    color: var(--text-color-main); 
    text-align: left; 
    flex: 1;
}
.image-column { 
    display: flex; 
    justify-content: center; 
    align-items: center;
    flex: 1;
}
figure { 
    margin: 0; 
}
figure a { 
    position: relative; 
    display: block; 
}
figure img { 
    width: 100%; 
    display: block; 
    border: 1px solid #ddd; 
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); 
    cursor: pointer; 
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
}
figure img:hover { 
    transform: scale(1.03); 
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* ======================================================= */
/* 4. ГЛОБАЛЬНАЯ ТИПОГРАФИКА */
/* ======================================================= */
h1, h2, h3, p, ul, blockquote { color: var(--text-color-main); }
h3 { font-size: clamp(1.4em, 4vw, 1.8em); }
p { font-size: clamp(1.1em, 2.5vw, 1.3em); line-height: 1.7; }
blockquote { 
    font-size: clamp(1.1em, 2.5vw, 1.3em); 
    margin: 20px auto; 
    padding-left: 20px; 
    border-left: 3px solid var(--accent-color); 
    text-align: left; 
    max-width: 800px;
}
ul { list-style: square; font-size: clamp(1.1em, 2.5vw, 1.3em); padding-left: 25px; }
figcaption { margin-top: 15px; font-size: clamp(0.9em, 2vw, 1.0em); color: var(--text-color-secondary); text-align: center; }
a { color: var(--text-color-main); text-decoration: none; }
a:hover { text-decoration: underline; }
.source-text { font-size: clamp(1.0em, 2vw, 1.1em); color: var(--text-color-secondary); margin-top: 20px; text-align: left; }
.main-heading { font-family: 'Monomakh', cursive; font-weight: normal; font-size: clamp(2.8em, 7vw, 4.2em); line-height: 1.2; }
.main-heading-subtitle { font-family: 'Monomakh', cursive; font-weight: normal; font-size: clamp(2.0em, 5vw, 3.0em); margin-bottom: 1em; }
.subtitle { font-size: clamp(1.1em, 2.5vw, 1.3em); margin-bottom: 2em; }
.year { font-size: clamp(1.2em, 2.5vw, 1.4em); margin-top: 0; margin-bottom: 10px; }
.section-heading { font-family: 'Monomakh', cursive; font-size: clamp(2.5em, 6vw, 3.0em); font-weight: normal; text-align: center; margin-bottom: 40px; width: 100%; }
.subsection-heading { font-family: 'Monomakh', cursive; font-size: clamp(2.0em, 5vw, 2.5em); text-align: center; margin: 30px 0 20px 0; }
.renaming-flow { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 20px 0; flex-wrap: wrap; }
.renaming-flow span { font-family: 'Monomakh', cursive; font-size: clamp(1.8em, 4vw, 2.2em); }
.renaming-flow img { height: 1.2em; }
.photo-title { text-align: center; }
.text-block { width: 100%; text-align: center; margin: 0 auto 30px auto; max-width: 900px; }

/* ======================================================= */
/* 5. ЛОКАЛЬНЫЕ СТИЛИ И УЛУЧШЕНИЯ */
/* ======================================================= */
#block1 .photo-gallery { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; }
#block1 .photo-gallery img { max-width: 400px; width: 45%; height: auto; border-radius: 10px; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25); }
.visitor-counter {
    margin-top: 30px;
}
.content { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.layout-two-columns { align-items: center; }
#block2 .text-block > p { margin-bottom: 0; }
#block2 .street-list-inside-quote {
    list-style: none;
    padding-left: 0;
    margin-top: 15px;
    text-align: center;
    font-size: 1.1em;
    line-height: 1.6;
}
#block3 .text-column, #block3 .image-column { flex: 1; }
#block4 .text-column, #block15 .text-column, #block18 .text-column, #block20 .text-column { display: flex; flex-direction: column; justify-content: center; gap: 30px; text-align: center;}
.photo-grid-2x2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; width: 100%; }
.image-gallery-columns { align-items: flex-start; }
.gallery-column { flex: 1; }
#block7 .text-block blockquote, #block9 .text-block blockquote { border-left: none; padding-left: 0; text-align: center; }
#block9 .source-text { text-align: right; }
#block11 .text-block { text-align: left; }
#block11 .gallery-column { display: flex; flex-direction: column; gap: 30px; }
#block15 .renaming-list { list-style: none; padding: 0; font-size: 1.4em; line-height: 1.8; text-align: left; }
#block15 .renaming-list strong { font-family: 'Monomakh', cursive; font-size: 1.2em; }
#block16 .text-block figure { max-width: 500px; margin: 20px auto 0 auto; }
#block19 .subsection-heading { font-size: clamp(1.5em, 4vw, 2em); }
#block22 .central-streets-list { list-style: none; padding: 0; text-align: left; }
#block22 .central-streets-list li { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
#block23 .layout-two-columns { align-items: flex-start; }
#block23 .photo-stack-column { flex: 1; display: flex; flex-direction: column; gap: 30px; }
#block23 .text-block { text-align: left; margin-bottom: 0; }
#block24 .final-image { max-width: 250px; opacity: 0.7; margin-bottom: 20px; }
#block24 p { margin: 5px 0; }

/* ======================================================= */
/* 6. АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ */
/* ======================================================= */
@media (max-width: 992px) {
    .side-nav {
        right: 10px;
    }
    .side-nav .nav-dot::before {
        display: none;
    }
}

@media (max-width: 768px) {
    .fullscreen-block {
        padding: 60px 20px;
        background-attachment: scroll;
    }
    .layout-two-columns, .image-gallery-columns { 
        flex-direction: column; 
        gap: 30px;
    }
    .photo-grid-2x2 {
        grid-template-columns: 1fr;
    }
    #block1 .photo-gallery img {
        max-width: 90%;
        width: 100%;
    }
    blockquote, .text-column, #block15 .renaming-list, #block23 .text-block {
        text-align: center;
    }
    blockquote {
        border-left: none;
        padding-left: 0;
    }
    #block9 .source-text, .source-text {
        text-align: center;
    }
    #block22 .central-streets-list li {
        flex-direction: column;
        justify-content: center;
    }
    .side-nav {
        display: none;
    }
}