/*
Theme Name: dds_merygarriga.com
Author: Софья Калинина
Description: Информационная тема о моде и стиле: сезонные сочетания, посадка вещей, аксессуары, материалы и осознанный подход к личному гардеробу.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: mgstyle
*/

/* ------------------------------------------------------------------ */
/* Переменные и база                                                   */
/* ------------------------------------------------------------------ */
:root {
    --bg: #faf6f0;
    --surface: #ffffff;
    --ink: #2a2420;
    --muted: #6f645b;
    --accent: #a3624a;
    --accent-dark: #834c38;
    --line: #e6ddd0;
    --soft: #f2ebe0;
    --footer-bg: #26201c;
    --footer-text: #d6cabb;
    --footer-title: #f4ece1;
    --shadow: 0 10px 30px rgba(42, 36, 32, 0.08);
    --serif: Georgia, "Times New Roman", "PT Serif", serif;
    --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.7;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: var(--serif);
    line-height: 1.25;
    color: var(--ink);
    margin: 0 0 0.6em;
    font-weight: 600;
}

h1 { font-size: 2.15rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.3rem; }

p {
    margin: 0 0 1.1em;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

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

/* ------------------------------------------------------------------ */
/* Контейнер                                                           */
/* ------------------------------------------------------------------ */
.shell {
    width: min(92%, 1180px);
    margin-inline: auto;
}

/* ------------------------------------------------------------------ */
/* Шапка                                                               */
/* ------------------------------------------------------------------ */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 1.4rem 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}

.brand-logo {
    display: block;
    height: 52px;
    width: auto;
}

.brand-text {
    min-width: 0;
}

.brand-title {
    font-family: var(--serif);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
}

.brand-title a {
    color: var(--ink);
}

.brand-title a:hover {
    color: var(--accent);
    text-decoration: none;
}

.brand-desc {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0.25rem 0 0;
    max-width: 46ch;
}

/* Навигация (не липкая) */
.main-nav {
    background: var(--ink);
}

.main-nav .shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    margin: 0.6rem 0;
}

.menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 1.4rem;
    margin: 0;
    padding: 0;
}

.menu a {
    display: block;
    color: #f2ece3;
    padding: 0.95rem 0.2rem;
    font-size: 0.98rem;
    letter-spacing: 0.02em;
}

.menu a:hover,
.menu .current-menu-item > a {
    color: #f0c3ab;
    text-decoration: none;
}

/* ------------------------------------------------------------------ */
/* Хлебные крошки                                                      */
/* ------------------------------------------------------------------ */
.crumbs {
    font-size: 0.85rem;
    color: var(--muted);
    padding: 1.1rem 0 0;
}

.crumbs a {
    color: var(--muted);
}

.crumbs a:hover {
    color: var(--accent);
    text-decoration: none;
}

.crumbs .sep {
    color: var(--line);
    margin: 0 0.15rem;
}

/* ------------------------------------------------------------------ */
/* Раскладки                                                           */
/* ------------------------------------------------------------------ */
.site-main {
    padding: 2.4rem 0 3.4rem;
}

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

.layout-single .content-area {
    width: min(90%, 880px);
    margin-inline: auto;
}

.content-area {
    min-width: 0;
}

/* ------------------------------------------------------------------ */
/* Одиночная запись / страница                                         */
/* ------------------------------------------------------------------ */
.entry {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 2.2rem 2.3rem;
    box-shadow: var(--shadow);
}

.entry-title {
    margin-top: 0;
}

.entry-meta {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 1.3rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 1rem;
}

.entry-thumb {
    display: block;
    width: 100%;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.entry-content {
    min-width: 0;
}

.entry-content img {
    border-radius: 8px;
    display: block;
    margin: 1.2rem 0;
}

.entry-content h2 { margin-top: 1.6rem; }
.entry-content h3 { margin-top: 1.3rem; }

.entry-content ul,
.entry-content ol {
    padding-left: 1.4rem;
}

.entry-content blockquote {
    margin: 1.4rem 0;
    padding: 1.1rem 1.4rem;
    background: var(--soft);
    border-left: 4px solid var(--accent);
    border-radius: 6px;
    color: var(--ink);
}

.entry-content blockquote p:last-child {
    margin-bottom: 0;
}

.post-tags {
    margin-top: 1.6rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--line);
    font-size: 0.88rem;
}

.post-tags a {
    display: inline-block;
    background: var(--soft);
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    margin: 0.15rem 0.2rem 0.15rem 0;
    color: var(--accent-dark);
}

