/* Segmentation pages (/products/segmentation and its sub-pages; partial seg-assets). Builds on subpages.css (--sp-*
   colours, .sp-card, .sp-wide) and ai-models.css (.aim-table). Components:
   .seg-builder  the hero drawing: a segment with its conditions and an audience estimate
   .seg-types    the four segment types as cards
   .seg-q        the six questions every campaign answers, each with its models
   .seg-chip     a model or condition pill (.is-filter: decides who is in; .is-shape: decides the offer)
   .seg-recipe   audience cards of a goal page: who (sentence + condition chips) and what they get
   .seg-exclude  the "who never gets this" box that opens every goal page
   .seg-player   the example player of a goal page
   .seg-matrix   the goal x model grid (dots: filter / shape)
   .seg-where    small tiles: where segments are used
   .seg-rules    numbered rules (when models disagree) */

/* ---------------------------------------------------------------- hero drawing: a segment card */
.seg-builder { width: 100%; max-width: 30rem; margin: 0 auto; border: 1px solid rgba(255, 255, 255, .14); border-radius: 1rem; background: #fff; box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, .35); overflow: hidden; font-family: "Lexend Deca", sans-serif; color: var(--sp-ink); text-align: left; }
.seg-builder_head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .875rem 1.125rem; border-bottom: 1px solid var(--sp-line); background: var(--sp-soft); }
.seg-builder_name { font-size: .9375rem; font-weight: 600; }
.seg-builder_type { padding: .1875rem .5rem; border-radius: 1rem; background: rgba(17, 206, 215, .14); color: #0a7f86; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.seg-builder_body { display: flex; flex-direction: column; gap: .5rem; padding: 1rem 1.125rem; }
.seg-builder_row { display: flex; align-items: center; gap: .625rem; padding: .625rem .75rem; border: 1px solid var(--sp-line); border-radius: .625rem; font-size: .875rem; line-height: 1.35; }
.seg-builder_row b { font-weight: 600; }
.seg-builder_op { flex: none; min-width: 2.75rem; padding: .125rem .375rem; border-radius: .375rem; background: var(--sp-ink); color: #fff; font-size: .6875rem; font-weight: 700; letter-spacing: .04em; text-align: center; }
.seg-builder_row.is-not .seg-builder_op { background: var(--sp-red); }
.seg-builder_foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .875rem 1.125rem; border-top: 1px solid var(--sp-line); font-size: .875rem; color: var(--sp-muted); }
.seg-builder_n { font-size: 1.25rem; font-weight: 700; color: var(--sp-ink); font-variant-numeric: tabular-nums; }
.seg-builder_live { display: inline-flex; align-items: center; gap: .375rem; font-size: .8125rem; color: #138a4f; font-weight: 600; }
.seg-builder_live::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: #2ecc71; box-shadow: 0 0 0 .25rem rgba(46, 204, 113, .2); }

/* ---------------------------------------------------------------- chips */
.seg-chip { display: inline-flex; align-items: center; gap: .4375rem; padding: .3125rem .75rem; border-radius: 1rem; border: 1px solid #d5d9e6; background: #fff; color: var(--sp-ink); font-size: .8125rem; font-weight: 600; line-height: 1.3; text-decoration: none; white-space: nowrap; transition: border-color .15s, background-color .15s; }
/* the role marker matches the goal grid: a red dot decides who is in, a cyan ring shapes the offer */
.seg-chip.is-filter::before, .seg-chip.is-shape::before { content: ""; flex: none; width: .5625rem; height: .5625rem; border-radius: 50%; box-sizing: border-box; }
.seg-chip.is-filter::before { background: var(--sp-red); }
.seg-chip.is-shape::before { border: 2px solid #0fb5bd; }
a.seg-chip::after { content: "\2192"; margin-left: -.0625rem; color: var(--sp-muted); font-weight: 400; transition: transform .15s; }
a.seg-chip:hover { border-color: var(--sp-ink); background: var(--sp-soft); }
a.seg-chip:hover::after { transform: translateX(2px); color: var(--sp-ink); }
.seg-chip.is-never { border-color: var(--sp-ink); background: var(--sp-ink); color: #fff; }
a.seg-chip.is-never::after { color: rgba(255, 255, 255, .7); }
a.seg-chip.is-never:hover { background: #2b2f45; }
a.seg-chip.is-never:hover::after { color: #fff; }
.seg-chips { display: flex; flex-wrap: wrap; gap: .375rem; }
.seg-legend { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; margin: 0 0 1.5rem; font-size: .875rem; color: var(--sp-muted); }
.seg-legend span { display: inline-flex; align-items: center; gap: .5rem; }

/* ---------------------------------------------------------------- the four segment types */
.seg-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.seg-type { display: flex; flex-direction: column; gap: .75rem; padding: 1.5rem; border: 1px solid var(--sp-line); border-radius: .875rem; background: #fff; color: var(--sp-ink); text-decoration: none; transition: border-color .2s, box-shadow .2s; }
a.seg-type:hover { border-color: var(--sp-ink); box-shadow: 0 .75rem 1.5rem rgba(24, 27, 43, .08); }
.seg-type_tag { align-self: flex-start; padding: .1875rem .625rem; border-radius: 1rem; background: var(--sp-soft); color: var(--sp-muted); font-size: .75rem; font-weight: 600; letter-spacing: .02em; }
.seg-type_name { margin: 0; font-size: 1.25rem; font-weight: 600; line-height: 1.3; }
.seg-type_d { margin: 0; color: var(--sp-muted); line-height: 1.55; }
.seg-type_ex { margin: 0; padding: .625rem .875rem; border-left: 3px solid var(--sp-cyan); border-radius: 0 .5rem .5rem 0; background: var(--sp-soft); font-size: .9375rem; line-height: 1.45; }
.seg-type_more { margin-top: auto; font-weight: 600; color: #0a7f86; }

/* ---------------------------------------------------------------- the six questions */
.seg-q { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .875rem; margin: 0; padding: 0; list-style: none; counter-reset: segq; }
.seg-q_item { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: .25rem 1rem; padding: 1.25rem 1.375rem; border: 1px solid var(--sp-line); border-radius: .875rem; background: #fff; }
.seg-q_item::before { counter-increment: segq; content: counter(segq); grid-row: span 3; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--sp-red); color: #fff; font-weight: 700; }
.seg-q_t { margin: 0; font-size: 1.125rem; font-weight: 600; color: var(--sp-ink); }
.seg-q_d { margin: 0; color: var(--sp-muted); line-height: 1.5; }
.seg-q_item .seg-chips { margin-top: .5rem; }

/* ---------------------------------------------------------------- the example player */
.seg-player { width: 100%; max-width: 30rem; border: 1px solid var(--sp-line); border-radius: .875rem; background: #fff; box-shadow: 0 1rem 2rem rgba(24, 27, 43, .08); overflow: hidden; color: var(--sp-ink); }
.seg-player_head { display: flex; align-items: center; gap: .875rem; padding: 1rem 1.125rem; border-bottom: 1px solid var(--sp-line); background: var(--sp-soft); }
.seg-player_face { display: grid; place-items: center; flex: none; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--sp-ink); color: #fff; font-weight: 700; }
.seg-player_name { font-weight: 600; }
.seg-player_who { font-size: .875rem; color: var(--sp-muted); }
.seg-player_rows { margin: 0; padding: .375rem 1.125rem; }
.seg-player_row { display: flex; justify-content: space-between; gap: 1rem; padding: .625rem 0; border-bottom: 1px solid var(--sp-line); font-size: .9375rem; }
.seg-player_row:last-child { border-bottom: 0; }
.seg-player_row dt { color: var(--sp-muted); }
.seg-player_row dd { margin: 0; font-weight: 600; text-align: right; }
.seg-player_then { padding: .875rem 1.125rem; border-top: 1px solid var(--sp-line); background: rgba(17, 206, 215, .08); font-size: .9375rem; line-height: 1.45; }

/* ---------------------------------------------------------------- recipes: audience cards
   Each card: a name, "Who" (one plain sentence and the conditions as chips) and "What they get" (one sentence). */
.seg-recipe { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; }
.seg-recipe_row { display: flex; flex-direction: column; gap: 1rem; padding: 1.5rem; border: 1px solid var(--sp-line); border-radius: .875rem; background: #fff; }
.seg-recipe_name { margin: 0; font-size: 1.125rem; font-weight: 600; line-height: 1.3; color: var(--sp-ink); }
.seg-recipe_lbl { margin: 0 0 .375rem; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sp-muted); }
.seg-recipe_say { margin: 0 0 .625rem; color: var(--sp-ink); line-height: 1.5; }
.seg-recipe_get { margin-top: auto; padding: .875rem 1rem; border-radius: .625rem; background: rgba(17, 206, 215, .08); }
.seg-recipe_get .seg-recipe_lbl { color: #0a7f86; }
.seg-recipe_then { margin: 0; color: var(--sp-ink); line-height: 1.5; }
/* in a recipe the chips only list the conditions: no role marker */
.seg-recipe .seg-chip { font-weight: 500; color: var(--sp-muted); }
.seg-recipe .seg-chip::before { display: none; }
.seg-recipe .seg-chip.is-never { color: #fff; }
@media screen and (max-width: 767px) { .seg-recipe { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------- who never gets this */
.seg-exclude { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: 1rem; padding: 1.5rem; border-radius: .875rem; background: var(--sp-dark); color: #fff; }
.seg-exclude_icon { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: .75rem; background: rgba(255, 255, 255, .1); }
.seg-exclude_icon svg { width: 1.5rem; height: 1.5rem; }
.seg-exclude_t { margin: 0 0 .5rem; font-size: 1.125rem; font-weight: 600; color: #fff; }
.seg-exclude ul { margin: 0; padding-left: 1.125rem; color: #c9cee3; line-height: 1.6; }
.seg-exclude p { margin: .75rem 0 0; color: #c9cee3; font-size: .9375rem; line-height: 1.5; }
.seg-exclude a { color: #7fe7ec; text-decoration: underline; }

/* ---------------------------------------------------------------- goal x model grid */
.seg-matrix_wrap { width: 100%; overflow-x: auto; border: 1px solid var(--sp-line); border-radius: .875rem; background: #fff; }
.seg-matrix { width: 100%; min-width: 46rem; border-collapse: collapse; font-size: .875rem; }
.seg-matrix th, .seg-matrix td { padding: .75rem .625rem; border-bottom: 1px solid var(--sp-line); text-align: center; vertical-align: middle; }
.seg-matrix thead th { background: var(--sp-soft); color: var(--sp-muted); font-size: .75rem; font-weight: 600; line-height: 1.25; }
.seg-matrix tbody th { text-align: left; font-weight: 600; white-space: nowrap; }
.seg-matrix tbody th a { color: var(--sp-ink); text-decoration: none; }
.seg-matrix tbody th a:hover { text-decoration: underline; }
.seg-matrix tbody tr:last-child > * { border-bottom: 0; }
.seg-dot { display: inline-block; width: .875rem; height: .875rem; border-radius: 50%; vertical-align: middle; }
.seg-dot.is-filter { background: var(--sp-red); }
.seg-dot.is-shape { border: 2px solid var(--sp-cyan); }

/* ---------------------------------------------------------------- where segments are used */
.seg-where { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .875rem; }
.seg-where_tile { padding: 1.125rem 1.25rem; border: 1px solid var(--sp-line); border-radius: .75rem; background: #fff; }
.seg-where_t { margin: 0 0 .375rem; font-size: 1rem; font-weight: 600; color: var(--sp-ink); }
.seg-where_d { margin: 0; color: var(--sp-muted); font-size: .9375rem; line-height: 1.45; }

/* ---------------------------------------------------------------- numbered rules */
.seg-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; counter-reset: segr; }
.seg-rules > li { position: relative; padding: 1.25rem 1.375rem 1.25rem 3.75rem; border: 1px solid var(--sp-line); border-radius: .875rem; background: #fff; line-height: 1.5; color: var(--sp-muted); }
.seg-rules > li::before { counter-increment: segr; content: counter(segr); position: absolute; left: 1.25rem; top: 1.125rem; display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--sp-ink); color: #fff; font-size: .875rem; font-weight: 700; }
.seg-rules strong { display: block; margin-bottom: .25rem; color: var(--sp-ink); }

/* anchored recipes (predictive page): leave room under the fixed header */
.seg-anchor { scroll-margin-top: calc(var(--nav-fixed-h, 6rem) + 1rem); }

@media screen and (max-width: 991px) {
  .seg-q { grid-template-columns: minmax(0, 1fr); }
  .seg-where { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seg-rules { grid-template-columns: minmax(0, 1fr); }
}
@media screen and (max-width: 767px) {
  .seg-types, .seg-where { grid-template-columns: minmax(0, 1fr); }
  .seg-exclude { grid-template-columns: minmax(0, 1fr); }
}

/* Ready-made page: one small table per template theme */
.seg-theme { font-size: 1.25rem; line-height: 1.3; margin: 2.5rem 0 .75rem; }
.seg-theme:first-of-type { margin-top: 1.5rem; }
.seg-tpl { table-layout: fixed; width: 100%; }
.seg-tpl th:first-child, .seg-tpl td:first-child { width: 52%; }
@media (max-width: 767px) { .seg-tpl th:first-child, .seg-tpl td:first-child { width: 50%; } }

/* Hub: one side-by-side block per segment type (eyebrow tag, "Explore" link), grey bands between white ones */
.slde_section.sp-band { background: var(--sp-soft); }
.slde_section.sp-band .sp-visual { background: #fff; box-shadow: inset 0 0 0 1px var(--sp-line); }
.seg-eyebrow { display: inline-flex; align-items: center; gap: .5rem; margin: 0 0 1rem; padding: .25rem .75rem; border-radius: 1rem; background: rgba(17, 206, 215, .12); color: #0a7f86; font-size: .8125rem; font-weight: 600; letter-spacing: .02em; }
.seg-eyebrow::before { content: ""; width: .4375rem; height: .4375rem; border-radius: 50%; background: #0fb5bd; }
.seg-more { display: inline-flex; align-items: center; gap: .5rem; margin-top: 1.5rem; padding: .6875rem 1.25rem; border-radius: 2rem; background: var(--sp-ink); color: #fff; font-weight: 600; text-decoration: none; transition: background-color .2s; }
.seg-more::after { content: "\2192"; transition: transform .2s; }
.seg-more:hover { background: #2b2f45; color: #fff; }
.seg-more:hover::after { transform: translateX(3px); }
.seg-after { margin-top: 3.5rem; }
.seg-after_t { margin: 0 0 1.25rem; font-size: 1.5rem; font-weight: 600; line-height: 1.3; color: var(--sp-ink); }
