/*
Theme Name: dds_sp-zakupka.ru
Author: Зубова Дарья
Description: Тема для информационного сайта о совместных покупках. Спокойная сине-зелёная палитра, акцент на читаемость и доверие.
Version: 1.1
Text Domain: dds_sp
*/

/* ===== Сброс и базовые стили ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: "Inter", "Segoe UI", "PT Sans", system-ui, -apple-system, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: #1F2937;
    background-color: #F7F8F9;
    background-image:
        radial-gradient(rgba(31,41,55,0.025) 1px, transparent 1px),
        radial-gradient(rgba(31,41,55,0.018) 1px, transparent 1px);
    background-size: 3px 3px, 7px 7px;
    background-position: 0 0, 1px 2px;
}

img { max-width: 100%; height: auto; }
a { color: #1E6F5C; text-decoration: none; transition: color .15s ease; }
a:hover { color: #144A3D; }

p { margin: 0 0 1em; }

h1, h2, h3, h4, h5, h6 {
    font-family: "Merriweather", "PT Serif", Georgia, serif;
    color: #0F2E2A;
    line-height: 1.25;
    margin: 0 0 .6em;
    font-weight: 700;
}
h1 { font-size: 2.1rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
    background: #fff;
    border: 1px solid #D8DEE3;
}
th, td {
    border: 1px solid #D8DEE3;
    padding: .55em .8em;
    text-align: left;
    vertical-align: top;
}
th { background: #EFF3F2; font-weight: 600; }

blockquote {
    margin: 1.2em 0;
    padding: .9em 1.2em;
    border-left: 4px solid #1E6F5C;
    background: #E6F2EF;
    color: #1F2937;
    border-radius: 0 6px 6px 0;
}

code, pre {
    font-family: "JetBrains Mono", Consolas, Menlo, monospace;
    font-size: .92em;
    background: #EFF3F2;
    border-radius: 4px;
}
code { padding: 1px 5px; }
pre { padding: .9em 1.1em; overflow-x: auto; }

/* ===== Контейнер ===== */
.layout {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 22px;
}

