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

/* ============================================================
   Переменные
   ============================================================ */
:root {
    --teal:        #0d6b63;
    --teal-dark:   #094a44;
    --teal-deep:   #0c2522;
    --amber:       #d98c2b;
    --amber-soft:  #f0c785;
    --bg:          #f6f4ef;
    --surface:     #ffffff;
    --ink:         #1f2a28;
    --muted:       #5c6b68;
    --line:        #e2ddd3;
    --maxw:        1180px;
    --radius:      14px;
    --shadow:      0 6px 24px rgba(12, 37, 34, 0.08);
}

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

html { scroll-behavior: smooth; }

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

h1, h2, h3, h4 {
    font-family: "PT Serif", Georgia, "Times New Roman", serif;
    line-height: 1.25;
    color: var(--teal-deep);
    margin: 0 0 0.6em;
}

h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--amber); }

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

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

/* ============================================================
   Шапка
   ============================================================ */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 18px 0;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1 1 320px;
}

.brand-logo,
.brand-mark {
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
    display: block;
}

.brand-text { min-width: 0; }

.brand-name {
    display: block;
    font-family: "PT Serif", Georgia, serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--teal-deep);
    line-height: 1.3;
}

.brand-desc {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 3px;
}

.main-nav {
    flex: 1 1 auto;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    justify-content: flex-end;
}

.main-nav a {
    display: inline-block;
    padding: 8px 4px;
    color: var(--teal-deep);
    font-weight: 600;
    border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav .current-menu-item > a {
    color: var(--teal);
    border-bottom-color: var(--amber);
}

.nav-toggle {
    display: none;
    background: var(--teal);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 0.95rem;
    cursor: pointer;
}

/* ============================================================
   Макет
   ============================================================ */
.site-main { padding: 34px 0 48px; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 38px;
    align-items: start;
}

.layout-single .content-area,
.layout-single {
    display: block;
}

.content-narrow {
    width: 85%;
    max-width: 100%;
    margin-inline: auto;
}

@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .content-narrow { width: 100%; }
}

/* ============================================================
   Крошки
   ============================================================ */
.crumbs {
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 22px;
}
.crumbs a { color: var(--teal); }
.crumbs .sep { margin: 0 4px; color: var(--line); }

/* ============================================================
   Карточки записей
   ============================================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 26px;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    min-width: 0;
}

.card-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 18px 20px 22px;
    min-width: 0;
}

.card-title {
    font-size: 1.2rem;
    margin: 0 0 8px;
}
.card-title a { color: var(--teal-deep); }
.card-title a:hover { color: var(--teal); }

.card-meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 10px;
}

.card-excerpt {
    color: #2e3b39;
    margin-bottom: 16px;
}
.card-excerpt p { margin: 0 0 0.5em; background: none; }

.card-more {
    margin-top: auto;
    align-self: flex-start;
    font-weight: 600;
    color: var(--amber);
}
.card-more:hover { color: var(--teal); }

/* ============================================================
   Одиночная запись / страница
   ============================================================ */
.entry {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px clamp(20px, 4vw, 44px) 38px;
    box-shadow: var(--shadow);
}

.entry-thumb {
    display: block;
    width: 100%;
    max-height: 440px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 24px;
}

.entry-meta {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 18px;
}

.entry-content {
    min-width: 0;
}
.entry-content img { border-radius: 8px; }
.entry-content h2 { margin-top: 1.4em; }
.entry-content ul, .entry-content ol { padding-left: 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 var(--line);
}
.entry-content th,
.entry-content td {
    padding: 9px 12px;
    text-align: left;
}
.entry-content th { background: #eef3f1; }

/* ============================================================
   Сайдбар / виджеты
   ============================================================ */
.sidebar { min-width: 0; }

.widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 24px;
    color: var(--ink);
}
.widget-title {
    font-size: 1.1rem;
    margin: 0 0 14px;
    color: var(--teal-deep);
}
.widget a { color: var(--teal); }
.widget a:hover { color: var(--amber); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
}
.widget ul li:last-child { border-bottom: 0; }
.widget .post-date { display: block; font-size: 0.78rem; color: var(--muted); }

/* ============================================================
   Главная
   ============================================================ */
.section {
    padding: 46px 0;
    border-bottom: 1px solid var(--line);
}
.section:last-of-type { border-bottom: 0; }

.section-head {
    max-width: 720px;
    margin-bottom: 26px;
}
.section-head .eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--amber);
    font-weight: 700;
    margin-bottom: 8px;
}

/* Блок: текст + иллюстрация */
.split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px;
    align-items: center;
}
.split.reverse .split-media { order: -1; }
.split-media img,
.split-media svg {
    display: block;
    width: 100%;
    border-radius: var(--radius);
}
@media (max-width: 760px) {
    .split { grid-template-columns: 1fr; gap: 24px; }
    .split.reverse .split-media { order: 0; }
}

