/* Блог LU. Цвета и скругления взяты с главной (main.css). */
.lu-blog {
    --bg: #FBFAFF;
    --soft: #F0EFFF;
    --ink: #372C77;
    --text: #484B66;
    --muted: #6E7190;
    --accent: #7D8AFF;
    --line: #E4E2FA;
    --grad: linear-gradient(to right, #7D8AFF, #F79ED1, #EABDC8);
    --gutter: 44px;
    background: var(--bg);
    color: var(--text);
    font-family: 'Raleway', sans-serif;
    font-feature-settings: "lnum" 1;
}
.blog-page { padding-bottom: 96px; }
.blog-page *, .blog-page *::before, .blog-page *::after { box-sizing: border-box; }
.blog-page a:focus-visible, .blog-page button:focus-visible, .blog-audio-bar:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

/* ---------- Общая страница ---------- */
.blog-hero {
    margin: 0 var(--gutter);
    padding: 64px 96px;
    background: var(--soft);
    border-radius: 64px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 48px;
    overflow: hidden;
}
.blog-kicker {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 16px;
    font-weight: 600;
}
.blog-h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(44px, 5.4vw, 80px);
    font-weight: 300;
    line-height: 1.08;
    letter-spacing: -.01em;
}
.blog-grad {
    font-weight: 800;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.blog-hero-lede {
    margin: 28px 0 0;
    max-width: 560px;
    font-size: 20px;
    line-height: 1.55;
}
.blog-hero-cat { position: relative; width: clamp(180px, 20vw, 290px); }
.blog-hero-cat::before {
    content: "";
    position: absolute;
    inset: -14%;
    background: radial-gradient(closest-side, rgba(125, 138, 255, .32), rgba(125, 138, 255, 0));
}
.blog-hero-cat img { position: relative; display: block; width: 100%; height: auto; }

.blog-feed { margin: 72px auto 0; padding: 0 var(--gutter); max-width: 1420px; }

.blog-card-link { display: block; color: inherit; text-decoration: none; }
.blog-card-photo {
    display: block;
    overflow: hidden;
    border-radius: 28px;
    background: var(--soft);
    aspect-ratio: 4 / 3;
}
.blog-card-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .7s cubic-bezier(.2, .7, .2, 1);
}
.blog-card-link:hover .blog-card-photo img { transform: scale(1.04); }
.blog-card-body { display: block; padding-top: 22px; }
.blog-card-title {
    display: block;
    color: var(--ink);
    font-size: 23px;
    font-weight: 700;
    line-height: 1.28;
    transition: color .2s;
}
.blog-card-link:hover .blog-card-title { color: var(--accent); }
.blog-card-desc { display: block; margin-top: 10px; font-size: 16px; line-height: 1.5; }
.blog-card-meta { display: block; margin-top: 14px; color: var(--muted); font-size: 14px; font-weight: 500; }

.blog-card-lead { margin-bottom: 72px; }
.blog-card-lead .blog-card-link {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 64px;
    align-items: center;
}
.blog-card-lead .blog-card-photo { border-radius: 40px; aspect-ratio: 16 / 10; }
.blog-card-lead .blog-card-body { padding: 0; }
.blog-card-lead .blog-card-title { font-size: clamp(32px, 3.4vw, 48px); line-height: 1.14; }
.blog-card-lead .blog-card-desc { margin-top: 20px; font-size: 19px; }
.blog-card-lead .blog-card-meta { margin-top: 20px; font-size: 15px; }

.blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px 36px; }

