/*
Theme Name: dds_krishi-piter.ru
Author: Полина Ветлова
Description: Информационная тема для сайта о тематических прогулках, крышах, парадных и городских деталях. Адаптивная вёрстка, аккуратная типографика, готовые блоки главной.
Version: 1.1
Text Domain: krpit
*/

:root {
    --ink: #26313c;
    --ink-soft: #4a5763;
    --paper: #f4f1ea;
    --paper-2: #ece7db;
    --card: #ffffff;
    --slate: #2e4152;
    --slate-2: #35485a;
    --brick: #b45a3c;
    --brick-2: #c8794f;
    --line: #ddd6c8;
    --line-2: #cfc7b6;
    --gold: #c9a24a;
    --shadow: 0 6px 22px rgba(38, 49, 60, 0.10);
    --radius: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Georgia", "PT Serif", "Times New Roman", serif;
    color: var(--ink);
    background: var(--paper);
    line-height: 1.65;
    font-size: 17px;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: "Georgia", "PT Serif", serif;
    color: var(--ink);
    line-height: 1.25;
    margin: 0 0 0.6em;
    font-weight: 700;
}
h1 { font-size: 2.05rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.05em; }

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

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

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

/* ---------- Header ---------- */
.site-header {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 1.1rem 0;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 1.3rem;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
    text-decoration: none;
    color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand-logo, .brand-logo svg { display: block; width: 54px; height: 54px; flex: 0 0 auto; }
.brand-text { min-width: 0; }
.brand-title { font-size: 1.18rem; font-weight: 700; color: var(--ink); line-height: 1.2; }
.brand-desc { font-size: 0.82rem; color: var(--ink-soft); line-height: 1.35; margin-top: 2px; }

.main-nav { margin-left: auto; }
.nav-toggle {
    display: none;
    background: var(--slate);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
    font: inherit;
    font-size: 0.95rem;
    cursor: pointer;
}
.nav-menu {
    list-style: none;
    display: flex;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.nav-menu a {
    display: block;
    padding: 0.5rem 0.85rem;
    color: var(--ink);
    border-radius: 7px;
    font-size: 0.98rem;
    font-family: "Helvetica Neue", Arial, sans-serif;
}
.nav-menu a:hover { background: var(--paper-2); color: var(--slate); text-decoration: none; }
.nav-menu .current-menu-item > a { background: var(--slate); color: #fff; }

/* ---------- Layout ---------- */
.site-main { padding: 2.2rem 0 2.8rem; }
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 2.4rem;
    align-items: start;
}
.layout-single {
    display: block;
    width: 85%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}
.content-area { min-width: 0; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-bottom: 1.4rem;
}
.breadcrumbs a { color: var(--slate); }
.breadcrumbs .sep { color: var(--line-2); margin: 0 0.35rem; }

/* ---------- Cards ---------- */
.post-list { display: grid; gap: 1.6rem; }
.card {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.card-row { flex-direction: row; }
.card-thumb-wrap {
    flex: 0 0 300px;
    position: relative;
    overflow: hidden;
    min-height: 200px;
}
.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;
}
.card-body {
    flex: 1;
    min-width: 0;
    padding: 1.4rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
}
.card-title { font-size: 1.28rem; margin: 0 0 0.4rem; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--brick); text-decoration: none; }
.card-meta {
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: 0.8rem;
    color: var(--ink-soft);
    margin-bottom: 0.7rem;
}
.card-excerpt { color: var(--ink-soft); }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    align-self: flex-start;
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--brick);
    padding-top: 0.6rem;
}

/* ---------- Single / Page content ---------- */
.entry-header { margin-bottom: 1.1rem; }
.entry-title { font-size: 2rem; }
.entry-meta {
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: 0.82rem;
    color: var(--ink-soft);
    margin-bottom: 1rem;
}
.entry-thumb { border-radius: var(--radius); overflow: hidden; margin-bottom: 1.4rem; }
.entry-thumb img { display: block; width: 100%; }
.entry-content { font-size: 1.05rem; }
.entry-content img { border-radius: 8px; display: block; }
.entry-content h2, .entry-content h3 { margin-top: 1.6rem; }
.entry-content blockquote {
    margin: 1.4rem 0;
    padding: 1rem 1.4rem;
    background: var(--paper-2);
    border-left: 4px solid var(--brick);
    border-radius: 0 8px 8px 0;
    color: var(--ink);
    font-style: italic;
}
.entry-content ul, .entry-content ol { padding-left: 1.4rem; }

