/* ==========================================================================
   NewsroomIN Top Themed Banner & Ad Space
   ========================================================================== */

.nrin-top-banner-wrapper {
  margin: 1.25rem 0;
  width: 100%;
  clear: both;
  transition: opacity 0.25s ease;
}

/* Placement Modifiers */
.nrin-top-banner-wrapper--above-top-nav {
  margin: 0.85rem 0 0.95rem;
  padding: 0;
  clear: both;
}

.nrin-top-banner-wrapper--above-top-nav .nrin-top-banner-container {
  padding-top: 0;
  padding-bottom: 0;
}

.nrin-top-banner-wrapper--between-topnav-and-masthead,
.nrin-top-banner-wrapper--above-masthead {
  margin: 0.75rem 0;
  padding: 0;
}

.nrin-top-banner-wrapper--above-top-nav.nrin-top-banner-wrapper--frame-seamless,
.nrin-top-banner-wrapper--between-topnav-and-masthead.nrin-top-banner-wrapper--frame-seamless {
  background: transparent !important;
  border: none !important;
}

.nrin-top-banner-wrapper--above-top-nav.nrin-top-banner-wrapper--frame-dark,
.nrin-top-banner-wrapper--between-topnav-and-masthead.nrin-top-banner-wrapper--frame-dark {
  background: #000000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.35rem 0;
}

.nrin-top-banner-wrapper--between-nav-and-highlights,
.nrin-top-banner-wrapper--above-hero {
  margin-top: -1.25rem !important;
  margin-bottom: 0.75rem !important;
}

.nrin-top-banner-wrapper--between-nav-and-highlights.nrin-top-banner-wrapper--frame-seamless,
.nrin-top-banner-wrapper--above-hero.nrin-top-banner-wrapper--frame-seamless {
  margin-top: -1.35rem !important;
  margin-bottom: 0.75rem !important;
}

/* Eliminate hero slider top margin when banner directly precedes it to ensure balanced top & bottom gaps */
.nrin-top-banner-wrapper--between-nav-and-highlights + .hero-slider-section {
  margin-top: 0 !important;
}

.nrin-top-banner-wrapper--below-highlights,
.nrin-top-banner-wrapper--above-og-banner {
  margin-top: 0.75rem !important;
  margin-bottom: 1.5rem !important;
}

/* Stacked banners in the same location */
.nrin-top-banner-wrapper + .nrin-top-banner-wrapper {
  margin-top: 0.85rem !important;
}

/* Container Width */
.nrin-top-banner-container {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  width: 100%;
  box-sizing: border-box;
}

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

/* Adaptive / Fit-to-Creative Container Width */
.nrin-top-banner-wrapper--fit-creative .nrin-top-banner-container {
  display: flex;
  justify-content: center;
}

.nrin-top-banner-wrapper--fit-creative .nrin-top-banner {
  width: fit-content !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  display: inline-flex !important;
}

.nrin-top-banner-wrapper--fit-creative .nrin-banner-link,
.nrin-top-banner-wrapper--fit-creative .nrin-banner-media {
  width: auto !important;
  display: inline-flex !important;
}

/* Header Natural Scroll: Banner scrolls naturally with page content */
.nrin-top-banner-wrapper {
  position: relative;
}

/* Main Banner Box */
.nrin-top-banner {
  position: relative;
  background: var(--top-banner-bg);
  border: 1px solid var(--top-banner-border);
  border-radius: var(--top-banner-radius, 8px);
  box-shadow: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
  transition: transform var(--transition-fast), border-color 0.25s ease, background 0.25s ease;
}

/* Frame Styles */
.nrin-banner-frame--seamless {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  justify-content: center !important;
  align-items: center !important;
}

.nrin-banner-disclosure {
  position: absolute;
  top: 4px;
  right: 8px;
  z-index: 10;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-muted, #64748b);
  padding: 1px 5px;
  border-radius: 2px;
  pointer-events: none;
  line-height: 1.3;
}

.nrin-banner-frame--dark .nrin-banner-disclosure {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
}

.nrin-banner-frame--dark {
  background: #000000 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: none !important;
}

.nrin-banner-frame--card {
  background: var(--top-banner-bg);
  border: 1px solid var(--top-banner-border);
  box-shadow: none;
}

/* Card & Dark Frame: Natural adaptive fit so smaller banners don't sit in massive empty boxes */
.nrin-banner-frame--card.nrin-banner-fit-natural,
.nrin-banner-frame--dark.nrin-banner-fit-natural {
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.nrin-top-banner-wrapper--full-width .nrin-top-banner {
  width: 100% !important;
  border-radius: 0;
  border-left: none;
  border-right: none;
}

/* Height Presets */
.nrin-banner-h-auto {
  min-height: 0 !important;
  height: auto !important;
}

.nrin-banner-h-slim {
  min-height: 90px !important;
  height: 90px !important;
  max-height: 90px !important;
}

.nrin-banner-h-medium {
  min-height: 150px !important;
  height: 150px !important;
  max-height: 150px !important;
}

.nrin-banner-h-billboard {
  min-height: 250px !important;
  height: 250px !important;
  max-height: 250px !important;
}

.nrin-banner-h-poster {
  min-height: 350px !important;
  height: 350px !important;
  max-height: 350px !important;
}

.nrin-banner-h-custom {
  min-height: var(--banner-custom-h, 150px) !important;
  height: var(--banner-custom-h, 150px) !important;
  max-height: var(--banner-custom-h, 150px) !important;
}

/* Image / Poster Content */
.nrin-banner-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-decoration: none;
  overflow: hidden;
  position: relative;
  line-height: 0;
}

