/*
Theme Name: dds_duckyssheepshack.com
Description: Тема для информационного сайта о рукоделии, валянии и окрашивании. Японский минимализм с оттенком ремесленной мастерской.
Author: Евгения Тарасова
Version: 1.1
Text Domain: ddsfelt
Requires at least: 6.0
Requires PHP: 8.0
*/

:root {
    --bg: #F4F6F5;
    --alt: #E8EDEB;
    --head: #2C3A38;
    --foot: #1A2522;
    --panel: #FFFFFF;
    --text: #1E2B28;
    --accent: #A6B8B0;
    --accent2: #D1C6B6;
    --muted: #7A8983;
    --sans: "Helvetica Neue", Inter, Arial, "Segoe UI", sans-serif;
    --serif: Georgia, "Times New Roman", serif;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 17px;
    font-weight: 300;
    line-height: 1.9;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--sans);
    font-weight: 500;
    letter-spacing: 0.03em;
    line-height: 1.25;
    color: var(--text);
    margin: 0 0 0.7em;
}

h1 { font-size: 3.5rem; letter-spacing: 0.02em; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.12rem; }

p { margin: 0 0 1.3em; }

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

.entry-body a,
.widget a,
.crumbs a,
.card-title a {
    position: relative;
    padding-bottom: 3px;
}

.entry-body a:hover,
.widget a:hover,
.crumbs a:hover,
.card-title a:hover {
    box-shadow: inset 0 -1px 0 0 var(--accent);
}

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

blockquote {
    margin: 1.8em 0;
    padding: 0 0 0 12px;
    border-left: 2px solid var(--accent);
    color: var(--text);
    font-size: 1.05rem;
}

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

code, pre { font-family: "SFMono-Regular", Consolas, monospace; font-size: 0.9em; }

pre {
    background: var(--alt);
    padding: 1.1rem 1.2rem;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.6em 0;
    font-size: 0.95rem;
}

table, th, td { border: 1px solid var(--accent); }

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

th { background: var(--alt); font-weight: 500; }

/* ---------- Контейнеры ---------- */

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

.front-shell {
    width: min(85%, 1240px);
    margin-inline: auto;
}

.site-main { display: block; padding: 0 0 4rem; }

.page-shell { padding-top: 2.2rem; }

.layout-single {
    display: block;
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}

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

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

/* ---------- Кнопки ---------- */

.btn {
    display: inline-block;
    padding: 0.62rem 1.5rem;
    border: 1.5px solid var(--accent);
    border-radius: 2px;
    background: transparent;
    color: var(--text);
    font-family: var(--sans);
    font-size: 0.88rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: none;
}

.btn:hover,
.btn:focus {
    background: var(--accent);
    color: var(--bg);
    box-shadow: none;
}

/* ---------- Шапка ---------- */

.site-top {
    position: relative;
    background: var(--head);
    color: var(--bg);
    padding: 1.5rem 0;
}

.site-top-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    color: var(--bg);
    min-width: 0;
}

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

.brand-mark { width: 46px; height: 46px; display: block; flex: 0 0 auto; }

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

.brand-name {
    display: block;
    font-size: 1.02rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    line-height: 1.35;
}

.brand-desc {
    display: block;
    font-size: 0.76rem;
    line-height: 1.5;
    color: var(--accent);
    max-width: 46ch;
    margin-top: 0.2rem;
}

.nav-toggle {
    display: none;
    padding: 0.5rem 0.9rem;
    border: 1.5px solid var(--accent);
    border-radius: 2px;
    background: transparent;
    color: var(--bg);
    font-family: var(--sans);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
}

.site-nav ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.6rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav a {
    color: var(--bg);
    font-size: 0.86rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding-bottom: 4px;
    display: inline-block;
}

.site-nav a:hover,
.site-nav .current-menu-item > a {
    box-shadow: inset 0 -1px 0 0 var(--accent);
}

/* ---------- Хлебные крошки ---------- */

.crumbs {
    font-size: 0.8rem;
    color: var(--muted);
    letter-spacing: 0.04em;
    margin-bottom: 1.6rem;
}

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

.crumbs .sep { padding: 0 0.35rem; color: var(--accent2); }

/* ---------- Заголовки секций ---------- */

.sec-title {
    position: relative;
    text-align: left;
    margin-bottom: 2.2rem;
    padding-bottom: 1rem;
}

