/* UI-Umsetzung 25.11.2026: Stile der Übersichten /wissen/, /vergleich/, /modelle/ und /bildnachweise/.
   Gemeinsame Regeln (Breite, Schrift, Kopfzeile, Tabellen) stehen in styles.css; diese Datei wird danach geladen. */

/* ---- Seitenkopf (M4): Überschrift über die volle Breite, darunter links Text, rechts die vorhandenen Knöpfe ---- */
.page-intro .eyebrow,.cta-band .eyebrow{font-size:.75rem;line-height:1.5}
.model-overview thead th{font-size:.75rem}
@media(min-width:1051px){
  .page-intro{display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,400px);column-gap:72px;align-items:start}
  .page-intro>*{grid-column:1;min-width:0}
  .page-intro>.breadcrumbs{grid-column:1/-1;grid-row:1}
  .page-intro>.eyebrow{grid-column:1/-1;grid-row:2}
  .page-intro>h1{grid-column:1/-1;grid-row:3;max-width:none;margin-bottom:18px}
  .page-intro>.page-subline{grid-row:4}
  .page-intro>.lead{grid-row:5}
  .page-intro>p:has(>.button){grid-column:2;grid-row:4;align-self:start;margin:0}
  .page-intro>p:has(>.text-link){grid-column:2;grid-row:5;align-self:start;margin:0}
  .page-intro>p:has(>.button)+p:has(>.text-link){margin-top:0}
}