/* ===== Шапка ===== */
.site-top {
    background: #0F2E2A;
    color: #C0D6D0;
    border-bottom: 3px solid #1E6F5C;
}
.site-top a { color: #C0D6D0; }
.site-top a:hover { color: #fff; }

.brand-row {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 0 18px;
    flex-wrap: wrap;
}
.brand-link {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
}
.brand-logo {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    border-radius: 12px;
    background: #fff;
    padding: 6px;
    object-fit: contain;
}
.brand-text { display: flex; flex-direction: column; }
.brand-name {
    font-family: "Merriweather", Georgia, serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}
.brand-desc {
    font-size: .87rem;
    color: #9DBAB3;
    margin-top: 3px;
    line-height: 1.4;
}

/* Главное меню */
.primary-nav {
    border-top: 1px solid rgba(192,214,208,0.15);
}
.primary-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.primary-nav li { margin: 0; }
.primary-nav a {
    display: block;
    padding: 14px 18px;
    color: #C0D6D0;
    font-weight: 500;
    border-bottom: 2px solid transparent;
}
.primary-nav a:hover,
.primary-nav .current-menu-item > a {
    color: #fff;
    border-bottom-color: #E67E22;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid #C0D6D0;
    color: #C0D6D0;
    padding: 9px 14px;
    border-radius: 6px;
    font-size: .95rem;
    cursor: pointer;
    margin: 8px 0;
}
.menu-toggle:hover { background: rgba(255,255,255,0.07); }

/* Совет дня */
.tip-strip {
    background: #144A3D;
    color: #E6F2EF;
    border-top: 1px solid rgba(255,255,255,0.07);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    padding: 9px 0;
    font-size: .92rem;
}
.tip-strip-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}
.tip-bulb {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    color: #E67E22;
    animation: bulb-pulse 2.4s ease-in-out infinite;
}
@keyframes bulb-pulse {
    0%, 100% { opacity: .6; }
    50% { opacity: 1; }
}
.tip-label { color: #E67E22; font-weight: 600; margin-right: 4px; }

/* ===== Контент ===== */
.main-area { padding: 32px 0 56px; }

.layout-with-side {
    display: grid;
    grid-template-columns: 67% 27%;
    gap: 6%;
    align-items: start;
}
.layout-no-side {
    max-width: 85%;
    margin: 0 auto;
}

/* Хлебные крошки */
.crumbs {
    font-size: .88rem;
    color: #5A6874;
    margin-bottom: 18px;
    padding: 10px 14px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #E5E9EC;
}
.crumbs a { color: #1E6F5C; }
.crumbs .sep { margin: 0 7px; color: #9AA5B0; }
.crumbs .here { color: #1F2937; font-weight: 500; }

/* Карточка записи */
.card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.03);
    border: 1px solid #ECEFF1;
    margin-bottom: 22px;
    display: flex;
    flex-direction: column;
    transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(0,0,0,0.06);
}

/* Горизонтальная карточка для лент */
.card-row {
    flex-direction: row;
    align-items: stretch;
}
.card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
    background: #EFF3F2;
}
.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;
    padding: 18px 22px 20px;
    display: flex;
    flex-direction: column;
}
.card-meta {
    font-size: .82rem;
    color: #5A6874;
    margin-bottom: 6px;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.card-meta a { color: #5A6874; }
.card-meta a:hover { color: #1E6F5C; }

.card-title {
    font-size: 1.22rem;
    margin: 0 0 8px;
    line-height: 1.3;
}
.card-title a { color: #0F2E2A; }
.card-title a:hover { color: #1E6F5C; }

.card-excerpt {
    color: #1F2937;
    flex: 1;
    margin-bottom: 12px;
}
.card-excerpt p { margin: 0 0 0.5em; background: none; }

/* Ссылка «Читать далее» */
.read-on {
    align-self: flex-start;
    color: #1E6F5C;
    font-weight: 600;
    font-size: .95rem;
    border-bottom: 1px dashed #1E6F5C;
    padding: 1px 2px 2px;
    transition: background-color .15s ease, border-bottom-style .15s ease;
}
.read-on:hover {
    border-bottom-style: solid;
    background-color: rgba(30,111,92,0.08);
    color: #1E6F5C;
}

/* Кнопка-основная */
.btn {
    display: inline-block;
    background: #E67E22;
    color: #fff;
    padding: 11px 22px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: .98rem;
    text-decoration: none;
    transition: background-color .15s ease, transform .1s ease;
}
.btn:hover {
    background: #C2611A;
    color: #fff;
    transform: translateY(1px);
}

/* Статья */
.entry {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.03);
    border: 1px solid #ECEFF1;
    padding: 30px 36px 32px;
}
.entry-title { margin-top: 0; }
.entry-meta {
    color: #5A6874;
    font-size: .9rem;
    margin-bottom: 22px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.entry-content a { text-decoration: none; border-bottom: 1px solid transparent; }
.entry-content a:hover { border-bottom-color: #1E6F5C; }
.entry-content img { border-radius: 8px; margin: .8em 0; }

/* Tag/category pills */
.cat-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}
.cat-pill {
    display: inline-block;
    padding: 5px 14px;
    border: 1px solid #1E6F5C;
    color: #1E6F5C;
    background: transparent;
    border-radius: 40px;
    font-size: .85rem;
    transition: background-color .15s ease, color .15s ease;
}
.cat-pill:hover, .cat-pill.is-active {
    background: #1E6F5C;
    color: #fff;
}

/* Блок «Совет / безопасность» */
.note-safe {
    background: #E6F2EF;
    border-left: 4px solid #1E6F5C;
    padding: 14px 18px;
    margin: 18px 0;
    border-radius: 0 6px 6px 0;
}
.note-warn {
    background: #FDECEA;
    border-left: 4px solid #D9534F;
    padding: 14px 18px;
    margin: 18px 0;
    border-radius: 0 6px 6px 0;
    color: #7A1F1A;
}

/* Глоссарий — пунктирное подчёркивание */
.gloss {
    border-bottom: 1px dotted #1E6F5C;
    cursor: help;
    position: relative;
}
.gloss-tip {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    background: #0F2E2A;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: .85rem;
    line-height: 1.45;
    width: 240px;
    z-index: 30;
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
    pointer-events: none;
}
.gloss-tip[hidden] { display: none !important; }
.gloss-tip::after {
    content: "";
    position: absolute;
    left: 18px;
    top: 100%;
    border: 6px solid transparent;
    border-top-color: #0F2E2A;
}

/* ===== Сайдбар ===== */
.sidebar { font-size: .95rem; }
.widget {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.03);
    border: 1px solid #ECEFF1;
    padding: 18px 20px;
    margin-bottom: 20px;
}
.widget-title {
    font-size: 1.05rem;
    margin: 0 0 12px;
    color: #0F2E2A;
    border-bottom: 1px solid #ECEFF1;
    padding-bottom: 8px;
}
.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.widget li {
    padding: 6px 0;
    border-bottom: 1px dashed #ECEFF1;
}
.widget li:last-child { border-bottom: none; }

/* Виджет «Надёжный поставщик» */
.trust-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px dashed #ECEFF1;
}
.trust-card:last-child { border-bottom: none; padding-bottom: 0; }
.trust-avatar {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 50%;
    background: linear-gradient(135deg,#1E6F5C,#144A3D);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}
.trust-name { font-weight: 600; color: #0F2E2A; line-height: 1.2; }
.trust-stars { color: #E67E22; font-size: .9rem; margin-top: 1px; }
.trust-stars .num { color: #5A6874; margin-left: 5px; font-size: .82rem; }
.trust-mark {
    display: inline-block;
    margin-top: 4px;
    font-size: .75rem;
    background: #E6F2EF;
    color: #1E6F5C;
    padding: 2px 8px;
    border-radius: 30px;
}

/* ===== Главная — секции ===== */
.front-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.03);
    border: 1px solid #ECEFF1;
    padding: 30px 34px;
    margin-bottom: 28px;
}
.front-section h2 { margin-top: 0; }
.front-lede {
    color: #5A6874;
    font-size: 1.05rem;
    max-width: 720px;
}

/* Кейс-таймлайн */
.timeline {
    position: relative;
    margin: 26px 0 8px;
    padding: 30px 0 30px;
    overflow-x: auto;
}
.timeline-track {
    display: flex;
    gap: 20px;
    min-width: 100%;
    position: relative;
    align-items: stretch;
}
.timeline-track::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: repeating-linear-gradient(to right, #C8D2D6 0 6px, transparent 6px 12px);
    z-index: 0;
}
.tl-card {
    flex: 0 0 220px;
    background: #fff;
    border: 1px solid #E5E9EC;
    border-radius: 10px;
    padding: 14px 16px;
    position: relative;
    z-index: 1;
}
.tl-card.up   { transform: translateY(-22px); }
.tl-card.down { transform: translateY(22px); }
.tl-badge {
    display: inline-block;
    font-size: .75rem;
    padding: 2px 9px;
    border-radius: 30px;
    font-weight: 600;
    margin-bottom: 6px;
}
.tl-card.ok  .tl-badge { background: #E6F2EF; color: #1E6F5C; }
.tl-card.err .tl-badge { background: #FDECEA; color: #D9534F; }
.tl-card h4 { margin: 0 0 6px; font-size: 1rem; }
.tl-card p { font-size: .9rem; color: #5A6874; margin: 0; }

/* Шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 20px;
}
.step {
    background: #F7F8F9;
    border-radius: 8px;
    padding: 18px;
    border: 1px solid #ECEFF1;
}
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1E6F5C;
    color: #fff;
    font-weight: 700;
    margin-bottom: 10px;
}
.step h4 { margin: 0 0 6px; font-size: 1.05rem; }
.step p { font-size: .94rem; color: #5A6874; margin: 0; }

/* ===== Лента карточек на главной (3 в ряд) ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-top: 18px;
}
.cards-grid .card { margin-bottom: 0; flex-direction: column; }
.cards-grid .card-thumb-wrap {
    flex: none;
    position: relative;
    width: 100%;
    height: auto;
}
.cards-grid .card-thumb-wrap a { position: static; display: block; }
.cards-grid .card-thumb-wrap img {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
    display: block;
}

/* ===== Пагинация ===== */
.pager {
    margin: 28px 0 8px;
    text-align: center;
}
.pager .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 3px 6px;
    border-radius: 8px;
    border: 1px solid #D8DEE3;
    background: #fff;
    color: #1F2937;
    font-weight: 500;
    transition: background-color .15s ease, color .15s ease;
}
.pager .page-numbers:hover {
    background: #E6F2EF;
    color: #1E6F5C;
}
.pager .page-numbers.current {
    background: #1E6F5C;
    color: #fff;
    border-color: #1E6F5C;
}
.pager .page-numbers.dots { border: none; background: transparent; }

/* ===== Подвал ===== */
.site-bottom {
    background: #0F2E2A;
    color: #C0D6D0;
    padding: 36px 0 22px;
    margin-top: 48px;
}
.site-bottom a { color: #C0D6D0; }
.site-bottom a:hover { color: #fff; }
.foot-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}
.foot-col .widget {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin-bottom: 0;
    color: #C0D6D0;
}
.foot-col .widget-title {
    color: #fff;
    border-bottom-color: rgba(192,214,208,0.18);
}
.foot-col .widget li {
    border-bottom: 1px dashed rgba(192,214,208,0.15);
}
.foot-col .widget a { color: #C0D6D0; }
.foot-col .widget a:hover { color: #fff; }

.copyline {
    border-top: 1px solid rgba(192,214,208,0.15);
    margin-top: 28px;
    padding-top: 18px;
    font-size: .88rem;
    color: #9DBAB3;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.signoff {
    font-size: .82rem;
    color: #9DBAB3;
    display: flex;
    align-items: center;
    gap: 6px;
}
.signoff svg { color: #E67E22; }

/* ===== Форма поиска ===== */
.search-form {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}
.search-form input[type="search"] {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #D8DEE3;
    border-radius: 8px;
    font: inherit;
    background: #fff;
}
.search-form input[type="search"]:focus {
    outline: none;
    border-color: #1E6F5C;
    box-shadow: 0 0 0 3px rgba(30,111,92,0.15);
}
.search-form button { white-space: nowrap; }

/* ===== 404 ===== */
.notfound {
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #ECEFF1;
    box-shadow: 0 8px 20px rgba(0,0,0,0.03);
}
.notfound .big {
    font-size: 5rem;
    color: #1E6F5C;
    margin: 0 0 10px;
    line-height: 1;
    font-family: "Merriweather", Georgia, serif;
}

/* ===== Cookie-баннер ===== */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 1000;
    background: #0F2E2A;
    color: #E6F2EF;
    border: 1px solid #1E6F5C;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 14px 30px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    max-width: 1100px;
    margin: 0 auto;
}
.cookie-banner p {
    margin: 0;
    font-size: .92rem;
    line-height: 1.5;
    flex: 1 1 320px;
    background: none;
}
.cookie-banner a { color: #fff; text-decoration: underline; }
.cookie-accept {
    background: #E67E22;
    color: #fff;
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color .15s ease, transform .1s ease;
}
.cookie-accept:hover {
    background: #C2611A;
    transform: translateY(1px);
}

/* ===== Комментарии ===== */
.comments-block {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.03);
    border: 1px solid #ECEFF1;
    padding: 26px 32px;
    margin-top: 24px;
}
.comments-block h3 { margin-top: 0; }
.comm-list { list-style: none; padding: 0; margin: 0; }
.comm-list ol { list-style: none; padding-left: 22px; }
.comm-item {
    padding: 14px 0;
    border-bottom: 1px solid #ECEFF1;
}
.comm-item:last-child { border-bottom: none; }
.comm-head {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 6px;
}
.comm-head img { border-radius: 50%; }
.comm-author { font-weight: 600; color: #0F2E2A; }
.comm-date { color: #5A6874; font-size: .85rem; }
.comm-reply a { font-size: .85rem; color: #1E6F5C; }
.comment-respond {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #ECEFF1;
}
.comment-form p { margin: 0 0 10px; }
.comment-form label { display: block; font-size: .9rem; margin-bottom: 4px; color: #5A6874; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #D8DEE3;
    border-radius: 8px;
    font: inherit;
    background: #fff;
}
.comment-form textarea { min-height: 110px; resize: vertical; }
.form-submit input[type="submit"] {
    background: #E67E22;
    color: #fff;
    padding: 11px 22px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: .98rem;
}
.form-submit input[type="submit"]:hover { background: #C2611A; }

/* ===== Адаптив ===== */
@media (max-width: 960px) {
    .layout-with-side { grid-template-columns: 1fr; gap: 26px; }
    .layout-no-side { max-width: 100%; }
    .cards-grid { grid-template-columns: repeat(2, 1fr); }
    .steps { grid-template-columns: repeat(2, 1fr); }
    .foot-cols { grid-template-columns: 1fr 1fr; }
    .entry { padding: 24px 22px; }
    .front-section { padding: 24px 22px; }
}

@media (max-width: 600px) {
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.3rem; }
    .menu-toggle { display: inline-block; }
    .primary-nav ul {
        display: none;
        flex-direction: column;
        background: #0F2E2A;
        padding: 8px 0 12px;
    }
    .primary-nav.is-open ul { display: flex; }
    .primary-nav a { padding: 11px 18px; }
    .cards-grid { grid-template-columns: 1fr; }
    .steps { grid-template-columns: 1fr; }
    .foot-cols { grid-template-columns: 1fr; gap: 22px; }
    .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;
    }
    .entry { padding: 20px 18px; }
    .front-section { padding: 22px 18px; }
    .copyline { flex-direction: column; align-items: flex-start; }
    .timeline { padding: 30px 4px; }
    .tl-card.up, .tl-card.down { transform: none; }
}

/* ===== Утилиты ===== */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
.alignleft   { float: left;  margin: 0 1.4em 1em 0; }
.alignright  { float: right; margin: 0 0 1em 1.4em; }
.aligncenter { display: block; margin: 0 auto 1em; }
.wp-caption  { max-width: 100%; }
.wp-caption-text { font-size: .85rem; color: #5A6874; text-align: center; margin-top: 6px; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.gallery-caption { font-size: .8rem; color: #5A6874; }
