/*
Theme Name: dds_xamalga.com
Author: Максим Звонарёв
Description: Информационная тема для медиа о живом жанре аркад: подборки, рецензии, новости инди- и ретро-аркад, гайды по реиграбельности и музыке в аркадах.
Version: 1.1
Text Domain: xamalga
*/

/* ==========================================================================
   Переменные и базовые стили
   ========================================================================== */
:root {
    --bg:        #0c0d18;
    --bg-2:      #12132180;
    --panel:     #151627;
    --panel-2:   #1c1d33;
    --ink:       #e9eaff;
    --muted:     #9ea2c6;
    --line:      #2a2c4a;
    --cyan:      #2ff3e0;
    --magenta:   #ff3d8b;
    --lime:      #c6ff3d;
    --amber:     #ffb13d;
    --radius:    14px;
    --shell:     1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    overflow-x: hidden;
    background-image:
        radial-gradient(1100px 500px at 85% -10%, #1d1640 0%, transparent 60%),
        radial-gradient(900px 480px at 0% 0%, #102433 0%, transparent 55%);
    background-attachment: fixed;
}

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

a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--magenta); }

h1, h2, h3, h4 {
    line-height: 1.2;
    margin: 0 0 0.6em;
    font-weight: 800;
    letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }

/* Контейнер ширины — задаётся в одном месте */
.shell {
    width: min(92%, var(--shell));
    margin-inline: auto;
}

.section-pad { padding: 56px 0; }

/* ==========================================================================
   Шапка
   ========================================================================== */
.site-header {
    background: linear-gradient(180deg, #0e0f1f 0%, #0c0d18 100%);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 16px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}
.brand-logo,
.brand-fallback {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: block;
    border-radius: 12px;
}
.brand-text { min-width: 0; }
.brand-name {
    display: block;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--ink);
    line-height: 1.25;
    max-width: 640px;
}
.brand-name:hover { color: var(--cyan); }
.brand-desc {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
    margin-top: 4px;
    max-width: 680px;
}

/* Навигация */
.nav-toggle {
    display: none;
    background: var(--panel-2);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 1rem;
    cursor: pointer;
}
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.main-nav a {
    display: block;
    padding: 10px 16px;
    border-radius: 10px;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid transparent;
}
.main-nav a:hover,
.main-nav .current-menu-item > a {
    color: var(--bg);
    background: var(--cyan);
    border-color: var(--cyan);
}

/* ==========================================================================
   Хлебные крошки
   ========================================================================== */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--muted);
    padding: 18px 0 0;
}
.breadcrumbs a { color: var(--cyan); }
.breadcrumbs .sep { color: var(--line); margin: 0 4px; }
.breadcrumbs span { color: var(--muted); }

/* ==========================================================================
   Раскладки
   ========================================================================== */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 40px;
    align-items: start;
    padding: 32px 0 60px;
}
.layout-single {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
    padding: 32px 0 60px;
}
.content-area { min-width: 0; }

@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 32px; }
    .layout-single { width: 100%; }
}

