/* CRASA regulatory comparator: the three-step console (Day 2, D2 and S4).
 * Built on ui.css (u- components) and the light theme tokens. Classes here
 * are what is specific to the comparator: the steps, the indicator picker,
 * the flag chips, the bar chart and the result layout.
 */

.c-cmp__hero { padding-block: 32px 24px; }
.c-cmp__hero .u-h1 { font-size: 40px; }
.c-cmp__hero-grid { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 48px; }
.c-cmp__hero .u-figures { margin: 0; }
.c-cmp__hero .u-lead { max-width: 60ch; }
.c-cmp__hero .u-figures { margin-top: 16px; }

.c-cmp { padding-block: 32px 64px; }
.c-cmp__console { display: grid; gap: 24px; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); align-items: start; }
.c-cmp__console > * { min-width: 0; }
.c-cmp__step--1 { grid-row: 1 / span 2; }
.c-cmp__step--2, .c-cmp__step--3 { grid-column: 2; }

.c-cmp__step { background: #FFFFFF; border: 1px solid var(--u-line, #D9E3EC); border-radius: 12px; padding: 24px; }
.c-cmp__step--3 { border-color: var(--u-blue, #7A90C8); border-width: 2px; }
.c-cmp__step-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; }
.c-cmp__step-title { margin: 0 0 16px; font: 600 22px/1.3 var(--u-sans); color: var(--c-green-dark, #0B5F3E); display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.c-cmp__step-n { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--u-tint-blue, #EEF2FA); color: var(--u-blue-ink, #2F4F8F); font-size: 14px; font-weight: 600; }
.c-cmp__step-help { margin: 0 0 16px; color: var(--u-muted, #3F5264); font-size: 16px; }
.c-cmp__count { margin-left: 8px; font-weight: 600; color: var(--u-blue-ink, #2F4F8F); }

/* Step 1: indicators grouped by sector, each with a plain-words line. */
.c-cmp__sectors { display: grid; gap: 20px; }
.c-cmp__sector-title { margin: 0 0 8px; font: 600 16px/1.4 var(--u-sans); color: var(--u-ink, #25384A); padding-bottom: 6px; border-bottom: 2px solid var(--u-blue, #7A90C8); }
.c-cmp__picks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.c-cmp__pick { display: block; min-height: 44px; padding: 8px 12px; border-radius: 8px; border: 1px solid transparent; text-decoration: none; color: var(--u-ink, #25384A); transition: background-color 150ms, border-color 150ms; }
.c-cmp__pick:hover { background: var(--u-pale, #F4F8F6); border-color: var(--u-line, #D9E3EC); }
.c-cmp__pick[aria-current="true"] { background: var(--u-tint-green, #EAF4EF); border-color: var(--c-green, #0F8757); box-shadow: inset 4px 0 0 var(--c-green, #0F8757); }
.c-cmp__pick-name { display: block; font: 600 16px/1.35 var(--u-sans); color: var(--c-green-dark, #0B5F3E); }
.c-cmp__pick-line { display: block; font: 400 14px/1.4 var(--u-sans); color: var(--u-muted, #3F5264); }

/* Step 2: flag chips. */
.c-cmp__chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.c-cmp__chip { min-height: 44px; text-decoration: none; cursor: pointer; transition: background-color 150ms, border-color 150ms, transform 150ms; }
.c-cmp__chip img, .c-cmp__chip svg { width: 22px; height: auto; border-radius: 2px; flex: none; box-shadow: 0 0 0 1px rgba(37,56,74,.15); }
.c-cmp__chip:hover { border-color: var(--c-green, #0F8757); }
.c-cmp__chip[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.c-cmp__chip-x { font-weight: 700; margin-left: 2px; }
.c-cmp__chip--all { font-weight: 600; }
.c-cmp__clear { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: var(--c-link, #0C7A4E); font-weight: 600; }

/* Step 3: result. */
.c-cmp__result-head { margin-bottom: 16px; }
.c-cmp__result-title { margin: 0 0 4px; font: 600 28px/1.25 var(--u-display); color: var(--c-green-dark, #0B5F3E); }
.c-cmp__result-meta { margin: 0; color: var(--u-muted, #3F5264); font-size: 16px; max-width: 80ch; }
.c-cmp__view { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; margin-bottom: 24px; }
.c-cmp__view--browse { grid-template-columns: minmax(0, 1fr); }
.c-cmp__chart { margin: 0; padding: 16px 16px 8px; }
.c-cmp__chart-cap { margin: 0 0 8px; font: 600 14px/1.4 var(--u-sans); color: var(--u-blue-ink, #2F4F8F); }
.c-cmp__chart-frame { overflow-x: auto; }
.c-cmp-chart { display: block; overflow: visible; font-family: var(--u-sans); }
.c-cmp-chart--narrow { display: none; }
@media (max-width: 599.98px) {
  .c-cmp-chart--wide { display: none; }
  .c-cmp-chart--narrow { display: block; }
}
.c-cmp-chart__name { font-size: 14px; fill: var(--u-ink, #25384A); font-weight: 600; }
.c-cmp-chart__value { font-size: 14px; fill: var(--u-ink, #25384A); font-weight: 700; }
.c-cmp-chart__year { font-weight: 400; fill: var(--u-muted, #3F5264); }
.c-cmp-chart__missing { font-size: 14px; fill: var(--u-muted, #3F5264); font-style: italic; }
.c-cmp-chart__bar { fill: var(--u-green, #0F8757); }
/* The second series: the CRASA blue (on white 13.94:1, against the green 3.07:1). */
.c-cmp-chart__bar--second { fill: var(--u-crasa-blue, #052D53); }
.c-cmp-chart__bar { transform-box: fill-box; transform-origin: left center; animation: c-cmp-grow 400ms cubic-bezier(.2,.75,.25,1) both; animation-delay: calc(var(--i, 0) * 30ms); }
@keyframes c-cmp-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.c-cmp__map { padding: 16px; }
.c-cmp__map .c-map-region { margin: 0; }
.c-cmp__words { padding: 20px; display: grid; gap: 12px; }
.c-cmp__words--row { gap: 16px; margin-bottom: 24px; }
.c-cmp__words-label { margin: 0; font: 600 14px/1.4 var(--u-sans); color: var(--u-blue-ink, #2F4F8F); }
.c-cmp__words-text { margin: 0; font-size: 16px; line-height: 1.55; color: var(--u-ink, #25384A); }
.c-cmp__words .c-indicator-note { margin: 0; font-size: 14px; color: var(--u-muted, #3F5264); }
.c-cmp__share { display: grid; gap: 8px; }
.c-cmp__exports { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.c-cmp__exports .u-btn { min-height: 44px; }
.c-cmp__link { display: flex; gap: 8px; }
.c-cmp__link-input { flex: 1 1 auto; min-width: 0; font-size: 14px; }
.c-cmp__share .u-help { margin: 0; }

.c-cmp__tableframe { margin-bottom: 16px; }
.c-cmp__datatable th[scope="row"] { font-weight: 600; background: transparent; position: static; }
.c-cmp__datatable tbody tr:nth-child(even) th { background: var(--u-pale, #F4F8F6); }
.c-cmp__datatable th[scope="row"], .c-cmp__datatable td { font-size: 16px; padding: 12px 16px; border-bottom: 1px solid var(--u-line, #D9E3EC); }
.c-cmp__num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-cmp__datatable tr[data-missing] .c-cmp__num { color: var(--u-muted, #3F5264); font-style: italic; }
.c-cmp__src { font-size: 14px !important; color: var(--u-muted, #3F5264); max-width: 32ch; }
.c-cmp__state-link { display: inline-flex; align-items: center; gap: 8px; color: var(--c-link, #0C7A4E); }
.c-cmp__state-link img { width: 22px; height: auto; }
.c-cmp__foot { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; font-size: 14px; color: var(--u-muted, #3F5264); }
.c-cmp__empty { padding: 24px; }

[data-cmp-swap][aria-busy="true"] .c-cmp__step--3 { opacity: .6; transition: opacity 150ms; }

@media (max-width: 1099.98px) {
  .c-cmp__console { grid-template-columns: minmax(0, 1fr); }
  .c-cmp__step--1 { grid-row: auto; }
  .c-cmp__step--2, .c-cmp__step--3 { grid-column: auto; }
  .c-cmp__sectors { grid-template-columns: 1fr 1fr; }
  .c-cmp__sector[data-sector="postal"] { grid-column: 1 / -1; }
}

@media (max-width: 719.98px) {
  .c-cmp__hero .u-h1 { font-size: 30px; }
  .c-cmp__step { padding: 16px; }
  .c-cmp__sectors { grid-template-columns: 1fr; }
  .c-cmp__sector[data-sector="telecommunications"] .c-cmp__picks,
  .c-cmp__sector[data-sector="postal"] .c-cmp__picks { grid-template-columns: 1fr; }
  .c-cmp__link { flex-direction: column; }
  /* The table becomes one card per member state. */
  .c-cmp__tableframe { border: 0; overflow-x: auto; }
  .c-cmp__datatable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .c-cmp__datatable thead th { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .c-cmp__datatable, .c-cmp__datatable tbody, .c-cmp__datatable tr { display: block; width: 100%; }
  .c-cmp__datatable tr { border: 1px solid var(--u-line, #D9E3EC); border-radius: 12px; margin-bottom: 12px; padding: 8px 0; background: #FFFFFF; }
  .c-cmp__datatable tbody tr:nth-child(even) td, .c-cmp__datatable tbody tr:nth-child(even) th { background: transparent; }
  .c-cmp__datatable th[scope="row"], .c-cmp__datatable td { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 8px; border: 0; padding: 4px 16px; text-align: left; max-width: none; overflow-wrap: anywhere; }
  .c-cmp__datatable td::before, .c-cmp__datatable th[scope="row"]::before { content: attr(data-label); font-weight: 600; font-size: 14px; color: var(--u-muted, #3F5264); font-style: normal; }
  .c-cmp__datatable td:empty { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .c-cmp-chart__bar { animation: none; }
  .c-cmp__pick, .c-cmp__chip { transition: none; }
}

@media print {
  .c-cmp__step--1, .c-cmp__step--2, .c-cmp__share { display: none; }
  .c-cmp-chart__bar { animation: none; }
}
.c-cmp__datatable th[scope="row"] { vertical-align: top; }
.c-cmp__shortcuts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 12px 0 0; font-size: 16px; color: var(--u-muted, #3F5264); }
.c-cmp__shortcuts a { display: inline-flex; align-items: center; min-height: 44px; color: var(--c-link, #0C7A4E); font-weight: 600; }
.c-cmp__shortcuts a[aria-current="true"] { color: var(--c-green-dark, #0B5F3E); text-decoration-thickness: 3px; }
.c-cmp__hero-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 48px; align-items: center; }
.c-cmp__hero-grid { display: block; }
.c-cmp__hero .u-figures { margin-top: 16px; }
.c-cmp__photo { margin: 0; }
.c-cmp__photo-frame { aspect-ratio: 16 / 10; overflow: hidden; border-radius: 12px; border: 1px solid var(--u-line, #D9E3EC); background: var(--u-pale, #F4F8F6); }
.c-cmp__photo-frame picture, .c-cmp__masthead-media picture { display: block; width: 100%; height: 100%; }
.c-cmp__photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c-cmp__result { display: block; }
.c-cmp-chart__row { outline: none; }
@media (max-width: 899.98px) {
  .c-cmp__hero-wrap { grid-template-columns: 1fr; gap: 16px; }
  .c-cmp__photo { order: -1; }
  .c-cmp__photo-frame { aspect-ratio: 16 / 9; max-height: 240px; }
}

/* Home comparison console (C8). */
.c-hcmp { padding-block: 64px; background: var(--u-pale, #F4F8F6); }
.c-hcmp__head { margin-bottom: 24px; max-width: 70ch; }
.c-hcmp__intro { margin: 0; font-size: 18px; color: var(--u-muted, #3F5264); }
.c-hcmp__console { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; align-items: start; }
.c-hcmp__form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; margin-bottom: 8px; }
.c-hcmp__field { margin-bottom: 16px; }
.c-hcmp__field--wide { grid-column: 1 / -1; }
.c-hcmp__apply { grid-column: 1 / -1; justify-self: start; margin-bottom: 16px; }
.c-hcmp__table { background: #FFFFFF; }
.c-hcmp__table td { vertical-align: middle; }
.c-hcmp__summary { margin: 12px 0 0; font-size: 16px; color: var(--u-ink, #25384A); }
.c-hcmp__chart { margin: 0; padding: 20px; background: #FFFFFF; }
.c-hcmp__plain, .c-hcmp__source, .c-hcmp__note { margin: 12px 0 0; font-size: 14px; color: var(--u-muted, #3F5264); }
.c-hcmp__open { margin: 16px 0 0; }
[data-home-compare] [data-cmp-slot][aria-busy="true"] { opacity: .6; transition: opacity 150ms; }
@media (max-width: 899.98px) {
  .c-hcmp { padding-block: 40px; }
  .c-hcmp__console { grid-template-columns: minmax(0, 1fr); }
  .c-hcmp__form { grid-template-columns: 1fr; }
}
.c-hcmp__apply[hidden], [data-cmp-copy][hidden] { display: none; }

/* Browse mode: the result needs the full width for the ranking and the
 * map side by side, so the steps stack and the picker runs in columns. */
@media (min-width: 1100px) {
  .c-cmp__console--browse { grid-template-columns: minmax(0, 1fr); }
  .c-cmp__console--browse .c-cmp__step--1 { grid-row: auto; }
  .c-cmp__console--browse .c-cmp__step--2, .c-cmp__console--browse .c-cmp__step--3 { grid-column: auto; }
  .c-cmp__console--browse .c-cmp__sectors { grid-template-columns: 6fr 3fr 7fr; gap: 24px; }
  .c-cmp__console--browse .c-cmp__sector[data-sector="telecommunications"] .c-cmp__picks,
  .c-cmp__console--browse .c-cmp__sector[data-sector="postal"] .c-cmp__picks { grid-template-columns: 1fr 1fr; }
  .c-cmp__console--browse .c-cmp__view--browse { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
  .c-cmp__console--browse .c-cmp__words--row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
}
.c-hcmp__left, .c-hcmp__right { min-width: 0; }

/* The result table scrolls inside its own frame; the frame never widens its column (1.4.10). */
.c-cmp__tableframe { position: relative; min-width: 0; max-width: 100%; }
