:root{
  --bg:#F4F6FA; --paper:#fff; --ink:#0B1220; --muted:#475569; --line:#E5E7EB;
  --accent:#B91C1C; --link:#1D4ED8; --good:#16A34A; --warn:#F59E0B;
  --radius:14px; --radius2:18px;
  --shadow:0 12px 28px rgba(15,23,42,.10);
  --shadow2:0 7px 18px rgba(15,23,42,.08);
  --max:1280px; --pad: clamp(14px, 2.4vw, 26px);
  --h1: clamp(26px, 3.0vw, 44px);
  --h2: clamp(18px, 2.0vw, 26px);
  --h3: 16px;
}
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  color:var(--ink);
  background:
    radial-gradient(900px 520px at 10% -10%, rgba(29,78,216,.07), transparent 60%),
    radial-gradient(900px 520px at 90% 0%, rgba(185,28,28,.06), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg));
  overflow-x:hidden;
}

/* === Shortstory fallback width ===
   Иногда DLE выводит ленты shortstory без обёртки (container/page).
   Тогда элементы растягиваются на всю ширину окна.
   Этот блок принудительно ограничивает ширину до контейнера (как у бегущей строки).
*/
body > a.feedItem,
#dle-content > a.feedItem,
body > #dle-content > a.feedItem{
  width:min(var(--max), calc(100% - (var(--pad)*2)));
  margin-inline:auto;
  margin-top:10px;
}
body > a.feedItem:first-of-type,
#dle-content > a.feedItem:first-of-type,
body > #dle-content > a.feedItem:first-of-type{ margin-top:18px; }
body > a.feedItem:last-of-type,
#dle-content > a.feedItem:last-of-type,
body > #dle-content > a.feedItem:last-of-type{ margin-bottom:18px; }
/* пагинация/навигация, если выводится без обёртки */
body > .pager,
body > .navigation,
body > .pagination,
body > #dle-content,
body > #dle-content > .pager,
body > #dle-content > .navigation,
body > #dle-content > .pagination{
  width:min(var(--max), calc(100% - (var(--pad)*2)));
  margin-inline:auto;
}
a{ color:inherit; text-decoration:none; }
a:hover{ text-decoration:underline; text-underline-offset: 3px; }
.container{ width:min(var(--max), calc(100% - (var(--pad)*2))); margin-inline:auto; }
.muted{ color:var(--muted); }

