/* Campaign Highlight Description — SRS Part 15 §3.5 (Tables 36-40)
   Figma desktop 3090:127938 (998x336) · mobile 3090:129266 (355x622)
   Font: Figma names the face "UMobile Display"; the family actually served is 'Unbeatable'
   (its OpenType name IS "UMobile Display"). Dropping 'Unbeatable' silently falls through to Arial
   and no numeric gate can see it. */

.uiw-campaign-highlight-description {
  display: block;
  font-family: 'Unbeatable','Arial','Helvetica Neue','Helvetica',sans-serif;
}
/* bootstrap is loaded CONDITIONALLY by the public _Layout, so a global border-box may or may not
   apply — pin it so the widget renders identically on every page. */
.uiw-campaign-highlight-description,
.uiw-campaign-highlight-description * { box-sizing: border-box; }

.uiw-campaign-highlight-description-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  column-gap: 79px;
}
/* Not in SRS/Figma (§3.5 calls this a single-item widget) — only fires when a placement renders
   more than one item, e.g. displayMode "all". See gap report B5. */
.uiw-campaign-highlight-description-item + .uiw-campaign-highlight-description-item { margin-top: 64px; }

/* Figma crops an 881x541 landscape fill into a 287x338 portrait window; the computed window centre
   (278.9) vs image centre (274.85) shows the crop is effectively CENTRED, so plain cover+center
   reproduces it without baking a bias that would mis-crop a correctly-sized production upload
   (SRS recommends 574x676). */
.uiw-campaign-highlight-description-img {
  display: block;
  width: 287px;
  height: 338px;
  flex-shrink: 0;
  object-fit: cover;
  object-position: center;
}

.uiw-campaign-highlight-description-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  row-gap: 8px;
  width: 632px;
  max-width: 100%;
  min-width: 0;
}

.uiw-campaign-highlight-description-title {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  line-height: 36px;
  letter-spacing: -0.28px;   /* Figma letterSpacing -1 is a PERCENT: -1% x 28px */
  color: #000000;
  text-align: left;
  /* AB#132471: `-body` sets align-items:flex-start, so title/desc are flex items sized to their own
     content — a 500-char unbroken string sized the title to 8304px and spilled out of the 632px
     body. `anywhere` (unlike `break-word`) also shrinks the min-content width, so unbreakable
     content can no longer stretch the box; max-width pins it to the body regardless. */
  max-width: 100%;
  overflow-wrap: anywhere; /* Figma [word-break:break-word] */
}

.uiw-campaign-highlight-description-desc {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0px;       /* computes to "normal" — Figma letterSpacing 0 */
  color: #333333;
  text-align: left;
  max-width: 100%;           /* AB#132471 — same reasoning as -title above */
  overflow-wrap: anywhere;
}
/* Plain-text description (HTML-encoded at render): keep the editor's line breaks, so a blank line between
   two paragraphs renders as one empty line - the same 24px/18px gap the authored <p> rule below gives.
   19/10 tng-prepaid-plan-campaign intro (3 paragraphs on PROD). No item held a line break before. */
.uiw-campaign-highlight-description-desc { white-space: pre-line; }
/* R3 BA 21/10: description switched to the rich-text editor. Authored HTML carries its own blocks, and the newlines
   between them in the markup must not turn into extra blank lines; plain-text items (no block child) keep pre-line. */
.uiw-campaign-highlight-description-desc:has(> p, > ul, > ol, > div, > h2, > h3, > h4, > table) { white-space: normal; }
/* description is authored rich text: it emits its own <p>. Reset the outer margins so authored
   spacing cannot break the 8px title/description flex gap, and give inner paragraphs the one blank
   line the design shows between them (24px = one 24px line). */
.uiw-campaign-highlight-description-desc > :first-child { margin-top: 0; }
.uiw-campaign-highlight-description-desc > :last-child { margin-bottom: 0; }
.uiw-campaign-highlight-description-desc p { margin: 0 0 24px; }

/* ---- mobile ---------------------------------------------------------------
   767px is the repo-wide breakpoint (~1700 uses in src/Uop.CMS.Widgets/*.css), NOT the 355px
   Figma frame width — a bespoke breakpoint would leave this widget desktop-shaped while the rest
   of the page has already gone mobile. */
@media (max-width: 767px) {
  .uiw-campaign-highlight-description-item {
    flex-direction: column;
    align-items: center;
    column-gap: normal;
    row-gap: 26px;
  }
  .uiw-campaign-highlight-description-img { width: 269px; height: 316px; }
  /* width goes fluid: the Figma mobile frame is 355px only because it sits at x=20 in a 375px
     device — that 20px gutter belongs to the page, not to the widget. */
  .uiw-campaign-highlight-description-body { align-items: center; width: 100%; }
  .uiw-campaign-highlight-description-title {
    font-size: 24px;
    line-height: 28px;
    letter-spacing: -0.24px;  /* -1% x 24px */
    text-align: center;
  }
  .uiw-campaign-highlight-description-desc {
    font-size: 14px;
    font-weight: 500;
    line-height: 18px;
    color: #4d4d4d;
    text-align: center;
  }
  .uiw-campaign-highlight-description-desc p { margin: 0 0 18px; }
}
