/*
Theme Name: highperformancetrainingworks.com
Author: Алексей Градов
Description: Обучающий портал по строительству и ремонту с видеоуроками, иллюстрированными статьями и интерактивными курсами для самостоятельного освоения технологий.
Version: 1.1
Text Domain: hptw
*/

/* ===================== Базовые переменные ===================== */
:root {
    --graphite: #2A2A2A;
    --blue: #1E3A5F;
    --blue-dark: #15293f;
    --bg: #F5F7FA;
    --white: #FFFFFF;
    --terracotta: #C85C17;
    --terracotta-dark: #ad4d11;
    --text: #23282d;
    --muted: #5b6573;
    --border: #d9dee6;
    --shell: min(92%, 1180px);
}

/* ===================== Сброс / база ===================== */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

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

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

p { margin: 0 0 1em; }

/* Глобальный p без background-color (см. F) */

/* Контейнер ширины — задаётся в одном месте (см. A12.7) */
.shell {
    width: var(--shell);
    margin-inline: auto;
}

/* ===================== Кнопки ===================== */
.btn,
.wp-block-button__link,
button.btn {
    display: inline-block;
    padding: 0.7em 1.4em;
    border-radius: 4px;
    border: 2px solid var(--blue);
    background: var(--blue);
    color: var(--white);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.btn:hover {
    background: var(--terracotta);
    border-color: var(--terracotta);
    color: var(--white);
    text-decoration: none;
}
.btn-accent {
    background: var(--terracotta);
    border-color: var(--terracotta);
}
.btn-accent:hover {
    background: var(--terracotta-dark);
    border-color: var(--terracotta-dark);
}
.btn-outline {
    background: transparent;
    border: 2px solid var(--blue);
    color: var(--blue);
}
.btn-outline:hover {
    background: var(--blue);
    color: var(--white);
}

/* ===================== Шапка ===================== */
.site-header {
    background: var(--graphite);
    color: var(--white);
    padding: 18px 0;
}
.site-header .shell {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.brand a { color: var(--white); text-decoration: none; display: flex; align-items: center; gap: 14px; }
.brand-logo { max-height: 56px; width: auto; display: block; }
.brand-logo-svg { display: block; flex: 0 0 auto; }
.brand-text { min-width: 0; }
.site-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--white);
    margin: 0;
    line-height: 1.3;
}
.site-desc {
    font-size: 0.82rem;
    color: #c7ccd3;
    margin: 4px 0 0;
}

/* Навигация (не липкая) */
.main-nav {
    background: var(--blue-dark);
}
.main-nav .shell {
    display: flex;
    align-items: center;
}
.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid #ffffff55;
    color: var(--white);
    padding: 8px 12px;
    border-radius: 4px;
    margin: 10px 0;
    cursor: pointer;
}
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}
.main-nav li { margin: 0; }
.main-nav a {
    display: block;
    color: var(--white);
    padding: 14px 18px;
    text-decoration: none;
    border-bottom: 3px solid transparent;
}
.main-nav a:hover,
.main-nav .current-menu-item > a {
    background: var(--blue);
    border-bottom-color: var(--terracotta);
    text-decoration: none;
}

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

.layout-with-sidebar {
    display: flex;
    flex-wrap: wrap;
    gap: 6%;
    align-items: flex-start;
}
.layout-with-sidebar .content-area {
    flex: 0 1 67%;
    min-width: 0;
}
.layout-with-sidebar .sidebar {
    flex: 0 1 27%;
    min-width: 0;
}
.layout-single {
    display: block;
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}
.layout-single .content-area { min-width: 0; }

/* ===================== Хлебные крошки ===================== */
.breadcrumbs {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0 0 20px;
}
.breadcrumbs a { color: var(--blue); }
.breadcrumbs .sep { margin: 0 6px; color: var(--muted); }

/* ===================== Карточки записей ===================== */
.card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}
.card .card-thumb-wrap {
    display: block;
    overflow: hidden;
}
.card .card-thumb-wrap a { display: block; }
.card .card-thumb-wrap img,
.card .card-thumb-wrap .thumb-placeholder svg {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}
.card .card-thumb-wrap .thumb-placeholder { display: block; }
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 18px 20px 20px;
    min-width: 0;
}
.card-meta-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.tool-icon {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--blue);
    flex: 0 0 auto;
}
.verified-badge {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--terracotta);
    border: 1px solid var(--terracotta);
    border-radius: 3px;
    padding: 2px 8px;
    font-weight: 600;
}
.card-title { font-size: 1.15rem; margin: 0 0 8px; }
.card-title a { color: var(--blue); text-decoration: none; }
.card-title a:hover { text-decoration: underline; }
.card-excerpt { color: var(--text); }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-date { font-size: 0.82rem; color: var(--muted); margin-bottom: 12px; }
.card-footer { margin-top: auto; }

