/*
Theme Name: dds_intracosolar.com
Author: Олег Ковалёв
Description: Информационная тема о солнечной энергетике: подбор панелей и инверторов, расчёт нагрузки, сезонная выработка, монтаж и обслуживание.
Version: 1.1
Text Domain: intracosolar
*/

/* ---------- Переменные ---------- */
:root {
    --c-bg:      #f6f8fb;
    --c-surface: #ffffff;
    --c-ink:     #1c2733;
    --c-muted:   #5a6b7b;
    --c-line:    #e2e8ef;
    --c-deep:    #123456;
    --c-deep-2:  #0d2740;
    --c-sun:     #f4a723;
    --c-sun-2:   #e8912a;
    --c-sky:     #2f6db0;
    --shadow:    0 6px 22px rgba(18, 52, 86, .08);
    --radius:    12px;
}

/* ---------- База ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--c-bg);
    color: var(--c-ink);
    font-family: "Segoe UI", "PT Sans", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    overflow-x: hidden;
}

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

a { color: var(--c-sky); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
    line-height: 1.25;
    color: var(--c-deep);
    margin: 0 0 .6em;
    font-weight: 700;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1.1em; }

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

/* ---------- Шапка ---------- */
.site-head {
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-line);
    box-shadow: var(--shadow);
}
.head-inner {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    padding: 1rem 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-width: 0;
    text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-logo { display: block; height: 52px; width: auto; }
.brand-text { min-width: 0; }
.brand-name {
    display: block;
    font-weight: 700;
    color: var(--c-deep);
    font-size: 1.06rem;
    line-height: 1.25;
}
.brand-desc {
    display: block;
    color: var(--c-muted);
    font-size: .82rem;
    line-height: 1.35;
    margin-top: .15rem;
}

.nav-toggle {
    display: none;
    margin-left: auto;
    background: var(--c-deep);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: .55rem .8rem;
    font-size: .95rem;
    cursor: pointer;
}

.main-nav { margin-left: auto; }
.main-nav ul {
    list-style: none;
    display: flex;
    gap: .3rem;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.main-nav a {
    display: block;
    padding: .5rem .85rem;
    border-radius: 8px;
    color: var(--c-ink);
    font-weight: 600;
    font-size: .96rem;
}
.main-nav a:hover {
    background: #eef4fb;
    color: var(--c-deep);
    text-decoration: none;
}
.main-nav .current-menu-item > a {
    background: var(--c-deep);
    color: #fff;
}

/* ---------- Каркас страницы ---------- */
.site-main { padding: 2rem 0 3rem; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 2.4rem;
    align-items: start;
}
.layout-single {
    display: block;
}
.layout-single .content-area {
    width: 85%;
    margin-inline: auto;
}
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .layout-single .content-area { width: 100%; }
}

/* ---------- Хлебные крошки ---------- */
.crumbs {
    font-size: .88rem;
    color: var(--c-muted);
    margin: 0 0 1.4rem;
}
.crumbs a { color: var(--c-sky); }
.crumbs .sep { margin: 0 .35rem; color: var(--c-line); }
.layout-single .crumbs,
.front-crumbs .crumbs { width: 85%; margin-inline: auto; margin-bottom: 1.4rem; }

/* ---------- Статьи (single / page) ---------- */
.entry {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 2rem 2.2rem;
    box-shadow: var(--shadow);
}
.entry-title { margin-bottom: .4rem; }
.entry-meta {
    color: var(--c-muted);
    font-size: .85rem;
    margin-bottom: 1.2rem;
}
.entry-thumb {
    display: block;
    width: 100%;
    border-radius: 10px;
    margin-bottom: 1.4rem;
    object-fit: cover;
}
.entry-content { min-width: 0; }
.entry-content img { border-radius: 8px; display: block; }
.entry-content h2 { margin-top: 1.6rem; }
.entry-content ul, .entry-content ol { padding-left: 1.4rem; }

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2rem 0;
}
table, th, td { border: 1px solid var(--c-line); }
th, td { padding: .6rem .8rem; text-align: left; }
th { background: #eef4fb; color: var(--c-deep); }

blockquote {
    margin: 1.4rem 0;
    padding: 1rem 1.4rem;
    background: #f0f6fc;
    border-left: 4px solid var(--c-sun);
    border-radius: 8px;
    color: var(--c-deep-2);
}
blockquote p:last-child { margin-bottom: 0; }

/* ---------- Сайдбар ---------- */
.sidebar { min-width: 0; }
.widget {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 1.2rem 1.3rem;
    margin-bottom: 1.4rem;
    box-shadow: var(--shadow);
    color: var(--c-ink);
}
.widget-title {
    font-size: 1.05rem;
    margin-bottom: .8rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--c-sun);
    color: var(--c-deep);
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: .4rem 0; border-bottom: 1px dashed var(--c-line); }
.widget li:last-child { border-bottom: 0; }
.widget a { color: var(--c-sky); }
.widget .post-date { display: block; color: var(--c-muted); font-size: .8rem; }