/* === To top button === */
.toTop{
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.78);
  color: var(--ink);
  box-shadow: var(--shadow2);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 1200;
}
.toTop.is-visible{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.toTop:hover{ transform: translateY(-1px); }
.toTop:active{ transform: translateY(0); }
:root[data-theme="dark"] .toTop{
  background: rgba(15,23,42,.66);
  border-color: rgba(255,255,255,.10);
}

/* === Preloader === */
.preloader{
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 520px at 10% -10%, rgba(29,78,216,.12), transparent 60%),
    radial-gradient(900px 520px at 90% 0%, rgba(185,28,28,.10), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg));
  transition: opacity .25s ease, visibility .25s ease;
}
.preloader.is-hidden{ opacity: 0; visibility: hidden; pointer-events: none; }
.preloader__inner{
  width: min(420px, calc(100% - 10px));
  padding: 22px 20px;
  border-radius: var(--radius2);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  text-align: center;
}
:root[data-theme="dark"] .preloader__inner{
  background: rgba(15,23,42,.68);
  border-color: rgba(255,255,255,.08);
}
.preloader__logo{
  width: 76px;
  height: 76px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
.preloader__text{
  margin-top: 12px;
  font-weight: 800;
  letter-spacing: .2px;
}
.preloader__dots i{
  display:inline-block;
  width:6px; height:6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .25;
  margin-left: 4px;
  animation: preloaderDot 1.05s infinite;
}
.preloader__dots i:nth-child(2){ animation-delay: .15s; }
.preloader__dots i:nth-child(3){ animation-delay: .3s; }
@keyframes preloaderDot{
  0%, 100%{ opacity: .25; transform: translateY(0); }
  50%{ opacity: .95; transform: translateY(-1px); }
}
.preloader__bar{
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 14px;
  background: rgba(148,163,184,.35);
}
:root[data-theme="dark"] .preloader__bar{ background: rgba(148,163,184,.22); }
.preloader__barFill{
  display:block;
  height: 100%;
  width: 34%;
  border-radius: 999px;
  background: var(--accent);
  animation: preloaderBar 1.15s ease-in-out infinite;
}
@keyframes preloaderBar{
  0%{ transform: translateX(-140%); }
  100%{ transform: translateX(420%); }
}
@media (prefers-reduced-motion: reduce){
  .preloader__dots i, .preloader__barFill{ animation: none !important; }
}

/* Fullstory top banner spacing */
#ads{ margin-bottom: 18px; }

.btn{
  display:inline-flex; align-items:center; gap:10px;
  padding:10px 12px; border-radius:999px; border:1px solid var(--line);
  background: rgba(255,255,255,.9);
  box-shadow: 0 1px 0 rgba(15,23,42,.03);
  transition: transform .15s ease, box-shadow .15s ease;
  cursor:pointer;
}
.btn:hover{ transform: translateY(-1px); box-shadow: var(--shadow2); text-decoration:none; }
.btn.primary{
  border-color: rgba(185,28,28,.22);
  background: rgba(185,28,28,.08);
  color: var(--accent);
  font-weight:850;
}
.pill{
  padding:7px 10px; border-radius:999px; border:1px solid var(--line);
  background:#fff; color:var(--muted); font-weight:650;
}
.pill:hover{ text-decoration:none; color:var(--ink); }

.chip{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px; border-radius:999px;
  border:1px solid var(--line); background:#fff;
  color:var(--muted); font-weight:650; font-size:13px;
}
.chip.dot::before{
  content:""; width:8px; height:8px; border-radius:999px; background: var(--accent);
  box-shadow: 0 0 0 4px rgba(185,28,28,.12);
}

header{
  position:relative; top:0; z-index:60;
  background: rgba(244,246,250,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding: 12px 0; }
.brand{ display:flex; align-items:center; gap:12px; font-weight:950; letter-spacing:.2px; }
.logo{
  width:34px; height:34px; border-radius:10px;
  background: linear-gradient(135deg, var(--accent), #EF4444);
  box-shadow: 0 10px 20px rgba(185,28,28,.18);
}
.brand small{ display:block; font-weight:650; color:var(--muted); letter-spacing:.1px; }
.nav{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.nav a{ padding:8px 10px; border-radius:999px; border:1px solid transparent; color:var(--muted); font-weight:650; }
.nav a:hover{ text-decoration:none; color:var(--ink); border-color:var(--line); background: rgba(255,255,255,.85); }

.search{
  display:flex; align-items:center; gap:10px;
  padding:10px 12px; border-radius:999px;
  border:1px solid var(--line); background: rgba(255,255,255,.9);
  min-width: min(520px, 48vw);
}
.search input{ width:100%; border:0; outline:0; background:transparent; }
.search kbd{ font-size:12px; color:var(--muted); border:1px solid var(--line); background:#fff; padding:2px 8px; border-radius:10px; }

.hamburger{ display:none; width:42px; height:42px; border-radius:999px; }
.hamburger span{ width:18px; height:2px; background: var(--ink); display:block; margin:0 auto; position:relative; }
.hamburger span::before, .hamburger span::after{ content:""; position:absolute; left:0; width:18px; height:2px; background:var(--ink); }
.hamburger span::before{ top:-6px; } .hamburger span::after{ top:6px; }
.drawer{ display:none; border-top:1px solid var(--line); padding: 10px 0 14px; }
.drawer.open{ display:block; }
.drawer .row{ display:flex; flex-wrap:wrap; gap:10px; }

.breaking{
  border-top:1px solid rgba(15,23,42,.06);
  border-bottom:1px solid rgba(15,23,42,.06);
  background:#fff;
}
.breaking-inner{
  display:flex; align-items:center; gap:12px;
  padding: 10px 0;
  overflow:hidden;
}
.label{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px; border-radius:999px;
  background: rgba(185,28,28,.10);
  color: var(--accent);
  border:1px solid rgba(185,28,28,.20);
  font-weight:900;
  white-space:nowrap;
}
.marquee{ display:flex; gap:14px; white-space:nowrap; will-change: transform; animation: scroll var(--mq-duration, 18s) linear infinite; }
@keyframes scroll{ to{ transform: translateX(-50%); } }

main{ padding: 16px 0 26px; }
.ad{
  display:grid; place-items:center; text-align:center;
  
  border-radius: var(--radius2);
  min-height: auto;
  color: rgba(15,23,42,.72);
}
.ad b{ color: var(--ink); }
.ad small{ display:block; margin-top:6px; color: rgba(15,23,42,.58); }

.page{
  display:grid;
  grid-template-columns: 1fr 360px;
  gap: clamp(14px, 2.2vw, 22px);
  align-items:start;
  margin-top: 14px;
}

/* category / news listing: keep readable line length on wide screens */
.page--category{ grid-template-columns: minmax(0, 920px) 360px; justify-content:center; }
.page--category .stack{ min-width:0; }
.stack{ display:flex; flex-direction:column; gap:12px; }

.card{
  background: var(--paper);
  border:1px solid var(--line);
  border-radius: var(--radius2);
  box-shadow: var(--shadow2);
  overflow:hidden;
}
.card.pad{ padding: 14px; }
.card-head{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
  padding: 12px 14px;
  border-bottom:1px solid var(--line);
  background:#FAFAFB;
}
.card-title{
  margin:0;
  font-size: 14px;
  letter-spacing:.18px;
  color: var(--muted);
  font-weight:900;
  text-transform: uppercase;
}

/* hero */
.hero{ display:grid; grid-template-columns: 1.2fr .8fr; gap: 12px; }
.heroMain{ padding: 16px; }
.heroMain h1{ margin: 10px 0 10px; font-size: var(--h1); line-height: 1.06; letter-spacing: -0.02em; }
.heroMain p{ margin:0; color:var(--muted); line-height:1.6; max-width: 76ch; }
.heroImg{
  border-left:1px solid var(--line);
  background-image:
    var(--img, none),
    linear-gradient(120deg, rgba(29,78,216,.10), rgba(185,28,28,.08)),
    radial-gradient(280px 160px at 20% 20%, rgba(255,255,255,.85), transparent 55%);
  background-size: cover, auto, auto;
  background-position: center, center, center;
  background-repeat: no-repeat, no-repeat, no-repeat;
  min-height: 260px;
  position:relative;
}
.heroImg::after{
  content:"Фото / превью";
  position:absolute; bottom:10px; left:10px;
  font-size:12px; color: rgba(15,23,42,.56);
  background: rgba(255,255,255,.85);
  border:1px solid var(--line);
  padding: 4px 8px;
  border-radius: 999px;
}

.heroImgLink{ display:block; text-decoration:none; color:inherit; }
.heroImgLink:focus-visible{ outline: 3px solid rgba(29,78,216,.25); outline-offset: 3px; border-radius: 18px; }

/* ===== Fullstory gallery (фото из полного описания) ===== */
.fsGallery{
  position: relative;
  max-width: 760px;
  /* keep breathing room before AND after gallery */
  margin: 18px auto 26px;
  border-radius: 16px;
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow2);
  background: rgba(255,255,255,.6);
}

/* Fullstory: rail spacing (ads + related) */
.railStack > * + *{ margin-top: 14px; }

/* If any empty reveal/card blocks slip through – hide them (prevents "card pad reveal in" blank blocks) */
.card.pad.reveal.in:empty{ display:none; }

/* Fullstory card padding (readability) */
.fullStory.card.pad{ padding: 22px; }
@media (max-width: 900px){ .fullStory.card.pad{ padding: 14px; } }

/* Comments card: a bit more air so text/controls don't stick to the border */
.commentsCard.card.pad{ padding: 18px; }
@media (max-width: 900px){ .commentsCard.card.pad{ padding: 14px; } }

/* Rail cards on fullstory: keep headings readable, not glued to the border */
.rail .card.pad h2{ margin: 0 0 10px; }
.rail .card.pad .ad{ margin-top: 8px; }
.fsViewport{ overflow:hidden; width:100%; }
.fsTrack{
  display:flex;
  transition: transform .45s ease;
  will-change: transform;
}
.fsSlide{ min-width:100%; margin:0; }
.fsSlide img{
  width:100%;
  height: 380px;
  object-fit: cover;
  display:block;
}
@media (max-width: 900px){
  .fsSlide img{ height: 240px; }
}

.fsBtn{
  position:absolute;
  top:50%;
  transform: translateY(-50%);
  width:42px;
  height:42px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.82);
  cursor:pointer;
  display:grid;
  place-items:center;
  font-size: 24px;
  line-height: 1;
  z-index: 2;
}
.fsBtn.prev{ left: 10px; }
.fsBtn.next{ right: 10px; }
.fsBtn:active{ transform: translateY(-50%) translateY(1px); }

.fsDots{
  position:absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display:flex;
  justify-content:center;
  gap:8px;
  z-index:2;
}
.fsDots button{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.18);
  background: rgba(255,255,255,.55);
  cursor:pointer;
  padding:0;
}
.fsDots button.active{
  background: rgba(244,63,94,.85);
  border-color: rgba(244,63,94,.35);
}

/* Если фото вынесены в слайдер — скрываем картинки в тексте статьи (только после инициализации галереи) */
.fullStory.has-fsgallery .articleText img{ display:none !important; }
.fullStory.has-fsgallery .articleText a.highslide{ display:none !important; }


/* Readability helpers (длинные ссылки/слова не ломают верстку) */
.fullStory .lead,
.fullStory .articleText{
  overflow-wrap: anywhere;
  word-break: break-word;
}
.fullStory .articleText pre,
.fullStory .articleText code{
  max-width: 100%;
}
.fullStory .articleText pre{
  overflow: auto;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(15,23,42,.03);
}

/* Typography for fullstory */
.fullStory .title{
  margin: 10px 0 0;
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.fullStory .lead{
  max-width: 760px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}
.fullStory .lead img,
.fullStory .lead a.highslide{ display:none !important; }

.fullStory .articleText{
  max-width: 760px;
  margin: 16px auto 0;
  font-size: 17px;
  line-height: 1.75;
}

/* Keep some inner side padding on very narrow screens */
@media (max-width: 520px){
  .fullStory .lead,
  .fullStory .articleText{ max-width: 100%; }
}
.fullStory .articleText p{ margin: 0 0 1.05em; }
.fullStory .articleText h2,
.fullStory .articleText h3{
  margin: 1.25em 0 .6em;
  line-height: 1.22;
  letter-spacing: -0.01em;
}
.fullStory .articleText ul,
.fullStory .articleText ol{ margin: .2em 0 1.1em 1.2em; }
.fullStory .articleText blockquote{
  margin: 1.1em 0;
  padding: 14px 16px;
  border-left: 3px solid rgba(244,63,94,.55);
  background: rgba(15,23,42,.03);
  border-radius: 14px;
}
.fullStory .articleText table{
  width:100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow:hidden;
  margin: 1em 0;
}
.fullStory .articleText th,
.fullStory .articleText td{
  border-bottom:1px solid var(--line);
  padding: 10px 12px;
  vertical-align: top;
}
.fullStory .articleText th{ background:#FAFAFB; text-align:left; }

/* Sidebar related list tweaks */
.rail .feedItem{ padding: 10px; border-radius: 14px; }
.rail .feedItem .mini{ width:72px; min-width:72px; height:54px; border-radius: 12px; }

/* Comments (DLE) */
.commentsCard .section-head p{ margin-top: 4px; }
.commentsList{ display:flex; flex-direction:column; gap:12px; }
.commentsNav{ margin-top: 12px; }
.commentsForm{ margin-top: 14px; }

.commentItem{
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.commentHead{
  display:flex;
  gap:12px;
  align-items:flex-start;
  justify-content:space-between;
  flex-wrap:wrap;
}
.commentAvatar{
  width:42px;
  min-width:42px;
  height:42px;
  border-radius: 14px;
  border:1px solid var(--line);
  background-image: var(--img, none), linear-gradient(120deg, rgba(15,23,42,.08), rgba(15,23,42,.03));
  background-size: cover, auto;
  background-position: center, center;
}
.commentMeta{ flex:1; min-width: 180px; }
.commentAuthor{ font-weight: 900; line-height:1.2; }
.commentDate{ color: var(--muted); font-size: 12px; margin-top: 2px; }
.commentBtns{ display:flex; gap:8px; flex-wrap:wrap; }
.commentBtns a{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(15,23,42,.02);
  font-size: 12px;
  font-weight: 800;
  color: var(--link);
  text-decoration:none;
}
.commentBtns a:hover{ transform: translateY(-1px); box-shadow: var(--shadow2); }
.commentBody{ margin-top: 10px; line-height: 1.65; }
.commentBody img{ max-width:100%; height:auto; border-radius: 12px; }

/* Highlight newly scrolled-to comment */
.commentHighlight{
  outline: 3px solid rgba(29,78,216,.18);
  box-shadow: var(--shadow2);
  transition: outline-color .25s ease;
}

.commentForm{ margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.commentGrid{ display:grid; grid-template-columns: repeat(2, 1fr); gap:10px; margin-bottom: 12px; }
@media (max-width: 640px){ .commentGrid{ grid-template-columns: 1fr; } }
.commentEditor{ margin-top: 12px; }
.commentLabel{ display:block; font-size: 13px; color: var(--muted); font-weight: 850; margin: 0 0 6px; }
.commentField input,
.commentField textarea{
  width:100%;
  border:1px solid var(--line);
  border-radius: 14px;
  padding: 12px 12px;
  background:#fff;
  color: var(--ink);
  outline: none;
}

/* Make "Отправить" clearly visible on mobile/light theme (DLE can output either <button> or <input type=submit>) */
.commentsCard button#submit,
.commentsCard .commentActions .btn,
.commentsCard input[type="submit"],
.commentsCard input#submit{
  color: var(--ink) !important;
}
:root:not([data-theme="dark"]) .commentsCard input[type="submit"],
:root:not([data-theme="dark"]) .commentsCard input#submit,
:root:not([data-theme="dark"]) .commentsCard button#submit{
  background: rgba(185,28,28,.08);
  border-color: rgba(185,28,28,.18);
  font-weight: 900;
}
.commentField input:focus,
.commentField textarea:focus{ box-shadow: 0 0 0 4px rgba(29,78,216,.12); border-color: rgba(29,78,216,.35); }
.commentEditor textarea{ width:100%; min-height: 160px; }

/* Modern look for WysiBB editor (DLE {editor}) */
.commentEditor .wysibb{
  border:1px solid var(--line) !important;
  border-radius: 16px !important;
  overflow:hidden;
  background: var(--paper);
}
.commentEditor .wysibb-toolbar{
  border-bottom:1px solid var(--line) !important;
  background: rgba(15,23,42,.02) !important;
  padding: 8px 10px !important;
}
.commentEditor .wysibb-toolbar .wysibb-toolbar-btn{
  border-radius: 12px !important;
}
.commentEditor .wysibb-text textarea,
.commentEditor .wysibb-text{
  font-size: 15px !important;
  line-height: 1.6 !important;
}
.commentEditor .wysibb-textarea{
  padding: 12px !important;
}

.commentCaptcha #dle-captcha{ display:inline-block; border:1px solid var(--line); border-radius: 14px; overflow:hidden; }
.commentCaptcha img{ display:block; max-width: 100%; height:auto; }

/* Tighten classic DLE form bits if any slip through */
.commentsCard table{ width:100%; }
.commentsCard input[type="text"],
.commentsCard input[type="email"],
.commentsCard textarea{
  border-radius: 14px;
  border:1px solid var(--line);
}
.commentCaptcha{ margin-top: 10px; }
.commentActions{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-top: 12px; }
.commentSubscribe{ color: var(--muted); font-size: 13px; }

/* Ensure submit text is readable on mobile/light (some browsers override button text colors) */
.commentsCard button,
.commentsCard .btn,
.commentsCard input[type="submit"],
.commentsCard input[type="button"]{
  color: var(--ink) !important;
}

/* Give submit a clearer look (works for both <button> and <input type=submit>) */
.commentsCard button#submit,
.commentsCard input#submit,
.commentsCard input[type="submit"]{
  background: rgba(185,28,28,.10) !important;
  border-color: rgba(185,28,28,.22) !important;
  font-weight: 900;
}

/* Comments: mobile polish */
@media (max-width: 640px){
  .commentItem{ padding: 10px 12px; }
  .commentMeta{ min-width: 0; }
  .commentBtns{ width: 100%; }
  .commentBtns a{ flex: 1 1 auto; justify-content: center; }
  .commentActions .btn{ width: 100%; justify-content: center; }
  .commentSubscribe{ width: 100%; }
  .commentsCard select,
  .commentsCard input[type="button"],
  .commentsCard input[type="submit"],
  .commentsCard button{ max-width: 100%; }
  .commentsCard select,
  .commentsCard input[type="button"],
  .commentsCard input[type="submit"],
  .commentsCard button{ width: 100%; }
  .commentsCard .wysibb-toolbar{ overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Comments navigation (pagination) */
.commentsNav{ display:flex; justify-content:flex-end; }
.commentsNav .pages,
.commentsNav .navigation,
.commentsNav .pagination{ display:flex; flex-wrap:wrap; gap:8px; }
.commentsNav a,
.commentsNav span{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 34px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(15,23,42,.02);
  text-decoration:none;
  font-weight: 850;
  color: var(--ink);
}
.commentsNav a:hover{ transform: translateY(-1px); box-shadow: var(--shadow2); }

/* WysiBB editor (DLE) — modern look */
.commentsCard .wysibb{
  border-radius: 16px !important;
  border: 1px solid var(--line) !important;
  overflow: hidden;
  background: var(--paper) !important;
}
.commentsCard .wysibb-toolbar{
  padding: 10px 10px !important;
  border-bottom: 1px solid var(--line) !important;
  background: rgba(15,23,42,.02) !important;
}
.commentsCard .wysibb-toolbar .wysibb-toolbar-btn{
  border-radius: 12px !important;
}
.commentsCard .wysibb-text textarea{
  padding: 14px 14px !important;
  font-size: 15px !important;
  line-height: 1.65 !important;
  color: var(--text) !important;
  background: transparent !important;
}
.commentsCard .wysibb-body{ background: transparent !important; }
.commentsCard .wysibb-text{ background: transparent !important; }

/* Dark theme adjustments */
:root[data-theme="dark"] .commentItem,
:root[data-theme="dark"] .commentField input,
:root[data-theme="dark"] .commentField textarea{ background: rgba(15,23,42,.55); }
:root[data-theme="dark"] .commentBtns a{ background: rgba(255,255,255,.04); }
:root[data-theme="dark"] .commentEditor .wysibb-toolbar{ background: rgba(255,255,255,.04) !important; }

/* Related cards on fullstory */
.relatedStory .thumb{ height: 130px; }
.relatedStory h3{ margin-bottom: 14px; }
.heroMeta{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-bottom:10px; }
.heroActions{ display:flex; gap:10px; flex-wrap:wrap; margin-top: 14px; }

/* sections */
.section{ margin-top: 16px; }
.section-head{ display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin: 0 0 12px; }
.section-head h2{ margin:0; font-size: var(--h2); letter-spacing:-0.01em; }
.section-head p{ margin:0; color:var(--muted); }

/* grids */
.grid-3{ display:grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-2{ display:grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-4{ display:grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* story cards */
.story{ display:flex; flex-direction:column; transition: transform .15s ease, box-shadow .15s ease; }
.story:hover{ transform: translateY(-2px); box-shadow: var(--shadow); }
.thumbLink{ display:block; text-decoration:none; color:inherit; }
.thumbLink:focus-visible{ outline: 3px solid rgba(29,78,216,.25); outline-offset: 2px; border-radius: 12px; }
.thumb{
  height: 150px;
  border-bottom:1px solid var(--line);
  background-image: var(--img, none), linear-gradient(120deg, rgba(15,23,42,.08), rgba(15,23,42,.03));
  background-size: cover, auto;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}
.story .meta{ display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; padding: 12px 14px 0; color:var(--muted); font-size:13px; }
.tag{ display:inline-flex; align-items:center; gap:8px; padding: 6px 10px; border-radius:999px; border:1px solid var(--line); background:#fff; font-weight:650; }
.tag.red{ color: var(--accent); border-color: rgba(185,28,28,.22); background: rgba(185,28,28,.05); }
.tag.blue{ color: var(--link); border-color: rgba(29,78,216,.20); background: rgba(29,78,216,.04); }
.story h3{ margin: 10px 14px 8px; font-size: var(--h3); line-height:1.28; letter-spacing:-0.01em; }
.story p{ margin: 0 14px 14px; color:var(--muted); line-height:1.55; font-size: 14px; }
.story .foot{ margin-top:auto; padding: 0 14px 14px; display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; color:var(--muted); font-size:13px; }

/* feed list */
.feed{ display:flex; flex-direction:column; gap:10px; }
.feedItem{
  display:flex; gap:12px;
  align-items:flex-start;
  padding: 12px;
  border:1px solid var(--line);
  border-radius: 16px;
  background:#fff;
  transition: transform .15s ease, box-shadow .15s ease;
}
.feedItem:hover{ transform: translateY(-1px); box-shadow: var(--shadow2); text-decoration:none; }
.mini{
  width:92px;
  min-width:92px;
  height:66px;
  border-radius: 14px;
  border:1px solid var(--line);
  background-image: var(--img, none), linear-gradient(120deg, rgba(15,23,42,.08), rgba(15,23,42,.03));
  background-size: cover, auto;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}
.feedItem b{ display:block; line-height:1.22; }
.feedItem small{ color:var(--muted); }
.feedBody{ min-width:0; }
.feedTitle{ font-size: 16px; }
.feedMeta{ display:block; margin-top:4px; }
.feedExcerpt{
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.feedExcerpt img, .feedExcerpt iframe, .feedExcerpt video{ display:none !important; }
.feedActions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; justify-content:flex-end; }

/* calendar + places */
.calendar{ display:flex; flex-direction:column; gap:10px; }
.event{
  display:flex; gap:12px;
  padding: 12px;
  border:1px solid var(--line);
  border-radius: 16px;
  background:#fff;
  transition: transform .15s ease, box-shadow .15s ease;
}
.event:hover{ transform: translateY(-1px); box-shadow: var(--shadow2); text-decoration:none; }
.date{
  width:62px; min-width:62px;
  border-radius: 14px;
  border:1px solid var(--line);
  background:#FAFAFB;
  display:grid; place-items:center;
  padding:8px;
}
.date b{ font-size: 16px; } .date span{ font-size: 12px; color: var(--muted); }

.places{ display:grid; grid-template-columns: repeat(2, 1fr); gap:12px; }
.place{
  display:flex; gap:12px;
  padding: 12px;
  border:1px solid var(--line);
  border-radius: 16px;
  background:#fff;
  transition: transform .15s ease, box-shadow .15s ease;
}
.place:hover{ transform: translateY(-1px); box-shadow: var(--shadow2); text-decoration:none; }
.pin{
  width:42px; min-width:42px; height:42px;
  border-radius: 14px;
  background: rgba(29,78,216,.08);
  border:1px solid rgba(29,78,216,.18);
  display:grid; place-items:center;
  color: var(--link);
  font-weight:900;
}

/* footer */
footer{ margin-top: 20px; border-top:1px solid var(--line); background:#fff; padding: 18px 0 26px; }
.footgrid{ display:grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 14px; }
footer a{ color: var(--muted); }
footer a:hover{ color: var(--ink); text-decoration:none; }
.fine{
  margin-top: 12px; color: rgba(15,23,42,.55); font-size: 13px;
  display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap;
  border-top:1px solid rgba(15,23,42,.06); padding-top: 12px;
}

/* reveal */
.reveal{ opacity:1; transform:none; }
.reveal.in{ opacity:1; transform:none; }

/* search modal */
.modal{
  position: fixed; inset:0; z-index: 999;
  display:none; place-items:center;
  background: rgba(15,23,42,.30);
  backdrop-filter: blur(6px);
  padding: 20px;
}
.modal.open{ display:grid; }
.modalCard{
  width: min(860px, 100%);
  background: rgba(255,255,255,.96);
  border:1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modalTop{
  display:flex; align-items:center; gap:10px;
  padding: 12px 14px;
  border-bottom:1px solid var(--line);
  background:#FAFAFB;
}
.modalTop input{
  width:100%;
  border:1px solid var(--line);
  border-radius: 999px;
  padding: 12px 14px;
  outline:none;
  background:#fff;
}
.modalTop input:focus{
  border-color: rgba(29,78,216,.35);
  box-shadow: 0 0 0 6px rgba(29,78,216,.10);
}
.modalBody{ padding: 14px; }
.modalHint{ color: var(--muted); font-size: 13px; }

/* responsive */
@media (max-width: 1100px){
  .page{ grid-template-columns: 1fr 320px; }
  .page--category{ grid-template-columns: 1fr 320px; }
  .hero{ grid-template-columns: 1fr; }
  .heroImg{ border-left:0; border-top:1px solid var(--line); min-height: 220px; }
}
@media (max-width: 900px){
  .search{ display:none; }
  .page{ grid-template-columns: 1fr; }
  .page--category{ grid-template-columns: 1fr; }
  .page--category .stack{ max-width: 920px; width:100%; margin-inline:auto; }
  .grid-3{ grid-template-columns: 1fr; }
  .grid-2{ grid-template-columns: 1fr; }
  .grid-4{ grid-template-columns: 1fr; }
  .places{ grid-template-columns: 1fr; }
  .nav{ display:none; }
  .hamburger{ display:inline-flex; align-items:center; justify-content:center; }
  .footgrid{ grid-template-columns: 1fr 1fr; }
}

/* ===== Theme: Dark =====
   Toggle sets <html data-theme="dark"> (or "light")
*/
:root[data-theme="dark"]{
  --bg:#0B1220;
  --paper:#0F172A;
  --ink:#F8FAFC;
  --muted:#94A3B8;
  --line: rgba(148,163,184,.20);

  --accent:#F43F5E; /* slightly brighter for dark */
  --link:#60A5FA;
  --good:#22C55E;
  --warn:#FBBF24;

  --shadow: 0 18px 50px rgba(0,0,0,.45);
  --shadow2: 0 10px 28px rgba(0,0,0,.35);
}
:root[data-theme="dark"] body{
  background:
    radial-gradient(900px 520px at 10% -10%, rgba(96,165,250,.10), transparent 60%),
    radial-gradient(900px 520px at 90% 0%, rgba(244,63,94,.10), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg));
}
:root[data-theme="dark"] header{
  background: rgba(11,18,32,.78);
  border-bottom-color: rgba(148,163,184,.18);
}
:root[data-theme="dark"] .breaking{
  background: rgba(15,23,42,.85);
  border-top-color: rgba(148,163,184,.16);
  border-bottom-color: rgba(148,163,184,.16);
}
:root[data-theme="dark"] .card-head{ background: rgba(2,6,23,.40); }
:root[data-theme="dark"] .ad{
  background: repeating-linear-gradient(45deg, rgba(248,250,252,.06), rgba(248,250,252,.06) 8px, rgba(15,23,42,.75) 8px, rgba(15,23,42,.75) 16px);
  border-color: rgba(148,163,184,.35);
  color: rgba(248,250,252,.78);
}
:root[data-theme="dark"] .search,
:root[data-theme="dark"] .btn,
:root[data-theme="dark"] .pill,
:root[data-theme="dark"] .chip,
:root[data-theme="dark"] .feedItem,
:root[data-theme="dark"] .event,
:root[data-theme="dark"] .place{
  background: rgba(15,23,42,.86);
}
:root[data-theme="dark"] .thumb,
:root[data-theme="dark"] .mini{
  /* keep poster images in dark mode (was overriding background-image) */
  background-image:
    var(--img, none),
    linear-gradient(120deg, rgba(248,250,252,.12), rgba(248,250,252,.05));
  background-size: cover, auto;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}

:root[data-theme="dark"] .fsGallery{ background: rgba(15,23,42,.86); }
:root[data-theme="dark"] .fsBtn{
  background: rgba(15,23,42,.88);
  border-color: rgba(148,163,184,.18);
  color: rgba(248,250,252,.85);
}
:root[data-theme="dark"] .fsDots button{
  border-color: rgba(148,163,184,.25);
  background: rgba(15,23,42,.35);
}
:root[data-theme="dark"] footer{
  background: rgba(2,6,23,.70);
  border-top-color: rgba(148,163,184,.18);
}
:root[data-theme="dark"] .fine{
  border-top-color: rgba(148,163,184,.16);
  color: rgba(248,250,252,.72);
}
:root[data-theme="dark"] .label{
  background: rgba(244,63,94,.14);
  border-color: rgba(244,63,94,.28);
  color: #F43F5E;
}










.actions{ display:flex; align-items:center; gap:10px; }


/* ===== Header v4: Search + actions in first row, NAV in its own one-line row ===== */
.topbar{
  display:flex;
  align-items:center;
  gap:12px;
  padding: 12px 0;
}
.topbar .search{
  flex: 1 1 560px;
  min-width: 260px;
  max-width: 680px;
}
.actions{ margin-left: auto; display:flex; align-items:center; gap:10px; }

/* second row nav */
.navrow{
  border-top: 1px solid rgba(15,23,42,.06);
  background: rgba(255,255,255,.60);
}
:root[data-theme="dark"] .navrow{
  border-top-color: rgba(148,163,184,.16);
  background: rgba(2,6,23,.25);
}
.navrow .nav{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:nowrap;
  white-space:nowrap;
  overflow-x:auto;
  padding: 10px 0;
  scrollbar-width:none;
}
.navrow .nav::-webkit-scrollbar{ display:none; }
.navrow .nav a{ flex: 0 0 auto; }

@media (max-width: 900px){
  .topbar .search{ display:none; } /* на мобилке поиск через кнопку */
  .navrow{ display:none; }        /* на мобилке меню в drawer */
}


/* usolie-citi.ru branding */
.logo{ background: linear-gradient(135deg, #1D4ED8, #22C55E); box-shadow: 0 10px 20px rgba(29,78,216,.18); }
:root[data-theme="dark"] .logo{ box-shadow: 0 10px 20px rgba(0,0,0,.35); }


/* Brand (logo + title): no underline on hover */
.brand, .brand:hover, .brand:focus{ text-decoration:none !important; }
.brand *{ text-decoration:none !important; }

/* Logo image (PNG) */
.logo-img{
  width:34px;
  height:34px;
  border-radius:10px;
  object-fit:contain;
  display:block;
}
.logo-fallback{
  width:34px; height:34px; border-radius:10px;
  background: linear-gradient(135deg, #1D4ED8, #22C55E);
  box-shadow: 0 10px 20px rgba(29,78,216,.18);
}
:root[data-theme="dark"] .logo-fallback{ box-shadow: 0 10px 20px rgba(0,0,0,.35); }


/* extra: ensure major layout wrappers don't paint their own background */
main, .main, .wrap{ background: transparent !important; }


/* ===== Unified background + unified surfaces (glass) =====
   Цель: единый фон на всю страницу + карточки/элементы на полупрозрачной подложке,
   чтобы не выглядело как отдельные "плашки фона" для каждого блока.
*/
:root{
  --surface: rgba(255,255,255,.72);
  --surface2: rgba(255,255,255,.60);
}
:root[data-theme="dark"]{
  --surface: rgba(15,23,42,.74);
  --surface2: rgba(15,23,42,.62);
}

/* Единый фон фиксированный (чтобы при скролле выглядел как один фон) */
html, body{
  background-color: var(--bg) !important;
  background-image: none !important;
  background-attachment: scroll !important;
}


/* Хедер/футер/полосы — без собственного "белого" фона */
header,
.breaking,
.navrow,
footer{
  background: transparent !important;
}
.card-head{ background: transparent !important; }

/* Карточки и элементы — единая полупрозрачная подложка */
.card,
.feedItem,
.event,
.place,
.search,
.btn,
.pill,
.chip,
.modalCard{
  background: var(--surface) !important;
  backdrop-filter: blur(10px);
}
.ad{
  
  backdrop-filter: blur(10px);
}

/* Убираем фоновые заливки внутри служебных блоков */
.date{ background: transparent !important; }


/* Final override: ensure truly single background */
body{ background-color: var(--bg) !important; background-image:none !important; }


/* ===== Services tabs (Пробки/Курсы/Расписание) ===== */
.serviceTabs{ display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; }
.serviceTabs .tag{ cursor:pointer; user-select:none; }
.serviceTabs .tag.active{
  color: var(--link);
  border-color: rgba(29,78,216,.24);
  background: rgba(29,78,216,.06);
}
:root[data-theme="dark"] .serviceTabs .tag.active{
  border-color: rgba(96,165,250,.30);
  background: rgba(96,165,250,.10);
}
.servicePanel{ margin-top:10px; }
.servicePanel[hidden]{ display:none !important; }


/* ===== Rates: two columns (RUB and USD) ===== */
.rateHeader{
  display:grid;
  grid-template-columns: 56px 1fr 1fr;
  gap:12px;
  padding: 6px 10px 0;
  color: var(--muted);
  font-size: 12px;
}
.ratesGrid{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:8px;
}
.rateRow{
  display:grid;
  grid-template-columns: 56px 1fr 1fr;
  align-items:baseline;
  gap:12px;
  padding: 8px 10px;
  border:1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.85);
}
:root[data-theme="dark"] .rateRow{ background: rgba(15,23,42,.86); }
.rateRow b{ font-size: 14px; }
.rateRow small{ color: var(--muted); text-align:right; }


/* Reveal safe animation (does not hide content) */
.reveal{ animation: none; }
.reveal.in{ animation: revealPop .45s ease both; }
@keyframes revealPop{ from{ transform: translateY(8px); opacity:.98; } to{ transform: translateY(0); opacity:1; } }


/* Two ads in a row (after 'Главные новости') */
.ad-grid-2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
  align-items:stretch;
}
.ad.ad-big{
  min-height: auto;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  text-align:center;
}
@media (max-width: 900px){
  .ad-grid-2{ grid-template-columns: 1fr; }
}


/* Sidebar ad size 300x500 */
.ad.ad-300x500{
  width: 100%;
  max-width: 300px;
  height: 500px;
  margin: 0 auto;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  text-align:center;
}
@media (max-width: 900px){
  .ad.ad-300x500{
    max-width: 100%;
    height: 320px; /* keep reasonable on mobile */
  }
}


/* ===== Faces slider (Лица Усолья) ===== */
.faces-slider{
  position: relative;
  display:flex;
  align-items:center;
  gap:10px;
}
.slider-viewport{
  overflow:hidden;
  width:100%;
  border-radius:14px;
}
.slider-track{
  display:flex;
  transition: transform .45s ease;
  will-change: transform;
}
.slide{
  min-width: 100%;
}
.slide img{
  width:100%;
  height: 170px;
  object-fit: cover;
  display:block;
  border-radius:14px;
  border: 1px solid rgba(15,23,42,.08);
}
:root[data-theme="dark"] .slide img{ border-color: rgba(148,163,184,.18); }

.slider-btn{
  width:34px;
  height:34px;
  border-radius:12px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.75);
  cursor:pointer;
  display:grid;
  place-items:center;
  font-size:20px;
  line-height:1;
}
:root[data-theme="dark"] .slider-btn{
  background: rgba(15,23,42,.85);
  border-color: rgba(148,163,184,.18);
}
.slider-btn:active{ transform: translateY(1px); }

.slider-dots{
  display:flex;
  gap:6px;
  justify-content:center;
  margin-top:10px;
}
.slider-dots button{
  width:8px;
  height:8px;
  border-radius:999px;
  border: 1px solid rgba(15,23,42,.18);
  background: transparent;
  cursor:pointer;
  padding:0;
}
.slider-dots button.active{
  background: rgba(244,63,94,.85);
  border-color: rgba(244,63,94,.35);
}


/* Sidebar ad size 300x250 */
.ad.ad-300x250{
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 0 auto;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  text-align:center;
}
@media (max-width: 900px){
  .ad.ad-300x250{
    max-width: 100%;
    height: 200px; /* compact on mobile */
  }
}


/* ===== Kulinariya block (3 блюда дня) ===== */
.food-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.food-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px;
  border-radius:14px;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.55);
  text-decoration:none;
  color: inherit;
}
:root[data-theme="dark"] .food-item{
  border-color: rgba(148,163,184,.18);
  background: rgba(15,23,42,.55);
}
.food-item:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow2);
}
.food-item img{
  width:52px;
  height:52px;
  border-radius:14px;
  object-fit: cover;
  background: rgba(15,23,42,.05);
  flex: 0 0 auto;
}
.food-txt b{ display:block; font-size: 13px; line-height:1.2; }
.food-meta{ font-size: 12px; margin-top:2px; }


/* ===== Horoscope ===== */
.horo-controls{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.horo-label{
  font-size:12px;
  color: var(--muted);
  margin-bottom:-6px;
}
.horo-select{
  width:100%;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.65);
  color: inherit;
  outline:none;
}
:root[data-theme="dark"] .horo-select{
  border-color: rgba(148,163,184,.18);
  background: rgba(15,23,42,.55);
}
.horo-seg{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.seg-btn{
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.55);
  cursor:pointer;
  font-size:12px;
  color: inherit;
}
:root[data-theme="dark"] .seg-btn{
  border-color: rgba(148,163,184,.18);
  background: rgba(15,23,42,.55);
}
.seg-btn.is-active{
  box-shadow: var(--shadow2);
  transform: translateY(-1px);
}
.horo-box{
  margin-top:12px;
  padding:12px;
  border-radius:16px;
  border:1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.55);
}
:root[data-theme="dark"] .horo-box{
  border-color: rgba(148,163,184,.18);
  background: rgba(15,23,42,.55);
}
.horo-title{
  font-weight:800;
  font-size:13px;
  margin-bottom:6px;
}
.horo-text{
  font-size:13px;
  line-height:1.45;
}
.horo-src{
  margin-top:8px;
  font-size:12px;
}


/* ===== Ad placeholders ===== */
.ad{
  position: relative;
  overflow: hidden;
}
.ad .ad-placeholder{
  width: 100%;
  height: 100%;
  min-height: auto;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  border-radius: 18px;
  
  text-align:center;
  padding: 14px;
}
:root[data-theme="dark"] .ad .ad-placeholder{
  border-color: rgba(148,163,184,.22);
  background:
    radial-gradient(1200px 500px at 10% 10%, rgba(99,102,241,.18), transparent 55%),
    radial-gradient(900px 600px at 90% 20%, rgba(34,197,94,.14), transparent 55%),
    radial-gradient(1000px 700px at 30% 90%, rgba(236,72,153,.14), transparent 55%),
    rgba(15,23,42,.35);
}
.ad .ad-line{
  font-weight: 800;
  letter-spacing: .2px;
}
.ad .ad-size{
  font-size: 12px;
  opacity: .75;
}


/* Afisha import */
.event.event-import{ align-items: stretch; }
.event-thumb{
  width: 92px; min-width:92px; height: 92px;
  border-radius: 16px;
  overflow:hidden;
  border:1px solid var(--line);
  background: #f3f4f6;
  display:block;
}
.event-thumb img{
  width:100%; height:100%;
  object-fit: cover;
  display:block;
}
.date.mini{
  width:56px; min-width:56px;
  height:56px;
  padding:6px;
}
.event-title-row{
  display:flex;
  gap:12px;
  align-items:flex-start;
}
.event-text b{ display:block; line-height:1.2; }
@media (max-width: 900px){
  .event-thumb{ width:76px; min-width:76px; height:76px; border-radius:14px; }
  .date.mini{ width:52px; min-width:52px; height:52px; }
}


/* ===== Afisha grid (2x2) ===== */
#afisha .afisha-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}
@media (max-width: 820px){
  #afisha .afisha-grid{ grid-template-columns: 1fr; }
}
#afisha .afisha-item{
  display:flex;
  gap:10px;
  padding:10px;
  border-radius:16px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.55);
  text-decoration:none;
  color: inherit;
  min-height: 92px;
}
:root[data-theme="dark"] #afisha .afisha-item{
  border-color: rgba(148,163,184,.18);
  background: rgba(15,23,42,.55);
}
#afisha .afisha-item:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow2);
}
#afisha .afisha-thumb{
  width:72px;
  height:72px;
  border-radius:14px;
  object-fit: cover;
  flex: 0 0 auto;
  background: rgba(15,23,42,.06);
}
#afisha .afisha-txt b{
  display:block;
  font-size:13px;
  line-height:1.25;
  max-height: 2.5em;
  overflow:hidden;
}
#afisha .afisha-meta{
  font-size:12px;
  margin-top:4px;
}


