/*
 * Раздел статей: карточки (список, страница города, «Читайте также») и страница статьи.
 * Отдельный файл, чтобы правки статей не пересекались с landing.css. Цвета — переменные темы из landing.css.
 */

/* ---------- Список статей ---------- */
.art-index-head { display: grid; gap: 12px; max-width: 860px; margin-bottom: 24px; }
.art-index-head__note { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.55; }
.art-rubrics { margin-bottom: 28px; }

.lp-articles, .art-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
.art-card + .art-grid { margin-top: 24px; }

.art-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--white); color: var(--ink); text-decoration: none; transition: border-color .2s, box-shadow .2s, transform .2s; }
.art-card:hover { border-color: transparent; box-shadow: 0 18px 40px -22px rgba(13, 27, 42, .35); transform: translateY(-2px); }
.art-card__img { position: relative; display: block; flex: none; aspect-ratio: 16 / 10; overflow: hidden; background: var(--soft); }
.art-card__img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.art-card:hover .art-card__img img { transform: scale(1.03); }
.art-card__tag { position: absolute; top: 14px; left: 14px; padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.2; backdrop-filter: blur(6px); }
.art-card__body { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 20px 22px 22px; }
.art-card__title { display: -webkit-box; overflow: hidden; font-size: 19px; font-weight: 700; line-height: 1.3; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.art-card__text { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 15px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.art-card__meta { margin-top: auto; padding-top: 6px; color: var(--muted); font-size: 13px; }
.art-card__kicker { color: var(--brand); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

/* Свежая статья: фото слева, текст справа. */
.art-card--featured { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.art-card--featured .art-card__img { aspect-ratio: auto; min-height: 340px; }
.art-card--featured .art-card__body { justify-content: center; gap: 14px; padding: 36px 40px; }
.art-card--featured .art-card__title { font-size: 30px; line-height: 1.2; letter-spacing: -.01em; -webkit-line-clamp: 4; }
.art-card--featured .art-card__text { font-size: 17px; -webkit-line-clamp: 4; }
.art-card--featured .art-card__meta { margin-top: 8px; }

/* ---------- Страница статьи ---------- */
.art-hero { display: grid; gap: 28px; margin-bottom: 40px; }
.art-hero__text { max-width: 860px; }
.art-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.art-meta > * + *::before { content: '·'; margin-right: 14px; color: var(--line); }
.art-meta > .art-meta__tag + *::before { display: none; }
.art-meta__tag { padding: 5px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 600; text-decoration: none; }
.art-title { margin: 0; color: var(--ink); font-size: 44px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
.art-lead { margin: 18px 0 0; color: var(--ink-2); font-size: 20px; line-height: 1.55; }
.art-cover { display: block; width: 100%; height: auto; aspect-ratio: 21 / 9; object-fit: cover; border-radius: 24px; background: var(--soft); }

.art-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 64px; align-items: start; }
.art-main { width: 100%; min-width: 0; max-width: 760px; }
.art-aside__sticky { position: sticky; top: 96px; display: grid; gap: 20px; }

.art-toc { padding: 20px 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); }
.art-toc__title, .art-toc summary { margin: 0 0 10px; color: var(--ink); font-size: 15px; font-weight: 700; }
.art-toc ol { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.art-toc li { counter-increment: toc; }
.art-toc a { display: grid; grid-template-columns: 22px 1fr; padding: 6px 0; color: var(--ink-2); font-size: 14px; line-height: 1.4; text-decoration: none; }
.art-toc a::before { content: counter(toc); color: var(--muted); font-variant-numeric: tabular-nums; }
.art-toc a:hover { color: var(--brand); }
.art-toc--inline { display: none; }

.art-cta { padding: 24px 22px; border-radius: 18px; background: var(--grad, var(--brand)); color: #fff; }
.art-cta__title { margin: 0 0 8px; font-size: 19px; font-weight: 700; line-height: 1.3; }
.art-cta__text { margin: 0 0 16px; color: rgba(255, 255, 255, .85); font-size: 14px; line-height: 1.5; }
.art-cta .art-cta__btn { width: 100%; background: #fff; color: var(--brand); box-shadow: none; }
.art-cta__phone { display: block; margin-top: 12px; color: #fff; font-size: 15px; font-weight: 600; text-align: center; text-decoration: none; }

/* Текст статьи */
.art-body { font-size: 18px; line-height: 1.75; }
.art-body > :first-child { margin-top: 0; }
.art-body p { margin: 0 0 16px; }
.art-body p + p { margin-top: 0; }
.art-body h2 { margin: 48px 0 16px; scroll-margin-top: 96px; font-size: 30px; }
.art-body h3 { margin: 32px 0 12px; font-size: 22px; }
.art-body ul, .art-body ol { margin: 0 0 18px; padding-left: 24px; }
.art-body li + li { margin-top: 8px; }
.art-body li::marker { color: var(--brand); }
.art-body strong { color: var(--ink); }
.art-body a { color: var(--brand); text-decoration: underline; text-decoration-color: rgba(11, 95, 208, .35); text-underline-offset: 3px; }
.art-body a:hover { text-decoration-color: currentColor; }
.art-body table { display: block; width: 100%; max-width: 100%; overflow-x: auto; margin: 24px 0; border: 1px solid var(--line); border-radius: 16px; border-collapse: separate; border-spacing: 0; font-size: 15px; line-height: 1.5; }
.art-body thead th { background: var(--soft); color: var(--ink); font-weight: 700; }
.art-body th, .art-body td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.art-body tbody tr:last-child td { border-bottom: 0; }
.art-body figure { margin: 32px 0; }
.art-body figure img { display: block; width: 100%; height: auto; border-radius: 18px; }
.art-body figure.lp-figure--narrow img { max-width: 480px; margin: 0 auto; }
.art-body figcaption { margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.5; text-align: center; }

/* Частые вопросы */
.art-faq { display: grid; gap: 10px; margin: 8px 0 24px; }
.art-faq__item { border: 1px solid var(--line); border-radius: 16px; background: var(--white); transition: border-color .2s; }
.art-faq__item[open] { border-color: var(--brand); }
.art-faq__item summary { position: relative; padding: 18px 56px 18px 20px; color: var(--ink); font-size: 17px; font-weight: 600; line-height: 1.4; list-style: none; cursor: pointer; }
.art-faq__item summary::-webkit-details-marker { display: none; }
.art-faq__item summary::after { content: '+'; position: absolute; top: 50%; right: 20px; display: grid; place-items: center; width: 28px; height: 28px; margin-top: -14px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 20px; font-weight: 500; line-height: 1; }
.art-faq__item[open] summary::after { content: '−'; }
.art-faq__answer { padding: 0 20px 18px; color: var(--ink-2); font-size: 16px; line-height: 1.65; }
.art-faq__answer p:last-child { margin-bottom: 0; }

@media (max-width: 1099px) {
    .art-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .art-main { max-width: 760px; margin: 0 auto; }
    .art-aside { display: none; }
    .art-toc--inline { display: block; margin-bottom: 28px; }
    .art-toc--inline summary { margin: 0; cursor: pointer; }
    .art-toc--inline[open] summary { margin-bottom: 10px; }
    .art-hero__text { max-width: 760px; }
}
@media (max-width: 979px) {
    .lp-articles, .art-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .art-card--featured { grid-template-columns: 1fr; }
    .art-card--featured .art-card__img { aspect-ratio: 16 / 9; min-height: 0; }
    .art-card--featured .art-card__body { padding: 24px; }
    .art-card--featured .art-card__title { font-size: 24px; }
}
@media (max-width: 767px) {
    .lp-articles, .art-grid { grid-template-columns: 1fr; gap: 16px; }
    .art-card + .art-grid { margin-top: 16px; }
    .art-card__body { padding: 18px; }
    .art-card--featured .art-card__title { font-size: 22px; -webkit-line-clamp: 5; }
    .art-title { font-size: 30px; }
    .art-lead { font-size: 17px; }
    .art-hero { gap: 20px; margin-bottom: 28px; }
    .art-cover { aspect-ratio: 16 / 10; border-radius: 18px; }
    .art-body { font-size: 16px; }
    .art-body h2 { margin-top: 36px; font-size: 24px; }
    .art-body h3 { font-size: 19px; }
    .art-faq__item summary { font-size: 16px; }
    /* На телефоне в живой таблице — комплекс, срок и цена, остальное в карточке ЖК. */
    .art-body .art-live-table .art-live-table__extra { display: none; }
    .art-body .art-live-table th, .art-body .art-live-table td { padding: 10px 12px; }
}

/* Живые данные из каталога (App\Support\ArticleLive) и источники */
.art-body .art-live-table { margin: 28px 0; }
.art-body .art-live-table table { margin: 0; }
.art-body .art-live-table td small { color: var(--muted); font-size: 13px; }
.art-body .art-live-table__price { font-weight: 700; white-space: nowrap; }
.art-body .art-live-table figcaption { text-align: left; }
.art-sources { margin-top: 40px; padding: 20px 22px; border-radius: 16px; background: var(--soft); color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.art-sources__title { margin: 0 0 8px; color: var(--ink); font-size: 15px; font-weight: 700; }
.art-sources ul { margin: 0; padding-left: 18px; }
.art-sources li + li { margin-top: 4px; }
.art-sources__date { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
