/* /arbetsgivare/<slug> (the page) and the company card at the foot of an ad. Prefix: em-
   (shared and page) and em-card- (the card). Tokens only, same rule as jobb.css: no colour,
   radius, shadow or motion literal here, so dark mode is free and the page reads as the
   same design system as /jobb/. Narrow-first. Contract: docs/EMPLOYERS-SPEC.md
   §Presentation. */

.em-page, .em-page * { box-sizing: border-box; }

.em-page {
  font-size: var(--text-md);
  line-height: var(--lh-md);
  padding: var(--s-8) var(--st-chrome-gutter) var(--st-section);
  max-width: 1040px;
  margin: 0 auto;
}
.em-page :focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-sm); }
.em-page a:not(.ui-btn) { color: var(--accent-ink); text-decoration: none; }
.em-page a:not(.ui-btn):hover { text-decoration: underline; text-underline-offset: 2px; }
.em-page p { margin: 0; }

/* ---- Loading skeleton -------------------------------------------------------------- */
.em-skel-head, .em-skel-facts, .em-skel-list {
  background: var(--canvas-tint);
  border-radius: var(--r-md);
  margin-bottom: var(--s-5);
}
.em-skel-head { height: 96px; }
.em-skel-facts { height: 220px; }
.em-skel-list { height: 320px; }

/* ---- Head band: logo, name, one line of facts, the way to the ads --------------------- */
.em-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-4);
  padding-bottom: var(--s-6);
  border-bottom: 1px solid var(--line);
}
.em-logo { flex: 0 0 auto; }
.em-logo img { width: 72px; height: 72px; object-fit: contain; padding: var(--s-1); border-radius: var(--r-md); border: 1px solid var(--line); background: var(--card); }
.em-head-body { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; flex: 1 1 auto; }
.em-name {
  font-family: var(--font-display);
  font-size: var(--st-h2, var(--text-2xl));
  line-height: 1.15;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  color: var(--ink);
  margin: 0;
  overflow-wrap: anywhere;
}
.em-sub { color: var(--ink-3); font-size: var(--text-sm); }
.em-head-actions { flex: 0 0 auto; display: flex; gap: var(--s-2); }

/* ---- At a glance: sentence, tiles, size scale ------------------------------------------ */
.em-glance { display: grid; gap: var(--s-5); margin-top: var(--s-6); }
.em-card-about, .em-about { margin: 0; color: var(--ink-2); line-height: var(--lh-md); max-width: 78ch; }
.em-about { font-size: var(--text-lg); line-height: 1.55; color: var(--ink); }

/* Tiles: icon + label, the figure, a short second line. The value never breaks mid-word;
   a long one ("500 mkr–1 mdkr") makes the row hold fewer columns instead. */
