/* ─── ARTICLE PAGE ────────────────────────────────────────────────────────
   Layout и компоненты страниц статей.
   Используется только: templates/public/articles/*.html
   ─────────────────────────────────────────────────────────────────────── */

/* ── Article Hero ── */

.article-hero {
    background: linear-gradient(140deg, #071e2a 0%, #0d3d52 45%, #1B7A94 100%);
    padding: 56px var(--pad) 52px;
    overflow: hidden;
    position: relative;
}

.article-hero--overflow-visible {
    overflow: visible;
}

.article-hero-inner {
    max-width: var(--W);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 440px;
    gap: 48px;
    align-items: center;
}

/* Wider image column — for landscape illustrations (youtube-learning, etc.) */
.article-hero-inner--wide-visual {
    grid-template-columns: 1fr 560px;
    gap: 40px;
}

.article-hero-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .8125rem;
    color: rgba(255,255,255,.6);
    margin-bottom: 18px;
}

.article-hero-breadcrumb a {
    color: rgba(255,255,255,.6);
    transition: color var(--t-fast);
}

.article-hero-breadcrumb a:hover {
    color: rgba(255,255,255,.9);
}

.article-hero-category {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #64d8f0;
    margin-bottom: 12px;
}

.article-hero h1 {
    font-size: clamp(1.625rem, 3.2vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.15;
    color: var(--white);
    margin-bottom: 18px;
}

.article-hero-meta {
    font-size: .8125rem;
    color: rgba(255,255,255,.55);
}

/* Demo highlight card в hero — floating, rotated */
.demo-hl-wrap {
    position: relative;
}

.demo-hl-wrap .rcard {
    box-shadow: 0 28px 64px rgba(0,0,0,.5), 0 4px 16px rgba(0,0,0,.25);
    transform: rotate(2deg);
}

.demo-hl-card-2 {
    position: absolute;
    top: 18px; left: -12px; right: 12px; bottom: -12px;
    background: rgba(255,255,255,.15);
    border-radius: 20px;
    transform: rotate(-1.5deg);
    z-index: -1;
}

/* Hero illustration (used in youtube-learning, etc.) */

.article-hero-img {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 28px 64px rgba(0,0,0,.5), 0 4px 16px rgba(0,0,0,.25);
    transform: rotate(2deg);
    display: block;
}

/* ── Tooltip ── */

.tooltip-wrap {
    position: relative;
    display: inline;
}
.tooltip-ref {
    cursor: help;
    border-bottom: 1px dotted #39a0b3;
    text-decoration: none;
}
.tooltip-box {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #faf7f2;
    color: #333;
    font-size: .8rem;
    line-height: 1.65;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e5dfd4;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    width: 270px;
    z-index: 10;
    text-align: left;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    transition-delay: 0.15s;
}
.tooltip-box a { color: #39a0b3; }
.tooltip-wrap:hover .tooltip-box,
.tooltip-wrap:focus-within .tooltip-box,
.tooltip-wrap.tooltip-open .tooltip-box {
    opacity: 1;
    visibility: visible;
}

/* ── Article Body ── */

.article-wrap {
    padding: 60px var(--pad) 80px;
}

.article-body {
    max-width: 720px;
    margin: 0 auto;
}

.article-body p.article-lead {
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.75;
    color: var(--text-2);
    margin-bottom: 64px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border);
}

.article-body p a,
.article-body li a {
    color: var(--teal-dark);
    text-decoration: underline;
    text-decoration-color: rgba(27, 122, 148, 0.3);
    text-underline-offset: 3px;
    transition: color var(--t-fast), text-decoration-color var(--t-fast);
}

.article-body p a:hover,
.article-body li a:hover {
    color: var(--teal);
    text-decoration-color: var(--teal);
}

.article-section {
    margin-bottom: 48px;
}

.article-section:last-of-type {
    margin-bottom: 0;
}

.article-h2 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -.025em;
    color: var(--text-1);
    margin-bottom: 18px;
    padding-left: 14px;
    border-left: 3px solid var(--teal);
    line-height: 1.35;
}

.article-body p {
    font-size: .9375rem;
    line-height: 1.8;
    color: var(--text-2);
    margin-bottom: 14px;
}

.article-body p:last-child {
    margin-bottom: 0;
}

.bold-label {
    font-weight: 700;
    color: var(--text-1);
}

.article-body ul {
    list-style: none;
    margin: 4px 0 14px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.article-body ul li {
    font-size: .9375rem;
    line-height: 1.7;
    color: var(--text-2);
    padding-left: 20px;
    position: relative;
}

.article-body ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--teal);
}