/* Afisha description (excerpt) */
.event-desc{
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* Afisha description */
#afisha .afisha-desc{
  margin-top:6px;
  font-size:12px;
  line-height:1.35;
  display:-webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow:hidden;
}


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


/* Photo gallery (Yandex import) */
#photo .photo-item{
  display:block;
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
  /* height removed: use aspect ratio for better mobile thumbnails */
  aspect-ratio: 16 / 10;
  background: rgba(15,23,42,.04);
}
#photo .photo-item img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}


/* Faces slider autoplay */
#facesSliderCard .slider-viewport{ overflow:hidden; }
#facesSliderCard .slider-track{
  display:flex;
  width:100%;
  transition: transform .55s cubic-bezier(.2,.9,.2,1);
  will-change: transform;
}
#facesSliderCard .slide{
  min-width:100%;
}
#facesSliderCard .slide a{ display:block; }
#facesSliderCard .slide img{
  width:100%;
  height:200px;
  object-fit:contain;
  border-radius:16px;
  display:block;
}
#facesSliderCard .slider-dots{ display:flex; gap:8px; justify-content:center; margin-top:10px; }
#facesSliderCard .slider-dots .dot{
  width:8px; height:8px; border-radius:999px;
  border:1px solid var(--line);
  background: rgba(15,23,42,.08);
}
#facesSliderCard .slider-dots .dot.active{
  background: rgba(37,99,235,.65);
}
@media (max-width: 520px){
  #facesSliderCard .slide img{ height:180px; }
}

