/*
Theme Name: dds_loic-ousten.com
Author: Дмитрий Ковалёв
Description: Гибридная тема для агентства цифрового маркетинга и веб-разработки в строительной нише с информационным блогом о ремонте. Индустриальная стилистика: графит, бетонно-песочный акцент и строительный терракот.
Version: 1.1
Text Domain: dlo
*/

/* ============================================================
   ПЕРЕМЕННЫЕ И БАЗА
   ============================================================ */
:root {
    --c-graphite: #1E2629;
    --c-sand: #D9C8A9;
    --c-terra: #E05A2A;
    --c-terra-dark: #C24D22;
    --c-white: #F4F5F0;
    --c-ink: #2B2F2C;
    --c-paper: #EFEBE4;
    --shell: 1180px;
    --gap: 28px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    color: var(--c-ink);
    background: var(--c-white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

a { color: var(--c-terra); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--c-terra-dark); text-decoration: underline; }

p { margin: 0 0 1em; }

h1, h2, h3, h4 {
    font-family: "Arial Black", "Segoe UI", Arial, sans-serif;
    line-height: 1.18;
    color: var(--c-graphite);
    margin: 0 0 .55em;
    letter-spacing: -.01em;
}
h1 { font-size: 2.15rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.08rem; }

/* ============================================================
   КОНТЕЙНЕР ШИРИНЫ — ЕДИНЫЙ ИСТОЧНИК
   ============================================================ */
.shell {
    width: min(92%, var(--shell));
    margin-inline: auto;
}

/* ============================================================
   КНОПКИ — «незавершённый бетонный блок»
   ============================================================ */
.btn,
button,
input[type="submit"],
.wp-block-button__link {
    display: inline-block;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    padding: 12px 26px;
    color: var(--c-white);
    background: var(--c-terra);
    border: none;
    border-radius: 2px 2px 12px 12px;
    transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.btn:hover,
button:hover,
input[type="submit"]:hover,
.wp-block-button__link:hover {
    background: var(--c-terra-dark);
    color: var(--c-white);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(30, 38, 41, .28);
}
.btn-ghost {
    background: transparent;
    color: var(--c-terra);
    border: 2px solid var(--c-terra);
    border-radius: 2px 2px 12px 12px;
}
.btn-ghost:hover {
    background: var(--c-terra);
    color: var(--c-white);
}

/* ============================================================
   ШАПКА
   ============================================================ */
.site-header {
    background: var(--c-graphite);
    color: var(--c-white);
    border-bottom: 3px solid var(--c-terra);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--gap);
    padding: 20px 0;
}
.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}
.brand-logo,
.brand-fallback {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    display: block;
}
.brand-text { min-width: 0; }
.brand-title {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.25;
    color: var(--c-white);
}
.brand-title a { color: var(--c-white); }
.brand-title a:hover { color: var(--c-sand); text-decoration: none; }
.brand-desc {
    margin: 4px 0 0;
    font-size: .82rem;
    color: var(--c-sand);
    line-height: 1.4;
    max-height: 3.6em;
    overflow: hidden;
}

/* Навигация */
.main-nav { min-width: 0; }
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
}
.main-nav a {
    color: var(--c-white);
    font-weight: 700;
    padding: 6px 2px;
    border-bottom: 2px solid transparent;
    transition: border-color .2s ease, color .2s ease;
}
.main-nav a:hover {
    color: var(--c-terra);
    border-bottom-color: var(--c-terra);
    text-decoration: none;
}
.main-nav .current-menu-item > a {
    color: var(--c-sand);
    border-bottom-color: var(--c-sand);
}

/* Кнопка-«рычаг» мобильного меню */
.nav-toggle {
    display: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--c-terra);
    color: var(--c-white);
    border: none;
    padding: 0;
    font-size: 22px;
    line-height: 1;
    align-items: center;
    justify-content: center;
}
.nav-toggle:hover { background: var(--c-terra-dark); transform: none; box-shadow: none; }

/* ============================================================
   РАЗМЕТКА СТРАНИЦ
   ============================================================ */
.site-main { padding: 40px 0 56px; }

.layout-single .content-area {
    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: 6%;
    align-items: start;
}
.layout-with-sidebar .content-area { min-width: 0; }

/* ============================================================
   ХЛЕБНЫЕ КРОШКИ
   ============================================================ */
