/*
Theme Name: dds_swim55.ru
Theme URI: https://swim55.ru/
Author: Данилова Анастасия
Author URI: https://swim55.ru/
Description: Тема для блога о плавании — техника, экипировка, тренировки и советы для пловцов.
Version: 1.1
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: swim55
*/

/* ========== БАЗОВЫЕ ПЕРЕМЕННЫЕ ========== */
:root {
    --bg-main: #FFFFFF;
    --bg-soft: #F4F9FC;
    --text-main: #1A2A3A;
    --text-soft: #4a5a6a;
    --accent: #00A8C6;
    --accent-dark: #0086a0;
    --coral: #FF6B6B;
    --quote-bg: #E0F2F1;
    --border: #dbe6ec;
    --chip-tech: #00A8C6;
    --chip-equip: #FF6B6B;
    --chip-train: #1A2A3A;
    --chip-mistake: #d8dee3;
    --shadow-soft: 0 4px 12px rgba(26, 42, 58, 0.06);
    --shadow-hover: 0 8px 22px rgba(0, 168, 198, 0.18);
    --radius: 8px;
    --radius-pill: 40px;
    --speed: 0.22s;
}

/* ========== СБРОС И ОСНОВА ========== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: var(--text-main);
    background-color: var(--bg-main);
    -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', 'Inter', sans-serif;
    color: var(--text-main);
    line-height: 1.25;
    margin: 1.4em 0 0.6em;
    font-weight: 700;
}
h1 { font-size: 2.1rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

p {
    margin: 0 0 1em;
    background: none;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--speed) ease;
}
a:hover { color: var(--accent-dark); text-decoration: underline; }

ul, ol { padding-left: 1.4em; }
li { margin: 0.3em 0; }

blockquote {
    background: var(--quote-bg);
    border-left: 3px solid var(--accent);
    padding: 1em 1.2em;
    margin: 1.4em 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    font-style: italic;
}
blockquote p:last-child { margin-bottom: 0; }

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
    border: 1px solid var(--border);
}
th, td {
    border: 1px solid var(--border);
    padding: 0.6em 0.8em;
    text-align: left;
}
th { background: var(--bg-soft); font-weight: 600; }

code {
    background: var(--bg-soft);
    padding: 0.1em 0.35em;
    border-radius: 4px;
    font-size: 0.92em;
}

hr { border: 0; border-top: 1px solid var(--border); margin: 1.6em 0; }

.screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    width: 1px; height: 1px;
    overflow: hidden;
}

/* ========== СЕТКА ========== */
.wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.layout {
    display: flex;
    gap: 36px;
    margin: 36px auto;
    align-items: flex-start;
}

.layout-content { flex: 1 1 auto; min-width: 0; }
.layout-sidebar { flex: 0 0 27%; }

.layout-narrow .layout-content { width: 85%; max-width: 85%; margin: 0 auto; flex: 0 0 85%; }
.layout-full .layout-content { width: 85%; max-width: 85%; margin: 0 auto; flex: 0 0 85%; }

@media (max-width: 960px) {
    .layout { flex-direction: column; gap: 24px; }
    .layout-sidebar { width: 100%; flex: 1 1 auto; }
    .layout-narrow .layout-content,
    .layout-full .layout-content { width: 100%; max-width: 100%; flex: 1 1 auto; }
}

/* ========== ПРОГРЕСС ЧТЕНИЯ ========== */
.read-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--accent), #5fd4e6);
    z-index: 9999;
    transition: width 0.08s linear;
}

/* ========== ШАПКА ========== */
.site-header {
    background: var(--bg-main);
    border-bottom: 1px solid var(--border);
    padding: 18px 0;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text-main);
}
.brand:hover { text-decoration: none; }
.brand-logo, .brand svg { width: 46px; height: 46px; flex-shrink: 0; display: block; }
.brand-text { display: flex; flex-direction: column; }
.brand-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.18rem;
    color: var(--text-main);
    line-height: 1.2;
}
.brand-tagline {
    font-size: 0.82rem;
    color: var(--text-soft);
    line-height: 1.3;
    margin-top: 2px;
}

