/* ==========================================================================
   Schachjugend Rheinland-Pfalz – Basis-Stylesheet
   Mobile first: Grundstile gelten fürs Handy, Media Queries erweitern nach oben.
   Keine externen Fonts (Datenschutz) – System-Schriften.
   ========================================================================== */

:root {
  --bg: #f5f5f1;
  --surface: #ffffff;
  --surface-2: #eeeee8;
  --ink: #10131f;
  --ink-2: #4b5064;
  --line: #e2e2dc;

  --brand: #3446ff;
  --brand-hover: #2433d6;
  --brand-ink: #ffffff;
  --brand-soft: #e7eaff;

  --accent: #c6f03a;
  --accent-ink: #10131f;

  --pdf: #e5432a;
  --pdf-soft: #fde9e5;

  --success: #1f8f4e;
  --warning: #b86e00;
  --danger: #c62f2f;

  --hero-bg: #10131f;
  --hero-ink: #f4f5fa;
  --hero-square: rgba(255, 255, 255, 0.045);

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(16, 19, 31, 0.06), 0 8px 24px rgba(16, 19, 31, 0.06);
  --shadow-lift: 0 2px 4px rgba(16, 19, 31, 0.08), 0 16px 36px rgba(16, 19, 31, 0.12);

  --page: min(1140px, calc(100% - 2rem));
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0e17;
    --surface: #161927;
    --surface-2: #1d2133;
    --ink: #eef0f7;
    --ink-2: #a4a9bd;
    --line: #272b3d;

    --brand: #7b88ff;
    --brand-hover: #9aa4ff;
    --brand-ink: #0c0e17;
    --brand-soft: #1f2550;

    --pdf: #ff7a62;
    --pdf-soft: #3a1d19;

    --hero-bg: #070912;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.5), 0 16px 36px rgba(0, 0, 0, 0.45);

    color-scheme: dark;
  }
}