/* ---------- Карточки записей ---------- */
.cards { display: grid; gap: 1.4rem; }
.layout-with-sidebar .cards { grid-template-columns: 1fr; }

.card {
    display: flex;
    flex-direction: column;
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.card-thumb-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}
.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.3rem 1.5rem;
    display: flex;
    flex-direction: column;
}
.card-title { font-size: 1.2rem; margin-bottom: .35rem; }
.card-title a { color: var(--c-deep); }
.card-meta { color: var(--c-muted); font-size: .82rem; margin-bottom: .7rem; }
.card-excerpt { color: var(--c-ink); }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    align-self: flex-start;
    margin-top: auto;
    display: inline-block;
    padding: .5rem 1rem;
    background: var(--c-sun);
    color: #3a2a05;
    border-radius: 8px;
    font-weight: 600;
    font-size: .9rem;
}
.card-more:hover { background: var(--c-sun-2); text-decoration: none; }

/* Горизонтальная карточка в широкой раскладке (лента статей) */
@media (min-width: 761px) {
    .layout-single .cards .card {
        flex-direction: row;
    }
    .layout-single .cards .card-thumb-wrap {
        flex: 0 0 280px;
        aspect-ratio: auto;
    }
}
.front-latest .cards { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .front-latest .cards { grid-template-columns: 1fr; } }

@media (max-width: 760px) {
    .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
    .card-thumb-wrap a { position: static; }
    .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
}

/* ---------- Пагинация ---------- */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    justify-content: center;
    margin-top: 2rem;
}
.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 .7rem;
    border: 1px solid var(--c-line);
    border-radius: 8px;
    background: var(--c-surface);
    color: var(--c-deep);
    font-weight: 600;
    text-decoration: none;
}
.pager a.page-numbers:hover { background: #eef4fb; }
.pager .page-numbers.current {
    background: var(--c-deep);
    color: #fff;
    border-color: var(--c-deep);
}
.pager .page-numbers.dots {
    border: 0;
    background: none;
}

/* ---------- Главная ---------- */
.front-section { padding: 2.6rem 0; }
.front-section + .front-section { border-top: 1px solid var(--c-line); }
.front-head { text-align: center; max-width: 720px; margin: 0 auto 1.8rem; }
.front-head p { color: var(--c-muted); margin-bottom: 0; }

/* Блок текст + иллюстрация */
.fs-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.2rem;
    align-items: center;
}
.fs-split.rev .fs-split-media { order: -1; }
.fs-split-media img {
    display: block;
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.fs-split-text h2 { margin-bottom: .6rem; }
@media (max-width: 760px) {
    .fs-split { grid-template-columns: 1fr; }
    .fs-split.rev .fs-split-media { order: 0; }
}

/* Сетка карточек-рубрик */
.fs-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.3rem;
}
@media (max-width: 900px) { .fs-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .fs-grid { grid-template-columns: 1fr; } }
.tile {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 1.5rem 1.4rem;
    box-shadow: var(--shadow);
    min-width: 0;
}
.tile-ico {
    width: 48px; height: 48px;
    display: block;
    margin-bottom: .9rem;
}
.tile h3 { margin-bottom: .35rem; }
.tile p { margin-bottom: 0; color: var(--c-muted); font-size: .93rem; }

/* Пошаговый блок */
.fs-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.3rem;
    counter-reset: step;
}
@media (max-width: 900px) { .fs-steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .fs-steps { grid-template-columns: 1fr; } }
.step {
    position: relative;
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 1.8rem 1.4rem 1.4rem;
    box-shadow: var(--shadow);
    min-width: 0;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    top: -18px; left: 1.3rem;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: var(--c-sun);
    color: #3a2a05;
    font-weight: 700;
    border-radius: 50%;
    box-shadow: var(--shadow);
}
.step h3 { margin-bottom: .3rem; font-size: 1.08rem; }
.step p { margin-bottom: 0; color: var(--c-muted); font-size: .93rem; }

