/* my-city-knesset widget — ynet design language. All colors resolve to tokens in tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface-screen);
  color: var(--text-primary);
  font: var(--fw-regular) var(--fs-body)/var(--lh-body) var(--font-ynet);
  font-variant-numeric: tabular-nums;
}
.mck { max-width: 740px; margin: 0 auto; padding: var(--sp-4) var(--sp-3); }
@media (max-width: 420px) { .mck { padding: var(--sp-3) var(--sp-3); } }

/* ----- Buttons / tags (DS recipes) ----- */
.btn { font: var(--fw-bold) var(--fs-body)/1 var(--font-ynet); padding: 0 var(--sp-4); height: 44px; border-radius: var(--r-0); border: 1px solid transparent; cursor: pointer; }
.btn--primary.red { background: var(--btn-primary-red-bg); color: var(--btn-primary-red-fg); }
.btn--primary.red:hover { background: var(--ynet-red-hover); }
.btn:disabled { background: var(--btn-disabled-bg); color: var(--btn-disabled-fg); cursor: default; }
.btn--icon { border-radius: var(--r-round); width: 36px; height: 36px; padding: 0; display: inline-grid; place-items: center; }
.btn--icon.black { background: transparent; border-color: var(--btn-secondary-black); color: var(--btn-secondary-black); }
.btn--icon.black:hover { background: var(--surface-card); }
.btn:focus-visible, .mck__input:focus-visible { outline: 2px solid var(--ynet-black); outline-offset: 2px; }
.tag { display: inline-block; background: var(--surface-tag); border-radius: var(--r-4); padding: var(--sp-half) var(--sp-1); font: var(--fw-regular) var(--fs-caption)/var(--lh-caption) var(--font-ynet); color: var(--text-primary); white-space: nowrap; }

/* ----- Head ----- */
.mck__brand { display: flex; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-2); }
.mck__logo { height: 24px; width: auto; display: block; }
.mck__brand .mck__kicker { margin: 0; padding-inline-start: var(--sp-2); border-inline-start: 1px solid var(--divider-pale); line-height: 1; }
.mck__kicker { margin: 0 0 var(--sp-1); font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-caption); font-weight: var(--fw-bold); }
.mck__title { margin: 0 0 var(--sp-2); font-size: var(--fs-display); line-height: var(--lh-display); font-weight: var(--fw-bold); }
.mck__lede { margin: 0 0 var(--sp-3); font-size: var(--fs-body-lg); line-height: var(--lh-body-lg); color: var(--text-caption); }

/* ----- Search (DS input: radius 0, pale border, black on focus) ----- */
.mck__search { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-2); align-items: end; }
.mck__label { grid-column: 1 / -1; font-weight: var(--fw-bold); }
.mck__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mck__combo { position: relative; }
.mck__input { width: 100%; height: 44px; padding: 0 var(--sp-3); border: 1px solid var(--divider-pale); border-radius: var(--r-0); background: var(--surface-screen); color: var(--text-primary); font: var(--fw-regular) var(--fs-body-lg)/var(--lh-body-lg) var(--font-ynet); appearance: none; }
.mck__input::placeholder { color: var(--text-caption); }
.mck__input:focus { border-color: var(--ynet-black); outline: none; }
.mck__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.mck__list { position: absolute; inset-inline: 0; top: calc(100% - 1px); z-index: 5; margin: 0; padding: 0; list-style: none; background: var(--surface-screen); border: 1px solid var(--ynet-black); max-height: 320px; overflow-y: auto; }
.mck__list li { padding: var(--sp-2) var(--sp-3); cursor: pointer; display: flex; justify-content: space-between; gap: var(--sp-2); border-bottom: 1px solid var(--divider); }
.mck__list li:last-child { border-bottom: 0; }
.mck__list li[aria-selected="true"], .mck__list li:hover { background: var(--surface-card); }
.mck__list li small { color: var(--text-caption); font-size: var(--fs-caption); }
.mck__msg { grid-column: 1 / -1; margin: 0; min-height: var(--lh-caption); font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-caption); }
.mck__msg.is-error { color: var(--text-error); }
@media (max-width: 420px) {
  .mck__search { grid-template-columns: 1fr; }
  .mck__search .btn { width: 100%; }
}

/* ----- Demo banner ----- */
.mck__demo { margin: var(--sp-3) 0 0; padding: var(--sp-2) var(--sp-3); background: var(--surface-card); border-inline-start: 3px solid var(--ynet-black); font-size: var(--fs-caption); line-height: var(--lh-caption); }

/* ----- Results ----- */
.mck__results { margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--divider); }
.mck__cityhead { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-2); }
.mck__city { margin: 0 0 var(--sp-4); font-size: var(--fs-display); line-height: var(--lh-display); font-weight: var(--fw-bold); }
.mck__sub { margin: var(--sp-half) 0 0; color: var(--text-caption); font-size: var(--fs-body); }
.mck__small { color: var(--text-caption); font-size: var(--fs-caption); }

.mck__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); margin: var(--sp-4) 0 0; }
.mck__stat { background: var(--surface-card); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-0); }
.mck__stat dt { margin: 0; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-caption); }
.mck__stat dd { margin: var(--sp-half) 0 0; font-size: var(--fs-stat); line-height: var(--lh-stat); font-weight: var(--fw-bold); }
.mck__stat dd small { display: block; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-caption); font-weight: var(--fw-regular); }
@media (max-width: 420px) { .mck__stat { padding: var(--sp-2); } .mck__stat dd { font-size: var(--fs-body-lg); line-height: var(--lh-body-lg); } }

