/*
 * لوين؟ — the pages search engines read (resources/views/pages): a line's own page (/lines/12-…), the
 * list of all lines (/lines), an area's page (/areas/…) and the list of areas (/areas). Plain text in
 * the shell's reading column (.shell-page), loaded after app.css and shell.css. No inline styles (CSP).
 *
 * Calm, like the rest: white cards on the light surface, navy text, teal for what the team reviewed. The
 * one loud element is the line's name on a "placard", as on the cards of «الرحلة»: a white sign with a
 * band on top, dashed while the line is unconfirmed (as it is drawn on the map).
 */

.shell-page.seo-page { max-width: 46rem; }
.seo-page h2 { margin: 0 0 8px; font-size: 1.125rem; }

/* ── The way back up: home › list › this page ── */

.crumbs { margin: 0 0 12px; font-size: 0.875rem; color: var(--muted); }
.crumbs__list { display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; list-style: none; }
.crumbs__item { display: inline-flex; align-items: center; min-width: 0; }
.crumbs__item + .crumbs__item::before { content: "‹"; margin-inline: 8px; color: var(--border-strong); }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); }
.crumbs [aria-current="page"] { color: var(--navy); font-weight: 600; overflow-wrap: anywhere; }

/* ── Page heads ── */

.seo-head { margin: 4px 0 16px; }
.seo-lead { font-size: 1.0625rem; }
.seo-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; margin: 0; color: var(--muted); font-size: 0.875rem; }
.seo-head__meta a { display: inline-flex; align-items: center; min-height: 44px; color: var(--navy); font-weight: 700; }

/* The line's name on its sign. */
.seo-placard {
  margin: 0 0 16px;
  padding: 16px 16px 14px;
  border: 1.5px solid var(--control-edge);
  border-top: 6px solid var(--teal);
  border-radius: 14px;
  background: var(--white);
}
.seo-placard--new { border-style: dashed; border-top-style: solid; border-top-color: var(--border-strong); }
.seo-placard__title { margin: 0 0 6px; font-size: 1.5rem; overflow-wrap: anywhere; }
.seo-placard__lead { margin: 0 0 10px; font-weight: 600; }

.seo-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.seo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--quiet);
  color: var(--navy);
  font-size: 0.8125rem;
  font-weight: 700;
}
.seo-badge--useful { background: var(--teal-50); color: #0B6F64; }
.seo-badge--new { background: var(--yellow-50); color: #6B4700; }

/* ── Actions ── */

.seo-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.seo-actions .btn { flex: 1 1 12rem; }

/* ── Sections ── */

.seo-section { margin: 24px 0 0; }
.seo-hint { margin: 0 0 10px; color: var(--muted); font-size: 0.875rem; }

/* «يمر بـ: المزة، البرامكة…»: a sentence of links (what search engines read first). */
.seo-passes { margin: 0 0 6px; font-size: 1.0625rem; line-height: 2; }
.seo-passes a { color: var(--navy); font-weight: 700; }

/* The stops, in order along the route: stops on a line, as in the brand's motif. */
.seo-stops { margin: 0; padding: 0; list-style: none; }
.seo-stops__item { position: relative; padding: 6px 0; padding-inline-start: 28px; font-weight: 600; }
.seo-stops__item::before {
  content: "";
  position: absolute;
  top: 50%;
  inset-inline-start: 4px;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border: 2.5px solid var(--navy);
  border-radius: 50%;
  background: var(--white);
}
.seo-stops__item::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-start: 9px;
  width: 3px;
  background: var(--teal);
  z-index: -1;
}
.seo-stops { position: relative; z-index: 0; }
.seo-stops__item:first-child::after { top: 50%; }
.seo-stops__item:last-child::after { bottom: 50%; }
.seo-stops__item:only-child::after { display: none; }
.seo-stops__item:first-child::before { background: var(--yellow); }
.seo-stops__item:last-child::before { border-radius: 3px; background: var(--teal); }

/* The details: one row each, the label at the start, the value at the end. */
.seo-facts { margin: 0; padding: 4px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--white); }
.seo-facts__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.seo-facts__row:last-child { border-bottom: 0; }
.seo-facts dt { color: var(--muted); }
.seo-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; text-align: end; }

.seo-report { padding: 14px 16px 2px; border-radius: 14px; background: var(--quiet); }
.seo-report .seo-actions { margin: 8px 0 12px; }
.seo-report .btn--ghost { background: var(--white); }

/* ── Lists of lines: each a card linking to its page ── */

.seo-lines { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.seo-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 8px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--teal);
  border-radius: 12px;
  background: var(--white);
  color: var(--navy);
  text-decoration: none;
}
.seo-line:hover { border-color: var(--control-edge); border-inline-start-color: var(--teal); color: var(--navy); }
.seo-line__name { grid-column: 1; font-weight: 700; overflow-wrap: anywhere; }
.seo-line__alt { font-weight: 600; color: var(--muted); }
.seo-line__seal { grid-column: 2; grid-row: 1; display: inline-flex; }
.seo-line__route { grid-column: 1 / -1; color: var(--muted); font-size: 0.875rem; overflow-wrap: anywhere; }

/* ── Areas: the alphabetical list (cards) and the nearby ones (chips) ── */

.seo-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.seo-area {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  min-height: 44px;
  height: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  color: var(--navy);
  text-decoration: none;
}
.seo-area:hover { border-color: var(--control-edge); color: var(--navy); }
.seo-area__name { flex: 1 1 auto; font-weight: 700; overflow-wrap: anywhere; }
.seo-area__count { color: #0B6F64; font-size: 0.8125rem; font-weight: 700; white-space: nowrap; }
.seo-area__meta { flex-basis: 100%; order: 3; color: var(--muted); font-size: 0.8125rem; }

.seo-areas--chips { display: flex; flex-wrap: wrap; gap: 8px; }
.seo-areas--chips a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--control-edge);
  border-radius: 999px;
  background: var(--white);
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
}
.seo-areas--chips a:hover { background: var(--surface); border-color: var(--border-strong); }

@media (min-width: 900px) {
  .seo-placard { padding: 20px 22px 16px; }
  .seo-placard__title { font-size: 1.75rem; }
  .seo-actions .btn { flex: 0 1 auto; }
}

@media (forced-colors: active) {
  .seo-placard, .seo-line, .seo-area, .seo-facts, .seo-areas--chips a { border-color: CanvasText; }
  .seo-badge { border: 1px solid CanvasText; }
  .seo-stops__item::after { background: CanvasText; }
}
