/*
Theme Name: dds_na-treninge.ru
Author: Дмитрий Соловьев
Description: Информационная тема для фитнес-ресурса na-treninge.ru: практические гайды, программы тренировок и питания.
Version: 1.1
Text Domain: ntr
*/

/* ==================================================================
   Переменные и базовые стили
   ================================================================== */
:root {
    --ink: #181d26;
    --ink-soft: #4b5564;
    --bg: #ffffff;
    --bg-soft: #f3f5f0;
    --line: #e3e7df;
    --dark: #161b22;
    --dark-2: #1f2630;
    --accent: #9fd320;
    --accent-deep: #7cab12;
    --accent-ink: #14210a;
    --radius: 14px;
    --shell: min(92%, 1180px);
    --content-w: 85%;
}

* { box-sizing: border-box; }

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

html { scroll-behavior: smooth; }

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

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

a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
    line-height: 1.2;
    color: var(--ink);
    margin: 0 0 0.5em;
    font-weight: 800;
    letter-spacing: -0.01em;
}
h1 { font-size: 2.1rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }

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

/* ==================================================================
   Шапка
   ================================================================== */
.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.brand-logo, .brand-mark {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    display: block;
}
.brand-text { min-width: 0; }
.brand-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--ink);
    display: block;
    line-height: 1.25;
}
.brand-name a { color: inherit; text-decoration: none; }
.brand-desc {
    font-size: 0.82rem;
    color: var(--ink-soft);
    display: block;
    margin-top: 2px;
}

.nav-toggle {
    margin-left: auto;
    display: none;
    background: var(--dark);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.95rem;
    cursor: pointer;
}

.main-nav { margin-left: auto; }
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.main-nav a {
    display: block;
    padding: 9px 14px;
    border-radius: 10px;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.96rem;
}
.main-nav a:hover {
    background: var(--bg-soft);
    text-decoration: none;
}
.main-nav .current-menu-item > a {
    background: var(--accent);
    color: var(--accent-ink);
}

/* ==================================================================
   Раскладки
   ================================================================== */
.site-main { padding: 34px 0 48px; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: 67% 27%;
    gap: 6%;
    align-items: start;
}
.layout-single .content-area { width: var(--content-w); margin-left: auto; margin-right: auto; }
.layout-with-sidebar .content-area { min-width: 0; }

.sidebar { min-width: 0; }

/* ==================================================================
   Хлебные крошки
   ================================================================== */
.breadcrumbs {
    font-size: 0.86rem;
    color: var(--ink-soft);
    margin-bottom: 22px;
}
.breadcrumbs a { color: var(--ink-soft); }
.breadcrumbs a:hover { color: var(--accent-deep); }
.breadcrumbs .sep { margin: 0 6px; color: #b7bfb0; }
.breadcrumbs span { color: var(--ink); }

/* ==================================================================
   Карточки записей
   ================================================================== */
.card-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
}
.card {
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.card:hover {
    box-shadow: 0 14px 34px rgba(22, 27, 34, 0.1);
    transform: translateY(-2px);
}
.card-thumb-wrap {
    display: block;
    overflow: hidden;
}
.card-thumb-wrap img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}
.card-body {
    flex: 1;
    padding: 20px 22px 24px;
    display: flex;
    flex-direction: column;
}
.card-meta {
    font-size: 0.8rem;
    color: var(--ink-soft);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.card-title { font-size: 1.3rem; margin-bottom: 10px; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent-deep); text-decoration: none; }
.card-excerpt { color: var(--ink-soft); margin-bottom: 16px; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    align-self: flex-start;
    background: var(--dark);
    color: #fff;
    padding: 9px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
}
.card-more:hover { background: var(--accent-deep); text-decoration: none; }

/* Горизонтальные карточки (последние записи на главной) */
.feed-row .card { flex-direction: row; }
.feed-row .card .card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
}
.feed-row .card .card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.feed-row .card .card-thumb-wrap img {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
    display: block;
}

/* ==================================================================
   Одиночная запись / страница
   ================================================================== */