.article-body ul li strong {
    color: var(--text-1);
    font-weight: 700;
}

.article-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0 0 48px 0;
}

/* ── Agent Flow Diagram ── */

.agent-flow {
    background: var(--light-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 24px;
    margin: 24px 0 14px;
    text-align: center;
}

.agent-flow-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 16px;
}

.agent-input-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 18px;
    font-size: .875rem;
    font-weight: 600;
    color: var(--text-2);
}

.agent-arrow {
    color: var(--text-3);
    font-size: 1rem;
    margin: 8px 0;
    line-height: 1;
}

.agent-parallel-row {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.agent-box {
    flex: 1;
    max-width: 180px;
    background: var(--white);
    border: 1.5px solid rgba(27,122,148,.3);
    border-radius: 10px;
    padding: 12px 10px;
}

.agent-box-icon {
    font-size: 1.125rem;
    margin-bottom: 4px;
}

.agent-box-label {
    font-size: .8125rem;
    font-weight: 700;
    color: var(--teal-dark);
}

.agent-also {
    display: inline-block;
    margin-top: 8px;
    font-size: .75rem;
    color: var(--text-3);
    background: var(--white);
    border: 1px dashed var(--border);
    border-radius: 6px;
    padding: 4px 12px;
}

.agent-result {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--teal-bg);
    border: 1px solid rgba(27,122,148,.25);
    border-radius: 8px;
    padding: 8px 18px;
    margin-top: 8px;
    font-size: .875rem;
    font-weight: 700;
    color: var(--teal-dark);
}

/* ── Highlight Anatomy ── */

.hl-anatomy {
    background: var(--light-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 24px;
    margin: 24px 0 14px;
}

.hl-anatomy-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 20px;
}

/* Анатомия использует реальный .rcard без трансформаций */
.hl-anatomy .rcard {
    transform: none;
    box-shadow: none;
    margin-bottom: 20px;
}

.hl-a-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--teal);
    color: var(--white);
    border-radius: 50%;
    font-size: .6rem;
    font-weight: 700;
    vertical-align: middle;
    margin-left: 3px;
    font-style: normal;
    flex-shrink: 0;
}

.hl-anatomy-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 24px;
}

.hl-anatomy-legend-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .8125rem;
    color: var(--text-2);
}

.legend-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--teal);
    color: var(--white);
    border-radius: 50%;
    font-size: .65rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ── Status Chips ── */

.status-flow {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 16px 0 14px;
    padding: 16px 20px;
    background: var(--light-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.status-chip {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: .8125rem;
    font-weight: 700;
}

.status-chip.new {
    background: var(--white);
    border: 1.5px solid var(--border);
    color: var(--text-2);
}

.status-chip.learning {
    background: #fffbeb;
    border: 1.5px solid #fbbf24;
    color: #92400e;
}

.status-chip.done {
    background: #f0fdf4;
    border: 1.5px solid #4ade80;
    color: #166534;
}

.status-arrow {
    color: var(--text-3);
    font-size: .875rem;
}

.status-note {
    width: 100%;
    font-size: .75rem;
    color: var(--text-3);
    margin-top: 4px;
}

/* ── iPhone Mockup ── */

.iphone-mockup {
    display: flex;
    justify-content: center;
    margin: 28px 0 14px;
}

.iphone-frame {
    position: relative;
    width: 288px;
    background: linear-gradient(160deg, #2a2a2c 0%, #1c1c1e 60%, #141416 100%);
    border-radius: 52px;
    padding: 16px;
    box-shadow:
        0 0 0 1.5px rgba(255,255,255,.13),
        0 0 0 3px rgba(0,0,0,.6),
        0 40px 100px rgba(0,0,0,.45),
        0 16px 40px rgba(0,0,0,.3),
        inset 0 1px 0 rgba(255,255,255,.08);
}

.iphone-frame::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 108px;
    width: 4px;
    height: 28px;
    background: linear-gradient(180deg, #3a3a3c, #2c2c2e);
    border-radius: 3px 0 0 3px;
    box-shadow: 0 36px 0 #3a3a3c, 0 72px 0 #3a3a3c;
}

.iphone-frame::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 140px;
    width: 4px;
    height: 56px;
    background: linear-gradient(180deg, #3a3a3c, #2c2c2e);
    border-radius: 0 3px 3px 0;
}

.iphone-dynamic-island {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 88px;
    height: 29px;
    background: #000;
    border-radius: 20px;
    z-index: 10;
}

.iphone-screen {
    border-radius: 38px;
    overflow: hidden;
    background: #000;
    position: relative;
}

.iphone-screen img {
    width: 100%;
    display: block;
    vertical-align: bottom;
}

.iphone-home-bar {
    width: 96px;
    height: 4px;
    background: rgba(255,255,255,.28);
    border-radius: 3px;
    margin: 10px auto 5px;
}

/* ── Article image (centered screenshot) ── */

.article-img {
    display: block;
    margin: 24px auto 14px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
    max-width: 100%;
}

/* ── Screenshot / Image placeholder ── */

.img-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 36px 24px;
    border: 1.5px dashed var(--border);
    border-radius: 14px;
    background: var(--white);
    margin: 24px 0 14px;
    text-align: center;
}

.img-placeholder-icon {
    font-size: 1.5rem;
    opacity: .35;
}

.img-placeholder-label {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--text-3);
}

.img-placeholder-sub {
    font-size: .75rem;
    color: var(--text-3);
    opacity: .7;
}

/* ── FAQ Accordion ── */

.faq-list {
    display: flex;
    flex-direction: column;
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-item:first-child {
    border-top: 1px solid var(--border);
}

.faq-item summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 0;
    font-size: .9375rem;
    font-weight: 700;
    color: var(--text-1);
    line-height: 1.5;
    user-select: none;
    transition: color var(--t-fast);
}

.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::marker { display: none; }
.faq-item summary:hover { color: var(--teal); }

.faq-chevron {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--text-3);
    transition: transform .25s cubic-bezier(.4,0,.2,1), color var(--t-fast);
}

