/* ==========================================================================
   Komponenten: Hero-Shortcode, breite Tabellen, Footer-Abstände.
   Nutzen die kayal-Variablen und passen sich damit beiden Design-Varianten
   an (adminwerk.css bildet sie auf das Design System ab).
   ========================================================================== */

/* --- Footer: Abstand der unteren Zeile zum Rand ------------------------- */
footer {
  padding: 1.25rem 1.5rem;
  gap: 0.5rem 1.5rem;
  align-items: center;
}
@media (max-width: 640px) {
  footer {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
  }
}

/* --- Hero ----------------------------------------------------------------- */
.c-hero {
  display: grid;
  gap: 2rem;
  align-items: center;
  margin: 1rem 0 3rem;
  padding: 3rem 0;
  border-bottom: 1px solid var(--secondary-color-dark);
}
.c-hero--media {
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
}
.c-hero { container-type: inline-size; }
.c-hero--dunkel {
  padding: 3rem 2rem;
  background: var(--primary-color);
  color: var(--secondary-color);
  border-bottom: 0;
}
.c-hero__label {
  margin: 0 0 0.5rem;
  font-family: var(--aw-mono, ui-monospace, monospace);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tertiary-color);
}
.c-hero .c-hero__title {
  margin: 0 0 1rem;
  /* Größe nach Breite des Heros, nicht des Fensters: passt auch in schmale Spalten (70-30) */
  font-size: clamp(32px, 9cqi, 64px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: inherit;
}
.c-hero .c-hero__title::before { content: none; }
.c-hero__text {
  max-width: 38rem;
  font-size: 19px;
  line-height: 30px;
}
.c-hero__text p { margin: 0 0 0.75rem; }
.c-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
}
.c-hero__btn {
  display: inline-block;
  padding: 0.7rem 1.25rem;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-weight: 700;
  text-decoration: none;
  color: inherit;
}
/* Eigene Hover-Zustände: das globale a:hover färbt Links in der
   Signalfarbe – auf dem Signal-Button wäre die Schrift dann unsichtbar */
.c-hero a.c-hero__btn:hover,
.c-hero a.c-hero__btn:focus-visible {
  text-decoration: none;
  color: inherit;
  background: color-mix(in srgb, currentColor 12%, transparent);
}
.c-hero a.c-hero__btn--primary:hover,
.c-hero a.c-hero__btn--primary:focus-visible {
  color: var(--aw-auf-signal-text, #fff);
  background: color-mix(in srgb, var(--tertiary-color) 82%, #000);
  border-color: color-mix(in srgb, var(--tertiary-color) 82%, #000);
}
.c-hero__btn--primary {
  background: var(--tertiary-color);
  border-color: var(--tertiary-color);
  color: var(--aw-auf-signal-text, #fff);
}
.c-hero__media img {
  display: block;
  width: 100%;
  height: auto;
}
@media (max-width: 768px) {
  .c-hero, .c-hero--media { grid-template-columns: 1fr; padding: 2rem 0; }
  .c-hero--dunkel { padding: 2rem 1.25rem; }
  .c-hero__media { order: -1; max-width: 16rem; }
}

/* --- Breite Tabellen (render-table.html, js/tables.js) ------------------- */
.c-table {
  position: relative;
  margin: 1.5rem 0;
}
.c-table__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.c-table__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.c-table__title { margin: 0; font-weight: 700; }
/* Werkzeug-Icon: erscheint beim Überfahren, bei Tastaturfokus und auf Touch immer */
.c-table__tools { position: relative; display: flex; align-items: center; opacity: 0; }
.c-table:hover .c-table__tools, .c-table__tools:focus-within { opacity: 1; }
@media (pointer: coarse) { .c-table__tools { opacity: 1; } }
.c-table__icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--secondary-color-dark);
  border-radius: 4px;
  background: var(--secondary-color);
  color: var(--tertiary-color);
  cursor: pointer;
}
.c-table__icon svg { width: 1rem; height: 1rem; }
.c-table__open {
  visibility: hidden;
  position: absolute;
  right: 0;
  top: calc(100% - 1px);
  z-index: 20;
  white-space: nowrap;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--secondary-color-dark);
  border-radius: 4px;
  background: var(--secondary-color);
  font-size: 0.875rem;
  font-weight: 700;
}
.c-table__tools:hover .c-table__open, .c-table__tools:focus-within .c-table__open { visibility: visible; }
@media print { .c-table__tools, .c-table__ctrl { display: none !important; } }
.c-table__scroll {
  overflow-x: auto;
  border: 1px solid var(--secondary-color-dark);
  scrollbar-width: auto;
  scrollbar-color: var(--tertiary-color) var(--secondary-color);
}
.c-table__scroll::-webkit-scrollbar { height: 14px; }
.c-table__scroll::-webkit-scrollbar-track { background: var(--secondary-color); border-top: 1px solid var(--secondary-color-dark); }
.c-table__scroll::-webkit-scrollbar-thumb { background: var(--tertiary-color); border: 3px solid var(--secondary-color); }
.c-table__scroll table { width: 100%; margin: 0; border-collapse: collapse; }
.c-table__scroll th { white-space: nowrap; }
/* Kantenschatten, solange noch Inhalt verborgen ist */
.c-table.is-overflow:not(.at-end)::after,
.c-table.is-overflow:not(.at-start)::before {
  content: "";
  position: absolute;
  top: 2.5rem;
  bottom: 3.5rem;
  width: 1.25rem;
  pointer-events: none;
  z-index: 10;
}
.c-table.is-overflow:not(.at-end)::after { right: 1px; background: linear-gradient(to left, rgb(0 0 0 / 0.12), transparent); }
.c-table.is-overflow:not(.at-start)::before { left: 1px; background: linear-gradient(to right, rgb(0 0 0 / 0.12), transparent); }
.c-table__ctrl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
}
.c-table__ctrl[hidden] { display: none; }
.c-table__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--secondary-color-dark);
  border-radius: 999px;
  background: var(--secondary-color);
  color: var(--tertiary-color);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.c-table__btn:disabled { cursor: default; opacity: 0.35; }
@media (pointer: coarse) { .c-table__ctrl .c-table__btn { display: none; } }

/* Einzelansicht /tabelle/ */
/* Tabelle nutzt die ganze Fensterbreite statt der Inhaltsspalte */
.c-tableview__table {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 0 1.5rem;
  box-sizing: border-box;
  overflow-x: auto;
}
.c-tableview__table table { width: max-content; min-width: 100%; border-collapse: collapse; }
@media print { .c-tableview__back, #tvPrint, header, .footer-grid, footer { display: none !important; } }

/* Unterstützer-Hinweis (z. B. Buy me a coffee) als Band unter dem Hero */
.c-support {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin: 0 0 2.5rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--quaternary-color, currentColor);
  border-left: 3px solid var(--tertiary-color);
}
.c-support__text p { margin: 0; }
.c-support__action { flex: none; }