#facesSliderCard .slider-btn{display:none!important;}


/* Faces slider pretty */
#facesSliderCard .faces-slider{ margin-top: 2px; }
#facesSliderCard .slider-viewport{ overflow:hidden; }
#facesSliderCard .slider-track{
  display:flex;
  gap:0;
  transition: transform .55s cubic-bezier(.2,.9,.2,1);
  will-change: transform;
}
#facesSliderCard .slide{
  flex: 0 0 100%;
  min-width: 100%;
}
#facesSliderCard .face-link{
  display:block;
  text-decoration:none;
}
#facesSliderCard .face-img{
  width:100%;
  height:200px;
  object-fit:cover;
  border-radius:16px;
  display:block;
  box-shadow: 0 10px 30px rgba(2,8,23,.08);
}
#facesSliderCard .face-caption{
  margin-top:10px;
  font-weight:700;
  font-size:13px;
  line-height:1.15;
  color: var(--text);
  letter-spacing: .2px;
}
#facesSliderCard .faces-counter{
  margin-top:10px;
  display:inline-flex;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(15,23,42,.04);
  width: fit-content;
}
@media (max-width: 520px){
  #facesSliderCard .face-img{ height:170px; }
}


/* Faces slider padding 2px */
#facesSliderCard .slider-viewport{
  padding: 2px;
  box-sizing: border-box;
}


