/* ==========================================================================
   ШОНЕР — собственные стили сайта (не входят в поставку шаблона ShowCase)
   Файл: catalog/view/theme/oct_showcase/stylesheet/oct-custom.css
   Подключение: catalog/view/theme/oct_showcase/template/common/header.twig
   Правило: файлы темы не правим — все свои стили пишем здесь.

   ВАЖНО про специфичность.
   style.min.css темы содержит правила вида «.content-block p { font-size:14px }»
   и общий сброс «h1..h6, p, ul, ol, li { margin:0 }». Поэтому базовый селектор
   статьи записан как «.content-block.sc-article» — так наши правила гарантированно
   перебивают тему, не прибегая к !important. Класс sc-article всегда ставится
   на тот же div, где уже есть content-block.
   ========================================================================== */

:root {
    --sc-accent:      #f0bf64; /* фирменный жёлтый темы */
    --sc-accent-dark: #c9922c; /* тот же жёлтый, контрастный для текста */
    --sc-ink:         #1c1c28; /* основной текст темы */
    --sc-ink-2:       #4b4b57; /* второстепенный текст */
    --sc-line:        rgba(28, 28, 40, .12);
    --sc-card:        rgba(255, 255, 255, .55);
    --sc-measure:     82ch;    /* комфортная длина строки */
}

/* ==========================================================================
   1. Текстовая страница (.sc-article)
   Класс стоит на блоке с описанием информационных страниц:
   «О компании», «Доставка и оплата», «Условия соглашения», «Обмен и возврат».
   ========================================================================== */

.content-block.sc-article {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--sc-ink);
}

.content-block.sc-article > *:first-child { margin-top: 0; }
.content-block.sc-article > *:last-child  { margin-bottom: 0; }

/* --- Абзацы --------------------------------------------------------------- */

.content-block.sc-article p {
    max-width: var(--sc-measure);
    margin: 0 0 1.15rem;
    font-size: 1rem;
    line-height: 1.75;
}

/* Первый абзац после заголовка — вводный, крупнее остальных.
   Тот же вид даёт ручной класс .sc-lead */
.content-block.sc-article > h2:first-child + p,
.content-block.sc-article .sc-lead {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--sc-ink-2);
}

/* --- Заголовки ------------------------------------------------------------ */

.content-block.sc-article h2 {
    position: relative;
    max-width: var(--sc-measure);
    margin: 2.75rem 0 1rem;
    padding-bottom: .65rem;
    font-size: 1.5rem;
    line-height: 1.3;
    font-weight: 700;
}

.content-block.sc-article h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 56px;
    height: 3px;
    border-radius: 2px;
    background: var(--sc-accent);
}

.content-block.sc-article h3 {
    max-width: var(--sc-measure);
    margin: 2rem 0 .65rem;
    font-size: 1.1875rem;
    line-height: 1.4;
}

.content-block.sc-article h4,
.content-block.sc-article h5,
.content-block.sc-article h6 {
    max-width: var(--sc-measure);
    margin: 1.5rem 0 .5rem;
}

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

.content-block.sc-article ul,
.content-block.sc-article ol {
    max-width: var(--sc-measure);
    margin: 0 0 1.25rem;
    font-size: 1rem;
    line-height: 1.75;
}

.content-block.sc-article ul {
    padding-left: 0;
    list-style: none;
}

.content-block.sc-article ul > li {
    position: relative;
    margin-bottom: .5rem;
    padding-left: 1.6rem;
}

.content-block.sc-article ul > li::before {
    content: "";
    position: absolute;
    left: .35rem;
    top: .72em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--sc-accent);
}

.content-block.sc-article ol {
    padding-left: 1.35rem;
}

.content-block.sc-article ol > li {
    margin-bottom: .5rem;
    padding-left: .25rem;
}

.content-block.sc-article ol > li::marker {
    color: var(--sc-accent-dark);
    font-size: 1rem;
    font-weight: 700;
}

.content-block.sc-article li > ul,
.content-block.sc-article li > ol {
    margin: .5rem 0 0;
}

.content-block.sc-article li:last-child { margin-bottom: 0; }

/* Тема добавляет margin-top:1rem соседним p/ul/ol — вертикальный ритм
   уже задан через margin-bottom, поэтому снимаем. */