.sec-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 66%;
    height: 1px;
    background: var(--muted);
}

/* ---------- Главная ---------- */

.fs { padding: 5rem 0; }

.fs-alt { background: var(--alt); }

/* Блок 1 — hero */

.fs-hero {
    position: relative;
    overflow: hidden;
    background: var(--head);
    color: var(--bg);
    padding: 6rem 0;
}

.fs-hero::after {
    content: "";
    position: absolute;
    right: -40px;
    bottom: -60px;
    width: 420px;
    height: 420px;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg fill='%23ffffff'%3E%3Ccircle cx='100' cy='86' r='52'/%3E%3Ccircle cx='58' cy='68' r='28'/%3E%3Ccircle cx='142' cy='68' r='28'/%3E%3Ccircle cx='66' cy='118' r='30'/%3E%3Ccircle cx='134' cy='118' r='30'/%3E%3Cellipse cx='100' cy='134' rx='30' ry='40'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
}

.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: center;
}

.hero-title {
    color: #FFFFFF;
    font-weight: 400;
    letter-spacing: 0.06em;
    margin-bottom: 1.4rem;
}

.hero-sub {
    color: var(--muted);
    font-size: 1.02rem;
    max-width: 52ch;
    margin-bottom: 2rem;
}

.hero-note {
    border-left: 2px solid var(--accent);
    padding-left: 12px;
    color: var(--accent);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.fs-hero .btn { border-color: var(--accent); color: #FFFFFF; }

.fs-hero .btn:hover { background: var(--accent); color: var(--head); }

.hero-art { width: 100%; height: auto; display: block; opacity: 0.1; }

/* Блок 2 — таймлайн */

.tl { position: relative; padding: 0.5rem 0; }

.tl::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--accent);
}

.tl-item {
    position: relative;
    width: 50%;
    padding: 0 2.4rem 2.8rem 0;
    min-width: 0;
}

.tl-item:nth-child(even) {
    margin-left: 50%;
    padding: 0 0 2.8rem 2.4rem;
    text-align: left;
}

.tl-item:nth-child(odd) { text-align: right; }

.tl-item::before {
    content: "";
    position: absolute;
    top: 0.7rem;
    width: 7px;
    height: 7px;
    background: var(--accent);
}

.tl-item:nth-child(odd)::before { right: -3.5px; }

.tl-item:nth-child(even)::before { left: -3.5px; }

.tl-date {
    display: block;
    font-family: var(--serif);
    font-size: 1.25rem;
    color: var(--accent2);
    letter-spacing: 0.04em;
    margin-bottom: 0.3rem;
}

.tl-head {
    font-size: 1.1rem;
    color: var(--head);
    margin-bottom: 0.4rem;
}

.tl-text { font-size: 0.92rem; color: var(--text); margin: 0; }

/* Блок 3 — статистика */

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

.stat {
    padding: 1.6rem 1.8rem;
    text-align: center;
    border-right: 1px solid var(--accent2);
    min-width: 0;
}

.stat:last-child { border-right: none; }

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

.stat-label {
    display: block;
    font-size: 0.86rem;
    color: var(--text);
    line-height: 1.6;
}

/* Блок 4 — рубрикатор */

.topics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.2rem;
}

.topic {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 128px;
    padding: 1.6rem 1.4rem;
    border: 1px solid var(--accent);
    border-radius: 0;
    color: var(--text);
    font-size: 1rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    text-align: center;
    min-width: 0;
}

.topic:hover {
    background: var(--accent);
    color: #FFFFFF;
    box-shadow: none;
}

/* Блок «последние записи» на главной */

.fs-latest .cards { margin-top: 0; }

.fs-foot { margin-top: 2.4rem; }

/* ---------- Карточки записей ---------- */

.cards { display: block; }

.card {
    display: flex;
    flex-direction: column;
    background: transparent;
    border-top: 1px solid var(--accent2);
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 2.2rem;
    padding-top: 1.6rem;
    transform: translateY(0);
}

.card:hover {
    border-top-color: var(--accent);
    transform: translateY(2px);
}

.card-inner {
    display: flex;
    flex-direction: row;
    flex: 1;
    gap: 1.6rem;
    min-width: 0;
}

.card-thumb-wrap {
    flex: 0 0 260px;
    position: relative;
    overflow: hidden;
    min-height: 170px;
}