/* Faces header counter */
#facesSliderCard .card-head {
  align-items: flex-start;
}
#facesSliderCard .faces-counter-head {
  margin-left: auto;
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(15,23,42,.04);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}


/* Video import grid */
#video .video-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
}
#video .video-embed{
  border:1px solid var(--line);
  border-radius: 14px;
  overflow:hidden;
  background: rgba(15,23,42,.03);
  aspect-ratio: 16/9;
}
#video .video-embed iframe{
  width:100%;
  height:100%;
  border:0;
  display:block;
}
@media (min-width: 860px){
  #video .video-grid{ grid-template-columns: 1fr 1fr; }
}


/* Video cards with play overlay */
#video .video-card{
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(15,23,42,.03);
  aspect-ratio: 16/9;
  padding: 0;
  cursor: pointer;
}
#video .video-card:disabled{
  cursor: default;
  opacity: .6;
}
#video .video-thumb{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#video .video-play{
  position:absolute;
  left:50%;
  top:50%;
  width:64px;
  height:64px;
  transform: translate(-50%,-50%);
  border-radius: 999px;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 10px 30px rgba(2,8,23,.18);
}
#video .video-play::before{
  content:"";
  position:absolute;
  left: 26px;
  top: 20px;
  width: 0;
  height: 0;
  border-left: 18px solid rgba(255,255,255,.92);
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
}
#video .video-card:hover .video-play{
  transform: translate(-50%,-50%) scale(1.03);
  background: rgba(15,23,42,.62);
}

