/*
Theme Name: dds_cubeec.ru
Author: Токарева Екатерина
Description: Тема для информационного блога о строительстве домов и коттеджей. Индустриальная надёжность с уютом жилого пространства.
Version: 1.1
Text Domain: dds_cubeec
*/

/* === ОСНОВА === */
* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 17px;
    line-height: 1.65;
    color: #2E2A28;
    background-color: #F8F6F0;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(46,42,40,0.04) 1px, transparent 0),
        radial-gradient(circle at 11px 7px, rgba(111,126,91,0.03) 1px, transparent 0);
    background-size: 14px 14px, 22px 22px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

a {
    color: #C75C3A;
    text-decoration: none;
    transition: color .2s ease, border-color .2s ease;
    border-bottom: 1px dashed transparent;
}

a:hover {
    color: #2E2A28;
    border-bottom-color: #C75C3A;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Literata', 'Playfair Display', Georgia, serif;
    color: #2E2A28;
    line-height: 1.25;
    margin: 1.4em 0 0.6em;
    font-weight: 600;
    letter-spacing: -0.01em;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }

p {
    margin: 0 0 1em;
}

blockquote {
    margin: 1.6em 0;
    padding: 0.8em 1.2em;
    border-left: 3px solid #6F7E5B;
    background: rgba(111,126,91,0.06);
    font-style: italic;
    color: #3a3633;
}

code, pre {
    font-family: 'JetBrains Mono', Menlo, Consolas, monospace;
    background: rgba(46,42,40,0.05);
    border-radius: 2px;
}

code { padding: 0.1em 0.35em; font-size: 0.92em; }

pre {
    padding: 1em;
    overflow-x: auto;
    border: 1px solid #D8CFBF;
}

hr {
    border: none;
    border-top: 1px dashed #D8CFBF;
    margin: 2em 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
    border: 1px solid #D8CFBF;
}

th, td {
    padding: 0.6em 0.9em;
    border: 1px solid #D8CFBF;
    text-align: left;
}

th {
    background: rgba(111,126,91,0.08);
    font-family: 'Literata', Georgia, serif;
    font-weight: 600;
}

/* === КОНТЕЙНЕРЫ === */
.site-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-content {
    flex: 1;
    padding: 40px 120px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.layout-narrow {
    max-width: 85%;
    margin: 0 auto;
}

.layout-with-aside {
    display: grid;
    grid-template-columns: 67% 27%;
    gap: 6%;
    align-items: start;
}

@media (max-width: 960px) {
    .site-content { padding: 30px 40px; }
    .layout-with-aside { grid-template-columns: 1fr; gap: 32px; }
    .layout-narrow { max-width: 100%; }
}

@media (max-width: 600px) {
    .site-content { padding: 20px; }
    h1 { font-size: 1.7rem; }
    h2 { font-size: 1.4rem; }
}

/* === ШАПКА === */
.site-head {
    border-bottom: 1px dashed #D8CFBF;
    background: #F8F6F0;
}

.site-head-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 22px 120px;
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    border: none;
}

.brand:hover { border: none; }

.brand-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-svg {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-family: 'Literata', Georgia, serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: #2E2A28;
    line-height: 1.2;
}

.brand-tagline {
    font-size: 0.82rem;
    color: #6b6560;
    line-height: 1.3;
    margin-top: 2px;
    max-width: 480px;
}

.head-nav {
    margin-left: auto;
}

.head-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 26px;
    flex-wrap: wrap;
}

.head-nav a {
    color: #2E2A28;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    padding-bottom: 2px;
}

.head-nav a:hover,
.head-nav .current-menu-item > a {
    color: #C75C3A;
    border-bottom-color: #C75C3A;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid #2B2B2B;
    color: #2E2A28;
    padding: 8px 14px;
    font-size: 0.9rem;
    cursor: pointer;
    margin-left: auto;
}

@media (max-width: 960px) {
    .site-head-inner { padding: 18px 40px; gap: 18px; }
    .nav-toggle { display: inline-block; }
    .head-nav {
        flex-basis: 100%;
        margin-left: 0;
        display: none;
    }
    .head-nav.is-open { display: block; }
    .head-nav ul {
        flex-direction: column;
        gap: 10px;
        padding: 14px 0;
    }
}

