/* OD-42 Banner V1 — public slot component. Ships as src/MuaBanBiz.Web/wwwroot/css/banner.css, verbatim.
   Self-contained on purpose: every value is scoped to .bn-slot (no :root, no element selectors), so this
   file can load after site.css + mb-compose.css on every public page and in the Admin preview without
   changing a single rule either of them defines. Values mirror mb-compose.css's Navy/Gold tokens.
   No inline style anywhere: the CSP has style-src 'self' with no nonce, so variants are classes only. */
.bn-slot {
  --bn-navy-950: #061321;
  --bn-navy-900: #0B2036;
  --bn-navy-800: #12304C;
  --bn-navy-700: #1A4269;
  --bn-gold-700: #70551D;
  --bn-gold-500: #AB8B3E;
  --bn-gold-300: #D9C489;
  --bn-gold-100: #F3E9CE;
  --bn-gold-gradient: linear-gradient(135deg, #D3B36A 0%, #A9832E 55%, #6B5417 100%);
  --bn-n-100: #EDF1F7;
  --bn-n-200: #DCE4EF;
  --bn-n-300: #C3CFE0;
  --bn-n-600: #4E6178;
  --bn-surface: #FFFFFF;
  --bn-on-navy: #FFFFFF;
  --bn-on-navy-muted: #C9D3E0;
  --bn-r-md: 8px;
  --bn-r-lg: 12px;
  --bn-sh-1: 0 1px 2px rgba(11, 32, 54, .06), 0 1px 3px rgba(11, 32, 54, .04);

  container: bn / inline-size;
  display: block;
  min-width: 0;
  margin: 0;
}

/* Home only: the slot sits between .mb-find and .mb-listings, which space themselves with top margins
   (2.2rem / 2rem), not a flex gap. List and detail pages place the slot inside .acc, whose
   flex gap (1rem) already spaces it, so the default margin stays 0 there. */
.bn-slot.is-home { margin-top: 2rem; }

/* One link per banner: the whole surface is the click target (one counted click, one focus stop). */
.bn {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--bn-r-lg);
  color: var(--bn-navy-900);
  text-decoration: none;
  font: inherit;
}
.bn:focus-visible { outline: 2px solid var(--bn-gold-500); outline-offset: 2px; }

/* Label "Quảng cáo" / "MUABAN BIZ" — always present, never hidden by a variant (BN-10). 12px floor. */
.bn-label {
  display: inline-flex;
  align-items: center;
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--bn-n-300);
  border-radius: 4px;
  font-size: 0.75rem;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--bn-n-600);
  white-space: nowrap;
}

/* ------------------------------------------------------------- content banner (controlled) -- */
.bn-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem 2rem;
  min-height: 7.5rem;
  padding: 1.25rem 1.75rem;
  border: 1px solid transparent;
}
.bn-text { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.bn-meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.bn-eyebrow { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bn-gold-700); }
.bn-title { display: block; font-size: 1.25rem; line-height: 1.35; font-weight: 700; overflow-wrap: anywhere; text-wrap: balance; }
.bn-body { display: block; font-size: 0.95rem; line-height: 1.5; color: var(--bn-n-600); overflow-wrap: anywhere; max-width: 46rem; }
.bn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0 1.25rem;
  border-radius: var(--bn-r-md);
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 120ms cubic-bezier(.2, 0, 0, 1), filter 120ms cubic-bezier(.2, 0, 0, 1);
}
.bn-cta::after { content: "→"; }

/* Variant: Navy — the Home spotlight's own treatment (navy depth + gold top hairline). */
.bn-content.is-navy {
  background: linear-gradient(160deg, var(--bn-navy-800) 0%, var(--bn-navy-900) 62%, var(--bn-navy-950) 100%);
  color: var(--bn-on-navy);
}
.bn-content.is-navy::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--bn-gold-gradient); }
.bn-content.is-navy .bn-eyebrow { color: var(--bn-gold-300); }
.bn-content.is-navy .bn-body { color: var(--bn-on-navy-muted); }
.bn-content.is-navy .bn-label { border-color: rgba(255, 255, 255, .38); color: var(--bn-on-navy-muted); }
.bn-content.is-navy .bn-cta { background: var(--bn-gold-gradient); color: var(--bn-navy-950); }
.bn-content.is-navy:hover .bn-cta { filter: brightness(1.08); }

/* Variant: Gold — light gold field, navy action. */
.bn-content.is-gold { background: var(--bn-gold-100); border-color: var(--bn-gold-300); }
.bn-content.is-gold .bn-label { border-color: var(--bn-gold-500); color: var(--bn-gold-700); }
.bn-content.is-gold .bn-cta { background: var(--bn-navy-800); color: var(--bn-on-navy); }
.bn-content.is-gold:hover .bn-cta { background: var(--bn-navy-900); }

/* Variant: Light — white card, gold leading rule; the quietest option. */
.bn-content.is-light { background: var(--bn-surface); border-color: var(--bn-n-200); box-shadow: inset 4px 0 0 var(--bn-gold-500), var(--bn-sh-1); }
.bn-content.is-light .bn-cta { background: var(--bn-navy-800); color: var(--bn-on-navy); }
.bn-content.is-light:hover .bn-cta { background: var(--bn-navy-900); }

/* Narrow slot (phone, or any container under 40rem): stack, CTA full width. A container query, not a
   viewport query, so the Admin preview frames render exactly what a phone shows. */
@container bn (max-width: 40rem) {
  .bn-content { grid-template-columns: minmax(0, 1fr); min-height: 0; padding: 1.1rem 1.15rem 1.15rem; gap: 0.85rem; }
  .bn-title { font-size: 1.1rem; }
  .bn-cta { width: 100%; }
}

/* -------------------------------------------------------------------------- image banner -- */
/* Width/height attributes on <img>/<source> (1200×200 desktop, 800×400 mobile) reserve the exact box
   before the file arrives: no layout shift. The breakpoint is the <picture> media query (48rem). */
.bn-image { border: 1px solid var(--bn-n-200); background: var(--bn-n-100); line-height: 0; }
.bn-image picture, .bn-image img { display: block; width: 100%; max-width: 100%; height: auto; }
.bn-image .bn-label {
  position: absolute; top: 0.5rem; right: 0.5rem;
  border-color: transparent; background: rgba(255, 255, 255, .92); color: var(--bn-navy-900);
  line-height: 1.35;
}
.bn-image:hover { border-color: var(--bn-gold-500); }

@media (prefers-reduced-motion: reduce) {
  .bn-cta { transition: none; }
}
@media (forced-colors: active) {
  .bn { border: 1px solid CanvasText; }
  .bn-cta { border: 1px solid ButtonText; }
}