.card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.9;
    filter: grayscale(0.75) sepia(0.15) hue-rotate(120deg) saturate(0.75);
}

.card-body {
    flex: 1;
    min-width: 0;
    display: block;
}

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

.card-meta {
    font-size: 0.78rem;
    color: var(--muted);
    letter-spacing: 0.05em;
    margin-bottom: 0.8rem;
}

.card-meta .meta-date { font-family: var(--serif); color: var(--accent2); }

.card-meta .meta-cat a { color: var(--muted); }

.card-meta .meta-cat::before { content: "·"; padding: 0 0.45rem; color: var(--accent2); }

.card-excerpt { font-size: 0.95rem; color: var(--text); }

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

.card-more { margin-top: 0.6rem; }

/* ---------- Записи и страницы ---------- */

.entry-header { margin-bottom: 1.8rem; }

.entry-title { font-size: 2.4rem; margin-bottom: 0.6rem; }

.entry-meta {
    font-size: 0.8rem;
    color: var(--muted);
    letter-spacing: 0.05em;
}

.entry-meta .meta-date { font-family: var(--serif); color: var(--accent2); }

.entry-thumb { margin-bottom: 1.8rem; }

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

.entry-body { font-size: 1.02rem; }

.entry-body h2 { margin-top: 2rem; }

.entry-body h3 { margin-top: 1.6rem; }

.entry-body img { display: block; height: auto; }

.entry-tags {
    margin-top: 2rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--accent2);
    font-size: 0.85rem;
    color: var(--muted);
}

.entry-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
    font-size: 0.88rem;
}

.entry-nav span { display: block; color: var(--muted); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }

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

/* ---------- Сайдбар ---------- */

.sidebar { min-width: 0; }

.sidebar .widget {
    background: var(--panel);
    box-shadow: 0 1px 14px rgba(30, 43, 40, 0.06);
    padding: 1.6rem 1.5rem;
    margin-bottom: 1.6rem;
    color: var(--text);
}

.sidebar .widget-title {
    font-size: 1rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text);
    padding-bottom: 0.7rem;
    margin-bottom: 1rem;
    position: relative;
}

.sidebar .widget-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 66%;
    height: 1px;
    background: var(--muted);
}

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

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

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

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

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

/* ---------- Пагинация ---------- */

.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2.5rem;
}

.pager .page-numbers {
    display: inline-block;
    min-width: 42px;
    padding: 0.45rem 0.8rem;
    border: 1.5px solid var(--accent);
    border-radius: 2px;
    color: var(--text);
    font-size: 0.9rem;
    text-align: center;
    line-height: 1.5;
}

.pager .page-numbers:hover { background: var(--accent); color: var(--bg); }

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

.pager .page-numbers.dots { border-color: transparent; }

.pager .page-numbers.dots:hover { background: transparent; color: var(--text); }

/* ---------- Формы ---------- */

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

.search-form { display: flex; gap: 0.6rem; }

.search-label { flex: 1; min-width: 0; display: block; }

.search-form input[type="search"] {
    width: 100%;
    min-width: 0;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--accent);
    border-radius: 2px;
    background: var(--panel);
    color: var(--text);
    font-family: var(--sans);
    font-size: 0.92rem;
}

.search-form input[type="search"]:focus { outline: 1px solid var(--muted); }

/* ---------- Комментарии ---------- */

.comments-area {
    margin-top: 3rem;
    padding-top: 1.8rem;
    border-top: 1px solid var(--accent2);
}

.comments-title { font-size: 1.3rem; }

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

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

.comment-item {
    padding: 1.2rem 1.4rem;
    margin-bottom: 1rem;
    background: var(--panel);
    border-left: 2px solid var(--accent);
}

.comment-head { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: baseline; margin-bottom: 0.4rem; }

.comment-author { font-weight: 500; letter-spacing: 0.03em; }

.comment-date { font-family: var(--serif); font-size: 0.85rem; color: var(--accent2); }

.comment-text { font-size: 0.96rem; }

.comment-text p:last-child { margin-bottom: 0; }

.comment-actions { font-size: 0.82rem; }

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

.comment-respond { margin-top: 1.6rem; }

.comment-form label { display: block; font-size: 0.82rem; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 0.3rem; }