/* ------------------------------------------------------------------ */
/* Карточки записей (см. A8, A10)                                      */
/* ------------------------------------------------------------------ */
.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);
}

.card-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.card-thumb-placeholder {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, var(--soft), #e7d8c8);
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.3rem 1.4rem 1.5rem;
    min-width: 0;
}

.card-title {
    font-size: 1.2rem;
    margin: 0 0 0.5rem;
}

.card-title a {
    color: var(--ink);
}

.card-title a:hover {
    color: var(--accent);
    text-decoration: none;
}

.card-meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.7rem;
}

.card-excerpt {
    color: var(--muted);
    font-size: 0.96rem;
    flex: 1;
}

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

.card-more {
    margin-top: 1rem;
    font-weight: 600;
    font-size: 0.92rem;
    align-self: flex-start;
}

/* Сетка карточек */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(0, 1fr));
    gap: 1.6rem;
}

.card-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Лента блога — горизонтальные карточки */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}

.card-row {
    flex-direction: row;
}

.card-row .card-thumb-wrap {
    flex: 0 0 260px;
    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-placeholder {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
}

/* ------------------------------------------------------------------ */
/* Главная — тематические секции                                       */
/* ------------------------------------------------------------------ */
.front {
    padding: 0;
}

.fs {
    padding: 3rem 0;
    border-bottom: 1px solid var(--line);
}

.fs-head {
    max-width: 60ch;
    margin-bottom: 1.6rem;
}

.fs-head .kicker {
    display: inline-block;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

/* Блок текст + иллюстрация */
.fs-split .split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.6rem;
    align-items: center;
}

.fs-split .split-media img {
    display: block;
    width: 100%;
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.fs-split.reverse .split-media {
    order: -1;
}

.fs-split .split-text {
    min-width: 0;
}

/* Сетка рубрик */
.rubrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.4rem;
}

.rubric {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.rubric img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.rubric-body {
    flex: 1;
    padding: 1.1rem 1.2rem 1.3rem;
    min-width: 0;
}

.rubric-body h3 {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}

.rubric-body p {
    font-size: 0.92rem;
    color: var(--muted);
    margin: 0;
}

/* Пошаговый блок */
.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.6rem;
    counter-reset: step;
}

.step {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.6rem 1.5rem;
    min-width: 0;
}

.step-num {
    font-family: var(--serif);
    font-size: 1.9rem;
    color: var(--accent);
    line-height: 1;
    display: block;
    margin-bottom: 0.6rem;
}

.step h3 {
    font-size: 1.15rem;
    margin-bottom: 0.4rem;
}

.step p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

/* CTA-секция (см. A14 — отступы со всех сторон) */
.fs-cta {
    border-bottom: none;
}

.cta-box {
    background: var(--ink);
    color: #f4ece3;
    border-radius: 16px;
    padding: 2.8rem 2.6rem;
    text-align: center;
}

.cta-box h2 {
    color: #fff;
    margin-bottom: 0.6rem;
}

.cta-box p {
    color: #ddd2c6;
    max-width: 56ch;
    margin: 0 auto 1.5rem;
}

.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 0.8rem 1.8rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.98rem;
}

.btn:hover {
    background: var(--accent-dark);
    color: #fff;
    text-decoration: none;
}

/* Последние записи на главной */
.fs-latest .section-foot {
    margin-top: 1.8rem;
    text-align: center;
}

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

.sidebar .widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.4rem 1.5rem;
    margin-bottom: 1.6rem;
    color: var(--ink);
}

.sidebar .widget-title {
    font-size: 1.1rem;
    margin: 0 0 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--accent);
    color: var(--ink);
}

.sidebar .widget a {
    color: var(--accent-dark);
}

.sidebar .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar .widget li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.95rem;
}

.sidebar .widget li:last-child {
    border-bottom: none;
}

.sidebar .widget .post-date {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
}

/* ------------------------------------------------------------------ */
/* Пагинация (type => plain, см. D5)                                   */
/* ------------------------------------------------------------------ */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 2.2rem;
    justify-content: center;
}

.pager .page-numbers {
    display: inline-block;
    min-width: 42px;
    text-align: center;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font-size: 0.95rem;
    line-height: 1;
}

.pager a.page-numbers:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

.pager .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.pager .page-numbers.dots {
    border: none;
    background: none;
}

/* ------------------------------------------------------------------ */
/* Формы: поиск и комментарии                                          */
/* ------------------------------------------------------------------ */
.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
}

.search-form .search-submit {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font-size: 0.95rem;
}

.search-form .search-submit:hover {
    background: var(--accent-dark);
}