.nrin-banner-link:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

.nrin-banner-media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 0;
}

.nrin-banner-img {
  display: block;
  transition: opacity 0.25s ease, transform 0.35s ease;
}

/* When fixed or custom height is active: strictly enforce container height & scale image inside */
.nrin-top-banner:not(.nrin-banner-h-auto) .nrin-banner-link,
.nrin-top-banner:not(.nrin-banner-h-auto) .nrin-banner-media {
  height: 100% !important;
  max-height: 100% !important;
  width: 100%;
}

.nrin-top-banner:not(.nrin-banner-h-auto) .nrin-banner-img {
  height: 100% !important;
  max-height: 100% !important;
  max-width: 100% !important;
}

/* Fit Strategy: Natural inside height bounds */
.nrin-top-banner:not(.nrin-banner-h-auto).nrin-banner-fit-natural .nrin-banner-img {
  width: auto !important;
  height: 100% !important;
  max-height: 100% !important;
  max-width: 100% !important;
  object-fit: contain !important;
  margin: 0 auto;
}

/* Fit Strategy: Contain */
.nrin-top-banner:not(.nrin-banner-h-auto).nrin-banner-fit-contain .nrin-banner-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

/* Fit Strategy: Cover */
.nrin-top-banner:not(.nrin-banner-h-auto).nrin-banner-fit-cover .nrin-banner-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.nrin-banner-link:hover .nrin-banner-fit-cover .nrin-banner-img {
  transform: scale(1.015);
}

/* Pure Auto / Natural Height preset (.nrin-banner-h-auto) */
.nrin-top-banner.nrin-banner-h-auto {
  min-height: 0 !important;
  height: auto !important;
}

.nrin-top-banner.nrin-banner-h-auto .nrin-banner-link,
.nrin-top-banner.nrin-banner-h-auto .nrin-banner-media {
  height: auto;
  width: auto;
  max-width: 100%;
  line-height: 0;
  font-size: 0;
  display: block;
  margin: 0 auto;
}

.nrin-top-banner.nrin-banner-h-auto .nrin-banner-img {
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  display: block;
}

/* Separate Mobile Image Swap */
.nrin-banner-img-mobile {
  display: none;
}

@media (max-width: 768px) {
  .nrin-banner-has-mobile-img .nrin-banner-img-desktop {
    display: none !important;
  }
  .nrin-banner-has-mobile-img .nrin-banner-img-mobile {
    display: block !important;
  }
}

/* HTML / Ad Code Container */
.nrin-banner-ad-box {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.nrin-banner-ad-box iframe,
.nrin-banner-ad-box ins,
.nrin-banner-ad-box img {
  max-width: 100%;
  height: auto;
}

/* Themed Festive / Editorial Announcement Card */
.nrin-festive-card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 2rem;
  box-sizing: border-box;
  color: #ffffff;
  position: relative;
  text-align: center;
  border-radius: var(--top-banner-radius, 8px);
  overflow: hidden;
}

.nrin-festive-badge {
  display: inline-block;
  background: rgba(0, 0, 0, 0.35);
  color: #fbbf24 !important;
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  margin-bottom: 0.6rem;
  border: 1px solid rgba(251, 191, 36, 0.35);
  box-shadow: none;
}

.nrin-festive-title {
  font-family: var(--font-display) !important;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  margin: 0 0 0.4rem !important;
  color: #ffffff !important; /* CRITICAL: Must be white by default, never default h2 black */
  letter-spacing: -0.02em;
}

.nrin-festive-subtext {
  font-family: var(--font-body) !important;
  font-size: 0.9375rem !important;
  line-height: 1.5 !important;
  margin: 0 !important;
  max-width: 680px;
  color: rgba(255, 255, 255, 0.9) !important;
}