/* ---------- Переход на программу ---------- */
.blog-cta {
    margin: 72px 0;
    border-radius: 40px;
    overflow: hidden;
    color: #fff;
    background:
        linear-gradient(90deg, rgba(7, 7, 16, .86) 0%, rgba(7, 7, 16, .62) 48%, rgba(7, 7, 16, .12) 100%),
        var(--cta-photo) center / cover no-repeat #171730;
}
.blog-cta-inner { padding: 64px; max-width: 640px; }
.blog-page .blog-cta-title {
    margin: 0;
    color: #fff;
    font-size: clamp(32px, 3.4vw, 46px);
    font-weight: 300;
    line-height: 1.12;
}
.blog-cta-title b { font-weight: 800; }
.blog-page .blog-cta-text { margin: 18px 0 30px; color: rgba(255, 255, 255, .9); font-size: 18px; line-height: 1.55; }
.blog-page .blog-btn {
    display: inline-block;
    padding: 16px 40px;
    border-radius: 18px;
    background: var(--accent);
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s;
}
.blog-page .blog-btn:hover { background: #6A78F5; }
.blog-page .blog-cta-note { margin: 18px 0 0; color: rgba(255, 255, 255, .72); font-size: 14px; }

/* ---------- Статья: первый экран ---------- */
.article-hero {
    margin: 0 var(--gutter);
    padding: 48px;
    background: var(--soft);
    border-radius: 64px;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 56px;
    align-items: center;
}
.article-hero-text { padding: 16px 0 16px 48px; }
.article-crumbs { display: flex; gap: 10px; margin-bottom: 36px; color: var(--muted); font-size: 15px; font-weight: 500; }
.article-crumbs a { color: var(--muted); text-decoration: none; }
.article-crumbs a:hover { color: var(--accent); }
.article-h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(38px, 4.6vw, 68px);
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -.01em;
}
.article-h1 b { color: var(--ink); font-weight: 800; }
.article-lede { margin: 26px 0 0; font-size: 20px; line-height: 1.55; }
.article-meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 0; color: var(--muted); font-size: 15px; font-weight: 500; }
.article-hero-photo { overflow: hidden; border-radius: 40px; aspect-ratio: 1 / 1; background: #e6e4f8; }
.article-hero-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Статья: текст ---------- */
.article-layout {
    margin: 72px auto 0;
    padding: 0 var(--gutter);
    display: grid;
    grid-template-columns: 220px minmax(0, 720px);
    gap: 80px;
    justify-content: center;
    align-items: start;
}
.article-toc { position: sticky; top: 32px; display: flex; flex-direction: column; gap: 14px; font-size: 15px; line-height: 1.35; }
.article-toc-title { margin: 0 0 4px; color: var(--ink); font-weight: 700; }
.article-toc a { color: var(--muted); font-weight: 500; text-decoration: none; }
.article-toc a:hover { color: var(--accent); }

.article-body { font-size: 18px; line-height: 1.72; min-width: 0; }
.article-body > p, .article-body > ul { margin: 0 0 22px; }
.article-body > ul { padding-left: 0; list-style: none; }
.article-body > ul li, .article-short li { position: relative; padding-left: 26px; margin-bottom: 12px; }
.article-body > ul li::before, .article-short li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: .68em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}
.article-body h2 {
    margin: 64px 0 20px;
    color: var(--ink);
    font-size: 32px;
    font-weight: 700;
    line-height: 1.22;
    scroll-margin-top: 24px;
}
.article-body h3 { margin: 36px 0 12px; color: var(--ink); font-size: 22px; font-weight: 700; line-height: 1.3; }
.article-body a { color: #5563E8; text-underline-offset: 3px; }
.article-body > ol { margin: 0 0 22px; padding: 0; list-style: none; counter-reset: step; }
.article-body > ol li { position: relative; padding-left: 44px; margin-bottom: 16px; counter-increment: step; }
.article-body > ol li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: .2em;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--soft);
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
    line-height: 30px;
    text-align: center;
}
.article-table { overflow-x: auto; margin: 24px 0 28px; }
.article-table table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.45; }
.article-table th, .article-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.article-table th { color: var(--ink); font-weight: 700; }
.article-ref { font-size: .8em; font-weight: 600; text-decoration: none; vertical-align: .15em; }

.article-short { padding: 32px 36px 24px; background: var(--soft); border-radius: 28px; }
.article-body .article-short h2 { margin: 0 0 14px; font-size: 22px; }
.article-short ul { margin: 0; padding: 0; list-style: none; }