.breadcrumbs {
    font-size: .86rem;
    color: #6a6f6b;
    margin: 0 0 22px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--c-sand);
}
.breadcrumbs a { color: var(--c-terra); }
.breadcrumbs .sep { color: #9a9a92; margin: 0 4px; }
.breadcrumbs span:last-child { color: var(--c-ink); }

/* ============================================================
   КАРТОЧКИ ЗАПИСЕЙ
   ============================================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: var(--gap);
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--c-paper);
    color: var(--c-ink);
    border: 1px solid #ddd6c6;
    border-radius: 2px 2px 12px 12px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(30, 38, 41, .07);
    transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(30, 38, 41, .14);
}

/* миниатюра вертикальной карточки — aspect-ratio */
.card-thumb {
    display: block;
    overflow: hidden;
}
.card-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-thumb-ph {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background:
        repeating-linear-gradient(45deg, #e2dccb 0 14px, #d9c8a9 14px 28px);
}

.card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 20px 22px 24px;
}
.card-title { margin: 0 0 8px; font-size: 1.18rem; }
.card-title a { color: var(--c-graphite); }
.card-title a:hover { color: var(--c-terra); text-decoration: none; }

.card-meta {
    font-size: .8rem;
    color: #6a6f6b;
    margin: 0 0 10px;
}
.card-excerpt { margin: 0 0 16px; }
.card-excerpt p { margin: 0 0 .5em; background: none; }
.card-more { margin-top: auto; }
.card-more .btn { padding: 9px 20px; font-size: .92rem; }

/* «плиточная» сетка-заставка над руководствами в карточке блога */
.tile-strip {
    display: flex;
    gap: 5px;
    padding: 12px 22px 0;
}
.tile-strip span {
    flex: 1;
    height: 8px;
    background: var(--c-sand);
    box-shadow: 0 2px 0 rgba(30, 38, 41, .18);
    border-radius: 1px;
}

/* ============================================================
   ОДИНОЧНАЯ ЗАПИСЬ / СТРАНИЦА
   ============================================================ */
.entry {
    background: var(--c-paper);
    border: 1px solid #ddd6c6;
    border-radius: 2px 2px 12px 12px;
    padding: 32px clamp(20px, 4vw, 44px);
}
.entry-header { margin-bottom: 20px; }
.entry-meta { font-size: .85rem; color: #6a6f6b; }
.entry-thumb { margin: 0 0 24px; }
.entry-thumb img { display: block; width: 100%; border-radius: 2px 2px 12px 12px; }
.entry-content { min-width: 0; }
.entry-content img { display: block; }
.entry-content h2,
.entry-content h3 { margin-top: 1.4em; }

/* таблицы */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
}
.entry-content table,
.entry-content th,
.entry-content td {
    border: 1px solid #c9c1ad;
}
.entry-content th,
.entry-content td { padding: 9px 12px; text-align: left; }
.entry-content th { background: var(--c-sand); color: var(--c-graphite); }

blockquote {
    margin: 1.4em 0;
    padding: 12px 20px;
    border-left: 4px solid var(--c-terra);
    background: #e6e0d2;
}

/* ============================================================
   САЙДБАР И ВИДЖЕТЫ
   ============================================================ */
.sidebar {
    min-width: 0;
}
.widget {
    background: var(--c-paper);
    border: 1px solid #ddd6c6;
    border-radius: 2px 2px 12px 12px;
    padding: 20px 22px;
    margin-bottom: 24px;
    color: var(--c-ink);
}
.widget a { color: var(--c-terra); }
.widget a:hover { color: var(--c-terra-dark); }
.widget-title {
    margin: 0 0 14px;
    font-size: 1.1rem;
    color: var(--c-graphite);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--c-terra);
}
.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.widget li {
    padding: 7px 0;
    border-bottom: 1px dashed #d3cbb7;
    font-size: .94rem;
}
.widget li:last-child { border-bottom: none; }
.widget .post-date,
.widget .rss-date {
    display: block;
    font-size: .78rem;
    color: #6a6f6b;
}

/* ============================================================
   ПАГИНАЦИЯ
   ============================================================ */