/* ---------- Tables ---------- */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4rem 0;
    font-size: 0.96rem;
}
.entry-content table, .entry-content th, .entry-content td {
    border: 1px solid var(--line-2);
}
.entry-content th, .entry-content td { padding: 0.6rem 0.8rem; text-align: left; }
.entry-content th { background: var(--paper-2); }

/* ---------- Sidebar ---------- */
.sidebar { min-width: 0; }
.widget {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.2rem 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--ink);
}
.widget-title {
    font-size: 1.05rem;
    margin: 0 0 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--brick);
    color: var(--ink);
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget ul li { padding: 0.42rem 0; border-bottom: 1px solid var(--line); }
.widget ul li:last-child { border-bottom: 0; }
.widget a { color: var(--slate); }
.widget a:hover { color: var(--brick); }
.widget .post-date { display: block; font-size: 0.76rem; color: var(--ink-soft); font-family: "Helvetica Neue", Arial, sans-serif; }

/* ---------- Search form ---------- */
.search-form { display: flex; gap: 0.5rem; }
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--line-2);
    border-radius: 8px;
    font: inherit;
    font-size: 0.95rem;
    background: #fff;
    color: var(--ink);
}
.search-form button {
    background: var(--slate);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 0.55rem 1rem;
    font: inherit;
    cursor: pointer;
}
.search-form button:hover { background: var(--brick); }

/* ---------- Front page sections ---------- */
.front { width: 85%; max-width: 1100px; margin-inline: auto; }
.fs { padding: 2.6rem 0; border-bottom: 1px solid var(--line); }
.fs:last-child { border-bottom: 0; }
.fs-head { margin-bottom: 1.4rem; }
.fs-kicker {
    font-family: "Helvetica Neue", Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    color: var(--brick);
    font-weight: 700;
    margin-bottom: 0.4rem;
}
.fs-lead { font-size: 1.1rem; color: var(--ink-soft); }

/* split: text + illustration */
.fs-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.2rem;
    align-items: center;
}
.fs-split.reverse .fs-split-media { order: -1; }
.fs-split-media img { display: block; width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }

/* rubric grid */
.rubric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.3rem;
}
.rubric {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem 1.4rem;
    box-shadow: var(--shadow);
}
.rubric-ic {
    width: 46px; height: 46px;
    border-radius: 10px;
    background: var(--paper-2);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 0.9rem;
    color: var(--brick);
}
.rubric-ic svg { width: 26px; height: 26px; display: block; }
.rubric h3 { font-size: 1.12rem; margin-bottom: 0.4rem; }
.rubric p { margin: 0; color: var(--ink-soft); font-size: 0.96rem; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.4rem; counter-reset: step; }
.step {
    position: relative;
    padding: 1.5rem 1.4rem 1.4rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    background: var(--slate); color: #fff;
    border-radius: 50%;
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-weight: 700;
    margin-bottom: 0.8rem;
}
.step h3 { font-size: 1.08rem; margin-bottom: 0.35rem; }
.step p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

