/* ==========================================================================
   NewsroomIN Ad Suite & Multi-Placement Styles
   ========================================================================== */

/* Universal Ad Slot Container */
.nrin-ad-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
  clear: both;
}

.nrin-ad-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

.nrin-ad-disclosure {
  display: inline-block;
  font-family: var(--font-display, sans-serif);
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
  background: rgba(0, 0, 0, 0.04);
  padding: 1px 5px;
  border-radius: 2px;
  margin-bottom: 0.4rem;
  pointer-events: none;
  user-select: none;
}

[data-theme="dark"] .nrin-ad-disclosure {
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
}

.nrin-ad-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 0;
  max-width: 100%;
  cursor: pointer !important;
  pointer-events: auto !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.nrin-ad-img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  cursor: pointer !important;
  pointer-events: auto !important;
  touch-action: manipulation;
  /* Strictly static: zero transforms or transitions to avoid iframe/viewability glitches */
}

/* HTML / Google Ads Snippet Container: packed rock-solid with zero transforms or animations */
.nrin-ad-code-box {
  display: block;
  width: 100%;
  text-align: center;
  margin: 0 auto;
  overflow: visible;
  box-sizing: border-box;
  line-height: 1;
  position: relative;
  transform: none !important;
  transition: none !important;
  animation: none !important;
}

.nrin-ad-code-box iframe {
  display: block !important;
  margin: 0 auto !important;
  max-width: 100%;
}

.nrin-ad-code-box ins.adsbygoogle,
.nrin-ad-code-box ins {
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
  max-width: 100%;
  text-align: center;
}

.nrin-ad-code-box img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 4px;
}

/* Zero-out any transform/animation on code-based slots to guarantee 100% Google AdSense Active View viewability */
.nrin-ad-type--code,
.nrin-ad-type--code * {
  transform: none !important;
  transition: none !important;
  animation: none !important;
}

/* IAB Vector Mockups & Placeholders */
.nrin-ad-placeholder-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  overflow: hidden;
}