.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(--accent);
    border-radius: 2px;
    background: var(--panel);
    color: var(--text);
    font-family: var(--sans);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.comment-form .submit {
    display: inline-block;
    padding: 0.62rem 1.5rem;
    border: 1.5px solid var(--accent);
    border-radius: 2px;
    background: transparent;
    color: var(--text);
    font-family: var(--sans);
    font-size: 0.88rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
}

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

/* ---------- 404 ---------- */

.nf-code { font-family: var(--serif); font-size: 5rem; color: var(--accent2); line-height: 1; margin-bottom: 0.6rem; }

.nf-search { max-width: 460px; margin-top: 1.8rem; }

.nf-actions { margin-top: 1.6rem; }

/* ---------- Подвал ---------- */

.site-foot {
    position: relative;
    overflow: hidden;
    background: var(--foot);
    color: var(--alt);
    padding: 3.6rem 0 1.8rem;
}

.site-foot::after {
    content: "";
    position: absolute;
    right: -30px;
    bottom: -70px;
    width: 340px;
    height: 340px;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='4'%3E%3Ccircle cx='100' cy='100' r='72'/%3E%3Cpath d='M34 78c40 22 90 32 132 22M30 118c46-8 96-30 128-56M56 152c22-42 62-76 106-88'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
}

.foot-cols {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.4rem;
}

.foot-col { min-width: 0; }

.site-foot .widget { margin-bottom: 1.4rem; color: var(--alt); font-size: 0.92rem; }

.site-foot .widget p { color: var(--alt); }

.site-foot .widget-title {
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #FFFFFF;
    padding-bottom: 0.6rem;
    margin-bottom: 0.9rem;
    position: relative;
}

.site-foot .widget-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 66%;
    height: 1px;
    background: var(--muted);
}

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

.site-foot .widget li { padding: 0.35rem 0; }

.site-foot .widget a { color: var(--alt); }

.site-foot .widget a:hover { box-shadow: inset 0 -1px 0 0 var(--accent); }

.site-foot .widget .post-date { display: block; font-family: var(--serif); font-size: 0.8rem; color: var(--accent2); }

.foot-bottom {
    position: relative;
    z-index: 1;
    margin-top: 2.4rem;
    padding-top: 1.4rem;
    border-top: 1px solid rgba(166, 184, 176, 0.25);
    font-size: 0.82rem;
    color: var(--muted);
    letter-spacing: 0.04em;
}

/* ---------- Cookie-баннер ---------- */

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

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    padding: 1.1rem 1.6rem;
    background: var(--head);
    color: var(--alt);
    border-top: 1px solid var(--accent);
    font-size: 0.86rem;
}

.cookie-banner p { margin: 0; max-width: 78ch; }

.cookie-banner a { color: var(--accent); }

.cookie-banner .btn { color: #FFFFFF; border-color: var(--accent); }

.cookie-banner .btn:hover { background: var(--accent); color: var(--head); }

/* ---------- Адаптив ---------- */

@media (max-width: 960px) {
    h1 { font-size: 2.5rem; }
    .entry-title { font-size: 1.9rem; }

    .layout-with-sidebar { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
    .layout-single { width: 100%; }

    .nav-toggle { display: inline-block; }

    .site-nav {
        flex: 0 0 100%;
        display: none;
    }

    .site-nav.is-open { display: block; }

    .site-nav ul { flex-direction: column; align-items: flex-start; gap: 0.6rem; }

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

    .hero-art { max-width: 300px; }

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

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

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }

    .shell, .front-shell { width: 90%; }

    .fs { padding: 3.2rem 0; }
    .fs-hero { padding: 3.6rem 0; }

    .card-inner { flex-direction: column; gap: 1rem; }

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

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

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

    .tl::before { left: 4px; }

    .tl-item,
    .tl-item:nth-child(even),
    .tl-item:nth-child(odd) {
        width: 100%;
        margin-left: 0;
        padding: 0 0 2.2rem 1.6rem;
        text-align: left;
    }

    .tl-item:nth-child(odd)::before,
    .tl-item:nth-child(even)::before { left: 0.5px; right: auto; }

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

    .stat {
        border-right: none;
        border-bottom: 1px solid var(--accent2);
        padding: 1.3rem 1.2rem;
    }

    .stat:last-child { border-bottom: none; }

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

    .topic { min-height: 92px; padding: 1.2rem 1.2rem; }

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

    .cookie-banner { padding: 1rem 1.2rem; }
}