.nav-primary { margin-left: auto; }
.nav-primary ul {
    list-style: none;
    display: flex;
    gap: 26px;
    margin: 0;
    padding: 0;
}
.nav-primary a {
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.97rem;
    padding: 6px 2px;
    position: relative;
    text-decoration: none;
}
.nav-primary a:hover { color: var(--accent); text-decoration: none; }
.nav-primary a::after {
    content: '';
    position: absolute;
    left: 0; bottom: -2px;
    width: 0; height: 2px;
    background: var(--accent);
    transition: width var(--speed) ease;
}
.nav-primary a:hover::after { width: 100%; }
.nav-primary .current-menu-item > a { color: var(--accent); }
.nav-primary .current-menu-item > a::after { width: 100%; }

/* Бургер */
.burger {
    display: none;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 6px;
    margin-left: auto;
}
.burger span {
    display: block;
    width: 8px; height: 12px;
    background: var(--accent);
    margin: 3px auto;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    transition: transform var(--speed);
}

@media (max-width: 768px) {
    .burger { display: block; }
    .nav-primary {
        order: 10;
        width: 100%;
        margin-left: 0;
        display: none;
    }
    .nav-primary.open { display: block; }
    .nav-primary ul { flex-direction: column; gap: 4px; padding: 14px 0; }
    .nav-primary a { display: block; padding: 8px 0; }
}

