/*
Theme Name: dds_rem-tent.ru
Author: Алексей Кравцов
Description: Тёмная индустриальная тема для образовательного портала по монтажу мягких окон и ПВХ-конструкций. Концепция Industrial Navy: графитово-синий фон, медный акцент, инженерная типографика.
Version: 1.1
Text Domain: remtent
Requires at least: 6.0
Requires PHP: 8.0
*/

/* ==================================================================
   Переменные
================================================================== */
:root {
    --bg:        #0F1217;
    --bg-alt:    #171E26;
    --bg-head:   #0B0E12;
    --bg-side:   #141A21;
    --text:      #E8EDF2;
    --copper:    #D48A5E;
    --steel:     #6A8D92;
    --muted:     #6B7885;
    --line:      #2A3543;
    --hatch:     #1E2630;
    --head-font: 'Manrope', 'Segoe UI', system-ui, sans-serif;
    --body-font: 'Roboto', 'PT Sans', system-ui, sans-serif;
    --shell:     min(92%, 1180px);
}

/* ==================================================================
   База
================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--body-font);
    font-size: 17px;
    line-height: 1.7;
    color: var(--text);
    background-color: var(--bg);
    background-image: repeating-linear-gradient(45deg, transparent 0, transparent 39px, var(--hatch) 39px, var(--hatch) 40px);
    overflow-x: hidden;
}

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

a { color: var(--copper); text-decoration: none; }
.content-area a:not(.btn):not(.card-link):not(.card-title a) {
    background-image: linear-gradient(var(--copper), var(--copper));
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 100% 1px;
    transition: background-size .2s ease, color .2s ease;
}
.content-area a:not(.btn):not(.card-link):not(.card-title a):hover {
    background-size: 100% 100%;
    color: var(--bg);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--head-font);
    color: var(--text);
    line-height: 1.2;
    letter-spacing: .01em;
}

p { margin: 0 0 1.1em; }

.shell { width: var(--shell); margin-inline: auto; }

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--copper);
    color: var(--bg);
    padding: 10px 16px;
    z-index: 1000;
}
.skip-link:focus { left: 0; }

/* ==================================================================
   Кнопки
================================================================== */
.btn {
    display: inline-block;
    font-family: var(--head-font);
    font-weight: 700;
    font-size: .98rem;
    letter-spacing: .03em;
    color: var(--copper);
    background: transparent;
    border: 2px solid var(--copper);
    border-radius: 4px;
    padding: .7em 1.6em;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, transform .15s ease, box-shadow .2s ease;
}
.btn:hover, .btn:focus {
    background: var(--copper);
    color: var(--bg);
    transform: translateY(-2px);
    box-shadow: 4px 4px 0 rgba(212, 138, 94, .25);
}

/* ==================================================================
   Заголовки секций (рейсшина)
================================================================== */
.section-title {
    position: relative;
    font-size: 1.9rem;
    margin: 0 0 1.6rem;
    padding-left: 62px;
    letter-spacing: .02em;
}
.section-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 55%;
    width: 46px;
    height: 3px;
    background: var(--copper);
}

/* ==================================================================
   Шапка
================================================================== */
.site-header {
    background: var(--bg-head);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 0;
    flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 1rem; min-width: 0; flex: 1; }
.brand-logo-link { display: block; flex: 0 0 auto; line-height: 0; }
.brand-logo-svg { width: 52px; height: 52px; display: block; }
.brand-logo { max-height: 60px; width: auto; display: block; }
.brand-text { min-width: 0; }
.site-title {
    display: block;
    font-family: var(--head-font);
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text);
    letter-spacing: .01em;
    line-height: 1.25;
}
.site-desc {
    margin: .3rem 0 0;
    font-size: .78rem;
    color: var(--muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.main-nav .menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: .3rem;
    flex-wrap: wrap;
}
.main-nav .menu a {
    display: block;
    font-family: var(--head-font);
    font-weight: 600;
    font-size: .95rem;
    color: var(--text);
    padding: .5em .9em;
    border: 1px solid transparent;
    transition: color .2s ease, border-color .2s ease;
}
.main-nav .menu a:hover { color: var(--copper); }
.main-nav .menu .current-menu-item > a,
.main-nav .menu .current_page_item > a {
    color: var(--copper);
    border-bottom: 2px dashed var(--copper);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 4px;
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    margin: 0 auto;
    background: var(--copper);
}

/* ==================================================================
   Основной контент — раскладки
================================================================== */
.site-main { padding: 2.5rem 0 3rem; }

.page-wrap.layout-single .content-area {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}
.page-wrap.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 2.5rem;
    align-items: start;
}
.content-area { min-width: 0; }