.content-block.sc-article ol + p,
.content-block.sc-article ol + ul,
.content-block.sc-article p + p,
.content-block.sc-article p + ul,
.content-block.sc-article ul + p,
.content-block.sc-article ul + ul {
    margin-top: 0;
}

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

.content-block-text.sc-article a {
    color: var(--sc-ink);
    text-decoration: underline;
    text-decoration-color: var(--sc-accent-dark);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: color .15s ease, text-decoration-color .15s ease;
}

.content-block-text.sc-article a:hover {
    color: var(--sc-accent-dark);
    text-decoration-color: var(--sc-accent);
}

/* --- Прочие элементы ------------------------------------------------------ */

.content-block.sc-article img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.content-block.sc-article hr {
    height: 0;
    margin: 2rem 0;
    border: 0;
    border-top: 1px solid var(--sc-line);
    background: none;
    opacity: 1;
}

.content-block.sc-article blockquote {
    max-width: var(--sc-measure);
    margin: 1.5rem 0;
    padding: .85rem 1.25rem;
    border-left: 3px solid var(--sc-accent);
    border-radius: 0 8px 8px 0;
    background: var(--sc-card);
    color: var(--sc-ink-2);
}

.content-block.sc-article table {
    max-width: 100%;
}

.content-block.sc-article table td,
.content-block.sc-article table th {
    vertical-align: top;
}

/* ==========================================================================
   2. Видео 16:9 (.video-wrapper)
   Без этого iframe YouTube рисуется дефолтными 300x150.
   ========================================================================== */

.video-wrapper {
    position: relative;
    width: 100%;
    max-width: 860px;
    margin: 1.75rem 0 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
    box-shadow: 0 8px 24px rgba(28, 28, 40, .15);
}

.video-wrapper iframe,
.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@supports not (aspect-ratio: 16 / 9) {
    .video-wrapper {
        height: 0;
        padding-bottom: 56.25%;
    }
}

/* ==========================================================================
   3. Вспомогательные классы — проставляются вручную в HTML-редакторе админки
   ========================================================================== */

/* <ul class="sc-cards"> — список превращается в плитку карточек.
   Внутри li первым элементом ожидается <strong>Заголовок.</strong> */
.content-block.sc-article .sc-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    max-width: none;
    margin: 1.5rem 0;
    padding: 0;
    list-style: none;
}

.content-block.sc-article .sc-cards > li {
    margin: 0;
    padding: 1.15rem 1.25rem;
    border: 1px solid var(--sc-line);
    border-top: 3px solid var(--sc-accent);
    border-radius: 10px;
    background: var(--sc-card);
}

.content-block.sc-article .sc-cards > li::before { content: none; }

.content-block.sc-article .sc-cards > li > strong:first-child {
    display: block;
    margin-bottom: .35rem;
    font-size: 1.0625rem;
}

/* <ul class="sc-list-2col"> — короткий список в несколько колонок */
.content-block.sc-article .sc-list-2col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: .25rem 2rem;
    max-width: none;
}

/* <div class="sc-note"> — выноска с акцентом */
.content-block.sc-article .sc-note {
    max-width: var(--sc-measure);
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-left: 3px solid var(--sc-accent);
    border-radius: 0 10px 10px 0;
    background: var(--sc-card);
}

.content-block.sc-article .sc-note > *:last-child { margin-bottom: 0; }

/* ==========================================================================
   4. Адаптив
   ========================================================================== */

/* На планшетах и ниже ограничение длины строки уже не нужно */
@media (max-width: 991.98px) {
    :root { --sc-measure: none; }
}

@media (max-width: 767.98px) {
    .content-block.sc-article {
        font-size: .9375rem;
        line-height: 1.7;
    }

    .content-block.sc-article p,
    .content-block.sc-article ul,
    .content-block.sc-article ol {
        font-size: .9375rem;
        line-height: 1.7;
    }

    .content-block.sc-article > h2:first-child + p,
    .content-block.sc-article .sc-lead { font-size: 1rem; }

    .content-block.sc-article h2 {
        margin: 2rem 0 .875rem;
        font-size: 1.25rem;
    }

    .content-block.sc-article h3 {
        margin: 1.5rem 0 .5rem;
        font-size: 1.0625rem;
    }

    .video-wrapper {
        margin-top: 1.25rem;
        border-radius: 8px;
    }
}