/* Festive Preset Backgrounds (High-End Editorial Palettes) */
.nrin-festive--christmas {
  background: linear-gradient(135deg, #450a0a 0%, #881337 50%, #4c0519 100%);
}

.nrin-festive--royal {
  background: linear-gradient(135deg, #09132b 0%, #1e3a8a 50%, #0f172a 100%);
}

.nrin-festive--emerald {
  background: linear-gradient(135deg, #022013 0%, #064e3b 50%, #022c22 100%);
}

.nrin-festive--sunset {
  background: linear-gradient(135deg, #3f0e04 0%, #831843 50%, #31134a 100%);
}

.nrin-festive--purple {
  background: linear-gradient(135deg, #19092c 0%, #3b1764 50%, #17072a 100%);
}

.nrin-festive--obsidian {
  background: linear-gradient(135deg, #090e17 0%, #182234 50%, #090e17 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.nrin-festive--pine {
  background: linear-gradient(135deg, #061910 0%, #134e2e 50%, #061910 100%);
}

.nrin-festive--navy {
  background: linear-gradient(135deg, #070e1d 0%, #172c54 50%, #070e1d 100%);
}

.nrin-festive--cobalt {
  background: linear-gradient(135deg, #0b1535 0%, #1d4ed8 50%, #0b1535 100%);
}

.nrin-festive--light {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
}

.nrin-festive--light .nrin-festive-title {
  color: #0f172a !important;
}

.nrin-festive--light .nrin-festive-subtext {
  color: #475569 !important;
}

.nrin-festive--light .nrin-festive-badge {
  background: #f1f5f9;
  color: #b45309 !important;
  border-color: #fde68a;
}

/* Dark Mode Adaptation for All Presets */
[data-theme="dark"] .nrin-festive--light {
  background: #0d1524 !important;
  color: #f8fafc !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .nrin-festive--light .nrin-festive-title {
  color: #f8fafc !important;
}

[data-theme="dark"] .nrin-festive--light .nrin-festive-subtext {
  color: #94a3b8 !important;
}

[data-theme="dark"] .nrin-festive--light .nrin-festive-badge {
  background: rgba(255, 255, 255, 0.08);
  color: #fbbf24 !important;
  border-color: rgba(251, 191, 36, 0.3);
}

[data-theme="dark"] .nrin-festive-card:not(.nrin-festive--light) {
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

/* Height Adaptations & Compact Festive Card Layout */
.nrin-banner-h-slim .nrin-festive-card,
.nrin-festive-card.nrin-festive--compact {
  padding: 0.5rem 1.25rem !important;
  gap: 0.25rem;
}

.nrin-banner-h-slim .nrin-festive-badge,
.nrin-festive-card.nrin-festive--compact .nrin-festive-badge {
  margin-bottom: 0.15rem;
  font-size: 0.625rem;
  padding: 0.1rem 0.5rem;
}

.nrin-banner-h-slim .nrin-festive-title,
.nrin-festive-card.nrin-festive--compact .nrin-festive-title {
  font-size: 1.05rem !important;
  margin: 0;
  line-height: 1.2;
}

.nrin-banner-h-slim .nrin-festive-subtext,
.nrin-festive-card.nrin-festive--compact .nrin-festive-subtext {
  font-size: 0.8125rem !important;
  margin: 0;
  line-height: 1.3;
}

/* Subtle Disclosure Tag (e.g. ADVERTISEMENT / SPONSORED) */
.nrin-banner-disclosure {
  position: absolute;
  top: 4px;
  right: 8px;
  font-family: var(--font-display);
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--top-banner-label-color);
  background: rgba(0, 0, 0, 0.04);
  padding: 1px 4px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 2;
  user-select: none;
}

[data-theme="dark"] .nrin-banner-disclosure {
  background: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   Mobile Responsive Rules (< 768px)
   ========================================================================== */
@media (max-width: 768px) {
  /* Complete Mobile Hide when configured */
  .nrin-top-banner-wrapper.is-hidden-mobile {
    display: none !important;
  }

  /* Adapted Responsive Behavior */
  .nrin-top-banner-wrapper {
    margin: 0.75rem 0;
  }

  .nrin-top-banner-wrapper--above-top-nav {
    margin: 0.65rem 0;
    padding: 0;
  }

  .nrin-top-banner-container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .nrin-banner-h-billboard,
  .nrin-banner-h-poster {
    height: auto !important;
    min-height: 80px;
    max-height: var(--banner-mobile-max-h, 200px);
  }

  .nrin-banner-h-custom {
    min-height: 0 !important;
    height: var(--banner-custom-h, 150px) !important;
    max-height: var(--banner-custom-h, 150px) !important;
  }

  .nrin-banner-h-medium {
    height: auto !important;
    min-height: 80px;
    max-height: 120px;
  }

  .nrin-banner-h-slim {
    height: auto !important;
    min-height: 60px;
    max-height: 90px;
  }

  .nrin-festive-card {
    padding: 1rem 0.85rem;
  }

  .nrin-festive-title {
    font-size: 1.125rem;
  }

  .nrin-festive-subtext {
    font-size: 0.8125rem;
    line-height: 1.35;
    margin-bottom: 0.6rem;
  }

  .nrin-banner-disclosure {
    top: 2px;
    right: 4px;
    font-size: 0.5rem;
  }

  /* Cap multiple top banners stacked above fold on mobile */
  .nrin-top-banner-wrapper--above-top-nav ~ .nrin-top-banner-wrapper--above-top-nav,
  .nrin-top-banner-wrapper--between-topnav-and-masthead ~ .nrin-top-banner-wrapper--between-topnav-and-masthead {
    display: none !important;
  }
}
