.mayak-ocard-sqtag.pill-tag { display: inline-flex !important; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px; font-size: 13px; font-weight: 700; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color 0.15s ease, transform 0.15s ease; }
  .mayak-ocard-sqtag.pill-tag:hover { border-color: var(--accent); text-decoration: none; }
  .mayak-ocard-sqtag.pill-super { padding: 5px 14px 5px 5px; min-height: 44px; font-size: 13.5px; font-weight: 800; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05); }
  .mayak-ocard-sqtag-ava { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); }
</style>
<style>
  :root {
    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-soft: #f1f5f9;
    --border: #dfe5ee;
    --border-strong: #c7d1e0;
    --text: #111827;
    --text-muted: #5b6472;
    --accent: #18181b;
    --accent-hover: #2f2f35;
    --accent-contrast: #ffffff;
    --link: #0b5ed7;
    --ok-bg: #e7f6ec;
    --ok-text: #166534;
    --ok-border: #a7dfb9;
    --warn-bg: #fff1f2;
    --warn-text: #9f1239;
    --warn-border: #fecdd3;
    --shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    --shadow-hover: 0 8px 24px rgba(15, 23, 42, 0.08);
    --radius: 14px;
  }

  @media (prefers-color-scheme: dark) {
    html[data-theme="auto"] {
      --bg: #0e1116;
      --surface: #161b22;
      --surface-soft: #1f2630;
      --border: #2a323e;
      --border-strong: #3b4656;
      --text: #f1f5f9;
      --text-muted: #9aa4b2;
      --accent: #f8fafc;
      --accent-hover: #e2e8f0;
      --accent-contrast: #0f172a;
      --link: #60a5fa;
      --ok-bg: #112a1d;
      --ok-text: #6ee7b7;
      --ok-border: #1e4d35;
      --warn-bg: #2c141a;
      --warn-text: #fda4af;
      --warn-border: #5b212d;
      --shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
      --shadow-hover: 0 8px 26px rgba(0, 0, 0, 0.4);
    }
  }

  html[data-theme="dark"] {
    --bg: #0e1116;
    --surface: #161b22;
    --surface-soft: #1f2630;
    --border: #2a323e;
    --border-strong: #3b4656;
    --text: #f1f5f9;
    --text-muted: #9aa4b2;
    --accent: #f8fafc;
    --accent-hover: #e2e8f0;
    --accent-contrast: #0f172a;
    --link: #60a5fa;
    --ok-bg: #112a1d;
    --ok-text: #6ee7b7;
    --ok-border: #1e4d35;
    --warn-bg: #2c141a;
    --warn-text: #fda4af;
    --warn-border: #5b212d;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    --shadow-hover: 0 8px 26px rgba(0, 0, 0, 0.4);
  }
  * { box-sizing: border-box; }

  body {
    margin: 0;
    padding: 0 0 56px;
    width: 100%;
    max-width: 100%;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    background: var(--bg);
    color: var(--text);
  }

  body > * {
    width: min(1120px, calc(100% - 36px));
    margin-left: auto;
    margin-right: auto;
  }

  body > .mayak-drawer-backdrop,
  body > .mayak-lb-overlay,
  body > #city-msg-backdrop,
  body > script,
  body > style {
    width: auto;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }

  body > .pub-section.full-bleed-section {
    width: 100%;
    max-width: 100%;
  }

  body > .pub-section.full-bleed-section > .pub-section-title,
  body > .pub-section.full-bleed-section > .section-inner-wrap {
    width: min(1120px, calc(100% - 36px));
    margin-left: auto;
    margin-right: auto;
  }

  a { color: var(--link); text-decoration: none; }
  a:hover { text-decoration: underline; }
  .pub-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 14px;
  }
  .pub-hero {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px 24px;
    margin-bottom: 22px;
    box-shadow: var(--shadow);
  }
  .pub-hero h1 {
    margin: 0 0 8px;
    font-size: clamp(24px, 3.4vw, 34px);
    line-height: 1.2;
    letter-spacing: -0.02em;
  }
  .pub-lead { color: var(--text-muted); font-size: 16px; margin: 6px 0 0; }

  .pub-section { margin-top: 28px; }
  .pub-section-title {
    font-size: 21px;
    font-weight: 800;
    margin: 0 0 14px;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .pub-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
  }
  .pub-card h3 { margin: 0 0 6px; font-size: 18px; line-height: 1.3; }
  .pub-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }

  .pub-grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
  .pub-grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 14px; }

  .pub-offer-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 15px 16px;
    display: flex;
    align-items: flex-start;
    gap: 13px;
    box-shadow: var(--shadow);
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
    color: var(--text);
  }
  .pub-offer-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border-strong);
    text-decoration: none;
  }
  .pub-offer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--surface-soft);
  }
  .pub-offer-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 800;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .pub-chips { display: flex; flex-wrap: wrap; gap: 9px; }
  .pub-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 11px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow);
    transition: border-color 0.14s ease, transform 0.12s ease;
  }
  .pub-chip:hover { border-color: var(--border-strong); transform: translateY(-1px); text-decoration: none; }
  .pub-chip.super { border-color: var(--text); background: var(--surface-soft); }
  .pub-chip small { color: var(--text-muted); font-weight: 500; }

  .pub-gallery { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0; }
  .pub-gallery figure {
    margin: 0;
    width: 215px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
    box-shadow: var(--shadow);
  }
  .pub-gallery figure img {
    width: 100%;
    height: 155px;
    object-fit: cover;
    display: block;
    border: none;
    border-radius: 0;
  }
  .pub-gallery figure figcaption {
    padding: 7px 10px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.35;
  }
  .pub-gallery > img {
    width: 215px;
    height: 160px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border);
  }

  .pub-gallery.offer-full-gallery {
    width: 100%;
    padding: 0 22px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
  }
  .pub-gallery.offer-full-gallery figure {
    width: 100%;
  }
  .pub-gallery.offer-full-gallery figure img {
    height: 210px;
  }
  .pub-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid var(--border);
    background: var(--surface-soft);
  }
  .pub-badge.ok { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-border); }
  .pub-badge.warn { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-border); }

  .pub-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 17px;
    border-radius: 10px;
    border: none;
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.14s ease;
  }
  .pub-btn:hover { background: var(--accent-hover); text-decoration: none; }
  .pub-btn.secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-strong);
  }
  .pub-btn.secondary:hover { background: var(--surface-soft); }

  .pub-form { display: flex; flex-direction: column; gap: 12px; }
  .pub-field { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 14px; }
  .pub-input, .pub-select, .pub-textarea {
    padding: 10px 12px;
    border: 1.5px solid var(--border-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
  }
  .pub-input:focus, .pub-select:focus, .pub-textarea:focus {
    outline: none;
    border-color: var(--link);
  }

  .pub-article-body img { max-width: 100%; height: auto; border-radius: 10px; margin: 10px 0; }
  .pub-article-body iframe { max-width: 100%; border-radius: 10px; margin: 10px 0; }

  .pub-footer {
    margin-top: 40px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
  }

  .offers-full-grid {
    width: 100%;
    padding: 0 22px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
    gap: 18px;
  }
  .mayak-ocard {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  }
  .mayak-ocard:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border-strong);
  }
  .mayak-ocard-media {
    position: relative;
    width: 100%;
    height: 340px;
    background: var(--surface-soft);
    overflow: hidden;
    flex-shrink: 0;
  }
  .mayak-ocard-slides-link { display: block; width: 100%; height: 100%; }
  .mayak-ocard-slide { display: none; width: 100%; height: 100%; position: relative; }
  .mayak-ocard-slide.active { display: block; }
  .mayak-ocard-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .mayak-ocard-empty {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    font-size: 56px; font-weight: 800; color: var(--text-muted); text-decoration: none;
  }
  .mayak-ocard-bars {
    position: absolute; top: 10px; left: 10px; right: 10px; z-index: 5;
    display: flex; gap: 5px;
  }
  .mayak-ocard-bar {
    flex: 1; height: 4px; border: 0; padding: 0; border-radius: 99px;
    background: rgba(255, 255, 255, 0.42); cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  }
  .mayak-ocard-bar.active { background: #ffffff; }
  .mayak-ocard-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
    width: 32px; height: 32px; border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(15, 23, 42, 0.52); color: #fff;
    font-size: 19px; font-weight: 700; line-height: 1; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.15s ease;
  }
  .mayak-ocard-media:hover .mayak-ocard-arrow { opacity: 1; }
  .mayak-ocard-arrow.prev { left: 8px; }
  .mayak-ocard-arrow.next { right: 8px; }
  .mayak-ocard-more-badge {
    position: absolute; inset: 0;
    background: rgba(15, 23, 42, 0.56);
    color: #fff; font-size: 18px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    letter-spacing: 0.01em; backdrop-filter: blur(2px);
  }
  .mayak-ocard-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
  .mayak-ocard-title {
    font-size: 18px; font-weight: 800; line-height: 1.28; color: var(--text); text-decoration: none;
  }
  .mayak-ocard-title:hover { color: var(--link); text-decoration: none; }
  .mayak-ocard-city { font-size: 13px; color: var(--text-muted); font-weight: 600; }
  .mayak-ocard-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
  .mayak-ocard-sqtag {
    display: inline-flex; align-items: center;
    padding: 4px 9px; border-radius: 7px;
    font-size: 12px; font-weight: 700;
    background: var(--surface-soft); border: 1px solid var(--border-strong);
    color: var(--text); text-decoration: none;
  }
  .mayak-ocard-sqtag:hover { border-color: var(--link); color: var(--link); text-decoration: none; }

  @media (max-width: 600px) {
    body > * { width: calc(100% - 24px); }
    body > .pub-section.full-bleed-section > .pub-section-title,
    body > .pub-section.full-bleed-section > .section-inner-wrap { width: calc(100% - 24px); }
    .offers-full-grid { grid-template-columns: 1fr; padding: 0 12px; gap: 14px; }
    .pub-gallery.offer-full-gallery { padding: 0 12px; grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .mayak-ocard-media { height: 320px; }
    .mayak-ocard-arrow { opacity: 0.85; }
  }
</style>

<script>
  function setOfferCardSlide(el, idx) {
    const card = el.closest('.mayak-ocard');
    if (!card) return;
    const slides = card.querySelectorAll('.mayak-ocard-slide');
    const bars = card.querySelectorAll('.mayak-ocard-bar');
    if (!slides.length) return;
    const nextIdx = ((Number(idx) % slides.length) + slides.length) % slides.length;
    card.dataset.slideIdx = String(nextIdx);
    slides.forEach((s, i) => s.classList.toggle('active', i === nextIdx));
    bars.forEach((b, i) => b.classList.toggle('active', i === nextIdx));
  }

  function stepOfferCardSlide(el, delta) {
    const card = el.closest('.mayak-ocard');
    if (!card) return;
    const cur = Number(card.dataset.slideIdx) || 0;
    setOfferCardSlide(card, cur + delta);
  }

  (function () {
    let sx = 0, sy = 0, activeMedia = null;
    document.addEventListener('touchstart', (ev) => {
      const m = ev.target.closest('.mayak-ocard-media');
      if (!m || !ev.touches || !ev.touches) return;
      activeMedia = m; sx = ev.touches.clientX; sy = ev.touches.clientY;
    }, { passive: true });
    document.addEventListener('touchend', (ev) => {
      if (!activeMedia || !ev.changedTouches || !ev.changedTouches) return;
      const dx = ev.changedTouches.clientX - sx;
      const dy = ev.changedTouches.clientY - sy;
      if (Math.abs(dx) > 36 && Math.abs(dx) > Math.abs(dy) * 1.2) {
        stepOfferCardSlide(activeMedia, dx < 0 ? 1 : -1);
      }
      activeMedia = null;
    }, { passive: true });
  })();
</script>