/* Блок: сетка направлений */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 22px;
}
.tile {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 22px;
    min-width: 0;
    box-shadow: var(--shadow);
}
.tile .tile-ico {
    width: 46px;
    height: 46px;
    display: block;
    margin-bottom: 14px;
}
.tile h3 { margin: 0 0 8px; }
.tile p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Блок: шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 22px;
    counter-reset: step;
}
.step {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 22px 22px;
    min-width: 0;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--teal);
    color: #fff;
    font-weight: 700;
    font-family: "PT Serif", serif;
    margin-bottom: 14px;
}
.step h3 { margin: 0 0 6px; font-size: 1.1rem; }
.step p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Блок: CTA */
.cta {
    background: linear-gradient(135deg, var(--teal-dark), var(--teal-deep));
    color: #eaf4f1;
    border-radius: var(--radius);
    padding: clamp(28px, 5vw, 52px);
    text-align: center;
}
.cta h2 { color: #fff; }
.cta p { color: #bdd6d0; max-width: 640px; margin: 0 auto 22px; }

.btn {
    display: inline-block;
    background: var(--amber);
    color: #2a1c06;
    font-weight: 700;
    padding: 13px 28px;
    border-radius: 10px;
    border: 0;
}
.btn:hover { background: var(--amber-soft); color: #2a1c06; }

.latest-grid { margin-top: 8px; }

/* ============================================================
   Пагинация (type => plain → .page-numbers)
   ============================================================ */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 36px;
}
.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--teal-deep);
    font-weight: 600;
}
.pager a.page-numbers:hover {
    border-color: var(--teal);
    color: var(--teal);
}
.pager .page-numbers.current {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}
.pager .page-numbers.dots {
    border-color: transparent;
    background: transparent;
}

/* ============================================================
   Поиск
   ============================================================ */
.search-form {
    display: flex;
    gap: 8px;
    min-width: 0;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 1rem;
}
.search-form .search-submit {
    background: var(--teal);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 0 20px;
    cursor: pointer;
    font-weight: 600;
}
.search-form .search-submit:hover { background: var(--teal-dark); }

/* ============================================================
   Комментарии
   ============================================================ */
.comments-area { margin-top: 34px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 26px; padding: 0; }
.comment-body {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 16px;
}
.comment-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.comment-author { font-weight: 700; color: var(--teal-deep); }
.comment-date { font-size: 0.8rem; color: var(--muted); }
.comment-await { font-size: 0.85rem; color: var(--amber); }
.comment-respond {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    margin-top: 20px;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 1rem;
    margin-top: 4px;
}
.comment-form p { margin-bottom: 14px; }
.comment-form .submit {
    background: var(--teal);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 11px 26px;
    font-weight: 600;
    cursor: pointer;
}

/* ============================================================
   404
   ============================================================ */
.notfound {
    text-align: center;
    padding: 40px 0;
}
.notfound .code {
    font-family: "PT Serif", serif;
    font-size: clamp(4rem, 14vw, 8rem);
    color: var(--teal);
    line-height: 1;
    margin: 0;
}
.notfound .search-form { max-width: 460px; margin: 24px auto 0; }

/* ============================================================
   Контакты — статичные
   ============================================================ */
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { margin-bottom: 10px; }

/* ============================================================
   Подвал
   ============================================================ */
.site-footer {
    background: var(--teal-deep);
    color: #c6d8d3;
    padding: 46px 0 0;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
}
@media (max-width: 760px) {
    .footer-cols { grid-template-columns: 1fr; gap: 24px; }
}
.site-footer .widget {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    color: #c6d8d3;
}
.site-footer .widget-title { color: #fff; }
.site-footer .widget a { color: #a9e3d8; }
.site-footer .widget a:hover { color: var(--amber-soft); }
.site-footer .widget ul li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    color: #c6d8d3;
}
.site-footer .widget .post-date { color: #8fa9a3; }

.footer-bottom {
    margin-top: 38px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 18px 0;
    font-size: 0.85rem;
    color: #8fa9a3;
    text-align: center;
}

/* ============================================================
   Cookie-баннер (A11, D6)
   ============================================================ */
.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    background: var(--teal-deep);
    color: #e7f2ef;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.cookie-banner p { margin: 0; font-size: 0.9rem; flex: 1 1 320px; min-width: 0; }
.cookie-banner .btn { flex: 0 0 auto; padding: 10px 22px; }

/* ============================================================
   Адаптив навигации
   ============================================================ */
@media (max-width: 760px) {
    .nav-toggle { display: inline-block; }
    .main-nav {
        flex-basis: 100%;
        display: none;
    }
    .main-nav.is-open { display: block; }
    .main-nav ul { flex-direction: column; justify-content: flex-start; gap: 0; }
    .main-nav li { border-bottom: 1px solid var(--line); }
}
