/*
Theme Name: dds_morningbirdgames.com
Author: Александр Соколов
Description: Morning Bird Games — мультиформатный проект о независимых играх и их создателях: обзоры инди-хитов, интервью с разработчиками и разбор механик. Светлая, воздушная тема с тёплой природной палитрой.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: morningbird
*/

/* ============================================================
   1. Переменные
   ============================================================ */
:root {
    --bg: #fef7e8;
    --bg-card: #f5f0e2;
    --accent: #e69a3e;
    --accent-dark: #c97f24;
    --olive: #6b8c5c;
    --olive-dark: #577147;
    --terracotta: #c05a4a;
    --text: #2e2a24;
    --text-muted: #6b6258;
    --footer-bg: #2e2a24;
    --footer-text: #f1e9d6;
    --footer-muted: #b3a892;
    --line: #e3d9c2;
    --radius: 8px;
    --shadow: 0 4px 14px rgba(46, 42, 36, 0.10);
    --max: 1180px;
}

/* ============================================================
   2. База
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    overflow-x: hidden;
}

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

a { color: var(--terracotta); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
    font-family: "Playfair Display", Georgia, "Times New Roman", serif;
    line-height: 1.25;
    color: var(--text);
    margin: 0 0 0.5em;
}
h1 { font-size: 2.1rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

.handwritten {
    font-family: "Caveat", "Segoe Script", "Comic Sans MS", cursive;
}

.shell {
    width: min(92%, var(--max));
    margin-inline: auto;
}

.skip-link {
    position: absolute;
    left: -999px;
}
.skip-link:focus {
    left: 12px;
    top: 12px;
    background: var(--text);
    color: var(--bg);
    padding: 8px 14px;
    border-radius: var(--radius);
    z-index: 999;
}

/* ============================================================
   3. Кнопки
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.55em 1.1em;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: var(--shadow);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.btn:hover {
    background: var(--accent-dark);
    border-color: transparent;
    text-decoration: none;
    transform: translateY(-1px);
}
.btn .arr { transition: transform 0.2s ease; }
.btn:hover .arr { transform: translateX(3px); }

.btn-olive {
    background: var(--olive);
    border-color: var(--olive);
}
.btn-olive:hover { background: var(--olive-dark); }

.btn-ghost {
    background: transparent;
    color: var(--olive-dark);
    border-color: transparent;
    box-shadow: none;
    text-decoration: underline;
    padding-inline: 0;
}
.btn-ghost:hover { background: transparent; color: var(--accent-dark); transform: none; }

/* ============================================================
   4. Шапка
   ============================================================ */
.site-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--line);
}
.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    padding: 0.9rem 0;
}
.branding {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}
.brand-logo-link { display: flex; flex: 0 0 auto; }
.brand-logo {
    display: block;
    width: 56px;
    height: 56px;
}
.branding-text { min-width: 0; }
.site-title {
    display: block;
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
}
.site-desc {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
    max-height: 2.8em;
    overflow: hidden;
}

/* Навигация */
.primary-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.3rem;
}
.primary-menu a {
    color: var(--text);
    font-weight: 600;
    font-size: 0.97rem;
    padding: 0.3em 0;
    border-bottom: 2px solid transparent;
}
.primary-menu a:hover,
.primary-menu .current-menu-item > a {
    color: var(--olive-dark);
    border-bottom-color: var(--accent);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    margin: 0 auto;
    background: var(--text);
}

/* ============================================================
   5. Раскладки
   ============================================================ */
.site-main { padding: 2rem 0 3rem; }

.layout-with-sidebar { display: block; }
.layout-single { display: block; }
.layout-single .content-area {
    width: 85%;
    margin-inline: auto;
}
.content-area { min-width: 0; }

/* ============================================================
   6. Хлебные крошки
   ============================================================ */
.breadcrumbs {
    font-size: 0.86rem;
    color: var(--text-muted);
    margin-bottom: 1.4rem;
}
.breadcrumbs a { color: var(--olive-dark); }
.breadcrumbs .sep { margin: 0 0.35em; color: var(--accent); }

/* ============================================================
   7. Карточки записей
   ============================================================ */
.card-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(46, 42, 36, 0.16);
}

.card-thumb {
    display: block;
    position: relative;
    overflow: hidden;
}
.card-img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    filter: sepia(0.28) saturate(1.05);
    transition: transform 0.3s ease;
}
.card:hover .card-img { transform: scale(1.04); }

.card-img--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #efe6cf, #e3d4ad);
    color: var(--accent-dark);
}
.card-img--placeholder svg { width: 64px; height: 64px; }

/* отпечаток птичьей лапки при наведении */
.card-paw {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 30px;
    height: 30px;
    opacity: 0;
    transform: translateY(8px) rotate(-12deg);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}
.card:hover .card-paw {
    opacity: 0.95;
    transform: translateY(0) rotate(0);
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.1rem 1.2rem 1.3rem;
}

