
/* ==========================================================
   POLITICAL FEED HISTORY
   THEME: ASHES & EMBERS
   Палитра: графит, пепел, медь, раскалённый янтарь
   ========================================================== */

:root {
    --border-h: rgba(202, 157, 105, .22);
    --accent-h: #d47a42;
    --text-main-h: #eee4d3;
    --text-muted-h: #b1a493;
    --surface-h: #211f1c;

    --ash-bg: #111211;
    --ash-panel: rgba(31, 30, 27, .94);
    --ash-panel-hover: rgba(45, 39, 33, .97);
    --ash-copper: #c77945;
    --ash-ember: #f1a35b;
    --ash-gold: #d6b98b;
    --ash-text: #eee4d3;
    --ash-muted: #a99e8e;
    --ash-border: rgba(208, 167, 117, .2);
}

/* ==========================================================
   ОБЩИЙ ФОН
   Копоть, дым и рассеянное свечение
   ========================================================== */

body.theme-wwii {
    position: relative;
    isolation: isolate;
    overflow-x: hidden;
    background-color: var(--ash-bg);
    background-image:
        radial-gradient(
            ellipse at 12% 17%,
            rgba(115, 66, 39, .16) 0,
            transparent 36%
        ),
        radial-gradient(
            ellipse at 90% 44%,
            rgba(103, 48, 31, .13) 0,
            transparent 32%
        ),
        radial-gradient(
            ellipse at 48% 88%,
            rgba(165, 66, 29, .11) 0,
            transparent 44%
        ),
        linear-gradient(
            180deg,
            #111210 0%,
            #171613 42%,
            #12110f 100%
        );
    background-attachment: fixed;
    color: var(--ash-text);
}

/* Единая модель размеров */

body.theme-wwii *,
body.theme-wwii *::before,
body.theme-wwii *::after {
    box-sizing: border-box;
}

body.theme-wwii a {
    color: var(--ash-copper);
    text-decoration: none;
    transition: color .25s ease, border-color .25s ease;
}

body.theme-wwii a:hover {
    color: var(--ash-ember);
}

/* ==========================================================
   ДЕКОРАТИВНЫЕ ТРЕЩИНЫ
   CSS-рисунок: тонкие разломы в обугленной поверхности
   ========================================================== */

body.theme-wwii .project-hero {
    isolation: isolate;
}

body.theme-wwii .project-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .34;
    background-image:
        linear-gradient(
            116deg,
            transparent 0 22%,
            rgba(205, 159, 111, .16) 22.08%,
            transparent 22.3% 100%
        ),
        linear-gradient(
            73deg,
            transparent 0 54%,
            rgba(205, 159, 111, .12) 54.08%,
            transparent 54.25% 100%
        ),
        linear-gradient(
            158deg,
            transparent 0 67%,
            rgba(205, 159, 111, .1) 67.06%,
            transparent 67.2% 100%
        ),
        linear-gradient(
            28deg,
            transparent 0 36%,
            rgba(205, 159, 111, .09) 36.05%,
            transparent 36.18% 100%
        );
    background-size:
        380px 300px,
        440px 340px,
        500px 370px,
        330px 270px;
    background-position:
        4% 18%,
        93% 40%,
        78% 4%,
        22% 82%;
    mask-image: linear-gradient(
        to bottom,
        black,
        rgba(0, 0, 0, .7) 65%,
        transparent
    );
}

/* ==========================================================
   HERO — ШАПКА ПРОЕКТА
   ========================================================== */

body.theme-wwii .project-hero {
    position: relative;
    overflow: hidden;
    padding: 112px 8% 64px;
    text-align: center;
    border-bottom: 1px solid rgba(201, 143, 87, .25);
    background:
        radial-gradient(
            ellipse at 50% 100%,
            rgba(173, 70, 34, .13),
            transparent 58%
        ),
        linear-gradient(
            180deg,
            rgba(10, 11, 10, .94),
            rgba(22, 20, 17, .96)
        );
    box-shadow: 0 20px 70px rgba(0, 0, 0, .18);
}

body.theme-wwii .back-link {
    display: inline-block;
    margin-bottom: 30px;
    padding-bottom: 4px;
    border-bottom: 1px solid transparent;
    color: #b6a38d;
    font-size: .9rem;
    font-weight: 500;
    transition:
        transform .25s ease,
        color .25s ease,
        border-color .25s ease;
}