/* ==========================================================================
   Карточки записей
   ========================================================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.18s ease, border-color 0.18s ease;
}
.card:hover {
    transform: translateY(-4px);
    border-color: var(--cyan);
}
.card-thumb {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}
.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.card-thumb-fallback {
    width: 100%;
    height: 100%;
    display: block;
    background: linear-gradient(135deg, #1b1d36, #261a3d);
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 18px 20px 20px;
    min-width: 0;
}
.card-title {
    font-size: 1.15rem;
    margin: 0 0 8px;
}
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--cyan); }
.card-meta {
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.card-excerpt {
    color: var(--muted);
    font-size: 0.95rem;
    flex: 1;
}
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-excerpt a { color: var(--cyan); }
.card-more {
    margin-top: 14px;
    align-self: flex-start;
    padding: 8px 16px;
    border-radius: 9px;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--bg);
    background: var(--lime);
}
.card-more:hover { background: var(--cyan); color: var(--bg); }

/* Горизонтальная карточка (лента) */
.post-list { display: flex; flex-direction: column; gap: 22px; }
.card-row {
    display: flex;
    flex-direction: row;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.card-row .card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
}
.card-row .card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.card-row .card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.card-row .card-thumb-fallback {
    width: 100%;
    height: 100%;
    display: block;
    background: linear-gradient(135deg, #1b1d36, #261a3d);
}
.card-row .card-body { flex: 1; min-width: 0; }

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

/* ==========================================================================
   Одиночная запись / страница
   ========================================================================== */
.entry {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px;
}
.entry-header { margin-bottom: 18px; }
.entry-meta {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.entry-thumb {
    margin: 0 0 22px;
    border-radius: var(--radius);
    overflow: hidden;
}
.entry-thumb img { display: block; width: 100%; height: auto; }
.entry-content { font-size: 1.02rem; }
.entry-content img { border-radius: 10px; }
.entry-content a { text-decoration: underline; }
.entry-content h2, .entry-content h3 { margin-top: 1.4em; }
.entry-content blockquote {
    margin: 1.4em 0;
    padding: 14px 20px;
    border-left: 3px solid var(--magenta);
    background: var(--panel-2);
    color: var(--ink);
    border-radius: 0 10px 10px 0;
}

/* Таблицы */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
}
.entry-content table,
.entry-content th,
.entry-content td {
    border: 1px solid var(--line);
}
.entry-content th, .entry-content td {
    padding: 10px 12px;
    text-align: left;
}
.entry-content th { background: var(--panel-2); }

.tags-line { margin-top: 24px; font-size: 0.9rem; }
.tags-line a {
    display: inline-block;
    background: var(--panel-2);
    border: 1px solid var(--line);
    padding: 4px 12px;
    border-radius: 20px;
    margin: 0 6px 6px 0;
    color: var(--cyan);
}

/* ==========================================================================
   Сайдбар и виджеты
   ========================================================================== */
.sidebar { min-width: 0; }
.sidebar .widget {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    color: var(--ink);
}
.sidebar .widget-title {
    font-size: 1rem;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--cyan);
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.sidebar .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sidebar .widget li {
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}
.sidebar .widget li:last-child { border-bottom: none; }
.sidebar .widget a { color: var(--cyan); }
.sidebar .widget a:hover { color: var(--magenta); }
.sidebar .widget,
.sidebar .widget .post-date,
.sidebar .widget .rss-date { color: var(--ink); }

/* ==========================================================================
   Подвал
   ========================================================================== */
.site-footer {
    background: #090a14;
    border-top: 1px solid var(--line);
    color: #c7cae8;
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 34px;
    padding: 50px 0 36px;
}
.footer-cols .widget { color: #c7cae8; }
.footer-cols .widget-title {
    color: #ffffff;
    font-size: 1rem;
    margin: 0 0 14px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.footer-cols .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.footer-cols .widget li { padding: 6px 0; }
.footer-cols .widget a { color: var(--cyan); }
.footer-cols .widget a:hover { color: var(--lime); }
.footer-cols .widget p { color: #c7cae8; }

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

.site-copy {
    border-top: 1px solid var(--line);
    padding: 18px 0;
    font-size: 0.85rem;
    color: var(--muted);
    text-align: center;
}

/* ==========================================================================
   Главная
   ========================================================================== */
.home-wrap { width: 85%; margin-left: auto; margin-right: auto; }

@media (max-width: 960px) {
    .home-wrap { width: 100%; }
}

.hero {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--line);
    margin: 28px 0 8px;
}
.hero-slider { position: relative; }
.slide {
    display: none;
    position: relative;
}
.slide.is-active { display: block; }
.slide img {
    width: 100%;
    height: clamp(280px, 46vw, 520px);
    object-fit: cover;
    display: block;
}
.slide-caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 40px 36px 30px;
    background: linear-gradient(0deg, rgba(7,8,18,0.92) 10%, rgba(7,8,18,0) 100%);
}
.slide-caption h2 { margin: 0 0 8px; color: #fff; }
.slide-caption p { margin: 0; color: #d6d9f5; max-width: 640px; }
.slider-dots {
    position: absolute;
    bottom: 16px; right: 22px;
    display: flex;
    gap: 8px;
}
.slider-dots button {
    width: 11px; height: 11px;
    border-radius: 50%;
    border: none;
    background: #ffffff66;
    cursor: pointer;
    padding: 0;
}
.slider-dots button.is-active { background: var(--cyan); }
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(12,13,24,0.6);
    color: #fff;
    border: 1px solid var(--line);
    width: 44px; height: 44px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 2;
}
.slider-arrow.prev { left: 16px; }
.slider-arrow.next { right: 16px; }

.home-section { padding: 46px 0; }
.home-section .section-head { margin-bottom: 26px; }
.home-section .section-head h2 { margin-bottom: 6px; }
.home-section .section-head p { color: var(--muted); margin: 0; max-width: 760px; }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
}
.feature {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    min-width: 0;
}
.feature .feat-icon {
    width: 46px; height: 46px;
    display: block;
    margin-bottom: 14px;
}
.feature h3 { margin: 0 0 8px; color: var(--ink); }
.feature p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.media-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 30px;
    align-items: center;
}
.media-row.reverse .media-text { order: 2; }
.media-row .media-img {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
}
.media-row .media-img img { display: block; width: 100%; height: auto; }
.media-row .media-text { min-width: 0; }
.media-row .media-text h2 { margin-top: 0; }

@media (max-width: 760px) {
    .media-row { grid-template-columns: 1fr; }
    .media-row.reverse .media-text { order: 0; }
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    counter-reset: step;
}
.step {
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    min-width: 0;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--magenta);
    color: #fff;
    font-weight: 800;
    margin-bottom: 12px;
}
.step h3 { font-size: 1.05rem; margin: 0 0 6px; }
.step p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.home-latest-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.home-latest-head a { font-weight: 700; }