/* Video modal */
.modal-open{ overflow: hidden; }
#videoModal{
  position: fixed;
  inset: 0;
  z-index: 9999;
}
#videoModal .modal-backdrop{
  position:absolute;
  inset:0;
  background: rgba(2,6,23,.55);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 18px 18px 18px;
}
#videoModal .modal-box{
  width: min(980px, 100%);
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(2,8,23,.35);
  overflow:hidden;
  position: relative;
}
html[data-theme="dark"] #videoModal .modal-box{
  background: rgba(15,23,42,.85);
  border-color: rgba(255,255,255,.08);
}
#videoModal .modal-close{
  position:absolute;
  right: 10px;
  top: 10px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.9);
  cursor:pointer;
  font-size: 24px;
  line-height: 1;
}
html[data-theme="dark"] #videoModal .modal-close{
  background: rgba(15,23,42,.85);
}
#videoModal .modal-player{
  padding: 0;
}
#videoModal .modal-player .video-embed{
  aspect-ratio: 16/9;
}
#videoModal .modal-player iframe{
  width:100%;
  height:100%;
  border:0;
  display:block;
}


/* Video tiles inline play */
#videoGrid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}
@media (max-width: 520px){
  #videoGrid{ grid-template-columns: 1fr; }
}
.video-tile{
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.6);
  cursor: pointer;
}
.video-thumb{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
}
.video-play{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
}
.video-play::before{
  content:"";
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: rgba(15,23,42,.55);
  border: 1px solid rgba(255,255,255,.35);
  backdrop-filter: blur(6px);
}
.video-play::after{
  content:"";
  margin-left: 4px;
  width: 0; height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 16px solid rgba(255,255,255,.92);
  position:absolute;
}
.video-frame{
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}
.video-frame iframe{
  width: 100%;
  height: 100%;
  border: 0;
  display:block;
}