.comments-area {
    margin-top: 2rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.8rem 2rem;
    box-shadow: var(--shadow);
}

.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment-list .children {
    list-style: none;
    margin-left: 1.4rem;
    padding-left: 0;
}

.comment-body {
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
}

.comment-author {
    font-weight: 600;
}

.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: 0.6rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    margin-top: 0.3rem;
}

.comment-form p {
    margin-bottom: 1rem;
}

.comment-form .submit {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.7rem 1.6rem;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.97rem;
}

.comment-form .submit:hover {
    background: var(--accent-dark);
}

/* ------------------------------------------------------------------ */
/* Таблицы                                                             */
/* ------------------------------------------------------------------ */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4rem 0;
}

.entry-content table,
.entry-content th,
.entry-content td {
    border: 1px solid var(--line);
}

.entry-content th,
.entry-content td {
    padding: 0.6rem 0.8rem;
    text-align: left;
}

.entry-content th {
    background: var(--soft);
}

/* ------------------------------------------------------------------ */
/* 404                                                                 */
/* ------------------------------------------------------------------ */
.notfound {
    text-align: center;
    padding: 2rem 0 3rem;
    max-width: 640px;
    margin-inline: auto;
}

.notfound .code {
    font-family: var(--serif);
    font-size: 5rem;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.notfound .search-form {
    max-width: 420px;
    margin: 1.6rem auto 1rem;
}

/* ------------------------------------------------------------------ */
/* Подвал                                                              */
/* ------------------------------------------------------------------ */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 3rem 0 1.5rem;
}

.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.4rem;
}

.footer-cols .widget {
    color: var(--footer-text);
    min-width: 0;
}

.footer-cols .widget-title {
    color: var(--footer-title);
    font-size: 1.15rem;
    margin: 0 0 1rem;
}

.footer-cols .widget p {
    color: var(--footer-text);
    font-size: 0.94rem;
}

.footer-cols .widget a {
    color: #ecd8c9;
}

.footer-cols .widget a:hover {
    color: #f5b596;
    text-decoration: none;
}

.footer-cols .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-cols .widget li {
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.94rem;
}

.footer-cols .widget li:last-child {
    border-bottom: none;
}

.footer-bottom {
    text-align: center;
    margin-top: 2.4rem;
    padding-top: 1.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.86rem;
    color: rgba(214, 202, 187, 0.8);
}

/* ------------------------------------------------------------------ */
/* Cookie-баннер (см. A11, D6)                                         */
/* ------------------------------------------------------------------ */
.cookie-banner[hidden] {
    display: none !important;
}

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: var(--ink);
    color: #f2ece3;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.18);
}

.cookie-banner p {
    margin: 0;
    font-size: 0.9rem;
    max-width: 70ch;
}

.cookie-banner a {
    color: #f0c3ab;
}

.cookie-accept {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.92rem;
    white-space: nowrap;
}

.cookie-accept:hover {
    background: var(--accent-dark);
}

/* ------------------------------------------------------------------ */
/* Утилиты                                                             */
/* ------------------------------------------------------------------ */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.page-title {
    margin-bottom: 1.6rem;
}

/* ------------------------------------------------------------------ */
/* Адаптив                                                             */
/* ------------------------------------------------------------------ */
@media (max-width: 960px) {
    .layout-with-sidebar {
        grid-template-columns: minmax(0, 1fr);
        gap: 2rem;
    }

    .rubrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .steps {
        grid-template-columns: minmax(0, 1fr);
    }

    .fs-split .split {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.6rem;
    }

    .fs-split.reverse .split-media {
        order: 0;
    }
}

@media (max-width: 600px) {
    body {
        font-size: 16px;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.45rem; }

    .main-nav .shell {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-toggle {
        display: block;
    }

    .menu {
        flex-direction: column;
        gap: 0;
        display: none;
        padding-bottom: 0.6rem;
    }

    .menu.is-open {
        display: flex;
    }

    .menu a {
        padding: 0.7rem 0.2rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .card-grid,
    .card-grid.cols-2,
    .rubrics {
        grid-template-columns: minmax(0, 1fr);
    }

    .card-row {
        flex-direction: column;
    }

    .card-row .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }

    .card-row .card-thumb-wrap a {
        position: static;
    }

    .card-row .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .card-row .card-thumb-placeholder {
        aspect-ratio: 16 / 9;
    }

    .footer-cols {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.8rem;
    }

    .entry {
        padding: 1.5rem 1.3rem;
    }

    .cta-box {
        padding: 2rem 1.5rem;
    }

    .comments-area {
        padding: 1.4rem 1.3rem;
    }
}