/* ==========================================================================
   Пагинация
   ========================================================================== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 36px 0 10px;
    justify-content: center;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--ink);
    font-weight: 700;
}
.pagination a.page-numbers:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}
.pagination .page-numbers.current {
    background: var(--cyan);
    border-color: var(--cyan);
    color: var(--bg);
}
.pagination .page-numbers.dots {
    border: none;
    background: none;
}

/* ==========================================================================
   Поиск
   ========================================================================== */
.search-form {
    display: flex;
    gap: 10px;
    max-width: 480px;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--ink);
    font-size: 1rem;
}
.search-form .search-submit {
    padding: 12px 20px;
    border-radius: 10px;
    border: none;
    background: var(--cyan);
    color: var(--bg);
    font-weight: 700;
    cursor: pointer;
}
.search-form .search-submit:hover { background: var(--magenta); color: #fff; }

/* ==========================================================================
   Комментарии
   ========================================================================== */
.comments-area {
    margin-top: 36px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 30px;
}
.comments-area .comment-list {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
}
.comments-area .comment-list ul { list-style: none; padding-left: 24px; }
.comments-area li.comment { margin-bottom: 18px; }
.comments-area .comment-body {
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px 18px;
}
.comments-area .comment-author { font-weight: 700; }
.comments-area .comment-meta { font-size: 0.8rem; color: var(--muted); }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 11px 13px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--ink);
    font-size: 1rem;
    margin-bottom: 12px;
}
.comment-form .submit {
    padding: 12px 22px;
    border-radius: 10px;
    border: none;
    background: var(--lime);
    color: var(--bg);
    font-weight: 700;
    cursor: pointer;
}
.comment-form .submit:hover { background: var(--cyan); }

/* ==========================================================================
   404
   ========================================================================== */
.error-404 {
    text-align: center;
    padding: 60px 0;
}
.error-404 .code {
    font-size: clamp(4rem, 14vw, 9rem);
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(90deg, var(--cyan), var(--magenta));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.error-404 .search-form { margin: 26px auto; }
.btn-home {
    display: inline-block;
    margin-top: 10px;
    padding: 12px 24px;
    border-radius: 10px;
    background: var(--cyan);
    color: var(--bg);
    font-weight: 700;
}
.btn-home:hover { background: var(--magenta); color: #fff; }

/* ==========================================================================
   Cookie-баннер
   ========================================================================== */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 16px; right: 16px; bottom: 16px;
    z-index: 999;
    background: var(--panel);
    border: 1px solid var(--cyan);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    max-width: 720px;
    margin: 0 auto;
}
.cookie-banner p { margin: 0; flex: 1; min-width: 220px; font-size: 0.9rem; color: var(--muted); }
.cookie-banner button {
    padding: 11px 22px;
    border-radius: 10px;
    border: none;
    background: var(--cyan);
    color: var(--bg);
    font-weight: 700;
    cursor: pointer;
}
.cookie-banner button:hover { background: var(--lime); }

/* ==========================================================================
   Адаптив навигации
   ========================================================================== */
@media (max-width: 760px) {
    .nav-toggle { display: block; }
    .main-nav {
        flex-basis: 100%;
        width: 100%;
    }
    .main-nav[hidden] { display: none !important; }
    .main-nav ul { flex-direction: column; }
    .main-nav a { padding: 12px 14px; }
    .header-inner { gap: 14px; }
}
