/* «Визуализация сайта»: праздничные темы Казахстана и траурное сообщение.
   Только оформление поверх страницы — вёрстка страниц не меняется.
   Цвета темы приходят переменными --st-1 (основной), --st-2 (акцент), --st-3 (тёмный). */

/* ── Лента под шапкой ── */
html.st-accent #header-container::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 4px; pointer-events: none;
    background: linear-gradient(90deg, var(--st-1), var(--st-2), var(--st-1), var(--st-2), var(--st-1));
    background-size: 200% 100%;
    animation: st-shimmer 8s linear infinite;
    box-shadow: 0 2px 10px color-mix(in srgb, var(--st-2) 45%, transparent);
}
/* Страницы со своей шапкой — лента по верхнему краю окна */
html.st-accent.st-no-header body::before {
    content: ""; position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 1003; pointer-events: none;
    background: linear-gradient(90deg, var(--st-1), var(--st-2), var(--st-1), var(--st-2), var(--st-1));
    background-size: 200% 100%;
    animation: st-shimmer 8s linear infinite;
}
html.st--mourning #header-container::after,
html.st--mourning.st-no-header body::before { background: linear-gradient(90deg, #111827, #4b5563, #111827); animation: none; box-shadow: none; }
@keyframes st-shimmer { from { background-position: 0 0; } to { background-position: -200% 0; } }

/* ── Открытка-поздравление ──
   «html body» в селекторах: на главной есть общий сброс .au-home :where(*) { margin: 0; padding: 0 },
   который подключается позже и при равном весе обнулял бы отступы открытки. */
html body .st-card {
    --st-ink: #0f172a;
    /* выше плавающей кнопки на главной (z 9998), ниже чат-бота (z 10040) */
    position: fixed; left: 22px; bottom: 84px; z-index: 9999;
    width: min(420px, calc(100vw - 44px));
    /* эмблема | текст | крестик — у крестика своя колонка, текст к нему не прилипает */
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 16px;
    padding: 24px 16px 20px 20px; border-radius: 22px; overflow: hidden;
    background: #fff; color: var(--st-ink);
    box-shadow: 0 22px 50px rgba(15, 23, 42, .22), 0 0 0 1px color-mix(in srgb, var(--st-1) 22%, transparent);
    font-family: "Twemoji Country Flags", "Noto Sans", "Segoe UI", system-ui, -apple-system, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
    opacity: 0; transform: translateY(26px) scale(.97); transition: opacity .45s ease, transform .55s cubic-bezier(.2, .8, .2, 1);
}
html body .st-card.is-in { opacity: 1; transform: none; }
html body .st-card.is-out { opacity: 0; transform: translateY(18px) scale(.97); }
/* Цветная полоса сверху и герб города Атырау водяным знаком в углу (images/kz/gerb-atyrau.svg — файл с Wikimedia Commons без изменений) */
html body .st-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: linear-gradient(90deg, var(--st-1), var(--st-2), var(--st-1)); }
html body .st-card::after {
    content: ""; position: absolute; right: 14px; bottom: 12px; width: 96px; aspect-ratio: 1; pointer-events: none; opacity: .15;
    background: url("../images/kz/gerb-atyrau.svg") center / contain no-repeat;
}
/* День памяти — герб без цвета */
html.st--memorial-kind body .st-card::after { filter: grayscale(1); opacity: .12; }
html body .st-card__emblem {
    position: relative; z-index: 1; width: 56px; height: 56px; margin: 5px; border-radius: 50%; align-self: center;
    display: flex; align-items: center; justify-content: center; font-size: 28px; line-height: 1;
    background: radial-gradient(circle at 30% 25%, #fff 0, color-mix(in srgb, var(--st-1) 18%, #fff) 60%, color-mix(in srgb, var(--st-1) 30%, #fff) 100%);
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--st-2), 0 8px 18px color-mix(in srgb, var(--st-1) 35%, transparent);
    animation: st-pop .7s .25s cubic-bezier(.2, .9, .3, 1.4) both;
}
html body .st-card__body { position: relative; z-index: 1; min-width: 0; display: grid; gap: 6px; padding: 2px 0; }
html body .st-card__title { margin: 0; font-size: 15px; font-weight: 800; line-height: 1.42; letter-spacing: -.005em; color: color-mix(in srgb, var(--st-3) 85%, #000); text-wrap: pretty; }
html body .st-card__sub { font-size: 12.5px; color: #64748b; line-height: 1.45; }
html body .st-card__tag { justify-self: start; margin-top: 4px; padding: 4px 11px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1.3; background: #fef3c7; color: #92400e; }
html body .st-card__close {
    position: relative; z-index: 2; align-self: start; margin: -10px -4px 0 0;
    width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: transparent; color: #94a3b8; font-size: 20px; line-height: 1; cursor: pointer; transition: background-color .2s ease, color .2s ease;
}
html body .st-card__close:hover { background: #f1f5f9; color: #0f172a; }
html body .st-card__close:focus-visible { outline: 2px solid var(--st-1); outline-offset: 2px; }

/* Траурное сообщение: строго, без анимации */
html body .st-card--mourning { background: #f8fafc; box-shadow: 0 18px 40px rgba(0, 0, 0, .25), 0 0 0 1px #cbd5e1; }
html body .st-card--mourning::before { background: #111827; }
html body .st-card--mourning::after { display: none; }
html body .st-card--mourning .st-card__emblem { width: 40px; height: 44px; margin: 0 2px; background: none; box-shadow: none; animation: none; }
html body .st-card--mourning .st-card__title { color: #111827; font-weight: 700; }
html body .st-ribbon { width: 30px; height: 40px; }

/* ── Частицы ── */
.st-particles { position: fixed; inset: 0; z-index: 998; pointer-events: none; }

@keyframes st-pop { from { transform: scale(.4) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes st-spin { to { transform: rotate(360deg); } }

@media (max-width: 767.98px) {
    html body .st-card {
        left: 12px; right: 12px; width: auto;
        bottom: calc(var(--m-nav-offset, calc(72px + env(safe-area-inset-bottom, 0px))) + 84px);
        column-gap: 12px; padding: 20px 10px 16px 14px; border-radius: 18px;
    }
    html body .st-card::after { right: 10px; bottom: 10px; width: 78px; }
    html body .st-card__emblem { width: 46px; height: 46px; margin: 4px; font-size: 23px; }
    html body .st-card__title { font-size: 14.5px; line-height: 1.4; }
    html body .st-card__sub { font-size: 12px; }
    html body .st-card__close { margin: -8px -2px 0 0; width: 30px; height: 30px; }
}

@media (prefers-reduced-motion: reduce) {
    html.st-accent #header-container::after, html.st-accent.st-no-header body::before, html body .st-card__emblem { animation: none !important; }
    html body .st-card { transition: opacity .2s ease; transform: none; }
    .st-particles { display: none; }
}
@media print { html body .st-card, .st-particles { display: none !important; } html.st-accent #header-container::after, html.st-accent body::before { display: none; } }