body.theme-wwii .back-link:hover {
    transform: translateX(-4px);
    border-bottom-color: var(--ash-copper);
    color: var(--ash-ember);
}

body.theme-wwii .project-label,
body.theme-wwii #project-label {
    display: inline-block;
    margin-bottom: 16px;
    padding: 9px 14px;
    border: 1px solid rgba(194, 106, 57, .58);
    color: #d78a52;
    font-family: "Courier New", monospace;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .3em;
    text-transform: uppercase;
    background: rgba(35, 23, 17, .4);
}

body.theme-wwii .project-hero h1,
body.theme-wwii #project-title {
    position: relative;
    margin: 18px auto 20px;
    color: #f0e6d4;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(2.8rem, 6vw, 5rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: .01em;
    text-shadow: 0 5px 28px rgba(0, 0, 0, .42);
}

body.theme-wwii .project-hero h1::before,
body.theme-wwii #project-title::before {
    content: "✦";
    display: inline-block;
    margin-right: .45em;
    color: #c66d39;
    font-size: .42em;
    vertical-align: middle;
    text-shadow: 0 0 18px rgba(231, 112, 48, .2);
}

body.theme-wwii .project-hero h1::after,
body.theme-wwii #project-title::after {
    content: "✦";
    display: inline-block;
    margin-left: .45em;
    color: #c66d39;
    font-size: .42em;
    vertical-align: middle;
    text-shadow: 0 0 18px rgba(231, 112, 48, .2);
}

body.theme-wwii .project-hero p,
body.theme-wwii #project-desc {
    max-width: 680px;
    margin: 0 auto;
    color: #b7aa96;
    font-size: 1.08rem;
    font-style: italic;
    line-height: 1.8;
}

/* ==========================================================
   СЕКЦИЯ ТАЙМЛАЙНА
   ========================================================== */

body.theme-wwii .timeline-section {
    position: relative;
    overflow: hidden;
    padding: 80px 8% 110px;
    background:
        radial-gradient(
            ellipse at 50% 95%,
            rgba(164, 61, 26, .1),
            transparent 46%
        );
}

/* Дополнительное свечение огня у нижнего края */

body.theme-wwii .timeline-section::after {
    content: "";
    position: absolute;
    z-index: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 260px;
    pointer-events: none;
    background:
        radial-gradient(
            ellipse at 16% 100%,
            rgba(190, 70, 29, .13),
            transparent 58%
        ),
        radial-gradient(
            ellipse at 78% 100%,
            rgba(214, 111, 39, .1),
            transparent 52%
        );
    opacity: .8;
}

body.theme-wwii .timeline-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
}

/* Вертикальная линия времени */

body.theme-wwii .timeline-wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(186, 106, 62, .7) 7%,
        rgba(201, 133, 82, .48) 48%,
        rgba(165, 64, 37, .55) 92%,
        transparent
    );
    box-shadow: 0 0 15px rgba(194, 89, 43, .08);
}

/* ==========================================================
   СОБЫТИЯ
   Не конфликтуем с анимацией из JavaScript
   ========================================================== */

body.theme-wwii .timeline-event {
    position: relative;
    display: flex;
    align-items: flex-start;
    margin-bottom: 66px;
    opacity: 1;
    transform: none;
    animation: none;
}

/* Чередование карточек по сторонам линии */

body.theme-wwii .timeline-event:nth-child(odd) {
    flex-direction: row;
    justify-content: flex-end;
    padding-right: calc(50% + 42px);
    text-align: right;
}

body.theme-wwii .timeline-event:nth-child(even) {
    flex-direction: row-reverse;
    justify-content: flex-end;
    padding-left: calc(50% + 42px);
    text-align: left;
}

/* Классы видимости добавляет project.js */

body.theme-wwii .timeline-event.pf-event-hidden {
    opacity: 0;
    transform: translateY(18px);
}

body.theme-wwii .timeline-event.pf-event-visible {
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity .8s ease,
        transform .9s cubic-bezier(.2, .7, .2, 1);
}

/* ==========================================================
   ТОЧКИ НА ЛИНИИ
   ========================================================== */