/* latest posts on front */
.front-latest .post-list { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.front-latest .card-row { flex-direction: column; }
.front-latest .card-thumb-wrap {
    flex: none;
    width: 100%;
    position: relative;
    min-height: 0;
}
.front-latest .card-thumb-wrap a { position: absolute; }
.front-latest .card-thumb-wrap img { aspect-ratio: 16 / 10; }

/* gallery mosaic */
.gallery-mosaic {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 180px;
    gap: 0.9rem;
}
.gallery-mosaic figure { margin: 0; border-radius: var(--radius); overflow: hidden; position: relative; }
.gallery-mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-mosaic .wide { grid-column: span 2; }
.gallery-mosaic .tall { grid-row: span 2; }
.gallery-cap {
    position: absolute; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(38,49,60,0.78), rgba(38,49,60,0));
    color: #fff;
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: 0.82rem;
    padding: 1.4rem 0.8rem 0.6rem;
}

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 2.2rem;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--line-2);
    border-radius: 8px;
    background: #fff;
    color: var(--slate);
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: 0.92rem;
    text-decoration: none;
}
.pagination a.page-numbers:hover { background: var(--paper-2); color: var(--brick); }
.pagination .page-numbers.current { background: var(--slate); color: #fff; border-color: var(--slate); }
.pagination .page-numbers.dots { border: 0; background: none; }

/* ---------- Footer ---------- */
.site-footer { background: var(--slate); color: #d6dee6; margin-top: 2rem; }
.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    padding: 2.6rem 0 2rem;
}
.footer-col { min-width: 0; }
.footer-col .widget {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    color: #d6dee6;
}
.footer-col .widget-title {
    color: #fff;
    border-bottom-color: var(--brick-2);
    font-size: 1.02rem;
}
.footer-col .widget ul li { border-bottom: 1px solid rgba(255,255,255,0.12); }
.footer-col .widget a { color: #e8edf2; }
.footer-col .widget a:hover { color: var(--brick-2); }
.footer-col .widget .post-date { color: #a9b6c1; }
.footer-col p { color: #cdd6de; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.14);
    padding: 1.1rem 0;
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: 0.85rem;
    color: #b6c1cb;
}

/* ---------- 404 ---------- */
.error-404 { text-align: center; padding: 1rem 0 2rem; }
.error-404 .big { font-size: 4.5rem; color: var(--brick); margin: 0; line-height: 1; }
.error-404 .search-form { max-width: 420px; margin: 1.6rem auto 1.2rem; }

/* ---------- Comments ---------- */
.comments-area { margin-top: 2.4rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list li { margin-bottom: 1.2rem; }
.comment-body {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
}
.comment-meta { font-family: "Helvetica Neue", Arial, sans-serif; font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 0.4rem; }
.comment-author { font-weight: 700; color: var(--ink); }
.comment-respond { margin-top: 1.6rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--line-2);
    border-radius: 8px;
    font: inherit;
    font-size: 0.95rem;
    background: #fff;
    color: var(--ink);
    margin-top: 0.3rem;
}
.comment-form p { margin-bottom: 0.9rem; }
.comment-form .submit,
.comment-respond .submit {
    background: var(--slate);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 0.6rem 1.3rem;
    font: inherit;
    cursor: pointer;
}
.comment-form .submit:hover { background: var(--brick); }

/* ---------- Cookie banner ---------- */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--ink);
    color: #eef1f4;
    padding: 1rem 0;
    box-shadow: 0 -4px 18px rgba(0,0,0,0.18);
}
.cookie-inner {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: 0.9rem;
}
.cookie-inner p { margin: 0; flex: 1; min-width: 220px; }
.cookie-inner a { color: var(--brick-2); }
.cookie-accept {
    background: var(--brick);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 0.6rem 1.4rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.cookie-accept:hover { background: var(--brick-2); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 1.8rem; }
    .fs-split { grid-template-columns: 1fr; gap: 1.4rem; }
    .fs-split.reverse .fs-split-media { order: 0; }
    .front, .layout-single { width: 92%; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.7rem; }
    .entry-title { font-size: 1.6rem; }
    .nav-toggle { display: block; }
    .main-nav { position: relative; }
    .nav-menu {
        display: none;
        position: absolute;
        right: 0;
        top: calc(100% + 0.5rem);
        flex-direction: column;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 10px;
        padding: 0.5rem;
        min-width: 210px;
        box-shadow: var(--shadow);
        z-index: 50;
    }
    .nav-menu.open { display: flex; }
    .card-row { flex-direction: column; }
    .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; }
    .gallery-mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 150px; }
    .gallery-mosaic .wide { grid-column: span 2; }
    .gallery-mosaic .tall { grid-row: span 1; }
    .front, .layout-single { width: 100%; }
}