.entry-header { margin-bottom: 22px; }
.entry-title { font-size: 2.2rem; }
.entry-meta {
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-top: 6px;
}
.entry-thumb {
    margin: 0 0 26px;
    border-radius: var(--radius);
    overflow: hidden;
}
.entry-thumb img { width: 100%; display: block; }
.entry-content { font-size: 1.05rem; }
.entry-content img { border-radius: 10px; }
.entry-content h2, .entry-content h3 { margin-top: 1.4em; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content blockquote {
    margin: 1.4em 0;
    padding: 14px 22px;
    border-left: 4px solid var(--accent);
    background: var(--bg-soft);
    border-radius: 0 10px 10px 0;
}

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

/* ==================================================================
   Сайдбар и виджеты
   ================================================================== */
.widget {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 22px;
    color: var(--ink);
}
.widget:last-child { margin-bottom: 0; }
.widget-title {
    font-size: 1.05rem;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
    color: var(--ink);
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.widget li:last-child { border-bottom: 0; }
.widget a { color: var(--ink); }
.widget a:hover { color: var(--accent-deep); }
.widget .post-date { display: block; font-size: 0.78rem; color: var(--ink-soft); }

/* ==================================================================
   Подвал
   ================================================================== */
.site-footer {
    background: var(--dark);
    color: #d6dbe2;
    padding: 46px 0 24px;
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
}
.site-footer .widget {
    background: var(--dark-2);
    border: 1px solid #2b333f;
    color: #d6dbe2;
}
.site-footer .widget,
.site-footer .widget p { color: #d6dbe2; }
.site-footer .widget-title { color: #ffffff; border-bottom-color: var(--accent); }
.site-footer .widget a { color: #c9ed7e; }
.site-footer .widget a:hover { color: var(--accent); }
.site-footer .widget li { border-bottom-color: #2b333f; }
.site-footer .widget .post-date { color: #97a1ae; }

.footer-bottom {
    border-top: 1px solid #2b333f;
    margin-top: 34px;
    padding-top: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: #97a1ae;
}

/* ==================================================================
   Пагинация
   ================================================================== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 36px;
}
.pagination .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;
    color: var(--ink);
    font-weight: 600;
    background: var(--bg);
}
.pagination a.page-numbers:hover {
    border-color: var(--accent);
    color: var(--accent-deep);
    text-decoration: none;
}
.pagination .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}
.pagination .page-numbers.dots {
    border: 0;
    background: none;
}

/* ==================================================================
   Главная
   ================================================================== */
.home-wrap { width: var(--content-w); margin-inline: auto; }

.section { margin: 0 0 56px; }
.section-head { margin-bottom: 26px; }
.section-head .eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-deep);
    margin-bottom: 8px;
}
.section-head h2 { font-size: 2rem; margin: 0; }
.section-head p { color: var(--ink-soft); margin-top: 10px; max-width: 720px; }

/* Hero */
.hero {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    color: #fff;
    margin-bottom: 56px;
    background: var(--dark);
}
.hero img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.42;
    display: block;
}
.hero-inner {
    position: relative;
    padding: 70px 8% 76px;
    max-width: 720px;
}
.hero h1 { color: #fff; font-size: 2.6rem; margin-bottom: 16px; }
.hero p { color: #e6ebe0; font-size: 1.12rem; margin-bottom: 24px; }
.hero .btn {
    display: inline-block;
    background: var(--accent);
    color: var(--accent-ink);
    padding: 13px 26px;
    border-radius: 12px;
    font-weight: 800;
}
.hero .btn:hover { background: #b4e840; text-decoration: none; }

/* Блок текст + иллюстрация */
.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 42px;
    align-items: center;
}
.split.reverse .split-media { order: 2; }
.split-media img {
    width: 100%;
    border-radius: 18px;
    display: block;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}
.split-text h2 { font-size: 1.8rem; }
.split-text p { color: var(--ink-soft); }
.split-text .btn-text {
    display: inline-block;
    margin-top: 6px;
    font-weight: 700;
    color: var(--accent-deep);
}

/* Сетка преимуществ */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}
.feature-card {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 24px;
}
.feature-card .ico {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent);
    color: var(--accent-ink);
    border-radius: 12px;
    margin-bottom: 16px;
}
.feature-card h3 { font-size: 1.15rem; }
.feature-card p { color: var(--ink-soft); margin: 0; font-size: 0.96rem; }

/* Пошаговый блок */
.steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    counter-reset: step;
}
.step {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 22px;
    position: relative;
}
.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(--dark);
    color: var(--accent);
    font-weight: 800;
    margin-bottom: 14px;
}
.step h3 { font-size: 1.08rem; }
.step p { color: var(--ink-soft); margin: 0; font-size: 0.94rem; }

/* Факты / статистика */
.facts {
    background: var(--dark);
    border-radius: 22px;
    padding: 42px 6%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    color: #fff;
}
.fact { text-align: center; min-width: 0; }
.fact .num {
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}
.fact .lbl { color: #c4ccd6; font-size: 0.95rem; margin-top: 8px; }

/* FAQ / аккордеон */
.faq { display: grid; gap: 14px; }
.faq details {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-soft);
    padding: 4px 22px;
}
.faq summary {
    cursor: pointer;
    font-weight: 700;
    padding: 16px 0;
    list-style: none;
    color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; float: right; color: var(--accent-deep); font-weight: 800; }
.faq details[open] summary::after { content: '–'; }
.faq details p { color: var(--ink-soft); margin: 0 0 16px; }

/* Галерея */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.gallery-grid img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

/* CTA */
.cta {
    background: var(--accent);
    border-radius: 22px;
    padding: 46px 6%;
    text-align: center;
}
.cta h2 { color: var(--accent-ink); font-size: 2rem; }
.cta p { color: #243615; max-width: 640px; margin: 0 auto 22px; }
.cta .btn {
    display: inline-block;
    background: var(--dark);
    color: #fff;
    padding: 13px 28px;
    border-radius: 12px;
    font-weight: 700;
}
.cta .btn:hover { background: var(--dark-2); text-decoration: none; }

/* ==================================================================
   Поиск, комментарии, 404
   ================================================================== */
.search-form {
    display: flex;
    gap: 8px;
}
.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(--dark);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 11px 20px;
    cursor: pointer;
    font-weight: 600;
}
.search-form .search-submit:hover { background: var(--accent-deep); }

.comments-area { margin-top: 46px; }
.comments-title { font-size: 1.4rem; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list ul.children { list-style: none; margin: 0 0 0 26px; padding: 0; }
.comment-inner {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 16px;
    background: var(--bg-soft);
}
.comment-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.comment-author { font-weight: 700; }
.comment-date { font-size: 0.8rem; color: var(--ink-soft); }
.comment-await { font-size: 0.85rem; color: var(--accent-deep); }
.comment-respond {
    margin-top: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    margin-top: 6px;
}
.comment-form .form-submit input {
    background: var(--dark);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 12px 26px;
    cursor: pointer;
    font-weight: 600;
}

.error-404 { text-align: center; padding: 30px 0; }
.error-404 .big { font-size: 5rem; font-weight: 800; color: var(--accent); line-height: 1; }
.error-404 .search-form { max-width: 420px; margin: 24px auto 0; }

/* Контакты */
.contact-block { display: grid; gap: 12px; margin-top: 18px; }
.contact-block a { font-weight: 600; }
.social-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.social-links a {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
}

/* ==================================================================
   Cookie-баннер
   ================================================================== */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--dark);
    color: #e7ece0;
    padding: 16px 0;
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.22);
}
.cookie-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: center;
}
.cookie-inner p { margin: 0; font-size: 0.92rem; flex: 1; min-width: 240px; }
.cookie-inner a { color: var(--accent); }
.cookie-accept {
    background: var(--accent);
    color: var(--accent-ink);
    border: 0;
    border-radius: 10px;
    padding: 11px 24px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.cookie-accept:hover { background: #b4e840; }

/* ==================================================================
   Адаптив
   ================================================================== */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 36px; }
    .layout-single .content-area,
    .home-wrap { width: 100%; }
    .feature-grid, .steps, .facts, .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-cols { grid-template-columns: 1fr; gap: 22px; }
    .split { grid-template-columns: 1fr; gap: 26px; }
    .split.reverse .split-media { order: 0; }
    .hero h1 { font-size: 2.1rem; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .nav-toggle { display: inline-block; }
    .main-nav {
        flex-basis: 100%;
        margin-left: 0;
        display: none;
    }
    .main-nav.is-open { display: block; }
    .main-nav ul { flex-direction: column; gap: 2px; }

    .feed-row .card { flex-direction: column; }
    .feed-row .card .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
    .feed-row .card .card-thumb-wrap a { position: static; }
    .feed-row .card .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .feature-grid, .steps, .facts, .gallery-grid { grid-template-columns: 1fr; }
    .hero-inner { padding: 50px 7% 54px; }
    .hero h1 { font-size: 1.8rem; }
    .entry-title { font-size: 1.7rem; }
}