/* Сетка карточек */
.card-list { display: flex; flex-direction: column; gap: 24px; }
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 24px;
}

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

/* ===================== Записи / контент ===================== */
.entry {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 28px 32px;
}
.entry-title { font-size: 1.9rem; }
.entry-meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 18px; }
.entry-content { min-width: 0; }
.entry-content img { border-radius: 4px; }
.entry-thumb { margin: 0 0 22px; }
.entry-thumb img { width: 100%; border-radius: 6px; display: block; }

/* Пошаговый иллюстрированный алгоритм */
.steps { counter-reset: step; margin: 24px 0; padding: 0; list-style: none; }
.steps li {
    position: relative;
    padding: 14px 14px 14px 56px;
    border-left: 3px solid var(--terracotta);
    background: var(--bg);
    margin-bottom: 12px;
    border-radius: 0 4px 4px 0;
}
.steps li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 12px; top: 12px;
    width: 30px; height: 30px;
    background: var(--blue);
    color: var(--white);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

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

/* ===================== Сайдбар / виджеты ===================== */
.sidebar .widget,
.footer-widgets .widget {
    margin-bottom: 26px;
}

/* Сайдбар: светлый фон → тёмный текст */
.sidebar .widget {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 18px 20px;
    color: var(--text);
}
.sidebar .widget-title {
    color: var(--blue);
    font-size: 1.1rem;
    margin-top: 0;
    border-bottom: 2px solid var(--terracotta);
    padding-bottom: 8px;
}
.sidebar .widget a { color: var(--blue); }
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li { padding: 7px 0; border-bottom: 1px solid var(--border); }
.sidebar .widget li:last-child { border-bottom: none; }
.sidebar .widget .post-date { display: block; font-size: 0.8rem; color: var(--muted); }

