/* ============================================================================
 * TCL Langenfeld – Base / Reset
 * Modern CSS Reset + Grundtypografie
 * ========================================================================== */

@layer reset {
  *, *::before, *::after {
    box-sizing: border-box;
  }

  html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + var(--s-2));
  }

  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }

  body {
    margin: 0;
    min-height: 100vh;
    line-height: var(--lh-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }

  img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
  }

  img {
    height: auto;
  }

  input, button, textarea, select {
    font: inherit;
    color: inherit;
  }

  button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
  }

  h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd {
    margin: 0;
  }

  ul, ol {
    margin: 0;
    padding: 0;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  hr {
    border: 0;
    border-top: 1px solid var(--ink-100);
    margin: var(--s-8) 0;
  }

  /* Accessible visually-hidden */
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  /* Skip-Link für Screenreader */
  .skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: var(--z-modal);
    padding: var(--s-3) var(--s-4);
    background: var(--tcl-indigo);
    color: var(--white);
    border-radius: 0 0 var(--r-md) 0;
  }
  .skip-link:focus {
    left: 0;
  }

  /* Fokus-Stil global (Tastatur-Navigation) */
  :focus-visible {
    outline: 2px solid var(--tcl-indigo);
    outline-offset: 2px;
    border-radius: var(--r-sm);
  }
  :focus:not(:focus-visible) {
    outline: none;
  }

  /* Text-Auswahl */
  ::selection {
    background: var(--tcl-indigo);
    color: var(--white);
  }
}

@layer base {
  /* ---------- Font-Faces (selbst gehostet, Platzhalter bis woff2 geliefert) ---------- */
  /* Inter */
  @font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: local("Inter"), url("/assets/fonts/inter-regular.woff2") format("woff2");
  }
  @font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: local("Inter"), url("/assets/fonts/inter-medium.woff2") format("woff2");
  }
  @font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: local("Inter"), url("/assets/fonts/inter-bold.woff2") format("woff2");
  }

  /* Manrope – Display */
  @font-face {
    font-family: "Manrope";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: local("Manrope"), url("/assets/fonts/manrope-bold.woff2") format("woff2");
  }
  @font-face {
    font-family: "Manrope";
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: local("Manrope"), url("/assets/fonts/manrope-extrabold.woff2") format("woff2");
  }

  /* ---------- Body ---------- */
  body {
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    color: var(--ink-900);
    background: var(--white);
    font-weight: 400;
  }

  /* ---------- Überschriften ---------- */
  h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: var(--lh-tight);
    letter-spacing: -0.015em;
    color: var(--ink-900);
    text-wrap: balance;
    /* Lange deutsche Komposita (z.B. "Datenschutzerklärung") sollen umbrechen,
       statt horizontales Scrollen zu erzeugen. */
    overflow-wrap: break-word;
    hyphens: auto;
  }

  h1 {
    font-size: var(--fs-4xl);
    font-weight: 800;
    letter-spacing: -0.025em;
  }

  h2 {
    font-size: var(--fs-3xl);
    letter-spacing: -0.02em;
  }

  h3 {
    font-size: var(--fs-2xl);
  }

  h4 {
    font-size: var(--fs-xl);
  }

  h5, h6 {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: var(--fs-lg);
    line-height: var(--lh-snug);
  }

  /* ---------- Body-Text ---------- */
  p {
    text-wrap: pretty;
    max-width: 65ch;
  }

  p + p {
    margin-top: var(--s-4);
  }

  .lead {
    font-size: var(--fs-lg);
    color: var(--ink-700);
    line-height: var(--lh-body);
    max-width: 60ch;
  }

  /* ---------- Links ---------- */
  a {
    color: var(--tcl-indigo);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: color-mix(in srgb, var(--tcl-indigo) 40%, transparent);
    transition: text-decoration-color var(--dur-normal) var(--ease-out),
                color var(--dur-normal) var(--ease-out);
  }
  a:hover {
    text-decoration-color: var(--tcl-indigo);
    color: var(--tcl-indigo-700);
  }

  /* Text-Links in Prose-Kontexten anders; chromelose Links (in Buttons/Nav) kein Underline */
  nav a,
  .btn,
  .card a,
  .no-underline {
    text-decoration: none;
  }

  /* ---------- Listen ---------- */
  .prose ul,
  .prose ol {
    margin: var(--s-4) 0;
    padding-left: var(--s-6);
  }
  .prose li + li {
    margin-top: var(--s-2);
  }

  /* ---------- Images ---------- */
  img.cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* ---------- Tabellen ---------- */
  table {
    border-collapse: collapse;
    width: 100%;
  }
  th, td {
    text-align: left;
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--ink-100);
  }
  th {
    font-weight: 600;
    color: var(--ink-700);
    font-size: var(--fs-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  /* ---------- Hilfsklassen ---------- */
  .container {
    width: var(--container);
    margin-inline: auto;
  }
  .container--narrow {
    width: var(--container-narrow);
    margin-inline: auto;
  }
  .container--wide {
    width: var(--container-wide);
    margin-inline: auto;
  }

  .section {
    padding-block: var(--s-16);
  }
  @media (min-width: 768px) {
    .section {
      padding-block: var(--s-24);
    }
  }
  .section--sm {
    padding-block: var(--s-10);
  }
  .section--tight {
    padding-block: var(--s-8);
  }

  .section--indigo {
    background: var(--tcl-indigo);
    color: var(--white);
  }
  .section--indigo h1,
  .section--indigo h2,
  .section--indigo h3 {
    color: var(--white);
  }

  .section--tinted {
    background: var(--ink-50);
  }

  /* Abstand zwischen Sections innerhalb einer <main> */
  main > * + * {
    /* nichts – jede Section hat ihr eigenes Padding */
  }

  /* Eyebrow / Kapitel-Label */
  .eyebrow {
    display: inline-block;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: var(--fs-sm);
    color: var(--tcl-indigo-500);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: var(--s-3);
  }
  .section--indigo .eyebrow {
    color: var(--tcl-indigo-300);
  }
}

@layer utilities {
  .text-center { text-align: center; }
  .text-muted  { color: var(--ink-500); }
  .text-indigo { color: var(--tcl-indigo); }
  .text-red    { color: var(--tcl-red); }

  .stack > * + * { margin-top: var(--s-4); }
  .stack-lg > * + * { margin-top: var(--s-8); }
  .stack-xl > * + * { margin-top: var(--s-12); }

  .flex { display: flex; }
  .flex-wrap { flex-wrap: wrap; }
  .items-center { align-items: center; }
  .justify-between { justify-content: space-between; }
  .gap-2 { gap: var(--s-2); }
  .gap-3 { gap: var(--s-3); }
  .gap-4 { gap: var(--s-4); }
  .gap-6 { gap: var(--s-6); }

  .grid { display: grid; }
  .grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

  @media (max-width: 900px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md\:grid-cols-1 { grid-template-columns: 1fr; }
  }
  @media (max-width: 600px) {
    .sm\:grid-cols-1 { grid-template-columns: 1fr; }
  }

  .hidden { display: none; }
  @media (max-width: 768px) {
    .md-hidden { display: none; }
  }
  @media (min-width: 769px) {
    .md-only\:hidden { display: none; }
  }
}
