/*
Theme Name: dds_astral-film.ru
Theme URI: https://astral-film.ru
Author: Молчанов Святослав
Author URI: https://astral-film.ru
Description: Тема для сайта о фильмах ужасов: история жанра, обзоры и новинки. Тёмная мистическая стилистика.
Version: 1.1
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: astralfilm
*/

/* ==================== БАЗА ==================== */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 17px;
    line-height: 1.65;
    color: #C7C7C7;
    background-color: #0A0A0A;
    background-image:
        repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 3px),
        radial-gradient(ellipse at 30% 20%, rgba(43,13,13,0.25), transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(59,94,59,0.06), transparent 60%);
    background-attachment: fixed;
    min-height: 100vh;
}

img { max-width: 100%; height: auto; }

a {
    color: #6A9D6A;
    text-decoration: none;
    border-bottom: 1px dotted rgba(106,157,106,0.4);
    transition: color .25s ease, border-color .25s ease;
}

a:hover, a:focus {
    color: #B85050;
    border-bottom-color: #B85050;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Playfair Display", Georgia, serif;
    color: #E0D6C8;
    line-height: 1.25;
    margin: 1.4em 0 0.6em;
    letter-spacing: 0.02em;
}

h1 { font-size: 2.1rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

/* "Кровавая" подпись для заголовков разделов */
.section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 0.4em;
    margin-bottom: 0.9em;
}
.section-title::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 6px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 6' preserveAspectRatio='none'><path d='M0 3 Q 25 0 50 3 T 100 3 T 150 3 T 200 3' stroke='%238B2A2A' stroke-width='2' fill='none' stroke-linecap='round'/></svg>") repeat-x center;
    background-size: 200px 6px;
    opacity: 0.85;
}

ul, ol { padding-left: 1.4em; }

blockquote {
    margin: 1.5em 0;
    padding: 1em 1.2em;
    background: #1a0707;
    border-left: 3px solid #8B2A2A;
    color: #C7C7C7;
    font-style: italic;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    border: 1px solid #3a1a1a;
}
th, td {
    border: 1px solid #3a1a1a;
    padding: 0.55em 0.8em;
    text-align: left;
}
th {
    background: #2B0D0D;
    color: #E0D6C8;
}

code, pre {
    font-family: "Courier New", monospace;
    background: #160404;
    color: #C7C7C7;
}
code { padding: 0.1em 0.35em; border-radius: 2px; }
pre { padding: 1em; overflow-x: auto; }

::selection { background: #8B2A2A; color: #E0D6C8; }

/* ==================== СЕТКА ==================== */

.wrap {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 22px;
}

.layout {
    display: flex;
    gap: 32px;
    margin: 36px auto;
    align-items: flex-start;
}

.layout .main { flex: 1 1 67%; min-width: 0; }
.layout .sidebar { flex: 0 0 27%; }
.layout--full .main { flex: 1 1 100%; max-width: 85%; margin: 0 auto; }

@media (max-width: 960px) {
    .layout { flex-direction: column; }
    .layout .main, .layout .sidebar { flex: 1 1 100%; width: 100%; }
    .layout--full .main { max-width: 100%; }
}

/* ==================== КНОПКИ — НАДГРОБНАЯ ПЛИТА ==================== */

.btn-stone {
    display: inline-block;
    padding: 0.7em 1.5em;
    background: #2B0D0D;
    color: #E0D6C8;
    border: 1px solid #3B5E3B;
    text-decoration: none;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    clip-path: polygon(15px 0, calc(100% - 8px) 0, 100% 12px, 100% calc(100% - 18px), calc(100% - 14px) 100%, 10px 100%, 0 calc(100% - 8px), 0 16px);
    box-shadow:
        inset 0 0 18px rgba(0,0,0,0.6),
        0 3px 0 #1a0707,
        0 4px 12px rgba(0,0,0,0.7);
    transition: transform .15s ease, color .25s ease, background .25s ease, box-shadow .15s ease;
}

.btn-stone:hover, .btn-stone:focus {
    color: #fff;
    background: #4a1414;
    border-color: #8B2A2A;
    transform: translateY(2px);
    box-shadow:
        inset 0 0 22px rgba(0,0,0,0.7),
        0 1px 0 #1a0707,
        0 2px 8px rgba(0,0,0,0.7);
}

/* ==================== ШАПКА ==================== */

.site-header {
    background: linear-gradient(180deg, #160404 0%, #0A0A0A 100%);
    border-bottom: 1px solid #2B0D0D;
    padding: 18px 0;
}

.site-header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    border: none;
}
.brand:hover { border: none; }

.brand-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 0 6px rgba(139,42,42,0.4));
    animation: neon-flicker 10s infinite;
}