/* ===================== Подвал ===================== */
.site-footer {
    background: var(--graphite);
    color: #d4d8de;
    padding: 40px 0 20px;
    margin-top: 40px;
}
.footer-widgets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
}
/* Тёмный фон подвала → светлый текст виджетов (см. F) */
.footer-widgets .widget { color: #d4d8de; }
.footer-widgets .widget-title {
    color: var(--white);
    font-size: 1.1rem;
    margin-top: 0;
    border-bottom: 2px solid var(--terracotta);
    padding-bottom: 8px;
}
.footer-widgets .widget a { color: #e7b58c; }
.footer-widgets .widget a:hover { color: var(--white); }
.footer-widgets .widget ul { list-style: none; margin: 0; padding: 0; }
.footer-widgets .widget li { padding: 6px 0; border-bottom: 1px solid #3d3d3d; }
.footer-widgets .widget li:last-child { border-bottom: none; }
.footer-widgets .widget .post-date { display: block; font-size: 0.8rem; color: #a8adb5; }
.site-copyright {
    border-top: 1px solid #3d3d3d;
    margin-top: 30px;
    padding-top: 18px;
    font-size: 0.85rem;
    color: #a8adb5;
    text-align: center;
}

/* ===================== Главная ===================== */
.home-section { margin-bottom: 48px; }
.section-title {
    font-size: 1.7rem;
    margin-bottom: 6px;
}
.section-lead { color: var(--muted); margin-bottom: 24px; max-width: 760px; }

.hero {
    background: var(--blue);
    color: var(--white);
    border-radius: 8px;
    padding: 48px 40px;
}
.hero h1 { color: var(--white); font-size: 2.2rem; }
.hero p { color: #d7e0ec; max-width: 720px; }
.hero .btn-accent { margin-top: 12px; }

/* Дорожка строителя — горизонтальная временная шкала */
.roadmap {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 32px 28px;
}
.roadmap-track {
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding-bottom: 10px;
    counter-reset: stage;
}
.roadmap-stage {
    flex: 1 0 180px;
    min-width: 0;
    position: relative;
    padding: 0 14px;
    text-align: center;
}
.roadmap-stage::before {
    content: "";
    position: absolute;
    top: 17px;
    left: 0; right: 0;
    height: 3px;
    background: var(--border);
    z-index: 0;
}
.roadmap-stage:first-child::before { left: 50%; }
.roadmap-stage:last-child::before { right: 50%; }
.roadmap-dot {
    position: relative;
    z-index: 1;
    width: 36px; height: 36px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: var(--blue);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    counter-increment: stage;
}
.roadmap-dot::after { content: counter(stage); }
.roadmap-stage:last-child .roadmap-dot { background: var(--terracotta); }
.roadmap-stage h3 { font-size: 1rem; margin: 0 0 6px; }
.roadmap-stage p { font-size: 0.85rem; color: var(--muted); margin: 0; }

/* Блок направлений */
.directions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 20px;
}
.direction-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 22px 22px 24px;
    border-top: 4px solid var(--blue);
    min-width: 0;
}
.direction-card h3 { font-size: 1.1rem; }
.direction-card p { color: var(--muted); margin: 0; font-size: 0.95rem; }

/* Блок преимуществ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 22px;
}
.feature {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 24px;
    min-width: 0;
}
.feature .feature-ico {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg);
    border-radius: 6px;
    color: var(--terracotta);
    margin-bottom: 12px;
}
.feature h3 { font-size: 1.1rem; }
.feature p { color: var(--muted); margin: 0; font-size: 0.95rem; }

/* ===================== Пагинация ===================== */
.pagination { margin: 32px 0 0; }
.pagination ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0; margin: 0;
}
.pagination a, .pagination span {
    display: block;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--blue);
    background: var(--white);
    text-decoration: none;
}
.pagination .current {
    background: var(--blue);
    color: var(--white);
    border-color: var(--blue);
}
.pagination a:hover {
    background: var(--terracotta);
    color: var(--white);
    border-color: var(--terracotta);
    text-decoration: none;
}

/* ===================== Комментарии ===================== */
.comments-area { margin-top: 36px; background: var(--white); border: 1px solid var(--border); border-radius: 6px; padding: 24px 28px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-item { border-bottom: 1px solid var(--border); padding: 14px 0; }
.comment-meta { display: flex; gap: 12px; align-items: baseline; margin-bottom: 6px; }
.comment-author { font-weight: 700; color: var(--blue); }
.comment-date { font-size: 0.8rem; color: var(--muted); }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

/* ===================== Форма поиска ===================== */
.search-form {
    display: flex;
    gap: 8px;
}
.search-form input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
}
.search-form button {
    flex: 0 0 auto;
    padding: 10px 18px;
    background: var(--blue);
    color: var(--white);
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.search-form button:hover { background: var(--terracotta); }

/* ===================== Контакты ===================== */
.contact-info { background: var(--white); border: 1px solid var(--border); border-radius: 6px; padding: 20px 24px; margin: 20px 0; }
.social-links { display: flex; gap: 14px; margin-top: 10px; }
.social-links a { color: var(--blue); font-weight: 600; }

/* ===================== 404 ===================== */
.error-404 { text-align: center; padding: 40px 0; }
.error-404 .big { font-size: 5rem; color: var(--blue); margin: 0; }

/* ===================== Cookie-баннер ===================== */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: var(--graphite);
    color: #e6e8eb;
    padding: 16px 0;
    z-index: 9999;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.25);
}
.cookie-banner .shell {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.cookie-banner p { margin: 0; flex: 1 1 320px; min-width: 0; font-size: 0.92rem; }
.cookie-banner a { color: #e7b58c; }
.cookie-banner .btn { flex: 0 0 auto; }

/* ===================== Адаптив ===================== */
@media (max-width: 960px) {
    .layout-with-sidebar { display: block; }
    .layout-with-sidebar .content-area,
    .layout-with-sidebar .sidebar { flex: none; width: 100%; }
    .layout-with-sidebar .sidebar { margin-top: 32px; }
    .footer-widgets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .layout-single { width: 92%; }
    .hero { padding: 36px 26px; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .footer-widgets { grid-template-columns: 1fr; }

    .nav-toggle { display: block; }
    .main-nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
    }
    .main-nav ul.is-open { display: flex; }
    .main-nav a { padding: 12px 4px; border-bottom: 1px solid #ffffff22; }

    /* Горизонтальные карточки → вертикальные (см. A10) */
    .card-row { flex-direction: column; }
    .card-row .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
    .card-row .card-thumb-wrap a { position: static; }
    .card-row .card-thumb-wrap img,
    .card-row .card-thumb-wrap .thumb-placeholder svg {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .entry { padding: 20px 18px; }
    .roadmap-stage { flex: 0 0 60%; }
}