/* Video grid should fill the whole card */
#video .card-body{ position: relative; }
#videoGrid{
  width: 100% !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0,1fr)) !important;
  gap: 12px !important;
}
@media (max-width: 520px){
  #videoGrid{ grid-template-columns: 1fr !important; }
}

/* Tiles: full size previews */
#videoGrid .video-tile{ width: 100% !important; }
#videoGrid .video-thumb{
  width: 100% !important;
  aspect-ratio: 16 / 9;
  min-height: 140px;
  background-size: cover !important;
  background-position: center !important;
  border-radius: 16px;
}

/* In-block modal (covers only the video card) */
#videoModal.video-modal{
  position: absolute;
  inset: 0;
  padding: 12px;
  display: none;
  align-items: flex-start;
  justify-content: center;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  z-index: 50;
}
#videoModal .video-modal-inner{
  width: 100%;
  max-width: 100%;
}
#videoModal .video-modal-frame{
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.22);
}
#videoModal .video-modal-frame iframe{
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
#videoModal .video-modal-close{
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(15,23,42,.55);
  color: rgba(255,255,255,.92);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}


/* Video grid single-item full width */
#videoGrid.is-single{
  grid-template-columns: 1fr !important;
}
#videoGrid.is-single .video-tile{
  grid-column: 1 / -1;
}


/* Gallery modal (inside Photo card) */
#photo{ position: relative; }
#galleryModal.gallery-modal{
  position: fixed;
  inset: 0;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 18px 18px 18px;
  display: none;
  align-items: flex-start;
  justify-content: center;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(10px);
  border-radius: 0;
  z-index: 200000;
  overflow: auto;
  box-sizing: border-box;
}
#galleryModal .gallery-modal-inner{
  width: 100%;
  max-width: 100%;
  position: relative;
}
#galleryModal .gallery-modal-frame{
  width: 100%;
  max-height: 520px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0,0,0,.75);
  border: 1px solid rgba(255,255,255,.22);
}
#galleryModal .gallery-modal-frame img{
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  display:block;
}
#galleryModal .gallery-modal-close{
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(15,23,42,.55);
  color: rgba(255,255,255,.92);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}


/* Gallery modal zoom */
#galleryModal .gallery-modal-zoom{
  position: absolute;
  top: 10px;
  right: 56px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(15,23,42,.55);
  color: rgba(255,255,255,.92);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}

#galleryModal.is-zoomed .gallery-modal-frame{
  overflow: auto;
  align-items: flex-start;
  justify-content: flex-start;
}
#galleryModal.is-zoomed .gallery-modal-frame img{
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
}


/* Gallery modal global (outside Photo card) */
#galleryModal.gallery-modal{
  position: fixed !important;
  inset: 0 !important;
  padding: 18px !important;
  display: none;
  align-items: flex-start;
  justify-content: center;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(10px);
  z-index: 999;
  overflow: auto;
}

#galleryModal .gallery-modal-inner{
  width: min(720px, calc(100vw - 36px));
  max-width: 720px;
  position: relative;
  margin: auto;
}

#galleryModal .gallery-modal-frame{
  width: 100%;
  max-height: 80vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0,0,0,.75);
  border: 1px solid rgba(255,255,255,.22);
}

#galleryModal .gallery-modal-frame img{
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  display:block;
}

/* 1:1 toggle now means fixed 720px width */
#galleryModal.is-zoomed .gallery-modal-inner{
  width: 720px;
  max-width: none;
}
#galleryModal.is-zoomed .gallery-modal-frame{
  width: 720px;
  max-height: none;
  overflow: visible;
}
#galleryModal.is-zoomed .gallery-modal-frame img{
  width: 720px;
  max-width: none;
  max-height: none;
  object-fit: unset;
}

/* Keep buttons visible */
#galleryModal .gallery-modal-close{
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}
#galleryModal .gallery-modal-zoom{
  position: absolute;
  top: 10px;
  right: 56px;
  z-index: 2;
}

html.modal-open, html.modal-open body{ overflow: hidden; }

/* Modal scroll lock override */
html.modal-open, html.modal-open body{ overflow: visible !important; }


/* Mobile header + gallery fixes */
@media (max-width: 520px){
  .container{ padding-left: 12px; padding-right: 12px; }
  .topbar{ gap: 10px; }
  .brand{ min-width: 0; flex: 1 1 auto; }
  .brand span{ min-width:0; }
  .brand span{ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48vw; }
  .brand small{ display:none; }
  .actions{ gap: 8px !important; }
  /* hide heavy buttons to prevent wrapping */
  .actions a.primary{ display:none; }
  .actions a.btn[href="#"]{ display:none; } /* login placeholder */
  .actions .btn{ padding: 8px 10px; font-size: 13px; }
  #themeToggle{ width: 40px; height: 40px; padding: 0; display:inline-flex; align-items:center; justify-content:center; }
  .hamburger{ width: 40px; height: 40px; }
}

/* Slightly taller photo posters on phones */
@media (max-width: 520px){
  #photo .photo-item{ aspect-ratio: 16 / 9; }
}


/* Podcast modal (global) */
#podcastModal.podcast-modal{
  position: fixed;
  inset: 0;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 18px 18px 18px;
  display: none;
  align-items: flex-start;
  justify-content: center;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(10px);
  z-index: 999;
  overflow: auto;
}
#podcastModal .podcast-modal-inner{
  width: min(720px, calc(100vw - 36px));
  max-width: 720px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  position: relative;
}
[data-theme="dark"] #podcastModal .podcast-modal-inner{
  background: rgba(15,23,42,.78);
  border-color: rgba(255,255,255,.14);
}
#podcastModal .podcast-modal-close{
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(15,23,42,.55);
  color: rgba(255,255,255,.92);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
#podcastModal .podcast-modal-header{
  padding-right: 90px;
}
#podcastModal .podcast-modal-title{
  font-weight: 800;
  font-size: 16px;
  line-height: 1.25;
  margin: 2px 0 10px;
}
#podcastModal .podcast-modal-frame{
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0,0,0,.15);
  border: 1px solid rgba(255,255,255,.18);
  margin-bottom: 10px;
}
#podcastModal .podcast-modal-frame img{
  width: 100%;
  height: auto;
  display: block;
}
#podcastModal .podcast-modal-text{
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.45;
  margin: 0 0 12px;
}
#podcastModal .podcast-modal-link{
  display: inline-flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.55);
  color: inherit;
  text-decoration: none;
}
[data-theme="dark"] #podcastModal .podcast-modal-link{
  background: rgba(255,255,255,.06);
}