/* FAQ */
.fs-faq { max-width: 820px; margin-inline: auto; }
.faq-item {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: 10px;
    margin-bottom: .9rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.faq-item summary {
    cursor: pointer;
    padding: 1rem 1.3rem;
    font-weight: 600;
    color: var(--c-deep);
    list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    float: right;
    color: var(--c-sun-2);
    font-weight: 700;
}
.faq-item[open] summary::after { content: '–'; }
.faq-body { padding: 0 1.3rem 1.1rem; color: var(--c-muted); }
.faq-body p { margin-bottom: 0; }

/* Латест на главной */
.front-latest .card-title a { color: var(--c-deep); }

.front-more {
    text-align: center;
    margin-top: 1.8rem;
}
.btn {
    display: inline-block;
    padding: .75rem 1.6rem;
    border-radius: 10px;
    font-weight: 700;
    background: var(--c-deep);
    color: #fff;
}
.btn:hover { background: var(--c-deep-2); text-decoration: none; }
.btn-sun { background: var(--c-sun); color: #3a2a05; }
.btn-sun:hover { background: var(--c-sun-2); }

/* ---------- Подвал ---------- */
.site-foot {
    background: var(--c-deep-2);
    color: #cdd9e6;
    margin-top: 2rem;
}
.foot-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
    padding: 2.6rem 0 2rem;
}
@media (max-width: 760px) { .foot-cols { grid-template-columns: 1fr; gap: 1.6rem; } }
.site-foot .widget {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
    color: #cdd9e6;
}
.site-foot .widget-title {
    color: #fff;
    border-bottom-color: var(--c-sun);
}
.site-foot .widget a { color: #ffd98a; }
.site-foot .widget a:hover { color: #ffe9bf; }
.site-foot .widget li { border-bottom-color: rgba(255,255,255,.12); }
.site-foot .widget .post-date { color: #93a7bb; }
.foot-copy {
    border-top: 1px solid rgba(255,255,255,.14);
    padding: 1.2rem 0;
    text-align: center;
    font-size: .88rem;
    color: #9fb2c6;
}

/* ---------- Поиск ---------- */
.search-form {
    display: flex;
    gap: .5rem;
}
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: .6rem .8rem;
    border: 1px solid var(--c-line);
    border-radius: 8px;
    font-size: .95rem;
}
.search-form button {
    padding: .6rem 1.1rem;
    background: var(--c-deep);
    color: #fff;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}
.search-form button:hover { background: var(--c-deep-2); }

/* ---------- Комментарии ---------- */
.comments {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 1.6rem 2rem;
    box-shadow: var(--shadow);
    margin-top: 1.6rem;
}
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 1.4rem; padding: 0; }
.comment-item { margin-bottom: 1.2rem; }
.comment-inner {
    border: 1px solid var(--c-line);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    background: #fbfdff;
}
.comment-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.comment-author { font-weight: 700; color: var(--c-deep); }
.comment-date { color: var(--c-muted); font-size: .82rem; }
.comment-await { color: var(--c-sun-2); font-size: .85rem; }
.comment-form-comment textarea,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
    width: 100%;
    padding: .6rem .8rem;
    border: 1px solid var(--c-line);
    border-radius: 8px;
    font-size: .95rem;
    margin-top: .3rem;
}
.comment-form .form-submit input {
    padding: .7rem 1.5rem;
    background: var(--c-deep);
    color: #fff;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}

/* ---------- 404 ---------- */
.err-box {
    text-align: center;
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    box-shadow: var(--shadow);
    max-width: 640px;
    margin-inline: auto;
}
.err-box .search-form { max-width: 420px; margin: 1.4rem auto 0; }

/* ---------- Контакты статичные ---------- */
.contacts-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.contacts-list li { padding: .4rem 0; }

/* ---------- Cookie ---------- */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 1rem; right: 1rem; bottom: 1rem;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    background: var(--c-deep-2);
    color: #e7eef6;
    padding: 1rem 1.3rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,.3);
    max-width: 640px;
    margin-inline: auto;
    font-size: .9rem;
}
.cookie-banner p { margin: 0; flex: 1; min-width: 200px; }
.cookie-banner a { color: #ffd98a; }
.cookie-accept {
    background: var(--c-sun);
    color: #3a2a05;
    border: 0;
    border-radius: 8px;
    padding: .6rem 1.3rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.cookie-accept:hover { background: var(--c-sun-2); }

/* ---------- Адаптив меню ---------- */
@media (max-width: 760px) {
    .nav-toggle { display: block; }
    .main-nav {
        flex-basis: 100%;
        margin-left: 0;
    }
    .main-nav[hidden] { display: none !important; }
    .main-nav ul { flex-direction: column; gap: .2rem; }
    .main-nav a { padding: .7rem .9rem; }
}
