/* ============================================================================
   Vote detail page (templates/detail.html) — page-scoped styles.
   Moved out of an inline <style> block: CSS belongs in CSS files only.
   Loaded AFTER custom.css so these page overrides win the cascade.
   ============================================================================ */

/* Match the votes.html ("Wie Lukas abgestimmt hat") palette exactly —
   the brighter #1e4dd6 looked off next to the existing votes-page card.
   --csv-blue mirrors --blue in redesign.css. */
:root { --csv-blue: #163980; --csv-blue-soft: #eaf0fb; }

main .card { border-radius: 12px !important; }

/* AI summary bullet list (Mistral agent returns markdown bullets, stored as <ul>). */
main .summary-bullets { padding-left: 1.15rem; margin-bottom: 0; }
main .summary-bullets li { margin-bottom: 0.3rem; }
main .summary-bullets li:last-child { margin-bottom: 0; }
main .card.custom-card,
main .card.orange-card,
main .card.card-group-stats {
  box-shadow: 0 1px 3px rgba(15, 30, 70, 0.05), 0 8px 24px rgba(15, 30, 70, 0.04);
  position: relative;
}
/* Add a thin blue stripe along the top of the main vote-data cards. */
main .card.custom-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--csv-blue), #4f7ee8);
  border-radius: 12px 12px 0 0;
}
/* Section headings inside cards get a small blue side-bar. */
main h3,
main .card-body > h5.fw-bold,
main h5.m-0.fw-bold {
  position: relative; padding-left: 12px; color: #1a253c;
}
main h3::before,
main .card-body > h5.fw-bold::before,
main h5.m-0.fw-bold::before {
  content: ""; position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 4px; background: var(--csv-blue); border-radius: 2px;
}
/* Form labels above filters → blue uppercase */
main .form-label.small.fw-bold.text-muted {
  color: var(--csv-blue) !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
}
main .form-select:focus,
main .form-control:focus {
  border-color: var(--csv-blue);
  box-shadow: 0 0 0 0.18rem rgba(30, 77, 214, 0.18);
}
/* Vote-position chips that are NEUTRAL (DID_NOT_VOTE) keep grey, but
   group-card-accent (= MEP's own group) gets a clearer blue ring. */
main .card-group-stats.group-card-accent {
  box-shadow: 0 0 0 2px var(--csv-blue), 0 6px 20px rgba(30, 77, 214, 0.12);
}

/* ─── Member info card (the "Lukas Sieper" hero at the top): switch from
   orange to blue. Page-scoped overrides of .orange-card-header /
   .member-info-badge / the speech-count link, no global CSS changes. */
main .card.orange-card {
  border: 1px solid #dbe3f5;
  box-shadow: 0 1px 3px rgba(15, 30, 70, 0.05), 0 10px 28px rgba(15, 30, 70, 0.06);
}
main .card.orange-card::before { display: none; }   /* the generic stripe above doesn't apply here */
main .orange-card-header {
  background: var(--csv-blue);
  color: #fff;
  border-radius: 12px 12px 0 0 !important;
}
main .orange-card .member-info-badge {
  background-color: var(--csv-blue);
  color: #fff;
}
/* Speech-count link (the "449" pill next to Reden:) — was orange, now blue. */
main .orange-card .card-body a[href*="/speeches"] {
  color: var(--csv-blue) !important;
  background-color: var(--csv-blue-soft) !important;
  border-color: rgba(30, 77, 214, 0.25) !important;
}
main .orange-card .card-body a[href*="/speeches"]:hover {
  color: #1741b8 !important;
  background-color: rgba(30, 77, 214, 0.18) !important;
  border-color: rgba(30, 77, 214, 0.45) !important;
}
/* The inline-styled colour="#f89c0e" on the speech count needs an
   override too. The selector below is specific enough to beat the
   inline style at the cascade level (page-scoped, with !important). */
main .orange-card a[style*="#f89c0e"] {
  color: var(--csv-blue) !important;
}

/* ─── MEP switcher integrated into the member name (same pattern as
   votes.html / speeches): the name in the member-info header is the visible
   Select2 trigger; the actual <select> is kept off-screen but in the DOM so
   Select2 can render its (body-parented) dropdown panel. ─── */
