/* Zweck: Lizenzseiten mit den Karten-, Titel- und Aufklapp-Rollen der App.
 * Gemeinsamer Stand mit demagogue-website/assets/lizenzen.css.
 * Die Rollen bleiben auf diese Seiten begrenzt; die Startseite erbt sie nicht.
 * Wie die uebrige Website bleibt die Seite auch bei hellem Systemmodus dunkel.
 */
@font-face {
  font-family: "IBM Plex Serif";
  font-display: swap;
  src: url("/assets/fonts/ibm_plex_serif/IBMPlexSerif-Regular.ttf") format("truetype");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-display: swap;
  src: url("/assets/fonts/ibm_plex_mono/IBMPlexMono-Regular.ttf") format("truetype");
}

.license-page {
  --license-space-xs: 4px;
  --license-space-sm: 8px;
  --license-space-md: 12px;
  --license-space-lg: 16px;
  --license-space-xxl: 24px;
  --license-anchor: var(--apollo-gold);
  --license-anchor-size: 36px;
  --license-glyph: 22px;
  --license-portrait-size: 48px;
  --license-event-width: 132px;
  --license-small-glyph: 16px;
  --license-radius-badge: 6px;
  --license-radius-button: 10px;
  --license-screen-top: var(--apollo-navy);
  --license-canvas: var(--elev-canvas);
  background: linear-gradient(180deg, var(--license-screen-top), var(--license-canvas) 42rem);
}

/* Seitenrahmen, Titel und Kartenabstaende stammen aus dem gemeinsamen CSS. */
.license-page .license-item {
  min-width: 0;
  gap: var(--license-space-md);
}

.license-heading {
  align-items: center;
  display: flex;
  gap: var(--license-space-md);
}

.license-heading > div { min-width: 0; }
.license-page .license-heading h2 {
  color: var(--text);
  margin: 0;
}

.license-page .license-item p {
  margin: 0;
}

.license-page .license-item .license-subtitle {
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.license-icon {
  background-color: currentColor;
  color: var(--muted);
  display: inline-block;
  flex: none;
  height: var(--license-glyph);
  width: var(--license-glyph);
  -webkit-mask: var(--license-icon) center / contain no-repeat;
  mask: var(--license-icon) center / contain no-repeat;
}

.license-anchor {
  background: var(--elev-kachel);
  border-radius: var(--license-radius-button);
  color: var(--license-anchor);
  height: var(--license-anchor-size);
  width: var(--license-anchor-size);
  position: relative;
  -webkit-mask: none;
  mask: none;
}

.license-anchor::before {
  background: currentColor;
  content: "";
  height: var(--license-glyph);
  width: var(--license-glyph);
  position: absolute;
  inset: 0;
  margin: auto;
  -webkit-mask: var(--license-icon) center / contain no-repeat;
  mask: var(--license-icon) center / contain no-repeat;
}

.license-page .license-link {
  align-items: flex-start;
  color: var(--muted);
  display: flex;
  font-size: inherit;
  font-weight: 400;
  gap: var(--license-space-sm);
  line-height: inherit;
  min-height: 28px;
  padding-block: var(--license-space-xs);
  text-decoration: none;
}

.license-link > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.license-link > .license-icon {
  color: var(--soft);
  height: var(--license-small-glyph);
  width: var(--license-small-glyph);
  margin-top: 2px;
}

.license-page .license-link:hover { color: var(--text); }
.license-page :is(a, summary):focus-visible {
  border-radius: var(--license-radius-badge);
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.license-portraits, .license-flags, .license-icon-raster, .license-fonts {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--license-space-md);
}

.license-portraits { gap: var(--license-space-sm); }
.license-portrait {
  background: var(--elev-kachel);
  border-radius: var(--radius-pill);
  height: var(--license-portrait-size);
  width: var(--license-portrait-size);
  object-fit: cover;
}

/* Wischbare Vorschauleiste: die angeschnittene letzte Kachel zeigt, dass es
   weitergeht. Die Leiste scrollt selbst, damit die Karte nie ueberlaeuft. */
.license-events {
  display: flex;
  gap: var(--license-space-sm);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: var(--license-space-sm);
  scroll-snap-type: x proximity;
  scrollbar-color: var(--elev-element) transparent;
  scrollbar-width: thin;
}

.license-events:focus-visible {
  border-radius: var(--license-radius-badge);
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.license-event {
  aspect-ratio: 3 / 2;
  background: var(--elev-kachel);
  border-radius: var(--license-radius-badge);
  display: block;
  flex: 0 0 auto;
  height: auto;
  scroll-snap-align: start;
  width: var(--license-event-width);
}

.license-app-icon { border-radius: var(--radius-secondary); }
.license-icon-raster .license-icon { height: 28px; width: 28px; }
.license-page .license-subheading {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.9375rem;
  font-weight: 600;
  gap: var(--license-space-sm);
  line-height: 1.4;
  margin: var(--license-space-xs) 0 0;
}

.license-subheading .license-icon { height: var(--license-small-glyph); width: var(--license-small-glyph); }
.license-noun-list { display: grid; gap: var(--license-space-sm); }
.license-details {
  background: var(--elev-kachel);
  border-radius: var(--radius-secondary);
  min-width: 0;
}

.license-details summary {
  align-items: center;
  display: flex;
  font-size: 0.9375rem;
  font-weight: 600;
  gap: var(--license-space-md);
  line-height: 1.4;
  list-style: none;
  min-height: 48px;
  padding: var(--license-space-md);
  cursor: pointer;
}

.license-details summary::-webkit-details-marker { display: none; }
.license-details summary > span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
.license-details .license-chevron { margin-left: auto; color: var(--soft); transition: transform 180ms; }
.license-details[open] .license-chevron { transform: rotate(180deg); color: var(--license-anchor); }
.license-details summary:hover { filter: brightness(1.05); }
.license-details summary:active { transform: scale(0.97); }
.license-detail { display: grid; gap: var(--license-space-xs); padding: 0 var(--license-space-md) var(--license-space-md); }
.license-fonts { color: var(--muted); font-size: 1.75rem; gap: var(--license-space-xxl); }
.license-fonts span:nth-child(2) { font-family: "IBM Plex Serif", serif; }
.license-fonts span:nth-child(3) { font-family: "IBM Plex Mono", monospace; }
.license-page .license-app-path {
  background: var(--elev-kachel);
  border-radius: var(--radius-secondary);
  color: var(--text);
  padding: var(--license-space-md);
}

.license-app-path > span { color: var(--soft); margin-inline: var(--license-space-xs); }
.license-page .license-binding-note { color: var(--muted); font-size: 0.8125rem; font-weight: 400; margin: var(--license-space-md) 0 0; overflow-wrap: anywhere; }

@media (pointer: coarse) {
  .license-page .license-link { align-items: center; min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .license-details .license-chevron { transition: none; }
  .license-details summary:active { transform: none; }
}