@keyframes neon-flicker {
    0%, 92%, 100% { opacity: 1; filter: drop-shadow(0 0 6px rgba(139,42,42,0.4)); }
    93% { opacity: 0.4; filter: drop-shadow(0 0 2px rgba(139,42,42,0.2)); }
    94% { opacity: 1; }
    95% { opacity: 0.6; }
    96% { opacity: 1; filter: drop-shadow(0 0 10px rgba(139,42,42,0.7)); }
}

.brand-text { display: flex; flex-direction: column; }
.brand-name {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.4rem;
    color: #E0D6C8;
    line-height: 1.15;
    letter-spacing: 0.03em;
}
.brand-tagline {
    font-size: 0.85rem;
    color: #6A9D6A;
    margin-top: 2px;
    font-style: italic;
}

.primary-nav { margin-left: auto; }
.primary-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.primary-nav a {
    display: block;
    padding: 8px 14px;
    color: #C7C7C7;
    border: none;
    font-size: 0.98rem;
    letter-spacing: 0.02em;
    transition: color .2s, background .2s;
}
.primary-nav a:hover, .primary-nav .current-menu-item a {
    color: #E0D6C8;
    background: rgba(43,13,13,0.6);
}

.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid #3B5E3B;
    color: #C7C7C7;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 1.2rem;
}

@media (max-width: 760px) {
    .menu-toggle { display: inline-block; margin-left: auto; }
    .primary-nav { width: 100%; margin-left: 0; display: none; }
    .primary-nav.is-open { display: block; }
    .primary-nav ul { flex-direction: column; gap: 0; }
    .primary-nav a { padding: 12px 4px; border-bottom: 1px solid #2B0D0D; }
}

/* ==================== ХЛЕБНЫЕ КРОШКИ ==================== */

.crumbs {
    margin: 22px 0 8px;
    font-size: 0.9rem;
    color: #888;
}
.crumbs a {
    color: #6A9D6A;
    border: none;
}
.crumbs a:hover { color: #B85050; }
.crumbs .sep { color: #5a5a5a; margin: 0 6px; }

/* ==================== САЙДБАР ==================== */

.sidebar {
    background: #160404;
    border: 1px solid #2B0D0D;
    padding: 18px 20px;
}
.sidebar .widget {
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px dashed #2B0D0D;
}
.sidebar .widget:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.sidebar .widget-title {
    margin-top: 0;
    font-size: 1.05rem;
    color: #E0D6C8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li {
    padding: 5px 0;
    border-bottom: 1px dotted #2B0D0D;
}
.sidebar li:last-child { border-bottom: none; }

/* ==================== КАРТОЧКИ ЗАПИСЕЙ ==================== */

.cards-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.card {
    display: flex;
    flex-direction: column;
    background: #160404;
    border: 1px solid #2B0D0D;
    overflow: hidden;
    transition: border-color .25s ease, transform .25s ease;
}
.card:hover {
    border-color: #3B5E3B;
    transform: translateY(-2px);
}

/* Горизонтальная карточка */
.card--row {
    flex-direction: row;
}

.card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
    background: #0A0A0A;
}
.card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border: none;
}
.card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease, filter .3s ease;
}
.card-thumb-wrap:hover img {
    transform: scale(1.04);
    filter: contrast(1.05) saturate(0.85);
}