.pagination {
    margin: 36px 0 0;
}
.pagination .page-numbers {
    display: inline-block;
    min-width: 42px;
    text-align: center;
    padding: 9px 12px;
    margin: 0 4px 8px 0;
    background: var(--c-paper);
    color: var(--c-graphite);
    border: 1px solid #ddd6c6;
    border-radius: 2px 2px 10px 10px;
    font-weight: 700;
    transition: background-color .2s ease, color .2s ease;
}
.pagination a.page-numbers:hover {
    background: var(--c-terra);
    color: var(--c-white);
    text-decoration: none;
}
.pagination .page-numbers.current {
    background: var(--c-graphite);
    color: var(--c-white);
    border-color: var(--c-graphite);
}
.pagination .page-numbers.dots { background: none; border: none; }

/* ============================================================
   ГЛАВНАЯ СТРАНИЦА
   ============================================================ */
.section {
    margin: 0 0 56px;
}
.section-head {
    margin: 0 0 26px;
}
.section-head h2 {
    color: var(--c-terra);
    display: inline-block;
    padding-bottom: 6px;
    border-bottom: 4px solid var(--c-sand);
}
.section-lead { max-width: 70ch; color: #4a4f4b; }

/* hero — две зоны */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 2px 2px 12px 12px;
    overflow: hidden;
    margin: 0 0 56px;
}
.hero > div { padding: clamp(28px, 5vw, 56px); min-width: 0; }
.hero-build {
    background: var(--c-graphite);
    color: var(--c-white);
    background-image:
        radial-gradient(rgba(217, 200, 169, .12) 1px, transparent 1px);
    background-size: 7px 7px;
}
.hero-build h1 { color: var(--c-white); font-size: 2.3rem; }
.hero-build p { color: var(--c-sand); }
.hero-digital {
    background: linear-gradient(140deg, #f3efe6 0%, #e3dcc9 100%);
    color: var(--c-ink);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.hero-digital .ui-chip {
    display: inline-block;
    background: var(--c-white);
    border: 2px solid var(--c-graphite);
    box-shadow: 4px 4px 0 var(--c-graphite);
    padding: 10px 16px;
    margin: 6px 8px 6px 0;
    font-weight: 700;
    border-radius: 4px;
}

/* блок «архитектурных планов» */
.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: var(--gap);
}
.plan-card {
    background:
        linear-gradient(rgba(45, 90, 140, .05) 1px, transparent 1px) 0 0 / 100% 22px,
        var(--c-white);
    border: 1px solid #b9c6d4;
    border-radius: 2px 2px 12px 12px;
    padding: 24px 22px;
    min-width: 0;
}
.plan-card .plan-icon {
    width: 46px;
    height: 46px;
    margin-bottom: 12px;
    color: var(--c-terra);
}
.plan-card h3 { color: var(--c-graphite); }

/* шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: var(--gap);
    counter-reset: step;
}
.step {
    min-width: 0;
    padding: 22px;
    background: var(--c-paper);
    border-left: 4px solid var(--c-terra);
}
.step::before {
    counter-increment: step;
    content: counter(step, decimal-leading-zero);
    display: block;
    font-family: "Arial Black", Arial, sans-serif;
    font-size: 1.8rem;
    color: var(--c-terra);
}

/* переключатель ролей */
.role-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 22px;
}
.role-btn {
    background: var(--c-paper);
    color: var(--c-graphite);
    border: 2px solid #ddd6c6;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 2px 2px 12px 12px;
    cursor: pointer;
    transition: all .2s ease;
}
.role-btn:hover { transform: translateY(-2px); }
.role-btn[aria-pressed="true"] {
    background: var(--role-color, var(--c-terra));
    color: var(--c-white);
    border-color: var(--role-color, var(--c-terra));
}
.role-panel[hidden] { display: none !important; }
.role-panel {
    border-top: 4px solid var(--role-color, var(--c-terra));
    padding-top: 22px;
    transition: border-color .2s ease;
}

/* ============================================================
   COOKIE-БАННЕР
   ============================================================ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 22px;
    padding: 16px 24px;
    background: var(--c-graphite);
    color: var(--c-white);
    border-top: 3px solid var(--c-terra);
}
.cookie-banner p { margin: 0; flex: 1; min-width: 220px; font-size: .9rem; }
.cookie-banner a { color: var(--c-sand); }
.cookie-banner .btn { padding: 9px 22px; }

/* ============================================================
   ПОДВАЛ
   ============================================================ */
