/* LHB-Kartenvertrag v1.1
   Gemeinsame semantische Rollen. Fachliche Varianten behalten ihre
   bestehende Geometrie, Inhalte und Interaktionen. Die Basisklassen sind
   bewusst niedrig spezifisch, damit die schrittweise Migration ohne
   Funktions- oder Gestaltungsverlust erfolgen kann. */

:where(.lhb-card){
  min-width:0;
  box-sizing:border-box;
}
:where(.lhb-card__media){
  position:relative;
  min-width:0;
  overflow:hidden;
}
:where(.lhb-card__media img){
  display:block;
  width:100%;
  height:100%;
}
:where(.lhb-card__body){
  min-width:0;
}
:where(.lhb-card__meta){
  min-width:0;
}
:where(.lhb-card__title){
  min-width:0;
  overflow-wrap:normal;
  word-break:normal;
  hyphens:none;
}
:where(.lhb-card__text){
  min-width:0;
}
:where(.lhb-card__tags){
  min-width:0;
}
:where(.lhb-card__footer){
  min-width:0;
}

/* Fachliche Varianten: zunächst nur als stabiler Vertrag markiert. */
:where(.lhb-card--event),
:where(.lhb-card--event-series),
:where(.lhb-card--publication),
:where(.lhb-card--article),
:where(.lhb-card--organisation),
:where(.lhb-card--link){
  --lhb-card-contract:1;
}

/* Publikationskarten – Referenzmigration v1.1
   Die vorhandene Cover-, Aktions- und Rückkehrlogik bleibt fachlich
   verantwortlich. Die globalen Rollen ergänzen Semantik, Fokusparität und
   belastbare Mindestregeln, ohne eine universelle Covergeometrie zu erzwingen. */
:where(.lhb-card--publication) :where(.lhb-card__media-link){
  display:block;
  min-width:0;
}
:where(.lhb-card--publication) :where(.lhb-card__title a){
  color:inherit;
}
:where(.lhb-card--publication) :where(.lhb-card__media-link,.lhb-card__title a,.lhb-card__action):focus-visible{
  outline:3px solid var(--lila);
  outline-offset:-3px;
}


/* Artikelfamilie – Referenzmigration v1.2
   Journalbeiträge, Podcasts und kuratierte Meldungen behalten ihre jeweilige
   Raster-, Medien- und Metadatengeometrie. Der globale Vertrag vereinheitlicht
   Rollen, Fokusparität und robuste Bildbehandlung. */
:where(.lhb-card--article){
  color:inherit;
  text-decoration:none;
}
:where(.lhb-card--article) :where(.lhb-card__media img){
  object-fit:cover;
}
:where(.lhb-card--article):focus-visible{
  outline:3px solid var(--lila);
  outline-offset:-3px;
}
:where(.lhb-card--article) :where(.lhb-card__title){
  transition:color .15s ease;
}
:where(.lhb-card--article):hover :where(.lhb-card__title){
  color:var(--lila);
}

/* Organisationsfamilie – Referenzmigration v1.3
   Mitgliedsvereine behalten Filter-, Nachlade- und Kartenkopplung sowie ihre
   bestehende Raster- und Mediengeometrie. Der globale Vertrag ergänzt nur
   semantische Rollen, robuste Fokuszustände und Interaktionsparität. */
:where(.lhb-card--organisation) :where(.lhb-card__title){
  transition:color .15s ease;
}
:where(.lhb-card--organisation):focus-within :where(.lhb-card__title){
  color:var(--lila);
}
:where(.lhb-card--organisation) :where(.lhb-card__action):focus-visible,
:where(.lhb-card--organisation) :where(.lhb-card__tags a):focus-visible{
  outline:3px solid var(--lila);
  outline-offset:-3px;
}



/* Publikationskarten v1.4 – intrinsische Coverflaeche und robuste Titel.
   Der Schatten gehoert zum tatsaechlich gerenderten Cover, nicht zu einer
   normierten grauen Medienflaeche. */
:where(.lhb-card--publication) :where(.lhb-card__media){
  overflow:visible;
}
:where(.lhb-card--publication) :where(.lhb-card__media img){
  width:auto;
  height:auto;
  max-width:100%;
  max-height:100%;
}
:where(.lhb-card--publication) :where(.lhb-card__title),
:where(.lhb-card--publication) :where(.lhb-card__title a),
:where(.lhb-card--publication) :where(.lhb-card-title__main){
  min-width:0;
  max-width:100%;
}
/* Kantenvertrag v1.2: Das Raster besitzt die durchgehende Abschlusskante.
   Die sichtbare letzte Kartenreihe entfernt ihre eigene Unterkante, damit
   die Linie auch bei einer unvollständigen Reihe lückenlos und einfach bleibt. */
.pub-grid{border-bottom:var(--linie) solid var(--lhb-line-color) !important}
.pub-card.is-last-visible-row{border-bottom:0 !important}

/* Publikationskarten v1.5 – Titelbreite ist die reale Kartenbreite.
   Der Haupttitel wird als Block gemessen; untrennbare Woerter erzwingen eine
   kleinere Schrift, niemals Abschneiden, Ueberlauf oder Worttrennung. */
:where(.lhb-card--publication) :where(.lhb-card__title),
:where(.lhb-card--publication) :where(.lhb-card__title a),
:where(.lhb-card--publication) :where(.lhb-card-title__main){
  display:block;
  width:100%;
  min-width:0;
  max-width:100%;
  overflow:visible !important;
  text-overflow:clip !important;
  white-space:normal !important;
  overflow-wrap:normal !important;
  word-break:normal !important;
  hyphens:none !important;
}



/* v266 - Publikationsraster: weisse Leerzellen und filterstabile Kanten.
   Das Grid selbst ist immer weiss. Karten zeichnen ihre Kanten; JS markiert
   das reale Reihenende nach Filterung. Die letzte sichtbare Reihe verliert
   nur ihre Karten-Unterkante, die durchgehende Abschlusskante gehoert zum Grid. */
#pub-grid.pub-grid{
  gap:0 !important;
  background:var(--lhb-color-paper) !important;
  border-bottom:var(--linie) solid var(--lhb-line-color) !important;
}
#pub-grid.pub-grid > .pub-card,
#pub-grid.pub-grid > .pub-card:nth-child(n){
  border-right:var(--linie) solid var(--lhb-line-color) !important;
  border-bottom:var(--linie) solid var(--lhb-line-color) !important;
  background:var(--lhb-color-paper) !important;
}
#pub-grid.pub-grid > .pub-card.is-row-end{border-right:0 !important}
#pub-grid.pub-grid > .pub-card.is-last-visible-row{border-bottom:0 !important}