body.theme-wwii .timeline-dot {
    position: absolute;
    top: 20px;
    left: 50%;
    z-index: 3;
    width: 17px;
    height: 17px;
    border: 2px solid #c77945;
    border-radius: 50%;
    background: #191714;
    transform: translateX(-50%);
    box-shadow:
        0 0 0 5px rgba(199, 121, 69, .07),
        0 0 13px rgba(211, 102, 49, .1);
    transition:
        background .3s ease,
        box-shadow .3s ease,
        border-color .3s ease;
}

body.theme-wwii .timeline-event:hover .timeline-dot,
body.theme-wwii .timeline-event.pf-event-active .timeline-dot {
    border-color: #f0a25b;
    background: #d47a42;
    box-shadow:
        0 0 0 6px rgba(212, 122, 66, .12),
        0 0 20px rgba(230, 112, 48, .28);
}

/* ==========================================================
   ФОТОГРАФИИ — АРХИВНЫЕ СНИМКИ
   Главное: фотографии не скрываются до загрузки
   ========================================================== */

body.theme-wwii .timeline-photo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 330px);
    min-height: 180px;
    overflow: hidden;
    border: 7px solid #d9cfbb;
    background: #191815;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, .42),
        0 0 0 1px rgba(201, 161, 118, .15);
    isolation: isolate;
}

/* Тонкая внутренняя рамка */

body.theme-wwii .timeline-photo::before {
    content: "";
    position: absolute;
    z-index: 2;
    inset: 0;
    border: 1px solid rgba(40, 31, 24, .38);
    pointer-events: none;
}

/* Не закрываем картинку псевдоэлементом */

body.theme-wwii .timeline-photo::after {
    content: none;
}

body.theme-wwii .timeline-photo img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 390px;
    object-fit: cover;
    opacity: 1;
    visibility: visible;
    filter: grayscale(100%) sepia(17%) contrast(1.04) brightness(.95);
    transform: none;
    transition:
        filter .65s ease,
        transform .8s cubic-bezier(.2, .7, .2, 1);
}

/* Лёгкое оживление снимка при наведении */

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    body.theme-wwii .timeline-photo:hover img {
        filter: grayscale(86%) sepia(12%) contrast(1.05) brightness(1);
        transform: scale(1.025);
    }
}

/* Появление только после успешной загрузки */

body.theme-wwii .timeline-photo.pf-photo-loaded img {
    animation: ashPhotoReveal .95s ease-out both;
}

@keyframes ashPhotoReveal {
    0% {
        filter: grayscale(100%) sepia(24%) contrast(1.02) brightness(.78);
    }
    55% {
        filter: grayscale(100%) sepia(18%) contrast(1.04) brightness(1);
    }
    100% {
        filter: grayscale(100%) sepia(17%) contrast(1.04) brightness(.95);
    }
}

/* Снимок отсутствует */

body.theme-wwii .timeline-photo.empty {
    min-height: 150px;
    border-color: rgba(201, 170, 131, .22);
    background:
        linear-gradient(135deg, rgba(95, 72, 48, .12), transparent),
        #171613;
    box-shadow: none;
}

/* ==========================================================
   КАРТОЧКИ СОБЫТИЙ
   ========================================================== */

body.theme-wwii .timeline-card {
    position: relative;
    width: 100%;
    max-width: 390px;
    padding: 27px 28px;
    border: 1px solid rgba(201, 170, 131, .18);
    border-radius: 3px;
    background:
        linear-gradient(
            145deg,
            rgba(43, 39, 33, .97),
            rgba(29, 28, 25, .97)
        );
    box-shadow:
        0 12px 32px rgba(0, 0, 0, .19),
        inset 0 1px 0 rgba(235, 211, 174, .025);
    cursor: pointer;
    transition:
        background .3s ease,
        border-color .3s ease,
        box-shadow .3s ease,
        transform .3s ease;
}

/* Медная полоска слева */

body.theme-wwii .timeline-card::before {
    content: "";
    position: absolute;
    top: -1px;
    bottom: -1px;
    left: -1px;
    width: 3px;
    background: linear-gradient(
        to bottom,
        #d88b51,
        #873d2c 70%,
        #562b23
    );
    opacity: .9;
}

body.theme-wwii .timeline-event:nth-child(even) .timeline-card::before {
    right: -1px;
    left: auto;
}