#podcastModal .podcast-modal-actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

#podcastModal .podcast-modal-action-close{
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.55);
  color: inherit;
  cursor: pointer;
}
[data-theme="dark"] #podcastModal .podcast-modal-action-close{
  background: rgba(255,255,255,.06);
}


/* Article modal (for Афиша + Сейчас на экране) */
#articleModal.article-modal{
  position: fixed;
  inset: 0;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 18px 18px 18px;
  display: none;
  align-items: flex-start;
  justify-content: center;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(10px);
  z-index: 200000;
  overflow: auto;
  box-sizing: border-box;
}

#articleModal .article-modal-inner{
  width: min(720px, calc(100vw - 28px));
  max-width: 720px;
  margin: 0;
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 18px;
  padding: 14px;
  position: relative;
}
html[data-theme="dark"] #articleModal .article-modal-inner,
body[data-theme="dark"] #articleModal .article-modal-inner{
  background: rgba(15,23,42,.82);
  border-color: rgba(255,255,255,.14);
}

#articleModal .article-modal-close{
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(15,23,42,.55);
  color: rgba(255,255,255,.92);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

#articleModal .article-modal-header{ padding-right: 90px; }
#articleModal .article-modal-title{
  font-weight: 900;
  font-size: 16px;
  line-height: 1.25;
  margin: 2px 0 10px;
}
#articleModal .article-modal-frame{
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0,0,0,.12);
  border: 1px solid rgba(255,255,255,.18);
  margin-bottom: 10px;
}
#articleModal .article-modal-frame img{
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: contain;
  display: block;
}
@media (max-width: 520px){
  #articleModal .article-modal-frame img{ max-height: 260px; }
}

#articleModal .article-modal-text{
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.45;
  margin: 0 0 12px;
}
#articleModal .article-modal-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
#articleModal .article-modal-link,
#articleModal .article-modal-action-close{
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.55);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
html[data-theme="dark"] #articleModal .article-modal-link,
html[data-theme="dark"] #articleModal .article-modal-action-close,
body[data-theme="dark"] #articleModal .article-modal-link,
body[data-theme="dark"] #articleModal .article-modal-action-close{
  background: rgba(255,255,255,.06);
}


/* Article modal responsive image size (desktop only) */
@media (min-width: 721px){
  #articleModal .article-modal-frame{
    max-height: 360px;
  }
  #articleModal .article-modal-frame img{
    max-height: 360px;
    width: 100%;
    height: 360px;
    object-fit: contain;
  }
}


/* Prevent layout shift when opening modals */
html{ scrollbar-gutter: stable; }
@supports not (scrollbar-gutter: stable){
  html{ overflow-y: scroll; }
}
html, body{ overflow-x: hidden; }


@media (min-width:721px){#breakingFloating .breaking-inner{max-width:1150px;margin:0 auto;}}


/* === MODAL_ZINDEX_OVER_URGENT === */
#videoModal{ z-index: 200000 !important; }
#articleModal.article-modal{ z-index: 200000 !important; }
#podcastModal.podcast-modal{ z-index: 200000 !important; }
#galleryModal.gallery-modal{
  position: fixed !important;
  inset: 0 !important;
  z-index: 200000 !important;
  border-radius: 0 !important;
  padding: max(12px, env(safe-area-inset-top)) 14px 18px !important;
}
/* ensure modal close buttons stay above */
#videoModal .modal-box, #articleModal .article-modal-inner, #podcastModal .podcast-modal-inner, #galleryModal .gallery-modal-inner{
  position: relative;
  z-index: 200001 !important;
}



/* urgent marquee items */
.mq-dot{opacity:.6;margin:0 10px;}
.mq-item{white-space:nowrap;}



/* === URGENT_TICKER_STYLE === */
.breaking .marquee, .breaking #marquee{
  color: #b91c1c;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .2px;
}
.breaking .mq-item, .breaking .mq-dot{
  flex: 0 0 auto;
}
.breaking .marquee{
  width: max-content;
  animation: scroll var(--mq-duration, 18s) linear infinite;
  animation-play-state: running !important;
}


.breaking .mq-lap{display:inline-flex;align-items:center;gap:0;}




/* === AD_PLACEHOLDER_CANVASTYLE === */
.ad-line{
  padding: 0 !important;
  overflow: hidden;
  background: transparent !important;
}
.ad-line .ad-img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}


/* === AD_PLACEHOLDER_FULLBLEED === */
.ad-placeholder.ad-has-img{
  padding: 0 !important;
  gap: 0 !important;
  display: block !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  overflow: hidden;
}
.ad-placeholder.ad-has-img .ad-img{
  display:block;
  width:100%;
  height:auto;
  object-fit: cover;
  border-radius: inherit;
}



/* === AD1_MOBILE_RIGHT_CROP === */
@media (max-width: 720px){
  :root{ --ad1-mobile-offset: 550px; } /* было 513px */
  #ad-slot-1-img{
    object-fit: cover !important;
    object-position: left center !important; /* показываем левую часть баннера */
    transform: none !important;
  }
}
/* === AD_CTA_BUTTON === */
.ad-placeholder.ad-has-img{ position: relative; }


/* === DLE_VOTE === */
.dle-vote__title{ display:block; font-weight: 900; margin-bottom: 10px; }
.dle-vote__options{ font-size: 14px; line-height: 1.5; }
.dle-vote__options input{ margin-right: 8px; }
.dle-vote__options br{ display:block; content:""; margin: 8px 0; }
.dle-vote__actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top: 12px; }
.dle-vote__meta{ margin-top: 10px; font-size: 13px; }

/* аккуратные отступы для вариантов, если движок выводит их DIV'ами */
.dle-vote__options > div{ padding: 8px 10px; border-radius: 999px; background: rgba(255,255,255,.85); margin: 0 0 8px; }
:root[data-theme="dark"] .dle-vote__options > div{ background: rgba(15,23,42,.40); }


/* === AD_LINKFULL === */
.ad-linkfull{
  display:block;
  width:100%;
  height:100%;
  text-decoration:none !important;
  cursor:pointer;
}
.ad-linkfull:focus-visible{
  outline: 2px solid rgba(239,68,68,.5);
  outline-offset: 4px;
  border-radius: 16px;
}

/* ==============================
   DLE popup (subscribe/comments/etc.)
   Fix: popup window becomes transparent on custom themes.
   ============================== */
#dlepopupbg{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 10040;
}

#dlepopup{
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
  padding: 16px;
  z-index: 10050;
}

html[data-theme="dark"] #dlepopup{
  background: #13161b;
  border-color: rgba(255,255,255,.08);
}

/* Common inner elements inside DLE popup */
#dlepopup .title,
#dlepopup h3{
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 800;
}

#dlepopup input[type="text"],
#dlepopup input[type="email"],
#dlepopup input[type="password"],
#dlepopup select,
#dlepopup textarea{
  width: 100%;
  background: rgba(0,0,0,.02);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  color: inherit;
  outline: none;
}

html[data-theme="dark"] #dlepopup input[type="text"],
html[data-theme="dark"] #dlepopup input[type="email"],
html[data-theme="dark"] #dlepopup input[type="password"],
html[data-theme="dark"] #dlepopup select,
html[data-theme="dark"] #dlepopup textarea{
  background: rgba(255,255,255,.04);
}

#dlepopup .btn,
#dlepopup button,
#dlepopup input[type="button"],
#dlepopup input[type="submit"]{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.04);
  color: inherit;
  cursor: pointer;
}

html[data-theme="dark"] #dlepopup .btn,
html[data-theme="dark"] #dlepopup button,
html[data-theme="dark"] #dlepopup input[type="button"],
html[data-theme="dark"] #dlepopup input[type="submit"]{
  background: rgba(255,255,255,.06);
}

#dlepopup .btn:hover,
#dlepopup button:hover,
#dlepopup input[type="button"]:hover,
#dlepopup input[type="submit"]:hover{
  filter: brightness(0.98);
}
.video-embed{
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
}
.video-embed iframe,
.video-embed video,
.video-embed embed,
.video-embed object{
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  border: 0;
}
