/* ============================================================
   sylt-custom — ad boxes + theme polish (v3)
   Loaded after style.min.css via _head.tpl
   ============================================================ */

/* ---------- Ad boxes (black theme blend) ---------- */
.ad-box {
  width: 100%;
  max-width: 100%;
  margin: 16px auto;
  padding: 0;
  background: transparent;
  border: none;
  text-align: center;
}
.ad-box__label {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  padding: 6px 12px 0;
  text-align: center;
}
.ad-box__inner {
  padding: 6px 0 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ad-box__inner iframe,
.ad-box__inner img,
.ad-box__inner > div {
  max-width: 100% !important;
}
.ad-box__inner iframe {
  margin: 0 auto;
}
.ad-box__inner > div {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.ad-box--feed_after_3,
.ad-box--feed_after_6 {
  margin: 14px 0;
}
.ad-box--market_top {
  margin: 20px 0;
}
.ad-box--sidebar_market {
  margin: 16px 0;
  min-height: 250px;
}
.ad-box--blog_after_content {
  margin: 24px 0 8px;
}

/* ---------- Modern typography ---------- */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6,
.card-header h5, .card-header h6,
.post-header .post-author-name,
.blog-wrapper h3 {
  letter-spacing: -0.02em;
}

/* ---------- Feed post cards: floating depth + hover lift ---------- */
.js_posts_stream .post {
  border-radius: 14px !important;
  border: 1px solid rgba(157, 78, 221, 0.32) !important;
  background: #151519 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.35), 0 0 24px rgba(157, 78, 221, 0.14) !important;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease, border-color 0.22s ease;
}
.js_posts_stream .post:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.45), 0 22px 55px rgba(0, 0, 0, 0.5), 0 0 46px rgba(168, 85, 247, 0.4) !important;
  border-color: rgba(168, 85, 247, 0.6) !important;
}

/* ---------- Generic cards: softer corners + depth ---------- */
body.night-mode .card,
body .card {
  border-radius: 14px !important;
  border-color: rgba(157, 78, 221, 0.32) !important;
  background: #151519 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.35), 0 0 24px rgba(157, 78, 221, 0.14) !important;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease;
}
body.night-mode .card[class*="post"]:hover,
body .card[class*="post"]:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.45), 0 22px 55px rgba(0, 0, 0, 0.5), 0 0 46px rgba(168, 85, 247, 0.4) !important;
}

/* ---------- Card entrance animation (fade + rise) ---------- */
@keyframes sylt-card-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.js_posts_stream .post {
  animation: sylt-card-in 0.45s ease both;
}
.js_posts_stream .post:nth-child(2) { animation-delay: 0.06s; }
.js_posts_stream .post:nth-child(3) { animation-delay: 0.12s; }
.js_posts_stream .post:nth-child(4) { animation-delay: 0.18s; }
.js_posts_stream .post:nth-child(5) { animation-delay: 0.24s; }
.js_posts_stream .post:nth-child(6) { animation-delay: 0.3s; }

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .js_posts_stream .post,
  .card {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Feed spacing: breathing room ---------- */
.js_posts_stream > ul > li,
.js_posts_stream .post {
  margin-bottom: 18px;
}
.card-body {
  padding: 18px 20px;
}

/* ---------- Color refinement: vibrant purple accents ---------- */
a, .link-primary {
  color: #b06ef5 !important;
  transition: color 0.15s ease;
}
a:hover, .link-primary:hover {
  color: #c98aff !important;
}
.btn {
  border-radius: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn-primary {
  background: #8b2fd6 !important;
  border-color: #a855f7 !important;
}
.btn-primary:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
  background: #9b3de8 !important;
}
.night-mode .btn-primary {
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.45);
}
.main-header .navbar .nav-link.active,
.main-header .navbar .nav-item.active .nav-link {
  color: #b06ef5 !important;
}

/* ---------- Header polish ---------- */
.main-header {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 20px rgba(0, 0, 0, 0.35);
}

/* ---------- Smooth theme transitions ---------- */
body, .card, .main-header, .btn {
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* ---------- Empty ad slot handling (JS toggles this) ---------- */
.ad-box--empty {
  display: none !important;
}

/* ---------- Weather widget cleanup ---------- */
.sylt-weather-widget,
.card-body [id^="ww_"] {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  overflow: hidden;
  border-radius: 10px;
}
.sylt-weather-widget iframe,
.sylt-weather-widget .ww_widget,
.card-body [id^="ww_"] iframe {
  width: 100% !important;
  display: block;
}

/* ---------- Reaction popup: above the React button ---------- */
.reactions-wrapper .emoji-menu {
  bottom: 34px !important;
  top: auto !important;
  right: -4px !important;
  left: auto !important;
}
.reactions-wrapper .reaction-btn {
  white-space: nowrap;
}
/* The reaction picker (emoji row) was position:fixed -> floated over video.
   Anchor it absolutely above the React button instead. */
.reactions-wrapper .reactions-container {
  position: absolute !important;
  bottom: 34px !important;
  top: auto !important;
  right: 0 !important;
  left: auto !important;
  transform: none !important;
  z-index: 99999 !important;
  background: #1a1a20 !important;
  border: 1px solid rgba(157, 78, 221, 0.35) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 20px rgba(157, 78, 221, 0.15) !important;
}

/* ---------- Mobile: constrain ad creative to viewport ---------- */
@media (max-width: 767px) {
  .ad-box {
    margin: 10px auto;
    width: 100%;
    max-width: 100%;
  }
  .ad-box__inner {
    overflow: hidden !important;
    padding: 4px 0 8px;
  }
  /* Force any wrapper HRF injects to be transparent + fit */
  .ad-box__inner > div,
  .ad-box__inner > div > div {
    background: transparent !important;
    max-width: 100% !important;
  }
  .ad-box__inner iframe {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 50px;
    border: 0;
  }
  .ad-box__label {
    font-size: 8px;
    padding-top: 4px;
  }
}

/* ---------- Dual ad spots (desktop + mobile variants) ---------- */
.ad-box-wrap--mobile {
  display: none;
}
@media (max-width: 767px) {
  .ad-box-wrap--desktop {
    display: none !important;
  }
  .ad-box-wrap--mobile {
    display: block !important;
  }
}