.faq-item[open] .faq-chevron {
    transform: rotate(180deg);
    color: var(--teal);
}

.faq-item[open] summary {
    color: var(--teal);
}

.faq-a {
    font-size: .9375rem;
    line-height: 1.75;
    color: var(--text-2);
    margin: 0;
    padding-bottom: 18px;
}

/* ── Article CTA block ── */

.article-cta {
    background: linear-gradient(135deg, #075674 0%, #1B7A94 100%);
    border-radius: 20px;
    padding: 40px 44px;
    margin-top: 56px;
    color: var(--white);
}

.article-cta-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.article-cta .article-cta-text {
    font-size: .9375rem;
    line-height: 1.75;
    color: var(--white);
    margin-bottom: 28px;
}

.article-cta-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-cta-note {
    font-size: .8125rem;
    color: rgba(255,255,255,.72);
}

/* ── Article Table ── */

.article-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0 14px;
    font-size: .875rem;
}

.article-table th {
    text-align: left;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-3);
    padding: 10px 14px;
    border-bottom: 2px solid var(--border);
}

.article-table td {
    padding: 12px 14px;
    line-height: 1.6;
    color: var(--text-2);
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.article-table tbody tr:last-child td {
    border-bottom: none;
}

.article-table tbody tr:hover td {
    background: var(--white);
}

.article-table td:first-child {
    font-weight: 600;
    color: var(--text-1);
    white-space: nowrap;
}

@media (max-width: 600px) {
    .article-table td:first-child {
        white-space: normal;
    }
}

/* ── YouTube slider embedded in article ── */

.article-yt-slider-wrap {
    margin-top: 56px;
    margin-bottom: 64px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.article-yt-slider-wrap .demo-heading {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--text-1);
    margin-bottom: 20px;
}

/* The slider itself breaks out of the 720px article body */
.article-yt-slider-wrap .yt-slider-outer {
    width: calc(100vw - 2 * var(--pad));
    max-width: var(--W);
    margin-left: 50%;
    transform: translateX(-50%);
}

/* ── Responsive ── */

@media (max-width: 900px) {
    .article-hero-inner,
    .article-hero-inner--wide-visual {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .article-hero--overflow-visible {
        overflow: hidden;
    }

    .demo-hl-wrap {
        max-width: 400px;
    }
}

@media (max-width: 600px) {
    .article-hero { padding: 40px var(--pad) 36px; }
    .article-wrap { padding: 40px var(--pad) 60px; }
    .article-cta { padding: 28px 24px; }
    .article-cta-title { font-size: 1.125rem; }
    .article-cta-actions { flex-direction: column; align-items: flex-start; gap: 12px; }
    .btn-cta-primary { width: 100%; justify-content: center; }
    .agent-parallel-row { flex-direction: column; align-items: center; }
    .agent-box { max-width: 100%; width: 100%; }
    .hl-anatomy-legend { grid-template-columns: 1fr; }
    .hl-anatomy { padding: 12px; }
    .hl-anatomy .rcard { margin-bottom: 16px; }
}