/* Шкала часов сна: 4 часа = 0%, 10 часов = 100% */
.sleep-range {
    margin: 36px 0 12px;
    padding: 36px 36px 28px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 28px;
}
.sleep-range-peak {
    margin: 0 0 16px 40%;
    color: var(--text);
    font-size: 15px;
    line-height: 1.35;
}
.sleep-range-peak b { color: var(--ink); font-size: 22px; font-weight: 800; white-space: nowrap; }
.sleep-range-track { position: relative; height: 18px; border-radius: 9px; background: var(--soft); }
.sleep-range-band {
    position: absolute;
    left: 40%;
    width: 23.333%;
    top: 0;
    bottom: 0;
    border-radius: 9px;
    background: linear-gradient(to right, #7D8AFF, #F79ED1);
}
.sleep-range-scale { position: relative; height: 24px; margin-top: 8px; color: var(--muted); font-size: 14px; font-weight: 600; }
.sleep-range-scale span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.sleep-range-scale span:first-child { transform: none; }
.sleep-range-scale span:last-child { transform: translateX(-100%); }
.sleep-range-zones {
    display: grid;
    grid-template-columns: 33.333% 33.334% 33.333%;
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.35;
}
.sleep-range-zones span:nth-child(2) { text-align: center; }
.sleep-range-zones span:nth-child(3) { text-align: right; }
.sleep-range figcaption { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1.45; }

.article-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0 28px; }
.article-stats div { padding: 24px 28px; background: var(--soft); border-radius: 28px; }
.article-stats b { display: block; color: var(--ink); font-size: 36px; font-weight: 800; line-height: 1.1; }
.article-stats span { display: block; margin-top: 8px; font-size: 16px; line-height: 1.35; }