main .orange-card-header .mep-name-trigger {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
main .orange-card-header .mep-name-trigger .mep-name-chevron {
  margin-left: 6px;
  opacity: 0.85;
  flex-shrink: 0;
}
main .detail-mep-select-hidden {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ─── Mobile: two fraction cards side by side, compact layout.
   Logo + name share one line; the donut sits on top and the legend
   becomes a 2×2 grid below it, so two fractions fit on a phone. ─── */
@media (max-width: 767.98px) {
  main .card-group-stats { padding: 0.6rem 0.5rem !important; }
  main .card-group-stats .group-logo-lg {
    width: 1.6rem !important; height: 1.6rem !important;
  }
  main .card-group-stats .member-name-sm {
    font-size: 0.72rem; line-height: 1.1;
  }
  main .group-chart-wrap {
    width: 92px !important; height: 92px !important;
  }
  main .group-body { gap: 0.45rem !important; }
  main .group-legend {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.15rem 0.5rem !important;
    width: 100%;
    font-size: 0.68rem !important;
  }
  main .group-legend-icon { width: 15px; height: 15px; }
  main .group-legend-icon svg { width: 10px; height: 10px; }
  main .card-group-stats .abstimmungs-badge { font-size: 0.6rem !important; }
}

/* ============================================================================
   Static styling extracted from inline style= attributes (CSS-in-HTML cleanup).
   Dynamic ({{…}}-driven widths/left) and JS-toggled styles intentionally stay
   inline in the template, since moving them would break templating/interactivity.
   ============================================================================ */

/* SEO hidden block */
main .seo-hidden {
  display: none !important; visibility: hidden !important; opacity: 0 !important;
  height: 0; width: 0; overflow: hidden;
}

/* Reference link rendered on the orange header */
main .ref-link-white { color: #fff !important; }

/* Amendments / header nav bits */
main .nav-col-narrow { min-width: 40px; }
main .btn-pad-sm { padding: 0.25rem 0.5rem; }
main .w-fit { width: fit-content; }
main .btn-amend-mobile { font-size: 0.75rem; white-space: nowrap; }

/* Overall-result block */
main .result-wrap { max-width: 600px; }
main .result-title { font-size: 0.85rem; }
/* The result bar lives inside <header>, not <main>, so these must NOT be
   main-prefixed. Combined with .vote-bar for enough specificity to beat the
   generic .vote-bar { height: 30px } base rule in custom.css. */
.vote-bar.result-bar-track-sm {
  background-color: rgba(255, 255, 255, 0.2); height: 6px; border-radius: 6px;
  position: relative; overflow: hidden;
}
.vote-bar.result-bar-track-lg {
  background-color: rgba(255, 255, 255, 0.2); height: 24px; border-radius: 12px;
  position: relative; overflow: hidden;
}
/* The bar segment is positioned/sized via a Jinja {{…}}-driven inline width that
   stays in the template; only the static bits live here. */
main .result-bar-seg { position: relative; height: 100%; }
main .result-bar-seg-novote { background-color: rgba(255, 255, 255, 0.3); }
main .vote-bar-label {
  color: #fff; font-size: 0.65rem; font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
main .vote-bar-label-muted { color: rgba(255, 255, 255, 0.8); font-size: 0.65rem; font-weight: 700; }
main .result-legend { font-size: 0.75rem; }

/* Small legend vote dots (size for the whole page) + special backgrounds */
main .vote-dot { width: 8px; height: 8px; }
main .vote-dot-on-dark { background-color: rgba(255, 255, 255, 0.3); border: 1px solid rgba(255, 255, 255, 0.5); }
main .vote-dot-grey { background-color: #ccc; }

/* Amendments banner + its button */
main .amend-banner {
  background: linear-gradient(90deg, #f59e0b, #fbbf24); color: #1a1a1a;
  font-size: 0.85rem; border-bottom: 2px solid #d97706;
}
main .amend-banner-btn { background: #1a1a1a; color: #fbbf24; border: none; white-space: nowrap; }

/* Summary card */
main .summary-wrap { word-wrap: break-word; overflow-wrap: break-word; overflow: hidden; width: 100%; }
main .summary-toggle { cursor: pointer; }
main .summary-icon { color: #f89c0e; }
main .summary-readmore { font-size: 0.9rem; color: #f89c0e; }
main .summary-teaser {
  font-size: 1rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2;
  line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer;
}
main .summary-expanded { line-height: 1.6; white-space: pre-wrap; word-wrap: break-word; }

/* Related-vote outcome badges */
main .badge-outcome { font-size: 0.65em; }

/* Member-info box */
main .mep-photo-cover { object-fit: cover; max-width: 140px; }
main .mep-photo-ph { min-height: 100px; }
main .mep-info-col { font-size: 0.75rem; }
main .mep-flag { object-fit: cover; border-radius: 2px; }
main .mep-group-logo-inline { height: 1.2em; vertical-align: middle; }
main .speech-count-link { color: #f89c0e; }
main .country-select-sm { font-size: 0.85rem; }

/* Group cards — desktop sizes (mobile overrides live in the @media block above) */
main .group-body { gap: 1.5rem; }
main .group-chart-wrap { width: 110px; height: 110px; flex-shrink: 0; }
main .group-chart-canvas { max-width: 110px; max-height: 110px; }
main .group-legend { font-size: 0.75rem; min-width: 0; gap: 0.35rem; }
main .group-card-badge { font-size: 0.7rem; }

/* Compact colour+symbol position markers in the per-group donut legend
   (mirrors the .pattern-bar-icon look from votes.html / redesign.css, but
   self-contained here since redesign.css isn't loaded on the detail page).
   Colours match the donut segments. */
main .group-legend-icon {
  width: 17px; height: 17px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: #fff;
}
main .group-legend-icon svg { width: 11px; height: 11px; display: block; }
main .group-legend-icon.gli-for     { background: #7AB800; }
main .group-legend-icon.gli-against  { background: #D0006F; }
main .group-legend-icon.gli-abstain  { background: #00C1F0; }
main .group-legend-icon.gli-didnot   { background: #B6B6B6; }

/* Intended-vote modal header */
main .intended-modal-header { background: rgba(255, 193, 7, 0.12); border-bottom: 1px solid rgba(255, 193, 7, 0.3); }
main .intended-modal-text { line-height: 1.6; }

/* eurovoc "+N more" badge — JS toggles only its display; cursor is static here */
main .eurovoc-more-badge { cursor: pointer; }