@media (max-width: 600px) {
    .site-head-inner { padding: 14px 20px; }
    .brand-tagline { display: none; }
}

/* === ХЛЕБНЫЕ КРОШКИ === */
.crumbs {
    font-size: 0.85rem;
    color: #6b6560;
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
}

.crumbs a {
    color: #6b6560;
    border-bottom: 1px dashed transparent;
}

.crumbs a:hover {
    color: #C75C3A;
    border-bottom-color: #C75C3A;
}

.crumbs .sep {
    color: #c7bdac;
}

/* === КАРТОЧКИ ЗАПИСЕЙ === */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
    margin: 24px 0 36px;
}

.card {
    display: flex;
    flex-direction: column;
    background: #FBFAF5;
    border: 1px solid #2E2A28;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
    position: relative;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px -10px rgba(46,42,40,0.4);
}

.card-thumb {
    display: block;
    overflow: hidden;
    border-bottom: 1px solid #2E2A28;
    position: relative;
}

.card-thumb img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
    filter: grayscale(60%);
    transition: filter .3s ease, transform .4s ease;
}

.card:hover .card-thumb img {
    filter: grayscale(0%);
    transform: scale(1.04);
}

.card-thumb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(199,92,58,0.7);
    color: #FBFAF5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
}

.card:hover .card-thumb-overlay { opacity: 1; }

.card-body {
    flex: 1;
    padding: 18px 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-cat {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6F7E5B;
    margin: 0;
}

.card-cat::before {
    content: '⌐ ';
    color: #C75C3A;
    font-family: monospace;
}

.card-title {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.3;
}

.card-title a {
    color: #2E2A28;
    border-bottom: none;
}

.card-title a:hover { color: #C75C3A; }

.card-excerpt {
    font-size: 0.94rem;
    color: #4a4541;
    margin: 0;
}

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

.card-meta {
    margin-top: auto;
    font-size: 0.78rem;
    color: #8a8378;
    padding-top: 8px;
    border-top: 1px dashed #D8CFBF;
}

/* Горизонтальные карточки на главной (тематические блоки) */
.card-row {
    flex-direction: row;
}

.card-row .card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
    border-bottom: none;
    border-right: 1px solid #2E2A28;
}

.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;
    filter: grayscale(60%);
    transition: filter .3s ease;
}

.card-row:hover .card-thumb-wrap img { filter: grayscale(0%); }

@media (max-width: 600px) {
    .card-row { flex-direction: column; }
    .card-row .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
        border-right: none;
        border-bottom: 1px solid #2E2A28;
    }
    .card-row .card-thumb-wrap a { position: static; }
    .card-row .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
}

/* === КНОПКИ === */
.btn {
    display: inline-block;
    background: #2B2B2B;
    color: #F8F6F0;
    padding: 10px 22px;
    font-size: 0.92rem;
    font-weight: 500;
    border: 1px solid #2B2B2B;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 3px), calc(100% - 3px) 100%, 0 100%);
}

.btn:hover {
    background: #C75C3A;
    border-color: #C75C3A;
    color: #F8F6F0;
}

.btn-ghost {
    background: transparent;
    color: #2B2B2B;
}

.btn-ghost:hover {
    background: #C75C3A;
    color: #F8F6F0;
}

.card-body .btn {
    align-self: flex-start;
    margin-top: 4px;
    padding: 8px 18px;
    font-size: 0.85rem;
}

/* === ПАГИНАЦИЯ === */
.pager {
    margin: 36px 0 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #2B2B2B;
    color: #2E2A28;
    font-size: 0.92rem;
    background: transparent;
    transition: background .2s ease, color .2s ease;
}

.pager .page-numbers:hover,
.pager .page-numbers.current {
    background: #C75C3A;
    color: #F8F6F0;
    border-color: #C75C3A;
}

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

/* === САЙДБАР === */
.aside {
    font-size: 0.95rem;
}

.widget {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px dashed #D8CFBF;
}

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

.widget-title {
    font-size: 1.05rem;
    margin: 0 0 14px;
    padding-left: 12px;
    border-left: 3px solid #C75C3A;
}

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

.widget li {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed rgba(216,207,191,0.6);
}

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