.nrin-iab-svg {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

/* 1. In-Article Content Ads */
.nrin-inarticle-ad {
  margin: 2rem 0;
  padding: 1.25rem 1rem;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .nrin-inarticle-ad {
  background: #0d1524;
  border-color: rgba(255, 255, 255, 0.08);
}

/* Native Sponsored Story Card */
.nrin-ad-sponsor-card {
  width: 100%;
  max-width: 728px;
  margin: 0 auto;
  text-align: left;
  box-sizing: border-box;
}

.nrin-ad-card-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.nrin-ad-card-badge {
  font-family: var(--font-display, sans-serif);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  padding: 2px 7px;
  border-radius: 4px;
}

[data-theme="dark"] .nrin-ad-card-badge {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.25);
}

.nrin-ad-card-partner {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nrin-ad-card-main {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nrin-ad-card-thumb-wrap {
  flex-shrink: 0;
  line-height: 0;
}

.nrin-ad-card-mock-thumb {
  border-radius: 6px;
  display: block;
}

.nrin-ad-card-content {
  flex: 1;
  min-width: 0;
}

.nrin-ad-card-title {
  font-family: var(--font-display, sans-serif);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary, #0f172a);
  margin: 0 0 0.4rem 0;
}

[data-theme="dark"] .nrin-ad-card-title {
  color: #f8fafc;
}

.nrin-ad-card-desc {
  font-family: var(--font-body, sans-serif);
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-secondary, #475569);
  margin: 0 0 0.5rem 0;
}

[data-theme="dark"] .nrin-ad-card-desc {
  color: #94a3b8;
}

.nrin-ad-card-cta {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #2563eb;
  text-decoration: none;
  transition: color 0.15s ease;
}

.nrin-ad-card-cta:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

[data-theme="dark"] .nrin-ad-card-cta {
  color: #60a5fa;
}

@media (max-width: 600px) {
  .nrin-ad-card-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .nrin-ad-card-thumb-wrap {
    width: 100%;
  }
  .nrin-ad-card-mock-thumb {
    width: 100%;
    height: auto;
  }
}

/* 2. Sidebar Ads */
aside.sidebar {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.sidebar-ad-wrapper {
  margin-top: 1.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  min-width: 0;
}

.sidebar-ad-wrapper + .sidebar-ad-wrapper {
  margin-top: 1.5rem;
}

/* Sidebar Ads Rail (Single Article Dynamic Fill) */
.sidebar-ads-rail {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  min-width: 0;
}

.sidebar-ads-rail .sidebar-ad-wrapper {
  /* Zero transforms or transitions to avoid breaking iframe scripts */
  transform: none;
}

.sidebar-ad-wrapper.is-sticky-sidebar-ad,
.sidebar-ad-wrapper.is-sticky-container,
.single .sidebar-ad-wrapper.is-sticky-sidebar-ad,
.single .sidebar-ad-wrapper.is-sticky-container,
.single .sidebar-ads-rail.is-sticky-container .sidebar-ad-wrapper:last-child {
  position: sticky;
  top: 85px;
  z-index: 10;
}

/* Single Article: Sticky Most Read Widget when no ads are present */
@media (min-width: 992px) {
  .single .layout-grid.has-sidebar-right .sidebar.has-no-ads {
    position: relative;
    align-self: stretch;
    height: 100%;
    margin-bottom: 0;
    padding-bottom: 0;
  }

  .single .layout-grid.has-sidebar-right .sidebar.has-no-ads .sidebar-ranked-widget {
    position: sticky;
    top: 72px;
    align-self: start;
    z-index: 10;
    margin-bottom: 0 !important;
  }

  body.admin-bar.single .layout-grid.has-sidebar-right .sidebar.has-no-ads .sidebar-ranked-widget {
    top: 104px;
  }
}

/* ==========================================================================
   Seamless / Frameless Banner Display (Remove Container Box / Background)
   ========================================================================== */
.nrin-frame--seamless,
.nrin-ad--seamless,
.nrin-archive-ad.nrin-archive-ad--seamless,
.nrin-archive-ad.nrin-frame--seamless,
.nrin-article-bottom-ad.nrin-frame--seamless,
.nrin-mid-footer-ad.nrin-frame--seamless,
.nrin-pre-footer-ad.nrin-frame--seamless,
.sidebar-ad-wrapper.nrin-frame--seamless .nrin-sidebar-ad,
.sidebar-ad-wrapper--seamless .nrin-sidebar-ad,
.nrin-inarticle-ad.nrin-frame--seamless {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.nrin-frame--seamless .nrin-ad-placeholder-box,
.nrin-ad--seamless .nrin-ad-placeholder-box {
  border: 1px dashed var(--border-subtle, #cbd5e1);
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .nrin-frame--seamless .nrin-ad-placeholder-box,
[data-theme="dark"] .nrin-ad--seamless .nrin-ad-placeholder-box {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Flush Bottom Sizing: Locks the bottom border of the last ad to match article bottom */
.sidebar-ad-wrapper.is-flush-bottom {
  display: flex !important;
  flex-direction: column;
  box-sizing: border-box;
}

.sidebar-ad-wrapper.is-flush-bottom .nrin-sidebar-ad {
  height: 100% !important;
  display: flex !important;
  flex-direction: column;
  box-sizing: border-box;
}

.sidebar-ad-wrapper.is-flush-bottom .nrin-ad-inner {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.sidebar-ad-wrapper.is-flush-bottom .nrin-ad-placeholder-box {
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-ad-wrapper.is-flush-bottom .nrin-iab-svg {
  max-height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.nrin-sidebar-ad {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  padding: 0.85rem 0.5rem;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .nrin-sidebar-ad {
  background: #0d1524;
  border-color: rgba(255, 255, 255, 0.08);
}

/* Sidebar Ad Inner & Link Elements */
.nrin-sidebar-ad .nrin-ad-inner {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nrin-sidebar-ad .nrin-ad-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Image & SVG Containment - strict proportional scaling to fit sidebar width and height */
.nrin-sidebar-ad .nrin-ad-img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  margin: 0 auto;
  box-sizing: border-box;
}

.nrin-sidebar-ad .nrin-ad-placeholder-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.nrin-sidebar-ad .nrin-iab-svg {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Code & iframe Overflow Containment */
.nrin-sidebar-ad .nrin-ad-code-box {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
  overflow: hidden;
  box-sizing: border-box;
}

.nrin-sidebar-ad .nrin-ad-code-box iframe,
.nrin-sidebar-ad .nrin-ad-code-box ins {
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Format Preset Height Caps for Sidebar Banner Ads */
.nrin-sidebar-ad.nrin-ad-fmt--300-250 .nrin-ad-img,
.nrin-sidebar-ad.nrin-ad-fmt--300-250 .nrin-ad-placeholder-box,
.nrin-sidebar-ad.nrin-ad-fmt--250-250 .nrin-ad-img,
.nrin-sidebar-ad.nrin-ad-fmt--250-250 .nrin-ad-placeholder-box {
  max-height: 250px;
}

.nrin-sidebar-ad.nrin-ad-fmt--200-200 .nrin-ad-img,
.nrin-sidebar-ad.nrin-ad-fmt--200-200 .nrin-ad-placeholder-box {
  max-height: 200px;
}

.nrin-sidebar-ad.nrin-ad-fmt--300-600 .nrin-ad-img,
.nrin-sidebar-ad.nrin-ad-fmt--300-600 .nrin-ad-placeholder-box,
.nrin-sidebar-ad.nrin-ad-fmt--160-600 .nrin-ad-img,
.nrin-sidebar-ad.nrin-ad-fmt--160-600 .nrin-ad-placeholder-box {
  max-height: 600px;
}

/* ==========================================================================
   Fluid Squeezing & Scaling Strategies Across All Panels
   Supports taking large format banners and squeezing them into smaller slots
   ========================================================================== */
.nrin-ad-slot img,
.nrin-ad-slot svg,
.nrin-ad-slot iframe {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Squeeze & Contain: Proportional downscale into slot with zero overflow */
.nrin-scale--squeeze .nrin-ad-img,
.nrin-ad-fit--contain .nrin-ad-img {
  max-width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
  margin: 0 auto;
}

.nrin-scale--squeeze .nrin-ad-placeholder-box svg,
.nrin-scale--squeeze .nrin-iab-svg {
  max-width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
}

/* Full Size / Natural Mode */
.nrin-scale--full .nrin-ad-img,
.nrin-scale--none .nrin-ad-img {
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
}

/* Scale Down Only: Shrinks oversized graphics, keeps natural if smaller */
.nrin-ad-fit--scale-down .nrin-ad-img {
  max-width: 100% !important;
  height: auto !important;
  object-fit: scale-down !important;
}

/* Cover Mode: Fills slot container edge-to-edge */
.nrin-ad-fit--cover .nrin-ad-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}


/* Homepage All News & Sidebar Ad Height Leveling */
.home .layout-grid,
.front-page .layout-grid,
.layout-grid {
  margin-bottom: 2.5rem;
}

.home .layout-grid .content-area > .all-news-section,
.front-page .layout-grid .content-area > .all-news-section {
  margin-bottom: 0 !important;
}

.home .layout-grid .sidebar-ranked-widget,
.front-page .layout-grid .sidebar-ranked-widget {
  margin-bottom: 0 !important;
}

.home .layout-grid .sidebar,
.front-page .layout-grid .sidebar {
  margin-bottom: 0;
}

@media (min-width: 992px) {
  .home .layout-grid.has-sidebar-right,
  .front-page .layout-grid.has-sidebar-right {
    align-items: stretch;
  }

  .home .layout-grid.has-sidebar-right .content-area,
  .front-page .layout-grid.has-sidebar-right .content-area {
    display: flex;
    flex-direction: column;
  }

  .home .layout-grid.has-sidebar-right .content-area > .all-news-section,
  .front-page .layout-grid.has-sidebar-right .content-area > .all-news-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 0 !important;
  }

  .home .layout-grid.has-sidebar-right .content-area > .all-news-section .all-news-box,
  .front-page .layout-grid.has-sidebar-right .content-area > .all-news-section .all-news-box {
    box-sizing: border-box;
    transition: height 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

/* Single Article Layout Grid: Natural top alignment for active ad rail, stretch for no-ads sticky */
.single .layout-grid.has-sidebar-right {
  align-items: start;
}

.single .layout-grid.has-sidebar-right:has(.sidebar.has-no-ads) {
  align-items: stretch;
}

/* 3. Between All News & Footer Showcase Billboard */
.nrin-mid-footer-ad-wrapper {
  margin-top: 0;
  margin-bottom: 2.5rem;
  width: 100%;
  clear: both;
  box-sizing: border-box;
}

.nrin-mid-footer-ad-wrapper:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.nrin-mid-footer-ad-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.nrin-mid-footer-ad-wrapper--full {
  margin-left: calc(-1 * var(--container-pad, 1.25rem));
  margin-right: calc(-1 * var(--container-pad, 1.25rem));
  width: calc(100% + 2 * var(--container-pad, 1.25rem));
}

.nrin-mid-footer-ad-wrapper--full .nrin-mid-footer-ad-container {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

.nrin-mid-footer-ad {
  width: 100%;
  padding: 0.65rem 1rem 0.75rem;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 8px;
  box-shadow: none;
  box-sizing: border-box;
}

.nrin-mid-footer-ad .nrin-ad-disclosure {
  margin-bottom: 0.35rem;
}

[data-theme="dark"] .nrin-mid-footer-ad {
  background: #0d1524;
  border-color: rgba(255, 255, 255, 0.08);
}

/* 4. Pre-Footer Ad (Below Last Category Slider / Above Footer) */
.nrin-pre-footer-ad-wrapper {
  margin-top: 0;
  margin-bottom: 2.5rem;
  width: 100%;
  clear: both;
  box-sizing: border-box;
}

.nrin-pre-footer-ad-wrapper:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.nrin-pre-footer-ad-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.nrin-pre-footer-ad-wrapper--full {
  margin-left: calc(-1 * var(--container-pad, 1.25rem));
  margin-right: calc(-1 * var(--container-pad, 1.25rem));
  width: calc(100% + 2 * var(--container-pad, 1.25rem));
}

.nrin-pre-footer-ad-wrapper--full .nrin-pre-footer-ad-container {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

.nrin-pre-footer-ad {
  width: 100%;
  padding: 0.65rem 1rem 0.75rem;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 8px;
  box-shadow: none;
  box-sizing: border-box;
}

.nrin-pre-footer-ad .nrin-ad-disclosure {
  margin-bottom: 0.35rem;
}

[data-theme="dark"] .nrin-pre-footer-ad {
  background: #0d1524;
  border-color: rgba(255, 255, 255, 0.08);
}

/* Below Article / Above Footer Ad Banner */
.nrin-article-bottom-ad-wrapper {
  margin-top: 0.75rem;
  margin-bottom: 0.35rem;
  width: 100%;
  clear: both;
  box-sizing: border-box;
}

.nrin-article-bottom-ad-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.nrin-article-bottom-ad-wrapper--full {
  margin-left: calc(-1 * var(--container-pad, 1.25rem));
  margin-right: calc(-1 * var(--container-pad, 1.25rem));
  width: calc(100% + 2 * var(--container-pad, 1.25rem));
}

.nrin-article-bottom-ad-wrapper--full .nrin-article-bottom-ad-container {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

/* Smart Congruency: Lock bottom ad to news container width when sidebar rail has no visible ads */
.nrin-article-bottom-ad-wrapper.is-article-width-congruent {
  width: 100%;
}

@media (min-width: 992px) {
  .nrin-article-bottom-ad-wrapper.is-article-width-congruent .nrin-article-bottom-ad-container {
    max-width: calc((100% - 1.25rem) * 0.75);
    width: calc((100% - 1.25rem) * 0.75);
    margin: 0 !important;
  }
}

.nrin-article-bottom-ad {
  width: 100%;
  padding: 0.65rem 1rem 0.75rem;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
}

.nrin-article-bottom-ad .nrin-ad-inner,
.nrin-article-bottom-ad .nrin-ad-placeholder-box {
  width: 100%;
}

.nrin-article-bottom-ad .nrin-iab-svg {
  width: 100%;
  max-width: 100%;
  height: auto;
}

.nrin-article-bottom-ad .nrin-ad-disclosure {
  margin-bottom: 0.35rem;
}

[data-theme="dark"] .nrin-article-bottom-ad {
  background: #0d1524;
  border-color: rgba(255, 255, 255, 0.08);
}

/* Balanced bottom space before site footer */
.site-main {
  padding-bottom: 1.5rem;
}

.home .site-main,
.front-page .site-main {
  padding-bottom: 0;
}

/* Mobile Responsive Optimizations (< 992px & < 768px) */
@media (max-width: 991px) {
  .sidebar-ads-rail[data-mobile="hide"] {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .nrin-inarticle-ad {
    margin: 1.25rem 0;
    padding: 0.75rem 0.5rem;
  }

  .nrin-inarticle-ad .nrin-iab-svg,
  .nrin-article-bottom-ad .nrin-iab-svg,
  .nrin-mid-footer-ad .nrin-iab-svg,
  .nrin-pre-footer-ad .nrin-iab-svg {
    width: 100% !important;
    height: auto !important;
  }

  .nrin-ad-sponsor-card .nrin-ad-card-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .nrin-ad-card-thumb-wrap {
    width: 100%;
    max-width: 100%;
  }

  .nrin-ad-card-mock-thumb {
    width: 100%;
    height: auto;
    max-height: 140px;
  }
}

/* 5. Sticky Bottom Mobile Anchor Banner */
.nrin-mobile-anchor-bar {
  display: none;
}

@media (max-width: 768px) {
  .nrin-mobile-anchor-bar {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #0d1524;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: none;
    padding: 0.35rem 0.5rem;
    box-sizing: border-box;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .nrin-mobile-anchor-bar.is-dismissed {
    transform: translateY(100%);
    pointer-events: none;
  }

  .nrin-mobile-anchor-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 320px;
    margin: 0 auto;
    min-height: 50px;
  }

  .nrin-anchor-close-btn {
    position: absolute;
    top: -8px;
    right: -10px;
    width: 22px;
    height: 22px;
    background: #0f172a;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  }

  .nrin-anchor-close-btn:hover {
    background: #dc2626;
  }
}

/* Device Visibility Utilities */
@media (max-width: 768px) {
  .is-hidden-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .is-hidden-desktop {
    display: none !important;
  }
}

/* ==========================================================================
   Category, Search & All-Posts Archive Ad Suites
   ========================================================================== */

/* Universal Archive Top & Bottom Ad Banners */
.nrin-archive-ad-wrapper {
  width: 100%;
  clear: both;
  box-sizing: border-box;
}

.nrin-archive-ad-wrapper--top {
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
}

.nrin-archive-ad-wrapper--bottom {
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.nrin-archive-ad-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
}

.nrin-archive-ad-wrapper--full {
  margin-left: calc(-1 * var(--container-pad, 1.25rem));
  margin-right: calc(-1 * var(--container-pad, 1.25rem));
  width: calc(100% + 2 * var(--container-pad, 1.25rem));
}

.nrin-archive-ad-wrapper--full .nrin-archive-ad-container {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

.nrin-archive-ad {
  width: 100%;
  padding: 0.65rem 1rem 0.75rem;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
}

[data-theme="dark"] .nrin-archive-ad {
  background: #0d1524;
  border-color: rgba(255, 255, 255, 0.08);
}

.nrin-archive-ad .nrin-ad-inner,
.nrin-archive-ad .nrin-ad-placeholder-box {
  width: 100%;
}

.nrin-archive-ad .nrin-iab-svg {
  width: 100%;
  max-width: 100%;
  height: auto;
}

/* All-Posts (/all-posts/) Layout Grid with Dedicated Side Rail */
.console-body-layout {
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 992px) {
  .console-body-layout.has-sidebar {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    align-items: start;
  }
}

.console-sidebar-col {
  width: 100%;
  max-width: 320px;
}

/* Dedicated Sidebar Rails for Archive, Search & All-Posts */
.sidebar-ads-rail--archive,
.sidebar-ads-rail--search,
.sidebar-ads-rail--allposts {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  box-sizing: border-box;
}

/* View Mode Spacing Adaptations (Grid, List with images, Text-only) */
.console-posts-deck[data-view="text"] {
  min-height: 240px;
}

@media (max-width: 768px) {
  .nrin-archive-ad .nrin-iab-svg {
    width: 100% !important;
    height: auto !important;
  }
}

/* ==========================================================================
   Zero-Glow & Zero-Shadow Rule: Flat, Clean Editorial Ads Across All Units
   ========================================================================== */
.nrin-ad-slot,
.nrin-ad-inner,
.nrin-ad-sponsor-card,
.nrin-top-banner,
.nrin-mobile-anchor-bar,
.sidebar-ad-wrapper,
.nrin-article-bottom-ad,
.nrin-mid-footer-ad,
.nrin-pre-footer-ad,
.nrin-archive-ad {
  box-shadow: none !important;
  text-shadow: none !important;
  filter: none !important;
}