.mck__h3 { margin: 0 0 var(--sp-2); font-size: var(--fs-body-lg); line-height: var(--lh-body-lg); font-weight: var(--fw-bold); }
.mck__legend { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin: 0 0 var(--sp-3); padding: 0; list-style: none; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-caption); }
.mck__legend li::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-inline-end: var(--sp-1); background: var(--sw); vertical-align: -1px; }

/* Party rows: avatar | name | bar | seats */
.mck__parties, .mck__blocs { margin: 0; padding: 0; list-style: none; }
.mck__row { display: grid; grid-template-columns: 36px minmax(96px, 150px) 1fr 56px; gap: var(--sp-2); align-items: center; padding: var(--sp-1) 0; }
@media (max-width: 420px) { .mck__row { grid-template-columns: 32px minmax(80px, 104px) 1fr 48px; gap: var(--sp-1); } }
.mck__avatar { width: 36px; height: 36px; border-radius: var(--r-round); background: var(--surface-tag); display: grid; place-items: center; overflow: hidden; font-size: 8px; line-height: 1.1; color: var(--text-caption); text-align: center; padding: 3px; overflow-wrap: anywhere; hyphens: auto; }
.mck__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mck__avatar--none { background: transparent; }
/* Ballot slip (פתק): the list's letters, for parties without a portrait */
.mck__slip { width: 36px; height: 30px; background: var(--surface-screen); border: 1px solid var(--divider-pale); box-shadow: 1px 1px 0 var(--divider); display: grid; place-items: center; font-weight: var(--fw-bold); font-size: 13px; line-height: 1; color: var(--text-primary); letter-spacing: -0.02em; }
.mck__slip--long { font-size: 10px; }
@media (max-width: 420px) { .mck__slip { width: 32px; height: 27px; font-size: 12px; } }
@media (max-width: 420px) { .mck__avatar { width: 32px; height: 32px; } }
.mck__name { font-weight: var(--fw-bold); font-size: var(--fs-body); line-height: 1.25; overflow-wrap: anywhere; }
.mck__name small { display: block; font-weight: var(--fw-regular); font-size: var(--fs-caption); color: var(--text-caption); }
.mck__track { height: 22px; background: var(--bar-track); position: relative; }
.mck__fill { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 0; background: var(--bloc-other); transition: width 250ms ease; }
.mck__fill[data-bloc="netanyahu"] { background: var(--bloc-netanyahu); }
.mck__fill[data-bloc="change"] { background: var(--bloc-change); }
/* List letters inside the bar (white on the bloc color); short bars carry them just past the fill in gray */
.mck__letters { position: absolute; inset-inline-start: 6px; top: 50%; transform: translateY(-50%); font: var(--fw-bold) var(--fs-caption)/1 var(--font-ynet); color: var(--surface-screen); white-space: nowrap; letter-spacing: .02em; opacity: 0; transition: opacity 200ms ease 200ms; }
.mck__fill.is-in .mck__letters { opacity: 1; }
.mck__fill--small .mck__letters { inset-inline-start: calc(100% + 6px); color: var(--text-caption); }
.mck__row--under .mck__letters { color: var(--text-primary); }
.mck__row--under .mck__fill--small .mck__letters { color: var(--text-caption); }
.mck__seats { text-align: start; font-weight: var(--fw-bold); font-size: var(--fs-body-lg); line-height: 1.1; }
.mck__seats small { display: block; font-weight: var(--fw-regular); font-size: var(--fs-caption); color: var(--text-caption); }
.mck__row--zero .mck__seats, .mck__row--zero .mck__name { color: var(--text-caption); }

.mck__hr { border: 0; border-top: 1px solid var(--divider); margin: var(--sp-4) 0; }

/* Under-threshold section: rows show vote share; bar scale = share of the threshold, marker at the line */
.mck__under { margin-top: var(--sp-2); }
.mck__threshold-line { display: flex; align-items: center; gap: var(--sp-2); margin: var(--sp-2) 0 var(--sp-1); font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-error); font-weight: var(--fw-bold); }
.mck__threshold-line::before, .mck__threshold-line::after { content: ""; flex: 1; border-top: 2px dashed var(--ynet-red-500); }
.mck__row--under .mck__name, .mck__row--under .mck__seats { color: var(--text-caption); }
.mck__row--under .mck__fill { background: var(--divider-pale); }
.mck__row--under .mck__track::after { content: ""; position: absolute; top: -3px; bottom: -3px; inset-inline-start: var(--mark); border-inline-start: 2px dashed var(--ynet-red-500); }

.mck__blocs .mck__row { grid-template-columns: minmax(96px, 150px) 1fr 56px; padding: var(--sp-2) 0; }
@media (max-width: 420px) { .mck__blocs .mck__row { grid-template-columns: minmax(80px, 110px) 1fr 48px; } }
.mck__blocs .mck__track { height: 30px; }
.mck__blocs .mck__seats { font-size: var(--fs-stat); line-height: var(--lh-stat); }

.mck__foot { margin: var(--sp-3) 0 0; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-caption); }
.mck__source { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2); margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--divider); font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-caption); }
.mck__source strong { color: var(--text-primary); }

.mck__empty { margin-top: var(--sp-4); padding: var(--sp-4); background: var(--surface-card); color: var(--text-caption); text-align: center; }
.mck__warn { margin: 0 0 var(--sp-3); padding: var(--sp-2) var(--sp-3); background: var(--ynet-red-50); color: var(--text-primary); font-size: var(--fs-caption); line-height: var(--lh-caption); }

/* Skeleton while loading */
.mck[aria-busy="true"] .mck__search { opacity: .5; pointer-events: none; }

@media (prefers-reduced-motion: reduce) { .mck__fill { transition: none; } }
