/* «Пульс» — городской портал как приложение. Шрифт — Onest во всех ролях.
   Токены из theme.json: --sf-bg, --sf-surface, --sf-text, --sf-muted, --sf-primary, --sf-border, --sf-sky, --sf-urgent, --sf-font-display.
   Иерархия скруглений: ведущий материал 28, плитки и карточки 18, чипы — полностью. Тени только у всплывающих слоёв. */
.pl { --pl-r-lg: 28px; --pl-r: 18px; --pl-head-h: 64px; }
.pl-lock, .pl-lock body { overflow: hidden; }
.pl .sf-container { width: min(1200px, 100% - 32px); }
.pl :focus-visible { outline: 3px solid var(--sf-primary); outline-offset: 2px; border-radius: 6px; }

/* ---------- Шапка ---------- */
/* Размытие — на псевдоэлементе: backdrop-filter на самой шапке сделал бы её контейнером для position: fixed и обрезал шторку меню */
.pl-head { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid color-mix(in srgb, var(--sf-border) 70%, transparent); }
.pl-head::before { content: ""; position: absolute; inset: 0; z-index: -1; background: color-mix(in srgb, var(--sf-bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); }
.pl-head__inner { display: flex; align-items: center; gap: 14px; height: var(--pl-head-h); }
.pl-logo { font-family: var(--sf-font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: -.02em; color: var(--sf-text); text-decoration: none; white-space: nowrap; }
.pl-logo img { height: 40px; width: auto; display: block; }
.pl-nav { display: flex; gap: 2px; margin-left: 10px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.pl-nav::-webkit-scrollbar { display: none; }
.pl-nav a { padding: 8px 12px; border-radius: 999px; color: var(--sf-muted); text-decoration: none; font-weight: 600; white-space: nowrap; }
.pl-nav a:hover { color: var(--sf-text); background: var(--sf-surface); }
.pl-nav a[aria-current="page"] { color: var(--sf-primary); background: var(--sf-sky); }
.pl-head__tools { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.pl-btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; min-width: 40px; justify-content: center; padding: 0 10px; border-radius: 999px; border: 0; background: transparent; color: var(--sf-text); text-decoration: none; font: inherit; font-weight: 600; cursor: pointer; }
.pl-btn:hover { background: var(--sf-surface); }
.pl .tpl-mode { width: 40px; height: 40px; border: 0; background: transparent; }
.pl .tpl-mode:hover { background: var(--sf-surface); }
.pl .tpl-weather-badge { height: 40px; padding: 0 12px; border-radius: 999px; }
.pl-account { background: var(--sf-sky); color: var(--sf-primary); }
.pl-account:hover { background: color-mix(in srgb, var(--sf-sky) 70%, var(--sf-primary) 12%); }

/* Меню-шторка (<details>) */
.pl-menu > summary { list-style: none; }
.pl-menu > summary::-webkit-details-marker { display: none; }
.pl-menu__panel { position: fixed; inset: 0 auto 0 0; width: min(380px, 88vw); background: var(--sf-bg); z-index: 60; isolation: isolate; padding: 16px 20px 32px; overflow-y: auto; box-shadow: 0 0 0 100vmax rgba(8, 15, 30, .45), 0 20px 60px rgba(8, 15, 30, .3); }
@media (prefers-reduced-motion: no-preference) { .pl-menu[open] .pl-menu__panel { animation: pl-slide .22s ease-out; } }
@keyframes pl-slide { from { transform: translateX(-24px); opacity: 0; } }
.pl-menu__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.pl-menu__title { font-family: var(--sf-font-display); font-weight: 700; }
.pl-menu__search { display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 999px; background: var(--sf-surface); margin-bottom: 18px; color: var(--sf-muted); }
.pl-menu__search input { flex: 1; border: 0; background: transparent; padding: 12px 0; font: inherit; color: var(--sf-text); outline: none; }
.pl-menu__group { display: grid; margin-bottom: 18px; }
.pl-menu__group h2 { font-size: .85rem; color: var(--sf-muted); font-weight: 600; margin: 0 0 6px; }
.pl-menu__group a { padding: 10px 0; color: var(--sf-text); text-decoration: none; font-size: 1.05rem; font-weight: 600; border-bottom: 1px solid var(--sf-border); }
.pl-menu__group a[aria-current="page"] { color: var(--sf-primary); }

@media (max-width: 960px) { .pl-nav { display: none; } }
@media (max-width: 600px) { .pl-hide-sm { display: none !important; } .pl-head__inner { gap: 8px; } .pl-logo { font-size: 1rem; } }

/* ---------- Пульс города ---------- */
.pl-main { padding-top: 0; }
.pl-pulse { padding: 18px 0 6px; }
.pl-stories { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: none; scroll-snap-type: x proximity; }
.pl-stories::-webkit-scrollbar { display: none; }
.pl-story { flex: 0 0 76px; display: grid; justify-items: center; gap: 6px; text-decoration: none; color: var(--sf-text); scroll-snap-align: start; }
.pl-story__ring { width: 72px; height: 72px; border-radius: 50%; padding: 3px; background: conic-gradient(from 210deg, var(--sf-primary), #29c4ff, var(--sf-primary)); display: grid; place-items: center; }
.pl-story__ring.is-urgent { background: conic-gradient(from 210deg, var(--sf-urgent), #ffb03a, var(--sf-urgent)); }
.pl-story__ring img { width: 66px; height: 66px; aspect-ratio: 1; border-radius: 50%; object-fit: cover; border: 3px solid var(--sf-bg); display: block; }
.pl-story.is-seen .pl-story__ring { background: var(--sf-border); }
.pl-story__title { font-size: .75rem; line-height: 1.2; text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--sf-muted); }

.pl-now { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.pl-now::-webkit-scrollbar { display: none; }
.pl-tile { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 14px; padding: 14px 18px; border-radius: var(--pl-r); background: var(--sf-surface); color: var(--sf-text); text-decoration: none; min-height: 84px; }
.pl-tile:hover { background: var(--sf-sky); }
.pl-tile__big { font-family: var(--sf-font-display); font-size: 2.2rem; font-weight: 700; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: var(--sf-primary); }
.pl-tile__text { font-size: .85rem; color: var(--sf-muted); line-height: 1.35; }
.pl-tile__text b { display: block; color: var(--sf-text); font-size: .95rem; }
.pl-tile--weather { grid-template-columns: auto auto 1fr; background: linear-gradient(135deg, var(--sf-sky), var(--sf-surface)); }
.pl-tile--weather .pl-tile__big { color: var(--sf-text); }
.pl-tile__icon { font-size: 1.8rem; }
.pl-tile--alert { background: color-mix(in srgb, var(--sf-urgent) 14%, var(--sf-bg)); color: var(--sf-text); grid-template-columns: auto 1fr; font-size: .9rem; }
.pl-tile--alert .pl-i { color: var(--sf-urgent); width: 28px; height: 28px; }
.pl-tile--alert b { color: var(--sf-urgent); }

.pl-urgent { display: flex; gap: 12px; align-items: center; margin-top: 14px; padding: 12px 18px; border-radius: var(--pl-r); background: var(--sf-urgent); color: #fff; text-decoration: none; font-weight: 600; }
.pl-urgent span { padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, .22); font-size: .85rem; }

/* ---------- Главная: ведущий материал, лента, правая колонка ---------- */
.pl-home { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; padding-top: 20px; align-items: start; }
@media (max-width: 1024px) { .pl-home { grid-template-columns: 1fr; } }
.pl-lead { position: relative; border-radius: var(--pl-r-lg); overflow: hidden; background: var(--sf-text); isolation: isolate; }
.pl-lead__img { aspect-ratio: 16 / 9; }
.pl-lead__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pl-lead__body { position: absolute; inset: auto 0 0; padding: 80px 32px 28px; background: linear-gradient(180deg, transparent, rgba(8, 15, 30, .82) 55%); color: #fff; display: grid; gap: 8px; justify-items: start; }
.pl-lead__title { font-family: var(--sf-font-display); font-weight: 700; font-size: clamp(1.5rem, 2.8vw, 2.4rem); line-height: 1.12; letter-spacing: -.025em; margin: 0; max-width: 24ch; }
.pl-lead__title a { color: #fff; text-decoration: none; }
.pl-lead__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.pl-lead__text { margin: 0; max-width: 56ch; opacity: .88; }
.pl-lead time { font-size: .85rem; opacity: .7; }
.pl-lead--text { background: var(--sf-sky); }
.pl-lead--text .pl-lead__body { position: static; background: none; color: var(--sf-text); padding: 32px; }
.pl-lead--text .pl-lead__title a { color: var(--sf-text); }
@media (max-width: 600px) {
    .pl-lead { border-radius: var(--pl-r); }
    .pl-lead__img { aspect-ratio: 4 / 3; }
    .pl-lead__body { padding: 60px 18px 18px; }
}

.pl-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--sf-sky); color: var(--sf-primary); font-size: .78rem; font-weight: 700; }
.pl-chip--urgent { background: var(--sf-urgent); color: #fff; }

.pl-feed { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px; margin-top: 28px; }
@media (max-width: 600px) { .pl-feed { grid-template-columns: 1fr; gap: 22px; } }
/* Карточка новости (общая разметка news:_card) в «Пульсе» */
.pl .tpl-card { display: grid; gap: 10px; align-content: start; }
.pl .tpl-card__img { border-radius: var(--pl-r); aspect-ratio: 3 / 2; }
.pl .tpl-card__title { font-family: var(--sf-font); font-weight: 700; font-size: 1.12rem; line-height: 1.3; margin: 0; }
.pl .tpl-card__title a { color: var(--sf-text); text-decoration: none; }
.pl .tpl-card__title a:hover { color: var(--sf-primary); }
.pl .tpl-card__meta { color: var(--sf-muted); font-size: .85rem; }
.pl .tpl-badge--urgent { background: var(--sf-urgent); border-radius: 999px; }
@media (max-width: 600px) {
    .pl-feed .tpl-card:not(.tpl-card--big):has(.tpl-card__img) { grid-template-columns: 112px 1fr; gap: 14px; align-items: start; }
    .pl-feed .tpl-card__img { aspect-ratio: 1; border-radius: 14px; }
    .pl-feed .tpl-card__title { font-size: 1rem; }
}
/* Вставки в ленту: афиша и объявление — другой ритм */
.pl-card { display: grid; grid-template-columns: 112px 1fr; gap: 16px; padding: 14px; border-radius: var(--pl-r); background: var(--sf-surface); color: var(--sf-text); text-decoration: none; align-items: center; }
.pl-card:hover { background: var(--sf-sky); }
.pl-card__poster, .pl-card__photo { border-radius: 12px; overflow: hidden; background: var(--sf-bg); display: grid; place-items: center; color: var(--sf-muted); }
.pl-card__poster { aspect-ratio: 3 / 4; }
.pl-card__photo { aspect-ratio: 1; }
.pl-card__poster img, .pl-card__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pl-card__body { display: grid; gap: 6px; justify-items: start; }
.pl-card__body b { font-size: 1.05rem; line-height: 1.3; }
.pl-card__meta { color: var(--sf-muted); font-size: .85rem; }
.pl-card__price { font-family: var(--sf-font-display); font-weight: 700; font-size: 1.05rem; }
.pl-more { margin-top: 26px; }

/* Правая колонка */
.pl-rail { position: sticky; top: calc(var(--pl-head-h) + 16px); display: grid; gap: 20px; }
@media (max-width: 1024px) { .pl-rail { position: static; } }
.pl-rail__box { padding: 20px; border-radius: var(--pl-r); background: var(--sf-surface); }
.pl-h { font-family: var(--sf-font-display); font-weight: 700; font-size: 1.4rem; letter-spacing: -.02em; margin: 0 0 14px; }
.pl-h a { color: var(--sf-text); text-decoration: none; }
.pl-h a:hover { color: var(--sf-primary); }
.pl-timeline { list-style: none; margin: 0; padding: 0; }
.pl-timeline li { display: grid; grid-template-columns: 44px 1fr; gap: 8px; padding: 10px 0; border-top: 1px solid var(--sf-border); line-height: 1.35; }
.pl-timeline li:first-child { border-top: 0; padding-top: 0; }
.pl-timeline time { color: var(--sf-muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.pl-timeline a { color: var(--sf-text); text-decoration: none; font-size: .95rem; }
.pl-timeline a:hover { color: var(--sf-primary); }
.pl-timeline li.is-urgent time { color: var(--sf-urgent); font-weight: 700; }
.pl-timeline li.is-urgent a { font-weight: 700; }

/* Разделы: горизонтальная прокрутка на телефоне, сетка на компьютере */
.pl-section { margin-top: 44px; }
.pl-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 960px) { .pl-row { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: minmax(240px, 72%); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 6px; } .pl-row > * { scroll-snap-align: start; } }
.pl-empty { padding: 32px; border-radius: var(--pl-r); background: var(--sf-sky); }

/* ---------- Внутренние страницы: общий стиль модулей ---------- */
.pl .sf-h1, .pl .sf-h2, .pl .tpl-article__title { font-family: var(--sf-font-display); font-weight: 700; letter-spacing: -.02em; }
.pl .sf-h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.pl .sf-h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.pl .tpl-article__title { font-size: clamp(1.6rem, 3.2vw, 2.4rem); line-height: 1.15; }
.pl .btn { border-radius: 999px; }
.pl .sf-card { border-radius: var(--pl-r); border-color: transparent; }
.pl .tpl-ad, .pl .tpl-org { border-radius: var(--pl-r); border-color: transparent; background: var(--sf-surface); }
.pl .tpl-event__poster { border-radius: var(--pl-r); }
.pl .tpl-tags a, .pl .tpl-periods a { border-radius: 999px; }
.pl .tpl-crumbs { font-size: .85rem; color: var(--sf-muted); }
.pl input, .pl select, .pl textarea { border-radius: 12px; }

/* ---------- Подвал ---------- */
.pl-foot { margin-top: 64px; background: var(--sf-surface); border-top: 1px solid var(--sf-border); }
.pl-foot__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; padding: 40px 0 28px; }
@media (max-width: 860px) { .pl-foot__grid { grid-template-columns: 1fr 1fr; } .pl-foot__about { grid-column: 1 / -1; } }
.pl-logo--foot { font-size: 1.3rem; }
.pl-foot__about p { color: var(--sf-muted); }
.pl-foot__reg { font-size: .82rem; line-height: 1.55; }
.pl-foot__col { display: grid; gap: 9px; align-content: start; }
.pl-foot__col h2 { font-size: .9rem; color: var(--sf-muted); font-weight: 600; margin: 0 0 4px; }
.pl-foot a { color: var(--sf-text); text-decoration: none; }
.pl-foot a:hover { color: var(--sf-primary); }
.pl-foot__bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 0 24px; border-top: 1px solid var(--sf-border); color: var(--sf-muted); font-size: .85rem; }
.pl-age { padding: 2px 8px; border-radius: 999px; border: 1.5px solid currentColor; font-weight: 700; }

/* ---------- Нижнее меню (телефон) ---------- */
.pl-tabs { display: none; }
@media (max-width: 760px) {
    .pl-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; inset: auto 0 0; z-index: 45; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
        background: color-mix(in srgb, var(--sf-bg) 88%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-top: 1px solid var(--sf-border); }
    .pl-tabs a { display: grid; justify-items: center; gap: 3px; padding: 6px 0; color: var(--sf-muted); text-decoration: none; font-size: .7rem; font-weight: 600; border-radius: 14px; }
    .pl-tabs a[aria-current="page"] { color: var(--sf-primary); }
    .pl-tabs a[aria-current="page"] .pl-i { background: var(--sf-sky); border-radius: 999px; padding: 3px 14px; box-sizing: content-box; }
    .pl { padding-bottom: 76px; }
}

/* ---------- Просмотр историй ---------- */
.pl-viewer { position: fixed; inset: 0; z-index: 100; background: #050a14; color: #fff; display: grid; place-items: center; }
.pl-viewer[hidden] { display: none; }
.pl-viewer__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 760px) { .pl-viewer__img { object-fit: cover; } }
.pl-viewer__bars { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; gap: 4px; z-index: 2; }
.pl-viewer__bars span { flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.pl-viewer__bars i { display: block; height: 100%; width: 0; background: #fff; }
.pl-viewer__close { position: absolute; top: 24px; right: 14px; z-index: 3; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .35); color: #fff; font-size: 1.1rem; cursor: pointer; }
.pl-viewer__body { position: absolute; inset: auto 0 0; padding: 120px max(20px, calc(50% - 320px)) calc(28px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(5, 10, 20, .92) 50%); z-index: 2; display: grid; gap: 10px; justify-items: start; }
.pl-viewer__body h2 { font-family: var(--sf-font-display); font-size: clamp(1.3rem, 4vw, 2rem); line-height: 1.2; margin: 0; }
.pl-viewer__body time { opacity: .75; font-size: .9rem; }
.pl-viewer__nav { position: absolute; top: 60px; bottom: 180px; width: 35%; border: 0; background: transparent; cursor: pointer; z-index: 1; }
.pl-viewer__nav--prev { left: 0; }
.pl-viewer__nav--next { right: 0; }
.pl-nav.is-overflow { -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
.pl-head:has(.pl-menu[open]) { z-index: 70; }
.pl .tpl-badge { text-transform: none; letter-spacing: 0; border-radius: 999px; }
.pl .sf-check { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