/* ---- Kartenraster (H6, M11): vier ab 1.280 px, drei ab 900 px, zwei ab 761 px; am Handy waagerechte Karten ---- */
.article-grid.knowledge-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin-bottom:48px}
@media(min-width:900px){.article-grid.knowledge-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(min-width:1280px){.article-grid.knowledge-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
.knowledge-grid .article-card{display:flex;flex-direction:column;min-width:0;height:100%}
.knowledge-grid .card-main{flex:1 1 auto}
.knowledge-grid .card-image{aspect-ratio:4/3}
.knowledge-grid .card-copy{padding:18px 18px 14px;gap:0}
.knowledge-grid .article-card .eyebrow{font-size:.75rem;line-height:1.45;letter-spacing:.06em;margin:0 0 10px}
.knowledge-grid .article-card h3{font-size:1.2rem;line-height:1.28;margin:0 0 10px;overflow-wrap:break-word;hyphens:auto}
.knowledge-grid .article-card .card-copy p{flex-grow:0;font-size:.9rem;line-height:1.55;margin:0 0 10px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-clamp:3;overflow:hidden}
.knowledge-grid .article-card .card-question{padding:6px 9px}
.knowledge-grid .article-card .text-link{margin-top:auto;padding-top:6px;min-height:44px;align-items:flex-end}
.knowledge-grid .article-card .card-credit{padding:0 18px 14px;font-size:.75rem;line-height:1.5}
@media(max-width:760px){
  .article-grid.knowledge-grid{grid-template-columns:minmax(0,1fr);gap:14px;margin-bottom:36px}
  .knowledge-grid .card-main{flex-direction:row}
  .knowledge-grid .card-image{flex:0 0 34%;aspect-ratio:auto;min-height:150px}
  .knowledge-grid .card-image .editorial-photo{object-fit:cover}
  .knowledge-grid .card-copy{padding:14px 14px 8px;min-width:0}
  .knowledge-grid .article-card h3{font-size:1.1rem;margin-bottom:8px}
  .knowledge-grid .article-card .card-copy p{-webkit-line-clamp:3;line-clamp:3;font-size:.875rem;margin-bottom:6px}
  .knowledge-grid .article-card .card-credit{padding:8px 14px 12px;border-top:1px solid var(--line)}
}

/* ---- Filter (N2): gleich breite Felder ---- */
.model-filter,.comparison-filter,.article-finder-fields{display:grid;gap:14px 18px;align-items:end}
.model-filter{grid-template-columns:repeat(5,minmax(0,1fr))}
.comparison-filter{grid-template-columns:repeat(2,minmax(0,280px)) auto}
.model-filter label,.comparison-filter label{display:block;flex:none;width:100%;max-width:none;min-width:0;font-size:.8rem}
.model-filter select,.comparison-filter select{display:block;width:100%;max-width:100%;min-width:0;min-height:44px;margin-top:6px}
.model-filter .reset,.comparison-filter .reset{justify-self:start;min-height:44px}
.model-filter-result,.comparison-result{grid-column:1/-1;flex-basis:auto}
.model-filter .reset{grid-column:1}
.model-filter .model-filter-result{grid-column:2/-1;align-self:center}
@media(max-width:1050px){.model-filter{grid-template-columns:repeat(3,minmax(0,1fr))}.model-filter .model-filter-result{grid-column:2/-1}}
@media(max-width:760px){
  .model-filter{grid-template-columns:repeat(2,minmax(0,1fr))}
  .comparison-filter{grid-template-columns:repeat(2,minmax(0,1fr))}
  .model-filter .model-filter-result{grid-column:1/-1}
  .comparison-filter .reset{grid-column:1/-1}
}
@media(max-width:520px){
  .model-filter,.comparison-filter{grid-template-columns:minmax(0,1fr)}
}
.article-finder input,.article-finder select{min-height:48px}

/* ---- Modelltabelle (H7): Tabelle ab 1.280 px, darunter Karten je Modell aus denselben Zellen (data-label) ---- */
@media(min-width:1280px){
  .model-overview-section .model-overview{min-width:0}
}
@media(max-width:1279px){
  .model-overview-section .table-hint{display:none!important}
  .model-overview-section .table-scroll{overflow:visible;border:0;background:none;margin:0}
  .model-overview-section .model-overview{display:block;min-width:0;width:100%;background:none}
  .model-overview-section .model-overview caption{display:block;padding:0 0 10px;font-size:.8rem}
  .model-overview-section .model-overview thead{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .model-overview-section .model-overview tbody{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}
  .model-overview-section .model-overview tr{display:block;min-width:0;background:var(--white);border:1px solid var(--line);border-radius:var(--radius);padding:6px 16px 10px}
  .model-overview-section .model-overview tr[hidden]{display:none}
  .model-overview-section .model-overview tbody th{display:block;min-width:0;border:0;padding:8px 0 10px;font-size:1rem}
  .model-overview-section .model-overview tbody th a{display:inline-block;padding:10px 0;min-height:44px;font-size:1.05rem}
  .model-overview-section .model-overview td{display:block;min-width:0;border:0;border-top:1px solid var(--line);padding:10px 0;font-size:.9rem;line-height:1.5;overflow-wrap:anywhere}
  .model-overview-section .model-overview td::before{content:attr(data-label);display:block;margin-bottom:3px;font-size:.75rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
  .model-overview-section .model-overview td a{display:inline-block;padding:6px 0}
}
@media(max-width:760px){
  .model-overview-section .model-overview tbody{grid-template-columns:minmax(0,1fr);gap:14px}
  .model-overview-section .model-overview td a{padding:12px 0;min-height:44px}
  .topic-block a{display:flex;align-items:center;min-height:44px;padding:4px 0}
}

/* ---- Bildnachweise (N4): mehrere Spalten mit kleinem Vorschaubild ---- */
.standalone:has(.image-credits){max-width:1344px}
.standalone:has(.image-credits)>p,.standalone:has(.image-credits) #bildnachweise>p{max-width:var(--measure)}
.standalone .image-credits{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 20px;list-style:none;margin:24px 0 0;padding:0;font-size:.875rem}
.image-credits li{display:flex;gap:14px;align-items:flex-start;margin:0;padding:12px;min-width:0;background:var(--white);border:1px solid var(--line);border-radius:var(--radius);line-height:1.5}
.image-credits .credit-thumb{flex:none;display:block;width:96px;height:72px;object-fit:cover;border-radius:4px;background:var(--sage)}
.image-credits .credit-text{min-width:0;overflow-wrap:anywhere}
.image-credits .credit-text strong{display:block;margin-bottom:2px}
.image-credits .credit-file{display:inline-flex;align-items:center;min-height:32px;font-weight:600}
@media(max-width:1050px){.standalone .image-credits{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){
  .standalone .image-credits{grid-template-columns:minmax(0,1fr);gap:0}
  .image-credits li{gap:12px;padding:12px 0;background:none;border:0;border-bottom:1px solid var(--line);border-radius:0}
  .image-credits .credit-thumb{width:72px;height:54px}
  .image-credits .credit-file{min-height:44px}
}

/* ---- Kein Layoutsprung beim Einblenden der Filter (nur mit JavaScript; ohne bleiben sie wegen [hidden] aus dem Fluss) ---- */
.model-filter-result,.comparison-result,.article-finder [role=status]{min-height:1.5em}
@media(scripting:enabled){
  .model-filter[hidden],.comparison-filter[hidden]{display:grid!important;visibility:hidden}
  .article-finder[hidden]{display:block!important;visibility:hidden}
}

/* ---- Vergleichskarten mit beiden Fahrzeugen (M11): zwei Fotos je zur Hälfte, ausgefüllt und mittig beschnitten, nie gestreckt ---- */
.knowledge-grid .card-image-pair{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:2px;background:var(--white)}
.card-image-pair>picture,.card-image-pair>img{position:relative;display:block;min-width:0;overflow:hidden;background:var(--sage)}
.card-image-pair .editorial-photo{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}

/* ---- Themeneinstiege: sechs Blöcke als 3 × 2 auch auf der Tablet-Breite ---- */
@media(min-width:761px) and (max-width:1050px){.topic-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){
  /* Zwei Fahrzeuge brauchen Breite: Paarkarten stehen am Handy mit dem Bild oben, jedes Foto halb so breit wie die Karte. */
  .knowledge-grid .article-card:has(.card-image-pair) .card-main{flex-direction:column}
  .knowledge-grid .card-image-pair{flex:none;aspect-ratio:16/9;min-height:0}
}
/* Hauptzweig, nach dem Zusammenführen: Am Handy ist das Einzelfoto ein festes Vorschaubild im Format 4:3 (ganz sichtbar),
   kein hoher, beschnittener Streifen neben dem Text. */
@media(max-width:760px){
  .knowledge-grid .card-image:not(.card-image-pair){flex:0 0 34%;align-self:flex-start;aspect-ratio:4/3;min-height:0}
  .knowledge-grid .card-image:not(.card-image-pair) .editorial-photo{object-fit:contain}
}

/* Nachstufe 26.11.2026: die Kernfrage steht ganz in ihrem Kasten (gekürzt wird nur die Beschreibung darunter). */
.knowledge-grid .article-card .card-copy p.card-question{display:block;-webkit-line-clamp:unset;line-clamp:unset;overflow:visible}

/* Stufe 7 (26.11.2026): Karten statt Tabelle gelten auch dann, wenn die Tabellenskripte vor diesen Regeln gelaufen sind
   (in Safari bei etwa jedem zweiten Laden): gesetzte Spaltenbreiten und die stehende erste Spalte greifen unter 1.280 px nicht. */
@media(max-width:1279px){
  .model-overview-section .model-overview{width:100%!important;min-width:0!important;table-layout:auto!important}
  .model-overview-section .model-overview :is(th,td){width:auto!important;min-width:0!important;position:static!important;box-shadow:none!important}
}
/* 28.11.2026: Balkendiagramm der nutzbaren Batterieenergie auf /modelle/. Hochkant-Fassung bis 999 px, quer ab 1000 px. */
.model-energy-section{margin-bottom:44px}
.model-energy-section .europe-visual{margin:0}
.model-energy-section .visual-heading h2{font-size:1.7rem;line-height:1.2;margin:10px 0 0}
.model-energy-section .energy-lead{max-width:var(--measure);margin:16px 0 0;font-size:.95rem}
.energy-chart{display:block;width:100%;height:auto;margin:24px 0 0}
.energy-chart-narrow{max-width:460px}
.energy-chart-wide{display:none}
.model-energy-section .diagram-caption{display:block;font-weight:400;line-height:1.7;color:#4f624f;margin:22px 0 0;padding-right:max(0px,calc(100% - var(--measure)))}
@media(min-width:1000px){.energy-chart-narrow{display:none}.energy-chart-wide{display:block}}
@media(max-width:760px){.model-energy-section .europe-visual{padding:18px 14px}}
@media(max-width:400px){.model-energy-section .europe-visual{padding:16px 8px}}