/* ========== ХЛЕБНЫЕ КРОШКИ ========== */
.crumbs {
    font-size: 0.88rem;
    color: var(--text-soft);
    margin: 18px 0 6px;
    padding: 0;
}
.crumbs a { color: var(--text-soft); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { margin: 0 8px; opacity: 0.5; }
.crumbs .current { color: var(--text-main); }

/* ========== КАРТОЧКИ ========== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin: 24px 0;
}

.card {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    transition: transform var(--speed) ease, box-shadow var(--speed) ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

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

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

.card-meta {
    font-size: 0.8rem;
    color: var(--text-soft);
    margin-bottom: 6px;
}
.card-meta a { color: var(--text-soft); }

.card-title {
    margin: 0 0 10px;
    font-size: 1.15rem;
    line-height: 1.3;
}
.card-title a { color: var(--text-main); text-decoration: none; }
.card-title a:hover { color: var(--accent); }

.card-excerpt {
    font-size: 0.94rem;
    color: var(--text-soft);
    margin: 0 0 14px;
    flex: 1;
}
.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}
.card-excerpt p:last-child { margin-bottom: 0; }

.card-readmore {
    align-self: flex-start;
    margin-top: auto;
}

/* Чипсы категорий */
.chip {
    display: inline-block;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    margin-right: 6px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.chip-tech { background: var(--chip-tech); }
.chip-equip { background: var(--chip-equip); }
.chip-train { background: var(--chip-train); }
.chip-mistake { background: var(--chip-mistake); color: #2a2a2a; }
.chip-default { background: var(--accent); }

/* ========== КНОПКИ ========== */
.btn {
    display: inline-block;
    height: 44px;
    line-height: 44px;
    padding: 0 22px;
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform var(--speed) ease, box-shadow var(--speed) ease, background var(--speed) ease;
    text-decoration: none;
}
.btn:hover {
    background: var(--accent-dark);
    box-shadow: var(--shadow-hover);
    text-decoration: none;
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
    line-height: 41px;
}
.btn-outline:hover {
    background: var(--accent);
    color: #fff;
}

.btn-pill {
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, var(--accent), #2c6bb0);
    padding: 0 28px;
}
.btn-pill:hover { transform: translateY(-2px) scale(1.02); }

/* ========== ГЛАВНАЯ ========== */
.hero {
    background: linear-gradient(135deg, var(--bg-soft), #d9eef4);
    padding: 60px 30px;
    border-radius: var(--radius);
    margin: 30px 0;
    text-align: center;
}
.hero h1 { margin-top: 0; font-size: 2.4rem; }
.hero p { font-size: 1.1rem; color: var(--text-soft); max-width: 720px; margin: 0 auto 20px; }

.section-block {
    margin: 50px 0;
    padding: 30px;
    background: var(--bg-soft);
    border-radius: var(--radius);
}
.section-block.alt { background: var(--bg-main); border: 1px solid var(--border); }
.section-block h2 { margin-top: 0; }

.feature-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 24px;
}
.feature-card {
    background: var(--bg-main);
    border-radius: var(--radius);
    padding: 22px 18px;
    border: 1px solid var(--border);
    transition: transform var(--speed) ease, box-shadow var(--speed) ease;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.feature-icon {
    width: 48px; height: 48px;
    margin-bottom: 12px;
    color: var(--accent);
}
.feature-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.feature-card p { font-size: 0.92rem; color: var(--text-soft); margin: 0; }

.steps {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 24px;
}
.step {
    flex: 1 1 220px;
    background: var(--bg-main);
    padding: 18px;
    border-radius: var(--radius);
    border-left: 3px solid var(--accent);
}
.step-num {
    display: inline-block;
    width: 30px; height: 30px;
    line-height: 30px;
    text-align: center;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    margin-bottom: 8px;
}

/* ========== СЛАЙДЕР (расчёт экипировки) ========== */
.gear-calc {
    background: var(--bg-soft);
    padding: 24px;
    border-radius: var(--radius);
    margin: 30px 0;
}
.gear-calc label {
    display: block;
    font-weight: 600;
    margin: 12px 0 6px;
}
.gear-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #cfe7ec;
    border-radius: 3px;
    outline: none;
}
.gear-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px; height: 22px;
    background: var(--coral);
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.gear-slider::-moz-range-thumb {
    width: 22px; height: 22px;
    background: var(--coral);
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #fff;
}
.gear-output {
    display: inline-block;
    margin-top: 8px;
    background: var(--accent);
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
}

/* ========== ОДИНОЧНАЯ ЗАПИСЬ ========== */
.entry-header { margin: 20px 0 26px; }
.entry-title { font-size: 2.1rem; margin: 0 0 8px; }
.entry-meta { font-size: 0.88rem; color: var(--text-soft); }
.entry-meta .chip { vertical-align: middle; }

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

.entry-content { font-size: 1.02rem; }
.entry-content img { border-radius: var(--radius); margin: 10px 0; }
.entry-content figure { margin: 1em 0; }
.entry-content h2 { margin-top: 1.6em; }

.entry-content .wp-block-quote,
.entry-content .coach-tip {
    background: var(--quote-bg);
    padding: 16px 20px;
    border-radius: var(--radius);
    border-left: 3px solid var(--accent);
    font-style: italic;
    letter-spacing: 0.3px;
}

.post-tags { margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 0.9rem; }
.post-tags a {
    display: inline-block;
    background: var(--bg-soft);
    padding: 4px 10px;
    margin: 2px 4px 2px 0;
    border-radius: 12px;
    color: var(--text-soft);
}

/* ========== САЙДБАР ========== */
.sidebar { background: var(--bg-soft); padding: 22px; border-radius: var(--radius); }
.sidebar .widget { margin-bottom: 26px; }
.sidebar .widget:last-child { margin-bottom: 0; }
.sidebar .widget-title {
    font-size: 1rem;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
}
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li { margin: 0.4em 0; }
.sidebar li a { color: var(--text-main); text-decoration: none; }
.sidebar li a:hover { color: var(--accent); }

/* ========== ПАГИНАЦИЯ ========== */
.pager {
    margin: 30px 0;
    text-align: center;
}
.pager .page-numbers {
    display: inline-block;
    min-width: 38px;
    height: 38px;
    line-height: 36px;
    padding: 0 12px;
    margin: 0 3px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-main);
    background: var(--bg-main);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--speed) ease;
}
.pager .page-numbers:hover {
    background: var(--bg-soft);
    border-color: var(--accent);
    color: var(--accent);
}
.pager .page-numbers.current {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ========== ПОИСК ========== */
.search-form {
    display: flex;
    gap: 8px;
    margin: 14px 0;
}
.search-form input[type="search"] {
    flex: 1;
    padding: 0 14px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    background: var(--bg-main);
    color: var(--text-main);
    font-family: inherit;
}
.search-form input[type="search"]:focus {
    outline: none;
    border-color: var(--accent);
}
.search-form button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--accent);
    cursor: pointer;
    transition: all var(--speed) ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.search-form button:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.search-form button svg { width: 18px; height: 18px; display: block; }

/* ========== ПОДПИСКА ========== */
.subscribe-block {
    background: linear-gradient(135deg, #e7f6f9, var(--bg-soft));
    padding: 36px 28px;
    border-radius: var(--radius);
    text-align: center;
    margin: 40px 0;
}
.subscribe-block h2 { margin-top: 0; }
.subscribe-form {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 16px;
    flex-wrap: wrap;
}
.subscribe-form input[type="email"] {
    flex: 1 1 250px;
    max-width: 360px;
    padding: 0 16px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
}

/* ========== ПОДВАЛ ========== */
.site-footer {
    background: #122332;
    color: #cdd9e3;
    padding: 50px 0 24px;
    margin-top: 60px;
}
.site-footer a { color: #cdd9e3; }
.site-footer a:hover { color: var(--accent); text-decoration: none; }
.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
}
.footer-cols .widget-title {
    color: #fff;
    font-size: 1rem;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer-cols ul { list-style: none; padding: 0; margin: 0; }
.footer-cols li { margin: 0.35em 0; }
.copyright {
    margin-top: 32px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
    text-align: center;
    font-size: 0.88rem;
    color: #8c9ba8;
}

/* ========== КОММЕНТАРИИ ========== */
.comments-area { margin: 40px 0; padding-top: 24px; border-top: 1px solid var(--border); }
.comment-list { list-style: none; padding: 0; }
.comment-list li { margin-bottom: 22px; }
.comment-body {
    padding: 16px 18px;
    background: var(--bg-soft);
    border-radius: var(--radius);
}
.comment-author { font-weight: 600; }
.comment-meta { font-size: 0.82rem; color: var(--text-soft); margin-bottom: 8px; }
.comment-respond { margin-top: 30px; }
.comment-form label { display: block; margin: 10px 0 4px; font-weight: 500; }
.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: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
}
.comment-form textarea { min-height: 120px; }

/* ========== COOKIE-БАННЕР ========== */
/* ВАЖНО: правило для [hidden] идёт ДО основного блока (правило A11) */
.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 9998;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.cookie-banner p { margin: 0; flex: 1 1 240px; font-size: 0.92rem; color: var(--text-soft); }
.cookie-banner .btn { white-space: nowrap; }

/* ========== 404 ========== */
.error-404 {
    text-align: center;
    padding: 60px 20px;
}
.error-404 h1 { font-size: 4rem; margin: 0; color: var(--accent); }
.error-404 p { font-size: 1.05rem; color: var(--text-soft); }
.error-404 .btn { margin-top: 14px; }

/* ========== БЛОГ — ШАПКА ========== */
.page-title-block {
    margin: 20px 0 24px;
    padding: 24px 26px;
    background: var(--bg-soft);
    border-radius: var(--radius);
}
.page-title-block h1 { margin: 0; }
.page-title-block .descr { margin: 8px 0 0; color: var(--text-soft); }

/* ========== АДАПТИВ ========== */
@media (max-width: 600px) {
    body { font-size: 15px; }
    h1 { font-size: 1.7rem; }
    h2 { font-size: 1.35rem; }
    .hero { padding: 36px 18px; }
    .hero h1 { font-size: 1.7rem; }
    .section-block { padding: 20px; margin: 30px 0; }
    .entry-title { font-size: 1.55rem; }
    .wrap { padding: 0 14px; }
    .card-grid { grid-template-columns: 1fr; gap: 18px; }
    .header-inner { gap: 12px; }
    .brand-name { font-size: 1.05rem; }
    .brand-tagline { display: none; }
    .cookie-banner { flex-direction: column; align-items: stretch; text-align: center; }
}