/* ==================================================================
   Хлебные крошки
================================================================== */
.breadcrumbs {
    font-size: .82rem;
    color: var(--muted);
    margin-bottom: 1.4rem;
    line-height: 1.5;
}
.breadcrumbs a { color: var(--steel); }
.breadcrumbs a:hover { color: var(--copper); }
.breadcrumbs .sep { color: var(--line); margin: 0 .1em; }

/* ==================================================================
   Заголовки страниц / архивов
================================================================== */
.archive-head, .single-head { margin-bottom: 1.8rem; }
.page-title { font-size: 2.2rem; margin: 0 0 .5rem; }
.single-title { font-size: 2.4rem; margin: 0 0 .7rem; letter-spacing: .01em; }
.single-meta, .archive-desc { color: var(--muted); font-size: .9rem; }
.single-meta { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.single-meta a { color: var(--steel); }

/* ==================================================================
   Карточки записей
================================================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 1.8rem;
}
.card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-alt);
    border: 1px solid var(--line);
    border-left: 4px solid transparent;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 10px 22px -8px rgba(212, 138, 94, .1);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.card:hover {
    transform: translateY(-4px);
    border-color: var(--copper);
    border-left-color: var(--copper);
    box-shadow: 0 16px 30px -10px rgba(212, 138, 94, .22);
}
.card-thumb-wrap {
    position: relative;
    overflow: hidden;
}
.card-thumb-wrap img,
.card-thumb-wrap .thumb-placeholder {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-thumb-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 60px 10px rgba(11, 14, 18, .55);
    pointer-events: none;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.2rem 1.3rem 1.4rem;
    min-width: 0;
}
.card-meta { font-size: .78rem; color: var(--muted); margin-bottom: .5rem; }
.card-title {
    font-size: 1.15rem;
    line-height: 1.3;
    margin: 0 0 .6rem;
}
.card-title a { color: var(--text); transition: color .2s ease; }
.card-title a:hover { color: var(--copper); }
.card-excerpt { font-size: .93rem; color: #c3ccd6; flex: 1; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-link {
    align-self: flex-start;
    margin-top: .8rem;
    font-family: var(--head-font);
    font-weight: 700;
    font-size: .85rem;
    letter-spacing: .04em;
    color: var(--copper);
    border-bottom: 2px dashed transparent;
    transition: border-color .2s ease;
}
.card-link:hover { border-bottom-color: var(--copper); }

.latest-more { text-align: center; margin-top: 2.2rem; }
.empty-note { color: var(--muted); }

/* ==================================================================
   Одиночная запись / страница
================================================================== */
.single-thumb { margin-bottom: 1.8rem; overflow: hidden; border: 1px solid var(--line); }
.single-thumb img { display: block; width: 100%; height: auto; }
.single-content { font-size: 1.02rem; }
.single-content h2 { font-size: 1.7rem; margin: 1.8rem 0 .8rem; }
.single-content h3 { font-size: 1.35rem; margin: 1.5rem 0 .7rem; }
.single-content img { height: auto; }
.single-content ul, .single-content ol { padding-left: 1.4rem; }
.single-content li { margin-bottom: .4rem; }
.single-content blockquote {
    position: relative;
    margin: 1.6rem 0;
    padding: 1.2rem 1.4rem 1.2rem 1.8rem;
    background: var(--bg-alt);
    border-left: 6px solid var(--copper);
    clip-path: polygon(0 12px, 12px 0, 100% 0, 100% 100%, 0 100%);
    color: #d4dbe3;
    font-style: italic;
}
.single-content pre {
    background: var(--bg-head);
    border: 1px solid var(--line);
    padding: 1rem;
    overflow-x: auto;
    min-width: 0;
}
.single-content code { background: var(--bg-head); padding: .1em .35em; border-radius: 3px; font-size: .9em; }

.single-tags { margin-top: 1.8rem; font-size: .88rem; color: var(--muted); }
.single-tags a { color: var(--steel); }
.tags-label { color: var(--text); font-weight: 600; }
.page-links { margin-top: 1.4rem; font-size: .9rem; }

/* Таблицы */
.single-content table { width: 100%; border-collapse: collapse; margin: 1.4rem 0; }
.single-content table, .single-content th, .single-content td { border: 1px solid var(--line); }
.single-content th, .single-content td { padding: .6em .8em; text-align: left; }
.single-content th { background: var(--bg-alt); color: var(--text); }

/* ==================================================================
   Сайдбар
================================================================== */
.sidebar {
    background: var(--bg-side);
    border-left: 1px solid var(--line);
    padding: 1.6rem 1.4rem;
    min-width: 0;
}
.sidebar .widget { margin-bottom: 1.8rem; }
.sidebar .widget:last-child { margin-bottom: 0; }
.widget-title {
    font-size: 1.05rem;
    margin: 0 0 1rem;
    padding-bottom: .5rem;
    border-bottom: 2px dashed var(--line);
    color: var(--text);
}
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li { padding: .45rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.sidebar .widget li:last-child { border-bottom: 0; }
.sidebar .widget a { color: #cfd7df; }
.sidebar .widget a:hover { color: var(--copper); }
.sidebar .widget, .sidebar .widget p { color: #c3ccd6; }
.sidebar .post-date, .sidebar .rss-date { color: var(--muted); font-size: .8rem; }

/* ==================================================================
   Пагинация
================================================================== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    justify-content: center;
    margin-top: 2.5rem;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 .8em;
    font-family: var(--head-font);
    font-weight: 600;
    color: var(--text);
    background: var(--bg-alt);
    border: 1px solid var(--line);
    border-radius: 4px;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.pagination a.page-numbers:hover { border-color: var(--copper); color: var(--copper); }
.pagination .page-numbers.current {
    background: var(--copper);
    color: var(--bg);
    border-color: var(--copper);
}
.pagination .page-numbers.dots { border-color: transparent; background: transparent; }

/* ==================================================================
   Поиск
================================================================== */
.search-form { margin: 1.2rem 0; }
.search-label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .4rem; }
.search-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.search-field {
    flex: 1;
    min-width: 0;
    background: var(--bg-alt);
    border: 1px solid var(--line);
    color: var(--text);
    padding: .6em .9em;
    border-radius: 4px;
    font-size: .95rem;
}
.search-field:focus { outline: none; border-color: var(--copper); }
.search-submit { white-space: nowrap; }

/* ==================================================================
   Комментарии
================================================================== */
.comments-area { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.comments-title { font-size: 1.5rem; margin: 0 0 1.5rem; }
.comment-list { list-style: none; margin: 0 0 2rem; padding: 0; }
.comment-list ol.children { list-style: none; padding-left: 1.5rem; }
.comment-item { margin-bottom: 1.2rem; }
.comment-body {
    background: var(--bg-alt);
    border: 1px solid var(--line);
    border-left: 3px solid var(--steel);
    padding: 1rem 1.2rem;
}
.comment-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.comment-author { font-family: var(--head-font); font-weight: 700; color: var(--text); }
.comment-author a { color: var(--text); }
.comment-date { font-size: .78rem; color: var(--muted); }
.comment-await { font-size: .82rem; color: var(--copper); font-style: italic; }
.comment-reply { margin-top: .5rem; font-size: .85rem; }
.comments-closed { color: var(--muted); }

.comment-respond {
    background: var(--bg-alt);
    border: 1px solid var(--line);
    padding: 1.4rem 1.5rem;
}
.comment-reply-title { font-size: 1.3rem; margin: 0 0 1rem; }
.comment-form label { display: block; font-size: .88rem; color: var(--muted); margin-bottom: .3rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--text);
    padding: .6em .8em;
    border-radius: 4px;
    font-family: var(--body-font);
    margin-bottom: 1rem;
}
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--copper); }
.comment-form .form-submit input, .form-submit .submit {
    display: inline-block;
    font-family: var(--head-font);
    font-weight: 700;
    color: var(--copper);
    background: transparent;
    border: 2px solid var(--copper);
    border-radius: 4px;
    padding: .7em 1.6em;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}
.comment-form .form-submit input:hover, .form-submit .submit:hover { background: var(--copper); color: var(--bg); }

/* ==================================================================
   404
================================================================== */
.error-404 { text-align: center; padding: 2rem 0 3rem; }
.error-code {
    display: block;
    font-family: var(--head-font);
    font-weight: 800;
    font-size: 6rem;
    color: var(--copper);
    letter-spacing: .05em;
    line-height: 1;
}
.error-text { color: var(--muted); max-width: 520px; margin: .8rem auto 1.6rem; }
.error-404 .search-form { max-width: 480px; margin-inline: auto; }
.error-home { margin-top: 1rem; }

/* ==================================================================
   FRONT PAGE
================================================================== */
.fs-alt {
    background-color: var(--bg-alt);
    background-image: repeating-linear-gradient(45deg, transparent 0, transparent 39px, rgba(42,53,67,.5) 39px, rgba(42,53,67,.5) 40px);
}
.fs-stats, .fs-latest, .fs-features, .fs-map { padding: 3.4rem 0; }

/* Hero */
.fs-hero {
    position: relative;
    background-size: cover;
    background-position: center;
    padding: 5.5rem 0 5rem;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}
.hero-inner { position: relative; z-index: 2; text-align: center; max-width: 760px; }
.hero-title {
    font-size: 3.5rem;
    line-height: 1.08;
    margin: 0 0 1rem;
    letter-spacing: .02em;
}
.hero-sub { font-size: 1.12rem; color: #b7c2cd; margin: 0 auto 2rem; max-width: 620px; }
.btn-hero { font-size: 1.05rem; padding: .85em 2.2em; }
.hero-plaque {
    position: absolute;
    top: 1.4rem;
    left: 1.4rem;
    z-index: 3;
    background: rgba(11, 14, 18, .8);
    border: 1px solid var(--line);
    border-left: 3px solid var(--copper);
    padding: .6rem .9rem;
}
.plaque-label { display: block; font-size: .68rem; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.plaque-mail { display: block; font-family: var(--head-font); font-weight: 700; font-size: .92rem; color: var(--copper); margin-top: .15rem; }
.hero-nut {
    position: absolute;
    right: -60px;
    bottom: -80px;
    width: 340px;
    height: 340px;
    z-index: 1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpolygon points='50,3 91,26 91,74 50,97 9,74 9,26' fill='none' stroke='%23D48A5E' stroke-width='4'/%3E%3Ccircle cx='50' cy='50' r='22' fill='none' stroke='%23D48A5E' stroke-width='4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    opacity: .05;
    pointer-events: none;
}

/* Статистика */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
}
.stat { text-align: center; min-width: 0; }
.stat-num {
    display: block;
    font-family: var(--head-font);
    font-weight: 800;
    font-size: 3rem;
    color: var(--copper);
    letter-spacing: .04em;
    line-height: 1;
}
.stat-line { display: block; width: 48px; height: 2px; background: var(--steel); margin: .8rem auto; }
.stat-cap { display: block; font-size: .88rem; color: var(--muted); }

/* Преимущества */
.features-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.6rem; }
.feature-card {
    min-width: 0;
    background: var(--bg);
    border: 1px solid var(--line);
    padding: 1.8rem 1.6rem;
    color: var(--steel);
    transition: background .25s ease, border-color .25s ease, color .25s ease;
}
.feature-card:hover { background: var(--bg-alt); border-color: var(--copper); color: var(--copper); }
.feature-ico { width: 52px; height: 52px; display: block; margin-bottom: 1rem; }
.feature-name { font-size: 1.2rem; margin: 0 0 .6rem; color: var(--text); }
.feature-text { font-size: .93rem; color: #b7c2cd; margin: 0; }

/* Рубрикатор */
.topic-mosaic {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
}
.topic-plate {
    grid-column: span 2;
    display: flex;
    align-items: center;
    gap: .8rem;
    min-width: 0;
    padding: 1.5rem 1.4rem;
    background: var(--bg-alt);
    border: 1px solid var(--steel);
    color: var(--text);
    transition: background .22s ease, color .22s ease, transform .18s ease;
}
.topic-plate.plate-wide { grid-column: span 3; }
.topic-plate:hover { background: var(--copper); color: var(--bg); transform: translateY(-3px); }
.topic-ico { font-size: 1.5rem; color: var(--copper); line-height: 1; transition: color .22s ease; }
.topic-plate:hover .topic-ico { color: var(--bg); }
.topic-name { font-family: var(--head-font); font-weight: 700; font-size: 1.05rem; letter-spacing: .01em; }

/* ==================================================================
   Подвал
================================================================== */
.site-footer { background: var(--bg-head); border-top: 1px solid var(--line); margin-top: 3rem; }
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
    padding: 3rem 0 2.5rem;
}
.footer-col { min-width: 0; }
.footer-col .widget-title { color: var(--text); border-bottom-color: var(--line); }
.footer-col, .footer-col p, .footer-col .widget { color: #a7b2bd; font-size: .92rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { padding: .35rem 0; border-bottom: 1px solid rgba(42,53,67,.5); }
.footer-col li:last-child { border-bottom: 0; }
.footer-col a { color: #b7c2cd; }
.footer-col a:hover { color: var(--copper); }
.footer-bottom { border-top: 1px solid var(--line); padding: 1.2rem 0; }
.copyright { margin: 0; font-size: .84rem; color: var(--muted); text-align: center; }

/* ==================================================================
   Cookie-баннер  (правило [hidden] ДО основного блока — A11)
================================================================== */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    background: var(--bg-head);
    border-top: 2px solid var(--copper);
    padding: 1rem 0;
}
.cookie-inner {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    justify-content: space-between;
}
.cookie-text { margin: 0; font-size: .88rem; color: #b7c2cd; flex: 1; min-width: 240px; }
.cookie-accept { white-space: nowrap; }

/* ==================================================================
   Адаптив
================================================================== */
@media (max-width: 960px) {
    .hero-title { font-size: 2.7rem; }
    .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1rem; }
    .features-grid { grid-template-columns: 1fr; }
    .topic-mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .topic-plate, .topic-plate.plate-wide { grid-column: span 1; }
    .page-wrap.layout-with-sidebar { grid-template-columns: 1fr; }
    .page-wrap.layout-single .content-area { width: 100%; }
    .sidebar { border-left: 0; border-top: 1px solid var(--line); }
    .footer-cols { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .header-inner { flex-wrap: nowrap; }
    .nav-toggle { display: flex; order: 3; margin-left: auto; }
    .main-nav {
        flex-basis: 100%;
        order: 4;
        display: none;
    }
    .main-nav.is-open { display: block; }
    .main-nav .menu { flex-direction: column; gap: 0; margin-top: .6rem; }
    .main-nav .menu a { border-bottom: 1px solid var(--line); }
    .site-desc { display: none; }
    .hero-title { font-size: 2.1rem; }
    .fs-hero { padding: 4.5rem 0 3.5rem; }
    .hero-plaque { position: static; display: inline-block; margin-bottom: 1.5rem; }
    .stats-row { grid-template-columns: 1fr; }
    .topic-mosaic { grid-template-columns: 1fr; }
    .section-title { font-size: 1.6rem; padding-left: 54px; }
    .single-title { font-size: 1.8rem; }
    .cookie-inner { justify-content: center; text-align: center; }
}