.em-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); margin: 0; }
.em-tile {
  display: grid;
  align-content: start;
  gap: 2px;
  min-width: 0;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
}
.em-tile-k { display: flex; align-items: center; gap: var(--s-2); color: var(--ink-3); font-size: var(--text-xs); font-weight: var(--weight-medium); }
.em-ico { display: inline-flex; flex: 0 0 auto; color: var(--accent-ink); }
.em-ico svg { width: 16px; height: 16px; }
.em-tile-v {
  margin: var(--s-1) 0 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.em-tile-sub { margin: 0; color: var(--ink-3); font-size: var(--text-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 720px) {
  .em-tiles-page { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .em-tiles-page[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.em-tiles-page .em-tile { padding: var(--s-4); }
/* The large figure only where a tile is wide enough for "500 mkr–1 mdkr" at that size. */
@media (min-width: 720px) {
  .em-tiles-page .em-tile-v { font-size: var(--text-xl); }
}

/* The size scale: four bands, the band the employer is in filled, the ones below tinted. */
.em-size { display: grid; gap: var(--s-2); }
.em-size-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-1) var(--s-3); font-size: var(--text-sm); }
.em-size-k { color: var(--ink-3); font-weight: var(--weight-medium); }
.em-size-v { color: var(--ink); font-weight: var(--weight-medium); }
.em-size-track { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-1); }
.em-size-seg { display: grid; gap: 2px; min-width: 0; font-size: var(--text-xs); color: var(--ink-4); }
.em-size-bar { height: 6px; border-radius: var(--r-xs); background: var(--line); margin-bottom: var(--s-1); }
.em-size-seg.is-below .em-size-bar { background: color-mix(in srgb, var(--accent) 35%, var(--canvas)); }
.em-size-seg.is-on .em-size-bar { background: var(--accent); }
.em-size-seg.is-on { color: var(--ink); }
.em-size-seg.is-on .em-size-lbl { font-weight: var(--weight-semibold); }
.em-size-lbl, .em-size-range { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Sections ---------------------------------------------------------------------------- */
.em-section-title { margin: var(--s-10) 0 var(--s-4); }

/* Om företaget: label | value rows under hairlines, two columns of them when there is room. */
.em-dl { display: grid; grid-template-columns: 1fr; column-gap: var(--s-8); margin: 0; border-top: 1px solid var(--line-soft); }
.em-dl-row { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--line-soft); font-size: var(--text-sm); }
.em-dl-k { color: var(--ink-3); }
.em-dl-v { margin: 0; color: var(--ink); overflow-wrap: break-word; }
.em-dl-line { display: block; }
.em-dl-line + .em-dl-line { margin-top: var(--s-1); }
.em-dl-sub { display: block; margin-top: 2px; color: var(--ink-3); font-size: var(--text-xs); }
.em-registry-note { margin: var(--s-3) 0 0; max-width: 78ch; }

/* Så rekryterar de: two bar charts, then a short grid of facts. */
.em-charts { display: grid; grid-template-columns: 1fr; gap: var(--s-4); margin-bottom: var(--s-4); }
.em-chart { padding: var(--s-5); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); min-width: 0; }
.em-chart-title { margin: 0 0 var(--s-4); color: var(--ink-3); }
.em-facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
  padding: var(--s-5);
  background: var(--canvas-tint);
  border-radius: var(--r-md);
}
.em-fact { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.em-fact-label { font-size: var(--text-xs); color: var(--ink-3); font-weight: var(--weight-medium); }
.em-fact-value { color: var(--ink-2); font-size: var(--text-sm); }
.em-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* ---- Ad list -------------------------------------------------------------------------- */
.em-jobs { scroll-margin-top: 80px; }
.em-jobs-empty { color: var(--ink-3); }
.em-job-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.em-job {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s-3) var(--s-2);
  border-bottom: 1px solid var(--line);
  color: inherit;
}
.em-page a.em-job:hover { background: var(--hover); text-decoration: none; }
.em-job-title { font-weight: var(--weight-medium); color: var(--ink); }
.em-jobs-more { margin-top: var(--s-5); }
.em-more { margin-top: var(--s-6); color: var(--ink-4); }

.em-empty { margin-top: var(--s-8); }

@media (min-width: 640px) {
  .em-head { flex-direction: row; align-items: center; }
  .em-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 860px) {
  .em-dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .em-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .em-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---- The company card (foot of an ad) --------------------------------------------------- */
.em-card { display: flex; flex-direction: column; gap: var(--s-4); container-type: inline-size; }
.em-card-head { display: flex; align-items: flex-start; gap: var(--s-3); }
.em-card-logo { flex: 0 0 auto; }
.em-card-logo img { width: var(--tile); height: var(--tile); object-fit: contain; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card); }
.em-card-head-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.em-card-name { color: var(--ink); overflow-wrap: anywhere; }
.em-card-profile { margin-left: auto; white-space: nowrap; font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--accent-ink); text-decoration: none; }
.em-card-profile:hover { text-decoration: underline; text-underline-offset: 2px; }
.em-card .em-tile { background: var(--canvas-tint); border-color: transparent; }

/* Bolagsform, ägande, börs: label | value, quiet. */
.em-quick { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-1) var(--s-4); margin: 0; font-size: var(--text-sm); }
.em-quick dt { color: var(--ink-3); }
.em-quick dd { margin: 0; color: var(--ink-2); overflow-wrap: break-word; }

.em-card-hiring { display: grid; grid-template-columns: 1fr; gap: var(--s-4); }
.em-card-col { display: grid; gap: var(--s-2); align-content: start; min-width: 0; }
.em-card-k { margin: 0; color: var(--ink-3); }
.em-card-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.em-card-more { color: var(--ink-3); }
.em-card-foot { display: grid; gap: var(--s-3); padding-top: var(--s-4); border-top: 1px solid var(--line-soft); }
.em-card-links { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.em-card-note { margin: 0; }
/* The card sits in the reading pane (about 450 px inside its padding), so its tiles are a
   size down from the page's and go three across as soon as three fit. */
.em-card .em-tile { padding: var(--s-3); }
.em-card .em-tile-v { font-size: var(--text-md); }
@container (min-width: 400px) {
  .em-card .em-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Four figures: two rows of two, never three and an orphan. */
  .em-card .em-tiles[data-cols="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .em-card-hiring { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 599px) {
  .em-card-head { flex-wrap: wrap; }
  .em-card-profile { margin-left: 0; flex-basis: 100%; }
}
