/* Блоки материалов: компоненты на токенах нового дизайна.
   Правила: docs/Задачи после 3 переноса тестового сайта/ДИЗАЙН_ПРАВИЛА.md
   Эталон: static/_preview/main_redesign/index.html, static/0_main_redesign.css

   Как это устроено:
   * значения берутся из токенов дизайна (--surface, --ink, --indigo, --gold,
     --radius-sm), если они есть на странице;
   * пока редизайн не дошёл до страниц материалов, работают fallback-значения
     из этих же токенов — вид блоков одинаковый в обоих случаях;
   * тёмная тема — старый механизм html[data-theme="dark"].

   Геометрия и типографика по правилам 40+: текст 18 px, вторичный 14 px,
   кнопки 54 px, радиусы 14/22, без «своих» цветов и шрифтов. */

/* ------------------------------------------------------------- токены --- */

:root {
    --art-bg: var(--bg, #F8F5EF);
    --art-surface: var(--surface, #FFFFFF);
    --art-surface-2: var(--surface-2, #F1ECE2);
    --art-ink: var(--ink, #211B2E);
    --art-ink-soft: var(--ink-soft, #3B3449);
    --art-muted: var(--muted, #5B5468);
    --art-line: var(--line, #E2DACD);
    --art-line-strong: var(--line-strong, #CEC3B1);
    --art-indigo: var(--indigo, #2F2A6E);
    --art-gold: var(--gold, #A9812F);
    --art-gold-ink: var(--gold-ink, #6E4F12);
    --art-gold-soft: var(--gold-soft, #D8BE86);
    --art-gold-pale: var(--gold-pale, #F3E7CD);
    --art-radius: var(--radius-sm, 14px);
    --art-radius-lg: var(--radius, 22px);
    --art-shadow: var(--shadow-sm, 0 8px 24px rgba(33, 27, 46, .06));

    --art-text: 1.125rem;      /* 18 px — основной текст блока */
    --art-small: 0.875rem;     /* 14 px — вторичный */
    --art-micro: 0.8125rem;    /* 13 px — только метаданные */
}

html[data-theme="dark"] {
    --art-bg: var(--bg, #0C0918);
    --art-surface: var(--surface, #171228);
    --art-surface-2: var(--surface-2, #211B33);
    --art-ink: var(--ink, #F7F1E5);
    --art-ink-soft: var(--ink-soft, #D9D2C5);
    --art-muted: var(--muted, #B9B0C6);
    --art-line: var(--line, #332C45);
    --art-line-strong: var(--line-strong, #4A4260);
    --art-indigo: var(--indigo, #5A4FBF);
    --art-gold: var(--gold, #C9A96B);
    --art-gold-ink: var(--gold-ink, #E9D9B4);
    --art-gold-soft: var(--gold-soft, #D8BE86);
    --art-gold-pale: var(--gold-pale, #2A2340);
    --art-shadow: var(--shadow-sm, 0 8px 24px rgba(0, 0, 0, .25));
}

.art-list,
.art-cards,
.art-checks,
.art-reviews,
.art-gallery,
.art-picks,
.art-note,
.art-acc,
.art-btn,
.art-video__facade,
.art-link-line,
.art-table__scroll {
    box-sizing: border-box;
}

/* ------------------------------------------------------------- списки --- */

.art-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    color: var(--art-ink);
}

.art-list > p {
    margin: 0;
    font-size: var(--art-text);
    line-height: 1.65;
}

.art-list > p + p {
    margin-top: 0.2rem;
}

.art-list ul,
.art-list ol {
    margin: 0;
    padding-left: 1.35em;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    font-size: var(--art-text);
    line-height: 1.65;
}

.art-list li > ul,
.art-list li > ol {
    margin-top: 0.45rem;
}

.art-list li::marker {
    color: var(--art-gold);
}

/* ------------------------------------------------------------- ссылки --- */

.art-link-line {
    margin: 0;
    font-size: var(--art-text);
    line-height: 1.65;
    color: var(--art-ink);
}

.art-link {
    color: var(--art-indigo);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.art-link:hover,
.art-link:focus-visible {
    color: var(--art-gold-ink);
    text-decoration-thickness: 2px;
}

.art-link:focus-visible {
    outline: 2px solid var(--art-gold);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ------------------------------------------------------ цвет текста (4) --- */

.art-accent {
    color: var(--art-indigo);
    font-weight: 600;
}

.art-muted {
    color: var(--art-muted);
    font-size: var(--art-small);
}

/* -------------------------------------------------------------- врезки --- */

.art-note {
    margin: 0;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--art-line);
    border-left: 4px solid var(--art-gold);
    border-radius: var(--art-radius);
    background: var(--art-surface-2);
    color: var(--art-ink);
    font-size: var(--art-text);
    line-height: 1.65;
}

.art-note p {
    margin: 0;
}

.art-note p + p {
    margin-top: 0.6rem;
}

.art-note--warning {
    background: var(--art-gold-pale);
    border-color: var(--art-gold-soft);
    border-left-color: var(--art-gold);
}

.art-note--warning p:first-child {
    font-weight: 700;
}

.art-note--success {
    background: var(--art-surface-2);
    border-left-color: var(--art-indigo);
}

/* ------------------------------------------------------------ галочки --- */

.art-checks {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    font-size: var(--art-text);
    line-height: 1.65;
    color: var(--art-ink);
}

.art-checks li {
    position: relative;
    padding-left: 1.9rem;
}

.art-checks li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.42em;
    width: 0.85rem;
    height: 0.5rem;
    border-left: 2.5px solid var(--art-gold);
    border-bottom: 2.5px solid var(--art-gold);
    transform: rotate(-45deg);
}

.art-checks strong,
.art-checks b {
    font-weight: 700;
    color: var(--art-ink);
}

/* ------------------------------------------------------------- карточки --- */

.art-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.art-card {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    height: 100%;
    padding: 1.4rem 1.4rem 1.2rem;
    border: 1px solid var(--art-line);
    border-radius: var(--art-radius);
    background: var(--art-surface);
    color: var(--art-ink);
    transition: transform .18s ease, box-shadow .18s ease;
}

.art-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--art-shadow);
}

.art-card__title {
    margin: 0;
    font-size: 1.1875rem;      /* 19 px */
    font-weight: 650;
    line-height: 1.3;
    color: var(--art-ink);
}

.art-card__text {
    margin: 0;
    font-size: var(--art-small);
    line-height: 1.55;
    color: var(--art-muted);
}

.art-card__link {
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--art-line);
    font-size: var(--art-small);
    font-weight: 650;
    color: var(--art-indigo);
    text-decoration: none;
}

.art-card__link:hover,
.art-card__link:focus-visible {
    color: var(--art-gold-ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* -------------------------------------------------------------- таблица --- */

.art-table__scroll {
    /* .seo-main — flex-колонка: без min-width:0 обёртка растягивается по
       min-width таблицы и вылезает за экран вместо прокрутки внутри. */
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--art-line);
    border-radius: var(--art-radius);
    background: var(--art-surface);
}

.art-table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: 1rem;
    color: var(--art-ink);
}

.art-table caption {
    caption-side: top;
    padding: 1rem 1.1rem 0.6rem;
    text-align: left;
    font-weight: 700;
    font-size: 1.0625rem;      /* 17 px */
    color: var(--art-ink);
}

.art-table th,
.art-table td {
    padding: 0.75rem 1.1rem;
    border-bottom: 1px solid var(--art-line);
    text-align: left;
    vertical-align: top;
    line-height: 1.5;
}

.art-table th {
    font-weight: 650;
    font-size: var(--art-small);
    letter-spacing: .02em;
    background: var(--art-surface-2);
    color: var(--art-ink);
}

.art-table tbody tr:last-child td {
    border-bottom: 0;
}

/* ----------------------------------------------------------- аккордеон --- */

.art-acc-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.art-acc {
    border: 1px solid var(--art-line);
    border-radius: var(--art-radius);
    background: var(--art-surface);
    color: var(--art-ink);
}

.art-acc > summary {
    position: relative;
    padding: 1.1rem 3rem 1.1rem 1.25rem;
    cursor: pointer;
    font-size: var(--art-text);
    font-weight: 650;
    line-height: 1.45;
    list-style: none;
}

.art-acc > summary::-webkit-details-marker {
    display: none;
}

.art-acc > summary::after {
    content: "+";
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.6rem;
    font-weight: 400;
    line-height: 1;
    color: var(--art-gold);
}

.art-acc[open] > summary::after {
    content: "\2212";
}

.art-acc > summary:focus-visible {
    outline: 2px solid var(--art-gold);
    outline-offset: 2px;
    border-radius: var(--art-radius);
}

.art-acc__body {
    padding: 0 1.25rem 1.15rem;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--art-ink-soft);
}

.art-acc__body p {
    margin: 0 0 0.6rem;
}

.art-acc__body p:last-child {
    margin-bottom: 0;
}

.art-acc__lead {
    margin: 0 0 0.2rem;
    font-weight: 700;
    font-size: var(--art-text);
    line-height: 1.45;
    color: var(--art-ink);
}

.art-acc__list {
    margin: 0;
    padding-left: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 1rem;
}

.art-acc__list li::marker {
    color: var(--art-gold);
}

/* -------------------------------------------------------------- кнопки --- */

.art-btn-line {
    margin: 0;
}

.art-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0 26px;
    border-radius: 999px;
    font-family: inherit;
    font-weight: 650;
    font-size: 1rem;
    line-height: 1.25;
    text-decoration: none;
    transition: transform .18s ease, background-color .18s ease, border-color .18s ease;
}

.art-btn:hover {
    transform: translateY(-2px);
}

.art-btn:focus-visible {
    outline: 2px solid var(--art-gold);
    outline-offset: 3px;
}

.art-btn--primary {
    background: var(--art-indigo);
    color: #FFFFFF;
    border: 1px solid transparent;
}

.art-btn--primary:hover {
    background: var(--indigo-soft, #4A4290);
    color: #FFFFFF;
}

.art-btn--secondary {
    background: transparent;
    color: var(--art-ink);
    border: 1px solid var(--art-line-strong);
}

.art-btn--secondary:hover {
    background: var(--art-surface-2);
    border-color: var(--art-gold);
}

/* --------------------------------------------------------------- видео --- */

.art-video {
    margin: 0;
}

.art-video__facade {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.35rem 1.1rem;
    padding: 1.2rem 1.35rem;
    border: 1px solid var(--art-line);
    border-radius: var(--art-radius);
    background: var(--art-surface);
    color: var(--art-ink);
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.art-video__facade:hover,
.art-video__facade:focus-visible {
    border-color: var(--art-gold);
    box-shadow: var(--art-shadow);
}

.art-video__facade:focus-visible {
    outline: 2px solid var(--art-gold);
    outline-offset: 3px;
}

.art-video__play {
    grid-row: span 2;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--art-indigo);
    color: var(--art-gold-soft);
    font-size: 1.15rem;
}

.art-video__title {
    font-size: var(--art-text);
    font-weight: 650;
    line-height: 1.4;
    color: var(--art-ink);
}

.art-video__note {
    font-size: var(--art-small);
    color: var(--art-muted);
}

/* ------------------------------------------------------------ галерея --- */

.art-gallery {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.art-gallery__item {
    margin: 0;
    list-style: none;
}

.art-gallery__link {
    display: block;
    height: 100%;
    border-radius: var(--art-radius);
}

.art-gallery__link:focus-visible {
    outline: 2px solid var(--art-gold);
    outline-offset: 3px;
}

.art-gallery img {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--art-radius);
}

/* ------------------------------------------------------------ подборка --- */

.art-picks {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.art-pick {
    margin: 0;
    list-style: none;
}

.art-pick__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--art-line);
    border-radius: var(--art-radius);
    background: var(--art-surface);
    color: var(--art-ink);
    text-decoration: none;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.art-pick__link:hover {
    transform: translateY(-2px);
    box-shadow: var(--art-shadow);
    border-color: var(--art-line-strong);
}

.art-pick__link:focus-visible {
    outline: 2px solid var(--art-gold);
    outline-offset: 3px;
}

.art-pick__img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.art-pick__body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.1rem 1.2rem 1.25rem;
}

.art-pick__type {
    font-size: var(--art-micro);
    font-weight: 750;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--art-gold-ink);
}

.art-pick__title {
    font-size: 1.0625rem;      /* 17 px */
    font-weight: 650;
    line-height: 1.35;
    color: var(--art-ink);
}

.art-pick__note {
    font-size: var(--art-small);
    line-height: 1.45;
    color: var(--art-muted);
}

/* -------------------------------------------------------------- отзывы --- */

.art-reviews {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.art-review {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.5rem 1.4rem 1.3rem;
    border: 1px solid var(--art-line);
    border-radius: var(--art-radius);
    background: var(--art-surface);
    color: var(--art-ink);
}

.art-review::before {
    content: "\201C";
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.6rem;         /* 42 px */
    line-height: 0.6;
    color: var(--art-gold-soft);
}

.art-review__text {
    margin: 0;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--art-ink-soft);
}

.art-review__name {
    margin-top: auto;
    font-size: var(--art-micro);
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--art-muted);
}

.art-review__photo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
}

/* --- защита от стилей сайта ---
   В тёмной теме main_css.css красит ВСЕ ссылки внутри .seo-page-container
   (html[data-theme="dark"] .seo-page-container a, специфичность 0,2,2).
   Поэтому ссылки внутри блоков задаём с той же специфичностью: файл
   material_blocks.css подключён позже, побеждает наше правило. */
html[data-theme="dark"] body .art-link,
html[data-theme="dark"] body .art-card__link {
    color: var(--art-gold-soft);
}

html[data-theme="dark"] body .art-link:hover,
html[data-theme="dark"] body .art-link:focus-visible,
html[data-theme="dark"] body .art-card__link:hover,
html[data-theme="dark"] body .art-card__link:focus-visible {
    color: var(--art-gold-ink);
}

html[data-theme="dark"] body .art-pick__link,
html[data-theme="dark"] body .art-video__facade {
    color: var(--art-ink);
}

html[data-theme="dark"] body .art-btn--primary {
    color: #FFFFFF;
}

html[data-theme="dark"] body .art-btn--secondary {
    color: var(--art-ink);
}

/* --------------------------------------------------------- адаптив --- */
@media (max-width: 1080px) {
    .art-cards,
    .art-picks,
    .art-reviews {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .art-reviews {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .art-cards,
    .art-picks {
        grid-template-columns: 1fr;
    }

    .art-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .art-table {
        min-width: 460px;
    }

    .art-btn {
        width: 100%;
    }

    .art-note,
    .art-acc > summary,
    .art-card,
    .art-review {
        border-radius: 12px;
    }
}