.widget a {
    color: #2E2A28;
}

.widget a:hover { color: #C75C3A; }

/* === ОДИНОЧНАЯ ЗАПИСЬ === */
.entry-head {
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px dashed #D8CFBF;
}

.entry-title {
    margin: 0 0 12px;
    font-size: 2.1rem;
}

.entry-meta {
    font-size: 0.85rem;
    color: #8a8378;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.entry-meta a { color: #6F7E5B; }
.entry-meta a:hover { color: #C75C3A; }

.entry-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-bottom: 14px;
}

.entry-cats a {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6F7E5B;
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
}

.entry-cats a::before {
    content: '⌐ ';
    color: #C75C3A;
    font-family: monospace;
}

.entry-cats a:hover {
    color: #C75C3A;
    border-bottom-color: #C75C3A;
}

.entry-thumb {
    margin: 0 0 24px;
    border: 1px solid #6F7E5B;
    box-shadow: 0 4px 14px -8px rgba(46,42,40,0.4);
}

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

.entry-content img {
    border: 1px solid #6F7E5B;
    box-shadow: 0 4px 14px -8px rgba(46,42,40,0.4);
    margin: 1.2em 0;
}

.entry-content h2,
.entry-content h3 { margin-top: 1.6em; }

.entry-tags {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px dashed #D8CFBF;
    font-size: 0.88rem;
    color: #6b6560;
}

.entry-tags a {
    display: inline-block;
    margin-right: 6px;
    padding: 2px 10px;
    background: rgba(111,126,91,0.1);
    border: 1px solid rgba(111,126,91,0.3);
    color: #4a4541;
    font-size: 0.82rem;
}

.entry-tags a:hover {
    background: #C75C3A;
    color: #F8F6F0;
    border-color: #C75C3A;
}

/* === ГЛАВНАЯ === */
.intro-block {
    margin: 0 0 48px;
    padding: 36px;
    background: #FBFAF5;
    border: 1px solid #2E2A28;
    position: relative;
}

.intro-block::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    width: 22px;
    height: 22px;
    border-top: 3px solid #C75C3A;
    border-left: 3px solid #C75C3A;
}

.intro-block::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 22px;
    height: 22px;
    border-bottom: 3px solid #C75C3A;
    border-right: 3px solid #C75C3A;
}

.intro-block h2 {
    margin-top: 0;
}

.intro-block p {
    background: none;
    margin-bottom: 0.8em;
    color: #3a3633;
}

.section-heading {
    font-size: 1.6rem;
    margin: 48px 0 24px;
    padding-bottom: 10px;
    border-bottom: 2px solid #2E2A28;
    position: relative;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 80px;
    height: 2px;
    background: #C75C3A;
}

/* === КОММЕНТАРИИ === */
.comments {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px dashed #D8CFBF;
}

.comments-title {
    font-size: 1.4rem;
    margin: 0 0 24px;
}

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

.comment-list .children {
    list-style: none;
    margin: 16px 0 0;
    padding-left: 32px;
}

.comment {
    padding: 16px 16px 16px 20px;
    margin-bottom: 18px;
    background: #FBFAF5;
    border-left: 3px solid #6F7E5B;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.comment-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid #2E2A28;
    filter: grayscale(100%) contrast(1.2);
    flex-shrink: 0;
}

.comment-author {
    font-weight: 600;
    color: #2E2A28;
    font-size: 0.95rem;
}

.comment-date {
    font-size: 0.8rem;
    color: #8a8378;
    margin-left: auto;
    font-family: 'JetBrains Mono', monospace;
}

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

.comment-reply a {
    font-size: 0.82rem;
    color: #6F7E5B;
    border-bottom: 1px dashed #6F7E5B;
}

.comment-reply a:hover {
    color: #C75C3A;
    border-bottom-color: #C75C3A;
}

.comment-form {
    margin-top: 24px;
}

.comment-form p {
    margin-bottom: 14px;
}

.comment-form label {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 4px;
    color: #4a4541;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    background: #FBFAF5;
    border: 1px solid #D8CFBF;
    color: #2E2A28;
    font-family: inherit;
    font-size: 0.95rem;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: #C75C3A;
}

.comment-form textarea { min-height: 130px; resize: vertical; }