/* VHS-помехи на ховере постера */
.card-thumb-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(0deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 3px),
        repeating-linear-gradient(0deg, rgba(139,42,42,0.08) 0 2px, transparent 2px 6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    mix-blend-mode: screen;
}
.card-thumb-wrap:hover::after {
    opacity: 1;
    animation: vhs-jitter 0.25s infinite;
}
@keyframes vhs-jitter {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(2px); }
}

.card-body {
    flex: 1;
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
}

.card-title {
    margin: 0 0 8px;
    font-size: 1.3rem;
    line-height: 1.25;
}
.card-title a {
    color: #E0D6C8;
    border: none;
}
.card-title a:hover { color: #B85050; }

.card-meta {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 10px;
}
.card-meta a { color: #6A9D6A; border: none; }
.card-meta a:hover { color: #B85050; }

.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}

.card-footer {
    margin-top: auto;
    padding-top: 12px;
}

@media (max-width: 600px) {
    .card--row { flex-direction: column; }
    .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
    .card-thumb-wrap a { position: static; }
    .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
}

/* ==================== ГЛАВНАЯ ==================== */

.hero {
    margin: 30px 0 40px;
    padding: 60px 30px;
    background:
        linear-gradient(rgba(10,10,10,0.7), rgba(10,10,10,0.85)),
        radial-gradient(circle at center, #2B0D0D, #0A0A0A);
    border: 1px solid #2B0D0D;
    text-align: center;
}
.hero-title {
    font-size: 2.4rem;
    margin: 0 0 0.4em;
    color: #E0D6C8;
}
.hero-subtitle {
    color: #C7C7C7;
    font-style: italic;
    max-width: 700px;
    margin: 0 auto 1.4em;
}

.feature-block {
    margin: 50px 0;
    padding: 36px 30px;
    background: #160404;
    border: 1px solid #2B0D0D;
    position: relative;
}
.feature-block::before {
    content: "";
    position: absolute;
    top: -1px; left: -1px;
    width: 24px; height: 24px;
    border-top: 2px solid #8B2A2A;
    border-left: 2px solid #8B2A2A;
}
.feature-block::after {
    content: "";
    position: absolute;
    bottom: -1px; right: -1px;
    width: 24px; height: 24px;
    border-bottom: 2px solid #8B2A2A;
    border-right: 2px solid #8B2A2A;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
    margin-top: 24px;
}
.feature-item {
    padding: 18px;
    background: #0A0A0A;
    border-left: 3px solid #3B5E3B;
}
.feature-item h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    color: #E0D6C8;
}
.feature-item p { margin: 0; font-size: 0.95rem; }

.steps-list {
    counter-reset: step;
    list-style: none;
    padding: 0;
    margin-top: 24px;
}
.steps-list li {
    counter-increment: step;
    padding: 14px 14px 14px 60px;
    margin-bottom: 12px;
    background: #0A0A0A;
    border: 1px solid #2B0D0D;
    position: relative;
}
.steps-list li::before {
    content: counter(step);
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    width: 34px; height: 34px;
    line-height: 34px;
    text-align: center;
    background: #2B0D0D;
    color: #E0D6C8;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.1rem;
    border: 1px solid #3B5E3B;
}

/* Цитата в стиле "плёнка" / субтитры старого ужастика */
.film-quote {
    margin: 30px 0;
    padding: 20px 24px;
    background: rgba(0,0,0,0.85);
    border: 1px dashed #5a5a5a;
    color: #f0d460;
    text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;
    font-family: "Courier New", monospace;
    font-style: italic;
    font-size: 1.05rem;
    text-align: center;
    animation: subtitle-jitter 0.3s infinite;
}
@keyframes subtitle-jitter {
    0%, 100% { transform: translate(0,0); }
    25% { transform: translate(0.4px, -0.3px); }
    50% { transform: translate(-0.3px, 0.4px); }
    75% { transform: translate(0.3px, 0.3px); }
}

/* ==================== СЛАЙДЕР ==================== */

.film-slider {
    position: relative;
    margin: 28px 0;
    overflow: hidden;
    border: 1px solid #2B0D0D;
    background: #0A0A0A;
}
.slider-track {
    display: flex;
    transition: transform .5s ease;
}
.slider-slide {
    flex: 0 0 100%;
    min-width: 100%;
    padding: 40px 60px;
    text-align: center;
    box-sizing: border-box;
}
.slider-slide h3 {
    color: #E0D6C8;
    margin-top: 0;
    font-size: 1.5rem;
}
.slider-slide p {
    max-width: 640px;
    margin: 0 auto;
    color: #C7C7C7;
}
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px; height: 40px;
    background: rgba(43,13,13,0.85);
    color: #E0D6C8;
    border: 1px solid #3B5E3B;
    cursor: pointer;
    font-size: 1.3rem;
    z-index: 2;
}
.slider-arrow:hover { background: #8B2A2A; }
.slider-arrow.prev { left: 10px; }
.slider-arrow.next { right: 10px; }
.slider-dots {
    position: absolute;
    left: 0; right: 0;
    bottom: 12px;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 2;
}
.slider-dots button {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #5a5a5a;
    border: none;
    cursor: pointer;
    padding: 0;
}
.slider-dots button.active { background: #8B2A2A; }

/* ==================== ОДИНОЧНАЯ ЗАПИСЬ ==================== */

.entry {
    background: #160404;
    border: 1px solid #2B0D0D;
    padding: 28px 32px;
}
.entry-title {
    margin-top: 0;
    font-size: 2rem;
    color: #E0D6C8;
}
.entry-meta {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #2B0D0D;
}
.entry-meta a { color: #6A9D6A; border: none; }
.entry-meta a:hover { color: #B85050; }

.entry-thumb {
    margin: 0 0 22px;
}
.entry-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

.entry-content {
    font-size: 1.02rem;
    line-height: 1.75;
}
.entry-content h2, .entry-content h3, .entry-content h4 {
    margin-top: 1.4em;
}
.entry-content img {
    height: auto;
    display: block;
    margin: 1em auto;
}

.tags-line {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #2B0D0D;
    font-size: 0.92rem;
    color: #888;
}
.tags-line a { color: #6A9D6A; border: none; margin-right: 6px; }

/* ==================== ПАГИНАЦИЯ ==================== */

.pager {
    margin: 36px 0 12px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}
.pager a, .pager span {
    display: inline-block;
    min-width: 40px;
    padding: 8px 12px;
    text-align: center;
    background: #160404;
    color: #C7C7C7;
    border: 1px solid #2B0D0D;
    text-decoration: none;
    font-family: "Playfair Display", Georgia, serif;
    transition: all .2s;
}
.pager a:hover {
    background: #2B0D0D;
    color: #E0D6C8;
    border-color: #3B5E3B;
}
.pager .current {
    background: #2B0D0D;
    color: #E0D6C8;
    border-color: #8B2A2A;
}

/* ==================== ФОРМА ПОИСКА ==================== */

.search-form {
    display: flex;
    gap: 8px;
    margin: 14px 0;
}
.search-form input[type="search"] {
    flex: 1;
    padding: 10px 14px;
    background: #0A0A0A;
    border: 1px solid #2B0D0D;
    color: #C7C7C7;
    font-family: inherit;
    font-size: 1rem;
}
.search-form input[type="search"]:focus {
    outline: none;
    border-color: #3B5E3B;
}
.search-form button {
    padding: 10px 18px;
    background: #2B0D0D;
    color: #E0D6C8;
    border: 1px solid #3B5E3B;
    cursor: pointer;
    font-family: "Playfair Display", Georgia, serif;
}
.search-form button:hover {
    background: #8B2A2A;
}

/* ==================== КОММЕНТАРИИ ==================== */

.comments-area {
    margin-top: 36px;
    padding: 24px 26px;
    background: #160404;
    border: 1px solid #2B0D0D;
}
.comments-title {
    margin-top: 0;
    font-size: 1.4rem;
}
.comments-area ol { list-style: none; padding: 0; }
.comments-area .children { padding-left: 26px; }
.comments-area .comment {
    margin-bottom: 18px;
    padding: 14px 16px;
    background: #0A0A0A;
    border-left: 3px solid #3B5E3B;
}
.comments-area .comment-meta {
    font-size: 0.88rem;
    color: #888;
    margin-bottom: 8px;
}
.comments-area .comment-meta strong { color: #E0D6C8; }

.comment-respond {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid #2B0D0D;
}
.comment-form label {
    display: block;
    margin: 8px 0 4px;
    color: #C7C7C7;
    font-size: 0.92rem;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    background: #0A0A0A;
    border: 1px solid #2B0D0D;
    color: #C7C7C7;
    font-family: inherit;
    font-size: 1rem;
}
.comment-form textarea { min-height: 130px; resize: vertical; }
.comment-form input:focus, .comment-form textarea:focus {
    outline: none;
    border-color: #3B5E3B;
}
.comment-form .form-submit input[type="submit"] {
    margin-top: 12px;
}

/* ==================== ПОДВАЛ ==================== */

.site-footer {
    margin-top: 48px;
    background: #160404;
    border-top: 1px solid #2B0D0D;
    color: #C7C7C7;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    padding: 36px 0 18px;
}
.footer-col .widget-title {
    color: #E0D6C8;
    font-size: 1.05rem;
    margin-top: 0;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid #2B0D0D;
    padding-bottom: 8px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { padding: 4px 0; }
.footer-col a { color: #6A9D6A; border: none; }
.footer-col a:hover { color: #B85050; }
.footer-bottom {
    padding: 16px 0 28px;
    border-top: 1px solid #2B0D0D;
    text-align: center;
    font-size: 0.9rem;
    color: #888;
}

@media (max-width: 760px) {
    .footer-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* ==================== COOKIE-БАННЕР ==================== */

.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 9999;
    background: #160404;
    border: 1px solid #8B2A2A;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    box-shadow: 0 6px 24px rgba(0,0,0,0.7);
    color: #C7C7C7;
}
.cookie-banner p {
    margin: 0;
    flex: 1 1 280px;
    font-size: 0.93rem;
}
.cookie-banner button {
    background: #2B0D0D;
    color: #E0D6C8;
    border: 1px solid #3B5E3B;
    padding: 8px 18px;
    cursor: pointer;
    font-family: "Playfair Display", Georgia, serif;
    letter-spacing: 0.04em;
    transition: background .2s, color .2s;
}
.cookie-banner button:hover {
    background: #8B2A2A;
    color: #fff;
}

/* ==================== ИКОНКА ЗАГРУЗКИ ==================== */

.film-loader {
    display: inline-block;
    width: 40px; height: 40px;
    border: 3px solid #2B0D0D;
    border-top-color: #8B2A2A;
    border-radius: 50%;
    animation: projector-spin 1.2s steps(8) infinite;
}
@keyframes projector-spin {
    to { transform: rotate(360deg); }
}

/* ==================== 404 ==================== */

.error-404 {
    text-align: center;
    padding: 60px 20px;
}
.error-404 .err-num {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 6rem;
    color: #8B2A2A;
    margin: 0;
    line-height: 1;
    text-shadow: 0 0 20px rgba(139,42,42,0.5);
}
.error-404 h1 { margin-top: 10px; }

/* ==================== АДАПТИВ ==================== */

@media (max-width: 600px) {
    body { font-size: 16px; }
    .wrap { padding: 0 14px; }
    h1 { font-size: 1.7rem; }
    h2 { font-size: 1.4rem; }
    .hero { padding: 36px 18px; }
    .hero-title { font-size: 1.7rem; }
    .entry { padding: 18px 18px; }
    .feature-block { padding: 24px 18px; }
    .slider-slide { padding: 24px 30px; }
}