.site-footer {
    background: var(--c-graphite);
    color: var(--c-white);
    border-top: 3px solid var(--c-terra);
    padding: 44px 0 24px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--gap);
}
.footer-col {
    min-width: 0;
    padding-bottom: 18px;
    border-bottom: 1px dashed #4a514b;
}
/* виджеты в футере — светлый текст на тёмном фоне */
.site-footer .widget {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--c-white);
}
.site-footer .widget-title {
    color: var(--c-sand);
    border-bottom-color: #4a514b;
}
.site-footer .widget a { color: var(--c-white); }
.site-footer .widget a:hover { color: var(--c-terra); }
.site-footer .widget li { border-bottom-color: #3c423d; }
.site-footer .widget .post-date,
.site-footer .widget .rss-date { color: var(--c-sand); }

/* контакты как «сметные позиции» */
.estimate-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.estimate-list li {
    display: flex;
    gap: 10px;
    padding: 6px 0;
    font-size: .92rem;
    color: var(--c-white);
}
.estimate-list .pos {
    color: var(--c-terra);
    font-weight: 700;
    flex: 0 0 auto;
}
.estimate-list a { color: var(--c-white); }

.footer-bottom {
    margin-top: 22px;
    font-size: .84rem;
    color: var(--c-sand);
    text-align: center;
}

/* ============================================================
   ФОРМЫ ПОИСКА И КОММЕНТАРИЕВ
   ============================================================ */
.search-form {
    display: flex;
    gap: 8px;
}
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    font: inherit;
    border: 1px solid #c9c1ad;
    border-radius: 2px;
    background: var(--c-white);
    color: var(--c-ink);
}
.search-form input[type="search"]:focus {
    outline: 2px solid var(--c-terra);
    outline-offset: 1px;
}

.comments-area {
    margin-top: 36px;
    background: var(--c-paper);
    border: 1px solid #ddd6c6;
    border-radius: 2px 2px 12px 12px;
    padding: 28px clamp(20px, 4vw, 40px);
}
.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.comment-list li { margin: 0 0 18px; }
.comment-body {
    background: var(--c-white);
    border: 1px solid #ddd6c6;
    border-radius: 2px 2px 10px 10px;
    padding: 14px 18px;
}
.comment-list .children {
    list-style: none;
    margin: 14px 0 0 26px;
    padding: 0;
}
.comment-meta { font-size: .82rem; color: #6a6f6b; margin-bottom: 6px; }
.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"],
.comment-respond textarea {
    width: 100%;
    padding: 10px 12px;
    font: inherit;
    border: 1px solid #c9c1ad;
    border-radius: 2px;
    margin-bottom: 12px;
    background: var(--c-white);
    color: var(--c-ink);
}

/* ============================================================
   404
   ============================================================ */
.error-404 {
    text-align: center;
    padding: 30px 0;
}
.error-404 .big {
    font-size: 5rem;
    color: var(--c-terra);
    margin: 0;
    line-height: 1;
}
.error-404 .search-form {
    max-width: 420px;
    margin: 22px auto;
}

/* ============================================================
   СЛАЙДЕР (главная)
   ============================================================ */
.dlo-slide[hidden] { display: none !important; }
.dlo-slider {
    border: 1px solid #ddd6c6;
    border-radius: 2px 2px 12px 12px;
    background: var(--c-paper);
    padding: 24px;
}
.dlo-slide { display: block; }
.slider-nav {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

/* ============================================================
   СЛУЖЕБНОЕ
   ============================================================ */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 960px) {
    .layout-with-sidebar {
        grid-template-columns: minmax(0, 1fr);
        gap: 36px;
    }
    .hero { grid-template-columns: minmax(0, 1fr); }
    .footer-cols { grid-template-columns: minmax(0, 1fr); }
    h1 { font-size: 1.8rem; }
    .hero-build h1 { font-size: 1.9rem; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .header-inner { flex-wrap: wrap; }
    .nav-toggle { display: inline-flex; }
    .main-nav {
        flex-basis: 100%;
        order: 3;
    }
    .main-nav ul {
        flex-direction: column;
        gap: 0;
        margin-top: 14px;
    }
    .main-nav li {
        border-bottom: 1px dashed #4a514b;
    }
    .main-nav a { display: block; padding: 12px 4px; }
    .main-nav[hidden] { display: none !important; }
    .layout-single .content-area { width: 100%; }
    .card-grid { grid-template-columns: minmax(0, 1fr); }
}