.card-cat {
    align-self: flex-start;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.25em 0.7em;
    border-radius: 999px;
    margin-bottom: 0.6rem;
    color: #3a3329;
}
.cat-saffron   { background: #f3c97e; }
.cat-terracotta{ background: #e0a79c; }
.cat-olive     { background: #aec59f; }
.cat-blue      { background: #a9bcce; }
.cat-lavender  { background: #c3bcd2; }
.cat-default   { background: #e7dcc1; }
a.card-cat:hover { text-decoration: none; filter: brightness(0.95); }

.card-title {
    font-size: 1.2rem;
    margin: 0 0 0.45rem;
}
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--terracotta); text-decoration: none; }

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}
.card-readtime::before { content: "🕮 "; }

.card-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
}
.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}

.card-more {
    align-self: flex-start;
    margin-top: auto;
}

/* ============================================================
   8. Записи / страницы — контент
   ============================================================ */
.entry {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.6rem 1.7rem 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.6rem;
}
.entry-title { font-size: 2rem; }
.entry-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.entry-thumb {
    display: block;
    width: 100%;
    border-radius: var(--radius);
    margin-bottom: 1.2rem;
}
.entry-content { min-width: 0; }
.entry-content img { border-radius: var(--radius); }
.entry-content h2 { margin-top: 1.4em; }
.entry-content blockquote,
blockquote {
    border-left: 4px solid var(--accent);
    background: #f7efda;
    margin: 1.4em 0;
    padding: 0.8em 1.1em;
    font-style: italic;
    color: var(--text);
}
.entry-content a { color: var(--terracotta); text-decoration: underline; }

.list-title {
    font-size: 1.7rem;
    margin-bottom: 1.2rem;
}

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

/* ============================================================
   9. Сайдбар + виджеты
   ============================================================ */
.sidebar { min-width: 0; }

.widget {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.2rem 1.3rem;
    margin-bottom: 1.4rem;
}
/* контраст в светлом сайдбаре — тёмный текст */
.sidebar .widget { color: var(--text); }
.sidebar .widget-title {
    color: var(--text);
    font-size: 1.1rem;
    margin-bottom: 0.7rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--accent);
}
.sidebar .widget a { color: var(--olive-dark); }
.sidebar .widget a:hover { color: var(--accent-dark); }
.sidebar .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sidebar .widget li {
    padding: 0.45em 0;
    border-bottom: 1px dashed var(--line);
    font-size: 0.95rem;
}
.sidebar .widget li:last-child { border-bottom: none; }
.sidebar .widget .post-date {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ============================================================
   10. Пагинация
   ============================================================ */
.pagination {
    margin: 2rem 0 0.5rem;
}
.pagination ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0;
    margin: 0;
    justify-content: center;
}
.pagination a,
.pagination span {
    display: inline-block;
    min-width: 2.3em;
    padding: 0.4em 0.7em;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.92rem;
}
.pagination a:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    text-decoration: none;
}
.pagination .current {
    background: var(--olive);
    border-color: var(--olive);
    color: #fff;
}

/* ============================================================
   11. Подвал
   ============================================================ */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    margin-top: 2rem;
}
.footer-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.6rem;
    padding: 2.4rem 0 1.6rem;
}
/* контраст в тёмном подвале — светлый текст */
.site-footer .widget {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--footer-text);
}
.site-footer .widget-title {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 0.7rem;
}
.site-footer .widget a { color: var(--accent); }
.site-footer .widget a:hover { color: #f3c97e; }
.site-footer .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-footer .widget li {
    padding: 0.32em 0;
    font-size: 0.93rem;
}
.site-footer .widget p { color: var(--footer-text); }

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 2rem;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(241, 233, 214, 0.18);
    padding: 1rem 0 1.6rem;
}
.footer-bottom p { margin: 0; }
.copyright { font-size: 0.88rem; color: var(--footer-muted); }
.gamedev-fact {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--footer-muted);
    max-width: 30em;
}

/* ============================================================
   12. Cookie-баннер  (правило [hidden] — до основного блока)
   ============================================================ */
.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.8rem 1.4rem;
    padding: 0.9rem 1.2rem;
    background: var(--text);
    color: var(--bg);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
}
.cookie-text {
    margin: 0;
    font-size: 0.9rem;
    max-width: 46em;
}
.cookie-banner .btn { flex: 0 0 auto; }

/* ============================================================
   13. Главная страница
   ============================================================ */
.front-section { padding: 1.6rem 0; }
.front-inner {
    width: 85%;
    margin-inline: auto;
}