/* --------------------------------------------------------------------------
   Grundlagen
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand);
  text-underline-offset: 0.18em;
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

h1 { font-size: clamp(2rem, 7vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.45rem, 4.4vw, 2.1rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 750; }

p { margin: 0 0 1em; }

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 999px;
  font-weight: 700;
}

.skip-link:focus {
  top: 0.75rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.icon {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  vertical-align: -0.18em;
}

/* --------------------------------------------------------------------------
   Header & Navigation
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-nav {
  width: var(--page);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
  padding: 0.6rem 0 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--accent);
  font-size: 1.5rem;
  line-height: 1;
  transition: transform 0.25s ease;
}

.brand:hover .brand-mark {
  transform: rotate(-8deg) scale(1.05);
}

.brand-logo {
  height: 40px;
  width: auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  font-family: var(--font-display);
}

.brand-text strong {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand-text small {
  font-size: 0.78rem;
  color: var(--ink-2);
  font-weight: 600;
}

/* Mobil: Navigation als horizontal wischbare Chip-Leiste unter dem Logo. */
.nav-links {
  order: 3;
  flex-basis: 100%;
  display: flex;
  gap: 0.3rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0.5rem 0 0.65rem;
  margin: 0 -1rem;
  padding-inline: 1rem;
  scroll-padding-inline: 1rem;
  mask-image: linear-gradient(90deg, transparent 0, #000 1rem, #000 calc(100% - 1.5rem), transparent);
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.8rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 650;
  font-size: 0.92rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.nav-links a:hover {
  border-color: var(--ink-2);
}

.nav-links a[aria-current="page"] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.nav-links a.nav-admin {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}

@media (min-width: 860px) {
  .site-nav {
    flex-wrap: nowrap;
    min-height: 72px;
    padding: 0;
  }

  .nav-links {
    order: 0;
    flex-basis: auto;
    margin: 0 0 0 auto;
    padding: 0;
    overflow: visible;
    mask-image: none;
  }

  .nav-links a {
    background: transparent;
    border-color: transparent;
  }

  .nav-links a:hover {
    background: var(--surface);
    border-color: var(--line);
  }
}

/* --------------------------------------------------------------------------
   Layout-Bausteine
   -------------------------------------------------------------------------- */

.site-main {
  min-height: 60vh;
}

.section {
  width: var(--page);
  margin: 0 auto;
  padding: 2.5rem 0;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1.25rem;
}

.section-heading h2 {
  margin: 0;
}

.section-heading p {
  margin: 0.35rem 0 0;
  color: var(--ink-2);
  max-width: 60ch;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
}

.lead {
  font-size: 1.1rem;
  color: var(--ink-2);
  max-width: 62ch;
}

.page-hero {
  width: var(--page);
  margin: 0 auto;
  padding: 2.25rem 0 0.5rem;
}

.page-hero h1 {
  font-size: clamp(1.9rem, 6vw, 3rem);
}

.page-hero p:not(.eyebrow) {
  color: var(--ink-2);
  max-width: 62ch;
}

.grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .section { padding: 3.5rem 0; }
}

.card,
.note-box,
.empty-state {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.note-box {
  border-left: 5px solid var(--brand);
}

.note-box.todo {
  border-left-color: var(--warning);
  background: color-mix(in srgb, var(--warning) 8%, var(--surface));
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1.25rem;
  color: var(--ink-2);
}

.empty-state .empty-icon {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}

/* --------------------------------------------------------------------------
   Buttons & Chips
   -------------------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 1.25rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.button:active {
  transform: scale(0.97);
}

.button.primary {
  background: var(--brand);
  color: var(--brand-ink);
}

.button.primary:hover {
  background: var(--brand-hover);
}

.button.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.button.secondary:hover {
  border-color: var(--ink-2);
}

.button.accent {
  background: var(--accent);
  color: var(--accent-ink);
}

.button.accent:hover {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent);
}

.button.pdf {
  background: var(--pdf);
  color: #fff;
}

.button.pdf:hover {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--pdf) 25%, transparent);
}

.button.danger {
  background: var(--danger);
  color: #fff;
}

.button.small {
  min-height: 38px;
  padding: 0 0.9rem;
  font-size: 0.9rem;
}

.button.block {
  width: 100%;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.text-link {
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.text-link:hover {
  text-decoration: underline;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 28px;
  padding: 0 0.65rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.chip.pdf {
  background: var(--pdf-soft);
  color: var(--pdf);
}

.chip.neutral {
  background: var(--surface-2);
  color: var(--ink-2);
}

.chip.success {
  background: color-mix(in srgb, var(--success) 14%, transparent);
  color: var(--success);
}

/* Kategorie-Filter auf "Aktuelles" – wischbar auf dem Handy */
.filter-bar {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -1rem 1.25rem;
  padding: 0.25rem 1rem;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-bar a {
  flex: none;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 650;
  font-size: 0.92rem;
  text-decoration: none;
}

.filter-bar a[aria-current="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

/* --------------------------------------------------------------------------
   Hero (Startseite)
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--hero-bg);
  color: var(--hero-ink);
  isolation: isolate;
}

/* Schachbrett-Muster, nach unten ausblendend */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: repeating-conic-gradient(var(--hero-square) 0 25%, transparent 0 50%) 0 0 / 56px 56px;
  mask-image: radial-gradient(120% 90% at 85% 0%, #000 25%, transparent 75%);
  -webkit-mask-image: radial-gradient(120% 90% at 85% 0%, #000 25%, transparent 75%);
}

.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 520px;
  height: 520px;
  right: -180px;
  bottom: -260px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 55%, transparent), transparent 65%);
  filter: blur(10px);
}

.hero-inner {
  width: var(--page);
  margin: 0 auto;
  padding: 3rem 0 3.25rem;
  display: grid;
  gap: 2rem;
}

.hero .eyebrow {
  color: var(--accent);
}

.hero h1 {
  margin-bottom: 0.4em;
}

.hero h1 .highlight {
  color: var(--accent-ink);
  background: var(--accent);
  padding: 0 0.18em;
  border-radius: 0.18em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.hero-text {
  font-size: 1.08rem;
  color: color-mix(in srgb, var(--hero-ink) 78%, transparent);
  max-width: 54ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

.hero .button.secondary {
  color: var(--hero-ink);
  border-color: rgba(255, 255, 255, 0.25);
}

.hero .button.secondary:hover {
  border-color: rgba(255, 255, 255, 0.6);
}

/* Springer-Figur als Deko, nur ab Tablet */
.hero-piece {
  display: none;
}

@media (min-width: 860px) {
  .hero-inner {
    grid-template-columns: 1.4fr 1fr;
    align-items: center;
    padding: 5rem 0 5.5rem;
  }

  .hero-piece {
    display: grid;
    place-items: center;
    justify-self: center;
    width: min(320px, 100%);
    aspect-ratio: 1;
    border-radius: 36px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--brand) 85%, #fff 0%), color-mix(in srgb, var(--brand) 60%, #000));
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    font-size: 11rem;
    line-height: 1;
    color: var(--accent);
    transform: rotate(-6deg);
    animation: piece-float 6s ease-in-out infinite;
    user-select: none;
  }
}

@keyframes piece-float {
  0%, 100% { transform: rotate(-6deg) translateY(0); }
  50% { transform: rotate(-3deg) translateY(-10px); }
}

/* Schnellzugriff-Kacheln unter dem Hero */
.quick-links {
  width: var(--page);
  margin: -1.5rem auto 0;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.quick-link {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.quick-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.quick-link .quick-icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.quick-link strong {
  font-family: var(--font-display);
  font-size: 1rem;
}

.quick-link span:last-child {
  font-size: 0.85rem;
  color: var(--ink-2);
}

@media (min-width: 860px) {
  .quick-links {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: -2.25rem;
  }
}

/* --------------------------------------------------------------------------
   Turnier-/Termin-Karten
   -------------------------------------------------------------------------- */

.event-list {
  display: grid;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 860px) {
  .event-list.two-col {
    grid-template-columns: repeat(2, 1fr);
  }
}

.event-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  align-items: start;
  padding: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.event-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: transparent;
}

.event-card.is-past {
  opacity: 0.78;
}

.date-tile {
  display: grid;
  justify-items: center;
  align-content: center;
  width: 64px;
  min-height: 72px;
  padding: 0.4rem 0;
  border-radius: 14px;
  background: var(--hero-bg);
  color: var(--hero-ink);
  border: 1px solid var(--line);
  font-family: var(--font-display);
  line-height: 1;
}

.date-tile .weekday {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.date-tile .day {
  font-size: 1.7rem;
  font-weight: 850;
  margin: 0.15rem 0;
}

.date-tile .month {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.event-card.is-past .date-tile {
  background: var(--surface-2);
  color: var(--ink-2);
}

.event-card.is-past .date-tile .weekday {
  color: var(--ink-2);
}

.event-body {
  min-width: 0;
}

.event-body h3 {
  margin: 0.1rem 0 0.3rem;
  font-size: 1.08rem;
}

/* Ganze Karte klickbar, ohne verschachtelte Links */
.event-body h3 a {
  color: var(--ink);
  text-decoration: none;
}

.event-body h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.9rem;
  margin: 0 0 0.6rem;
  font-size: 0.88rem;
  color: var(--ink-2);
}

.event-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Links über dem "Karten-Link" liegen lassen */
.event-card .chip,
.event-card .button {
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   Beitrags-Karten
   -------------------------------------------------------------------------- */

.post-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
  .post-grid { grid-template-columns: repeat(3, 1fr); }
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}

.post-card-media {
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  overflow: hidden;
}

.post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Platzhalter ohne Bild: schmales Schachbrett-Band */
.post-card-media.placeholder {
  aspect-ratio: auto;
  height: 64px;
  display: grid;
  place-items: center;
  background:
    repeating-conic-gradient(color-mix(in srgb, var(--brand) 14%, transparent) 0 25%, transparent 0 50%) 0 0 / 32px 32px,
    var(--brand-soft);
  font-size: 1.8rem;
  color: var(--brand);
}

@media (min-width: 640px) {
  .post-card-media.placeholder {
    height: auto;
    aspect-ratio: 16 / 9;
    font-size: 2.6rem;
  }
}

.post-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  padding: 1rem 1.1rem 1.15rem;
}

.post-card h3 {
  margin: 0.2rem 0 0;
  font-size: 1.12rem;
}

.post-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.post-card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.post-card .chip {
  position: relative;
  z-index: 1;
}

.post-card p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.95rem;
}

.post-meta {
  margin-top: auto !important;
  padding-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--ink-2);
}

/* --------------------------------------------------------------------------
   Detailseite
   -------------------------------------------------------------------------- */

.article-page {
  width: min(760px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  margin-bottom: 0.5rem;
  font-weight: 700;
  text-decoration: none;
}

.article-header h1 {
  font-size: clamp(1.8rem, 6vw, 2.8rem);
  margin-bottom: 0.35em;
}

.article-teaser {
  font-size: 1.12rem;
  color: var(--ink-2);
}

.event-box {
  display: grid;
  gap: 0.75rem;
  margin: 1.25rem 0;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.event-box-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.event-box-row .icon-bubble {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
}

.event-box-row small {
  display: block;
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.event-box-row strong {
  font-size: 1.05rem;
}

.pdf-cta {
  display: grid;
  gap: 0.5rem;
}

.pdf-cta .pdf-hint {
  font-size: 0.82rem;
  color: var(--ink-2);
  text-align: center;
  margin: 0;
}

@media (min-width: 640px) {
  .event-box {
    grid-template-columns: 1fr 1fr;
    padding: 1.25rem;
  }

  .pdf-cta {
    grid-column: 1 / -1;
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .pdf-cta .pdf-hint {
    text-align: left;
  }
}

.article-image {
  margin: 1.5rem 0;
}

.article-image img {
  width: 100%;
  border-radius: var(--radius);
}

.article-content {
  font-size: 1.05rem;
}

.article-content h2 { font-size: 1.5rem; margin-top: 1.8em; }
.article-content h3 { font-size: 1.2rem; margin-top: 1.5em; }

.article-content ul,
.article-content ol {
  padding-left: 1.3rem;
}

.article-content blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--brand);
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.article-content pre {
  overflow-x: auto;
  padding: 1rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}

.article-content a {
  word-break: break-word;
}

.article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 2rem;
}

.article-image figcaption {
  margin-top: 0.5rem;
  font-size: 0.88rem;
  color: var(--ink-2);
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.95rem;
  display: block;
  overflow-x: auto;
}

.article-content th,
.article-content td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.article-content thead th {
  background: var(--surface-2);
  font-weight: 750;
}

.gallery-forms {
  display: grid;
  gap: 1rem;
}

.gallery-form {
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
}

.gallery-thumb {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

/* --------------------------------------------------------------------------
   Grußwort (Startseite)
   -------------------------------------------------------------------------- */

.greeting {
  margin: 0;
}

.greeting-text {
  margin: 0 0 1rem;
  padding: 0 0 0 1rem;
  border-left: 4px solid var(--accent);
  font-size: 1.1rem;
  color: var(--ink);
}

.greeting-text p {
  margin: 0;
}

.greeting-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink-2);
  font-size: 0.95rem;
  line-height: 1.35;
}

.greeting-author strong {
  color: var(--ink);
}

.greeting-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  background: var(--hero-bg);
  color: var(--accent);
  font-size: 1.5rem;
}

/* --------------------------------------------------------------------------
   Rechtstexte
   -------------------------------------------------------------------------- */

.legal {
  width: min(760px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 3rem;
}

.legal h2 {
  font-size: 1.3rem;
  margin-top: 2rem;
}

.placeholder-field {
  display: inline-block;
  padding: 0 0.35em;
  border-radius: 6px;
  background: color-mix(in srgb, var(--warning) 16%, transparent);
  color: var(--warning);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  margin-top: 3rem;
  background: var(--hero-bg);
  color: color-mix(in srgb, var(--hero-ink) 80%, transparent);
}

.footer-inner {
  width: var(--page);
  margin: 0 auto;
  padding: 2.25rem 0 calc(2rem + env(safe-area-inset-bottom));
  display: grid;
  gap: 1.5rem;
}

.footer-brand strong {
  display: block;
  color: var(--hero-ink);
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.footer-brand p {
  margin: 0.3rem 0 0;
  font-size: 0.92rem;
}

.footer-parent {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  color: inherit;
  text-decoration: none;
  font-size: 0.88rem;
  line-height: 1.35;
}

.footer-parent img {
  width: 64px;
  height: 64px;
  padding: 4px;
  border-radius: 10px;
  background: #fff;
  flex: none;
}

.footer-parent strong {
  color: var(--hero-ink);
}

.footer-parent:hover strong {
  text-decoration: underline;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--hero-ink);
  text-decoration: none;
  font-weight: 600;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-board {
  height: 10px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 20px, transparent 20px 40px);
  opacity: 0.85;
}

@media (min-width: 860px) {
  .footer-inner {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

/* --------------------------------------------------------------------------
   Meldungen
   -------------------------------------------------------------------------- */

.message-area {
  width: var(--page);
  margin: 1rem auto 0;
  display: grid;
  gap: 0.5rem;
}

.message {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  font-weight: 600;
}

.message-success { border-left-color: var(--success); }
.message-warning { border-left-color: var(--warning); }
.message-error   { border-left-color: var(--danger); }

/* --------------------------------------------------------------------------
   Verwaltung
   -------------------------------------------------------------------------- */

.admin-bar {
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.85rem;
  font-weight: 700;
}

.admin-bar-inner {
  width: var(--page);
  margin: 0 auto;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.admin-bar a {
  color: inherit;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

@media (min-width: 860px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); gap: 1rem; }
}

.stat {
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.1;
}

.stat span {
  font-size: 0.85rem;
  color: var(--ink-2);
}

.manage-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1rem;
}

.manage-toolbar input[type="search"] {
  flex: 1 1 200px;
}

.manage-list {
  display: grid;
  gap: 0.75rem;
}

.manage-card {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.manage-card h3 {
  margin: 0.25rem 0;
}

.manage-card p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.92rem;
}

@media (min-width: 860px) {
  .manage-card {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

/* Formulare */
.content-form,
.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.form-section {
  border: 0;
  margin: 0 0 1.5rem;
  padding: 0;
}

.form-section legend {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  padding: 0;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid .full { grid-column: 1 / -1; }
}

.form-field label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.form-control,
.content-form input[type="text"],
.content-form input[type="password"],
.form-card input[type="text"],
.form-card input[type="password"],
.manage-toolbar input,
.manage-toolbar select {
  width: 100%;
  min-height: 48px;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 1rem; /* verhindert Auto-Zoom auf iOS */
}

.manage-toolbar select {
  width: auto;
}

textarea.form-control {
  min-height: 220px;
  resize: vertical;
}

.form-control:focus,
.form-card input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 20%, transparent);
}

.checkbox-list ul,
.checkbox-list > div {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.checkbox-list label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 42px;
  padding: 0 0.9rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-weight: 650;
  cursor: pointer;
}

.checkbox-list label:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.checkbox-field label {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  min-height: 44px;
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--brand);
}

.help-text {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-2);
}

.errorlist {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
  color: var(--danger);
  font-weight: 650;
  font-size: 0.9rem;
}

.form-errors {
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
  font-weight: 650;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

/* Sticky Speichern-Leiste auf dem Handy */
@media (max-width: 719px) {
  .form-actions.sticky {
    position: sticky;
    bottom: 0;
    margin: 1.5rem -1.25rem -1.25rem;
    padding: 0.75rem 1.25rem calc(0.75rem + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    border-radius: 0 0 var(--radius) var(--radius);
  }

  .form-actions.sticky .button {
    flex: 1;
  }
}

.preview-banner {
  width: var(--page);
  margin: 1rem auto 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--warning) 14%, var(--surface));
  border: 1px dashed var(--warning);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: space-between;
  font-weight: 650;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  color: var(--ink-2);
}

/* --------------------------------------------------------------------------
   Reduzierte Bewegung
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
