/**
 * css/global.css — base typography, layout, buttons, cards, tables
 * Mobile-first. BEM methodology used across blocks.
 */

body {
  background: var(--color-bg-primary);
  color: var(--color-text-body);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  /* German copy regularly contains long unbroken compound words
     (Kontaktmöglichkeiten, Mindesteinzahlung, Umsatzanforderung...). Without
     this, a single long word at heading font sizes can force horizontal
     overflow on narrow viewports even though its container is otherwise
     correctly sized. overflow-wrap is inherited, so this covers the whole
     site from one declaration. */
  overflow-wrap: break-word;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: 0;
  top: -100%;
  background: var(--color-heading-accent);
  color: #121212;
  font-weight: var(--fw-btn);
  padding: 12px 20px;
  z-index: 2000;
  transition: top var(--transition-fast);
}
.skip-link:focus {
  top: 0;
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

main {
  display: block;
}

.section {
  padding-block: calc(var(--space-section) / 2);
}
@media (min-width: 768px) {
  .section { padding-block: var(--space-section); }
}

/* ---------- Typography ---------- */
h1, .h1 {
  font-family: var(--font-body);
  font-size: var(--fs-h1);
  font-weight: var(--fw-heading);
  color: var(--color-white);
}
h2, .h2 {
  font-family: var(--font-display), var(--font-body);
  font-size: var(--fs-h2);
  font-weight: var(--fw-heading);
  color: var(--color-heading-accent);
  margin-bottom: var(--space-h2-text);
}
h3, .h3 {
  font-family: var(--font-display), var(--font-body);
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: var(--space-h3-text);
}
p {
  margin-bottom: var(--space-paragraph);
  color: var(--color-text-body);
}
p:last-child { margin-bottom: 0; }
a.inline-link {
  color: var(--color-heading-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}
a.inline-link:hover { color: var(--color-white); }

.section__intro { margin-bottom: var(--space-paragraph); }

/* ---------- Lists inside content ---------- */
.content-list {
  /* reset.css sets ul{list-style:none} site-wide (needed for nav/footer/FAQ
     lists); restore a visible marker here for body-copy bullet lists. */
  list-style: disc;
  display: grid;
  gap: 10px;
  margin-bottom: var(--space-paragraph);
  padding-left: 1.4em;
}
.content-list li {
  position: relative;
  padding-left: 0.4em;
}
.content-list li::marker {
  color: var(--color-heading-accent);
}

/* ---------- Tables ---------- */
.data-table-wrap {
  overflow-x: auto;
  margin-bottom: var(--space-paragraph);
  clip-path: var(--clip-card);
  background: var(--color-card-bg);
}
.data-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: var(--fs-small);
}
.data-table th, .data-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-cool-accent);
}
.data-table th {
  background: var(--color-bg-dark);
  color: var(--color-heading-accent);
  font-weight: var(--fw-btn);
  white-space: nowrap;
}
.data-table tr:last-child td { border-bottom: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-weight: var(--fw-btn);
  font-size: var(--fs-body);
  color: var(--color-btn-text);
  clip-path: var(--clip-card);
  border-radius: var(--radius);
  transition: transform var(--transition-fast), filter var(--transition-fast);
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--gradient-btn-primary); }
.btn--secondary { background: var(--gradient-btn-secondary); }
.btn--block { width: 100%; }

/* ---------- Cards (shared shape) ---------- */
.card {
  background: var(--color-card-bg);
  padding: var(--space-card-padding);
  clip-path: var(--clip-card);
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: var(--fs-small);
  color: var(--color-text-body);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--color-text-body); transition: color var(--transition-fast); }
.breadcrumb a:hover { color: var(--color-heading-accent); }
.breadcrumb__sep { color: var(--color-cool-accent); }
.breadcrumb__current { color: var(--color-white); }

/* ---------- Content section block (H2 -> optional image -> text), single column
   on every breakpoint per spec: image always sits right after the H2, above the text. */
.content-section {
  display: grid;
  gap: var(--space-paragraph);
}
/* Grid items default to min-width:auto, which lets their min-content size
   (e.g. an embedded swiper's unwrapped slide row) push the whole grid track
   — and the page — wider than the viewport. This is the actual cause behind
   any oversized/overflowing content dropped into a content-section (the
   Slots page's games slider on mobile, in particular).
   min-width:0 alone is not enough here: .container also has
   margin-inline:auto (for its normal centered-block usage elsewhere on the
   site), and a grid item with an auto inline margin is sized via
   fit-content instead of being stretched to fill its grid track — so it
   still grows up to its own max-content size (i.e. up to max-width) instead
   of being capped at the track/viewport width. Forcing width:100% makes it
   stretch to the track width like every other grid item, leaving no room
   for the auto margins to expand it. */
.content-section > .container {
  width: 100%;
  min-width: 0;
}
.content-section__media img {
  width: 100%;
  height: auto;
  clip-path: var(--clip-card);
  object-fit: contain;
  background: var(--color-bg-dark);
}
.content-section__cta { margin-top: 8px; }

/* ---------- 2-col grids ---------- */
.grid-2 {
  display: grid;
  gap: var(--space-card-gap);
  grid-template-columns: 1fr;
}
.grid-2 > * { min-width: 0; }
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

.grid-cards {
  display: grid;
  gap: var(--space-card-gap);
  grid-template-columns: 1fr;
}
.grid-cards > * { min-width: 0; }
@media (min-width: 480px) {
  .grid-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid-cards { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Utility ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.text-center { text-align: center; }
.mt-section { margin-top: var(--space-section); }
.media-contain {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: var(--color-bg-dark);
}
.platform-card__title { margin-top: 16px; }
.platform-card__icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
  background: none;
}
.error-404__code {
  font-size: clamp(48px, 10vw, 120px);
  font-weight: var(--fw-heading);
  color: var(--color-heading-accent);
  margin-bottom: 8px;
}

/* ---------- fade-in-on-scroll (opt-in via JS/IntersectionObserver) ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms ease, transform 500ms ease;
}
.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .fade-in { opacity: 1; transform: none; transition: none; }
}