.hero {
    background: linear-gradient(135deg, #f7efda, #efe2c3);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2.4rem 2rem;
    text-align: center;
}
.hero-slogan {
    font-size: 2.6rem;
    color: var(--accent-dark);
    margin: 0 0 0.2em;
    line-height: 1.1;
}
.hero-title {
    font-size: 1.5rem;
    margin-bottom: 0.6rem;
}
.hero-text {
    color: var(--text-muted);
    max-width: 40em;
    margin-inline: auto;
}
.hero-quote {
    margin: 1.4rem auto 0;
    max-width: 34em;
    border-left: 4px solid var(--accent);
    background: #fdf6e3;
    padding: 0.7em 1em;
    font-style: italic;
    text-align: left;
}

.section-head {
    text-align: center;
    margin-bottom: 1.4rem;
}
.section-head h2 { font-size: 1.8rem; margin-bottom: 0.2em; }
.section-head p { color: var(--text-muted); margin: 0; }

.rubric-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}
.rubric {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-card);
    padding: 1.1rem 1.2rem;
    min-width: 0;
}
.rubric .card-cat { margin-bottom: 0.5rem; }
.rubric p { margin: 0; color: var(--text-muted); font-size: 0.93rem; }

.steps {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    counter-reset: step;
}
.step {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-card);
    padding: 1.2rem 1.2rem 1.2rem 3.2rem;
    min-width: 0;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 1rem;
    top: 1.1rem;
    width: 1.7em;
    height: 1.7em;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--olive);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
}
.step h3 { margin-bottom: 0.3rem; }
.step p { margin: 0; color: var(--text-muted); font-size: 0.93rem; }

.contact-block {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-card);
    padding: 1.6rem 1.8rem;
    text-align: center;
}
.contact-links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem 1.6rem;
    justify-content: center;
    padding: 0;
    margin: 1rem 0 0;
}
.contact-links a {
    color: var(--olive-dark);
    font-weight: 600;
}

/* ============================================================
   14. Комментарии
   ============================================================ */
.comments-area {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem 1.6rem 1.8rem;
}
.comments-title { font-size: 1.4rem; }
.comment-list {
    list-style: none;
    margin: 0 0 1.4rem;
    padding: 0;
}
.comment-list ol { list-style: none; padding-left: 1.4rem; }
.comment-body {
    border-bottom: 1px dashed var(--line);
    padding: 0.9rem 0;
}
.comment-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}
.comment-meta img { border-radius: 50%; }
.comment-author { font-weight: 700; }
.comment-date { font-size: 0.8rem; color: var(--text-muted); }
.comment-reply { font-size: 0.85rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.55em 0.7em;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    font: inherit;
    margin-bottom: 0.2rem;
}

/* ============================================================
   15. Форма поиска / 404
   ============================================================ */
.search-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.search-form .search-field {
    flex: 1 1 200px;
    min-width: 0;
    padding: 0.55em 0.8em;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    font: inherit;
}
.search-form .search-submit {
    border: 1px solid var(--olive);
    background: var(--olive);
    color: #fff;
    border-radius: var(--radius);
    padding: 0.55em 1.1em;
    font-weight: 600;
    cursor: pointer;
}
.search-form .search-submit:hover { background: var(--olive-dark); }

.error-404 {
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2.4rem 1.6rem;
}
.error-404 .big { font-size: 4rem; color: var(--accent); margin: 0; }
.error-404 .search-form { max-width: 420px; margin: 1.2rem auto 0; }

/* ============================================================
   16. Прогрессивное появление (slider.js)
   ============================================================ */
.has-js .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.has-js .reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* ============================================================
   17. Адаптив
   ============================================================ */
@media (min-width: 600px) {
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rubric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .footer-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 960px) {
    .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .rubric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    h1 { font-size: 2.4rem; }

    .layout-with-sidebar {
        display: grid;
        grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
        gap: 6%;
        align-items: start;
    }
}

/* Мобильное меню — выдвижной ящик */
@media (max-width: 959px) {
    .nav-toggle { display: flex; }
    .primary-nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(82%, 320px);
        background: var(--bg-card);
        border-left: 1px solid var(--line);
        box-shadow: -8px 0 26px rgba(46, 42, 36, 0.25);
        transform: translateX(100%);
        transition: transform 0.28s ease;
        z-index: 150;
        padding: 4.2rem 1.4rem 1.4rem;
        overflow-y: auto;
    }
    .primary-nav.is-open { transform: translateX(0); }
    .primary-menu {
        flex-direction: column;
        gap: 0.2rem;
    }
    .primary-menu a {
        display: block;
        padding: 0.7em 0;
        border-bottom: 1px solid var(--line);
    }
    body.nav-open { overflow: hidden; }
}

@media (max-width: 599px) {
    body { font-size: 16px; }
    .layout-single .content-area,
    .front-inner { width: 100%; }
    .hero { padding: 1.8rem 1.2rem; }
    .hero-slogan { font-size: 2rem; }
    .entry { padding: 1.2rem 1.1rem 1.5rem; }
    .site-header-inner { gap: 0.7rem; }
    .brand-logo { width: 46px; height: 46px; }
}