.article-note { margin: 36px 0; padding: 28px 36px; background: #fff; border: 1px solid var(--line); border-radius: 28px; }
.article-note h3 { margin: 0 0 8px; color: var(--ink); font-size: 20px; font-weight: 700; }
.article-note p { margin: 0; }

/* Плеер */
.blog-audio {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    margin-top: 48px;
    padding: 28px 32px;
    background: var(--soft);
    border-radius: 28px;
}
.blog-audio-btn {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    transition: transform .2s, background .2s;
}
.blog-audio-btn:hover { background: #6A78F5; transform: scale(1.05); }
.blog-audio-btn .i-pause { display: none; }
.is-playing .blog-audio-btn .i-play { display: none; }
.is-playing .blog-audio-btn .i-pause { display: block; }
.blog-audio-main h3 { margin: 0; color: var(--ink); font-size: 20px; font-weight: 700; line-height: 1.3; }
.blog-audio-main p { margin: 6px 0 14px; font-size: 16px; line-height: 1.45; }
.blog-audio-bar { position: relative; height: 16px; cursor: pointer; }
.blog-audio-bar::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 4px; border-radius: 2px; background: #D9D7F5; }
.blog-audio-bar span { position: absolute; left: 0; top: 6px; height: 4px; width: 0; border-radius: 2px; background: var(--accent); }
.blog-audio-time { display: flex; justify-content: space-between; margin-top: 4px; color: var(--muted); font-size: 13px; font-weight: 600; }

.article-body .blog-cta { margin: 24px 0 0; }
.article-body .blog-cta-inner { padding: 48px; }

.article-body .article-sources { margin-top: 64px; font-size: 15px; line-height: 1.55; }
.article-body .article-sources h2 { margin: 0 0 14px; font-size: 22px; scroll-margin-top: 24px; }
.article-sources ol { margin: 0; padding-left: 22px; }
.article-sources li:target { background: var(--soft); border-radius: 8px; }

.article-related { margin: 96px auto 0; padding: 0 var(--gutter); max-width: 1420px; }
.article-related h2 { margin: 0 0 36px; color: var(--ink); font-size: 32px; font-weight: 700; }

@media (prefers-reduced-motion: no-preference) {
    .blog-hero-text, .article-hero-text { animation: blog-rise .7s cubic-bezier(.2, .7, .2, 1) both; }
    .blog-hero-cat, .article-hero-photo { animation: blog-rise .7s .12s cubic-bezier(.2, .7, .2, 1) both; }
    @keyframes blog-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
    .blog-card-photo img, .blog-audio-btn { transition: none; }
}

@media (max-width: 1180px) {
    .lu-blog { --gutter: 34px; }
    .blog-hero { padding: 56px; }
    .article-hero { padding: 32px; gap: 36px; }
    .article-hero-text { padding: 12px 0 12px 20px; }
    .article-layout { grid-template-columns: minmax(0, 720px); gap: 0; }
    .article-toc { display: none; }
    .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .blog-card-lead .blog-card-link { gap: 40px; }
}
@media (max-width: 760px) {
    .lu-blog { --gutter: 16px; }
    .blog-page { padding-bottom: 64px; }
    .blog-hero { grid-template-columns: 1fr; padding: 36px 24px 28px; border-radius: 40px; gap: 16px; }
    .blog-hero-lede { font-size: 18px; margin-top: 20px; }
    .blog-hero-cat { width: 150px; justify-self: end; margin-top: -8px; }
    .blog-feed { margin-top: 48px; }
    .blog-card-lead { margin-bottom: 48px; }
    .blog-card-lead .blog-card-link { grid-template-columns: 1fr; gap: 22px; }
    .blog-card-lead .blog-card-photo { border-radius: 28px; }
    .blog-card-lead .blog-card-title { font-size: 23px; line-height: 1.28; }
    .blog-grid { grid-template-columns: 1fr; gap: 44px; }
    .blog-cta { margin: 48px 0; border-radius: 28px;
        background: linear-gradient(180deg, rgba(7, 7, 16, .62) 0%, rgba(7, 7, 16, .9) 100%), var(--cta-photo) center / cover no-repeat #171730; }
    .blog-cta-inner, .article-body .blog-cta-inner { padding: 36px 24px; }
    .blog-page .blog-btn { display: block; padding: 16px 20px; text-align: center; }

    .article-hero { grid-template-columns: 1fr; padding: 28px 20px 20px; border-radius: 40px; gap: 26px; }
    .article-hero-text { padding: 0 4px; }
    .article-crumbs { margin-bottom: 22px; font-size: 14px; }
    .article-lede { font-size: 18px; }
    .article-hero-photo { border-radius: 28px; aspect-ratio: 4 / 3; }
    .article-layout { margin-top: 40px; }
    .article-body { font-size: 17px; line-height: 1.68; }
    .article-body h2 { margin-top: 48px; font-size: 26px; }
    .article-short { padding: 24px 22px 14px; }
    /* Таблицы на телефоне: каждая строка становится карточкой с подписями столбцов */
    .article-table { overflow: visible; }
    .article-table thead { display: none; }
    .article-table table, .article-table tbody, .article-table tr, .article-table td { display: block; width: auto; }
    .article-table tr { padding: 14px 0; border-bottom: 1px solid var(--line); }
    .article-table td { padding: 3px 0; border: 0; }
    .article-table td:first-child { color: var(--ink); font-weight: 700; }
    .article-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-weight: 600; }
    .sleep-range { padding: 24px 20px 20px; }
    .sleep-range-peak { margin-left: 0; width: auto; }
    .sleep-range-zones { font-size: 13px; }
    .article-stats b { font-size: 28px; }
    .article-stats div { padding: 18px 18px; border-radius: 22px; }
    .article-stats span { font-size: 15px; }
    .article-note { padding: 22px; }
    .blog-audio { grid-template-columns: 1fr; padding: 24px 22px; gap: 16px; }
    .blog-audio-btn { width: 64px; height: 64px; }
    .article-related { margin-top: 64px; }
    .article-related h2 { font-size: 26px; margin-bottom: 26px; }
}