.comment-form .form-submit input[type="submit"] {
    background: #2B2B2B;
    color: #F8F6F0;
    border: 1px solid #2B2B2B;
    padding: 10px 24px;
    font-size: 0.92rem;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 3px), calc(100% - 3px) 100%, 0 100%);
}

.comment-form .form-submit input[type="submit"]:hover {
    background: #C75C3A;
    border-color: #C75C3A;
}

/* === ФОРМА ПОИСКА === */
.search-form {
    display: flex;
    gap: 0;
    max-width: 460px;
    margin: 16px 0;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 10px 12px;
    background: #FBFAF5;
    border: 1px solid #2B2B2B;
    border-right: none;
    color: #2E2A28;
    font-family: inherit;
    font-size: 0.95rem;
}

.search-form input[type="search"]:focus {
    outline: none;
    border-color: #C75C3A;
}

.search-form button {
    background: #2B2B2B;
    color: #F8F6F0;
    border: 1px solid #2B2B2B;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 0.92rem;
    transition: background .2s ease, border-color .2s ease;
}

.search-form button:hover {
    background: #C75C3A;
    border-color: #C75C3A;
}

/* === 404 === */
.error404-block {
    text-align: center;
    padding: 40px 20px;
}

.error404-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 5.5rem;
    color: #C75C3A;
    margin: 0;
    line-height: 1;
    letter-spacing: -0.04em;
}

.error404-block h1 {
    margin: 16px 0 12px;
}

.error404-block .search-form {
    margin: 24px auto;
}

/* === ПОДВАЛ === */
.site-foot {
    margin-top: 60px;
    background: #2E2A28;
    color: #d8cfbf;
    padding: 50px 120px 26px;
    border-top: 4px solid #C75C3A;
}

.foot-cols {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.foot-col h4,
.foot-col .widget-title {
    color: #F8F6F0;
    font-family: 'Literata', Georgia, serif;
    font-size: 1.05rem;
    margin: 0 0 14px;
    padding-left: 0;
    border-left: none;
    padding-bottom: 6px;
    border-bottom: 1px dashed #6F7E5B;
}

.foot-col .widget {
    border: none;
    padding: 0;
    margin: 0;
}

.foot-col p,
.foot-col .textwidget {
    color: #d8cfbf;
    font-size: 0.92rem;
    line-height: 1.6;
}

.foot-col a {
    color: #d8cfbf;
    border-bottom: 1px dashed transparent;
}

.foot-col a:hover {
    color: #C75C3A;
    border-bottom-color: #C75C3A;
}

.foot-col li {
    border-bottom: 1px dashed rgba(216,207,191,0.15);
}

.foot-bottom {
    max-width: 1400px;
    margin: 36px auto 0;
    padding-top: 18px;
    border-top: 1px dashed #6F7E5B;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: #a8a094;
    text-align: center;
    letter-spacing: 0.02em;
}

@media (max-width: 960px) {
    .site-foot { padding: 40px 40px 24px; }
    .foot-cols { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 600px) {
    .site-foot { padding: 32px 20px 22px; }
}

/* === COOKIE-БАННЕР === */
.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 9999;
    background: #2E2A28;
    color: #F8F6F0;
    padding: 16px 20px;
    border: 1px solid #C75C3A;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 6px 20px -6px rgba(0,0,0,0.4);
    max-width: 980px;
    margin: 0 auto;
}

.cookie-banner p {
    margin: 0;
    flex: 1;
    min-width: 220px;
    font-size: 0.92rem;
    color: #F8F6F0;
}

.cookie-banner button {
    background: #C75C3A;
    color: #F8F6F0;
    border: 1px solid #C75C3A;
    padding: 9px 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background .2s ease;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 3px), calc(100% - 3px) 100%, 0 100%);
}

.cookie-banner button:hover {
    background: #F8F6F0;
    color: #2E2A28;
}

@media (max-width: 600px) {
    .cookie-banner {
        left: 8px;
        right: 8px;
        bottom: 8px;
        padding: 12px 14px;
    }
}

/* === FADE-IN ПРИ СКРОЛЛЕ === */
.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .6s ease, transform .6s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; }
    html { scroll-behavior: auto; }
}

/* === SR-ONLY === */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