body.theme-wwii .timeline-card:hover {
    transform: translateY(-3px);
    border-color: rgba(211, 139, 81, .42);
    background: var(--ash-panel-hover);
    box-shadow:
        0 17px 38px rgba(0, 0, 0, .28),
        0 0 22px rgba(178, 80, 39, .05);
}

body.theme-wwii .timeline-card:focus-visible {
    outline: 2px solid var(--ash-copper);
    outline-offset: 4px;
}

/* Год */

body.theme-wwii .timeline-year {
    display: inline-block;
    margin-bottom: 9px;
    color: #d9854b;
    font-family: "Courier New", monospace;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: .1em;
    line-height: 1;
}

/* Дата */

body.theme-wwii .timeline-date {
    display: block;
    margin-bottom: 15px;
    color: #928573;
    font-family: "Courier New", monospace;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

/* Заголовок карточки */

body.theme-wwii .timeline-card h3 {
    margin: 0 0 12px;
    color: #eee3d1;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.32;
    transition: color .25s ease;
}

body.theme-wwii .timeline-card:hover h3 {
    color: #f0b77e;
}

/* Описание */

body.theme-wwii .timeline-card p {
    margin: 0 0 18px;
    color: #b7ac9a;
    font-size: .93rem;
    line-height: 1.75;
}

/* Читать статью */

body.theme-wwii .timeline-read-more {
    display: inline-block;
    padding-bottom: 3px;
    border-bottom: 1px solid transparent;
    color: #d9854b;
    font-family: "Courier New", monospace;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .1em;
    transition:
        color .25s ease,
        border-color .25s ease;
}

body.theme-wwii .timeline-card:hover .timeline-read-more {
    border-bottom-color: rgba(217, 133, 75, .6);
    color: #f1b77f;
}

/* Пустая шкала */

body.theme-wwii .timeline-wrapper.empty {
    padding: 60px 0;
    text-align: center;
}

/* ==========================================================
   МОДАЛЬНОЕ ОКНО
   ========================================================== */

body.theme-wwii #article-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    inset: 0;
    overflow-y: auto;
    padding: 4vh 18px;
    background: rgba(6, 6, 5, .86);
    backdrop-filter: blur(7px);
}

body.theme-wwii #article-modal .modal-content {
    position: relative;
    width: min(100%, 850px);
    max-height: 91vh;
    overflow-y: auto;
    margin: 0 auto;
    padding: 36px clamp(22px, 5vw, 54px);
    border: 1px solid rgba(201, 157, 105, .24);
    background:
        radial-gradient(
            ellipse at top right,
            rgba(113, 59, 33, .1),
            transparent 45%
        ),
        #191815;
    color: #e9decc;
    box-shadow: 0 30px 100px rgba(0, 0, 0, .55);
}

body.theme-wwii .close-btn {
    position: sticky;
    top: 0;
    z-index: 5;
    float: right;
    border: 0;
    background: transparent;
    color: #a99b87;
    font-size: 31px;
    line-height: 1;
    cursor: pointer;
    transition: color .2s ease, transform .2s ease;
}

body.theme-wwii .close-btn:hover {
    transform: rotate(5deg);
    color: #e59a60;
}

body.theme-wwii #modal-title {
    margin: 12px 0 16px;
    color: #f0e5d2;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(27px, 4vw, 42px);
    line-height: 1.2;
}

body.theme-wwii .modal-date {
    display: block;
    margin: 0 0 22px;
    color: #a8957d;
    font-family: "Courier New", monospace;
    font-size: 12px;
    letter-spacing: .1em;
}

body.theme-wwii #modal-image {
    display: block;
    max-width: 100%;
    max-height: 430px;
    margin: 20px auto 28px;
    object-fit: contain;
    filter: grayscale(100%) sepia(15%);
}

body.theme-wwii #modal-body {
    overflow-wrap: anywhere;
    color: #d2c5b1;
    font-size: 16px;
    line-height: 1.9;
}

body.theme-wwii #modal-body h1,
body.theme-wwii #modal-body h2,
body.theme-wwii #modal-body h3 {
    margin-top: 1.6em;
    color: #f0e5d2;
    line-height: 1.35;
}

body.theme-wwii #modal-body p {
    margin: 0 0 1.25em;
}

body.theme-wwii #modal-body blockquote {
    margin: 25px 0;
    padding: 7px 0 7px 20px;
    border-left: 2px solid #c77945;
    color: #ad9e88;
    font-style: italic;
}

body.theme-wwii #modal-body img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 25px auto;
}

body.theme-wwii .open-article-btn {
    display: inline-block;
    margin-top: 26px;
    padding: 12px 16px;
    border: 1px solid rgba(199, 121, 69, .55);
    color: #e1a36e;
    font-family: "Courier New", monospace;
    font-size: 12px;
    letter-spacing: .04em;
    transition: background .25s ease, border-color .25s ease;
}

body.theme-wwii .open-article-btn:hover {
    border-color: #d78a52;
    background: rgba(199, 121, 69, .09);
}

/* Прогресс чтения */

body.theme-wwii #reading-progress {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 10;
    display: block;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #8c3b29, #e49a5d);
}

/* ==========================================================
   ИСКРЫ И ИНДИКАТОР ПРОКРУТКИ ИЗ JAVASCRIPT
   ========================================================== */

body.theme-wwii .pf-ember {
    mix-blend-mode: screen;
    background: #e7a15b;
    box-shadow:
        0 0 5px rgba(231, 161, 91, .6),
        0 0 13px rgba(214, 90, 40, .25);
}

body.theme-wwii #pf-scroll-progress {
    background: linear-gradient(90deg, #8b3d2a, #d47a42, #f0b77e);
    box-shadow: 0 0 8px rgba(212, 122, 66, .25);
}

/* ==========================================================
   АДАПТИВНОСТЬ
   ========================================================== */

@media (max-width: 900px) {
    body.theme-wwii .timeline-section {
        padding-right: 5%;
        padding-left: 5%;
    }

    body.theme-wwii .timeline-event:nth-child(odd) {
        padding-right: calc(50% + 28px);
    }

    body.theme-wwii .timeline-event:nth-child(even) {
        padding-left: calc(50% + 28px);
    }

    body.theme-wwii .timeline-card {
        padding: 22px;
    }

    body.theme-wwii .timeline-photo {
        width: min(100%, 300px);
    }
}

@media (max-width: 680px) {
    body.theme-wwii .project-hero {
        padding: 90px 5% 42px;
    }

    body.theme-wwii .project-hero h1,
    body.theme-wwii #project-title {
        font-size: clamp(2.2rem, 9vw, 3.5rem);
    }

    body.theme-wwii .project-hero p,
    body.theme-wwii #project-desc {
        font-size: .98rem;
    }

    body.theme-wwii .timeline-section {
        padding: 46px 5% 70px;
    }

    body.theme-wwii .timeline-wrapper::before {
        left: 11px;
    }

    body.theme-wwii .timeline-event,
    body.theme-wwii .timeline-event:nth-child(odd),
    body.theme-wwii .timeline-event:nth-child(even) {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        margin-bottom: 45px;
        padding: 0 0 0 32px;
        text-align: left;
    }

    body.theme-wwii .timeline-dot {
        top: 17px;
        left: 11px;
        width: 14px;
        height: 14px;
    }

    body.theme-wwii .timeline-photo {
        width: 100%;
        max-width: 440px;
        min-height: 120px;
    }

    body.theme-wwii .timeline-photo img {
        max-height: 320px;
    }

    body.theme-wwii .timeline-card {
        width: 100%;
        max-width: 520px;
        padding: 22px;
        text-align: left;
    }

    body.theme-wwii .timeline-card h3 {
        font-size: 1.2rem;
    }

    body.theme-wwii .timeline-card p {
        font-size: .9rem;
    }

    body.theme-wwii #article-modal {
        padding: 10px;
    }

    body.theme-wwii #article-modal .modal-content {
        max-height: 95vh;
        padding: 25px 19px;
    }
}

/* ==========================================================
   ДОСТУПНОСТЬ
   ========================================================== */

@media (prefers-reduced-motion: reduce) {
    body.theme-wwii *,
    body.theme-wwii *::before,
    body.theme-wwii *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

    body.theme-wwii .timeline-event.pf-event-hidden,
    body.theme-wwii .timeline-event.pf-event-visible {
        opacity: 1;
        transform: none;
    }
}
