/* ===================================================================
   Karate Verein Eppingen – Design-Tokens
   Sumi (Schwarz), Washi (Papierweiß mit kühlem Grünstich wie Tatami),
   Hinomaru-Rot, Obi-Gold. Die Gürtelfarben-Kette ist das wiederkehrende
   Signature-Element (Obi-Bar) – abgeleitet aus dem echten Prüfungssystem.
   =================================================================== */
:root {
  --sumi: #1d1c19;
  --ink: #2a2823;
  --paper: #eef0e9;
  --paper-alt: #e2e5da;
  --card: #ffffff;
  --red: #ae2b26;
  --red-dark: #8c211d;
  --gold: #c1922f;
  --indigo: #2c3c49;
  --line: #d7d9cd;
  --radius: 3px;
  --belt-white: #f4f4f0;
  --belt-yellow: #e3bd3f;
  --belt-orange: #d97f33;
  --belt-green: #4d7a49;
  --belt-blue: #386693;
  --belt-brown: #6b4a34;
  --belt-black: #1d1c19;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}
h1, h2, h3, h4 {
  font-family: 'Bebas Neue', 'Work Sans', sans-serif;
  letter-spacing: 0.04em;
  color: var(--sumi);
  line-height: 1.05;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.4rem; letter-spacing: 0.03em; }
p { margin: 0 0 1em; }
a { color: var(--red-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* Fokus sichtbar halten (Barrierefreiheit) */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---- Signature-Element: Obi-Bar (Gürtelfarben-Streifen) ---- */
.obi-bar {
  height: 7px;
  background: linear-gradient(90deg,
    var(--belt-white) 0 14.28%,
    var(--belt-yellow) 14.28% 28.56%,
    var(--belt-orange) 28.56% 42.84%,
    var(--belt-green) 42.84% 57.12%,
    var(--belt-blue) 57.12% 71.4%,
    var(--belt-brown) 71.4% 85.68%,
    var(--belt-black) 85.68% 100%);
}

/* ---- Header ---- */
.site-header { background: var(--sumi); color: #f2f1ec; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand__mark {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  width: 42px; height: 42px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
}
.brand__text strong { display: block; font-family: 'Bebas Neue', sans-serif; font-size: 1.25rem; letter-spacing: 0.05em; }
.brand__text small { display: block; font-size: 0.72rem; color: #b9b7ad; letter-spacing: 0.06em; text-transform: uppercase; }

.main-nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.main-nav > a, .nav-item > a {
  display: block; padding: 10px 14px; color: #e7e5dd; font-weight: 600;
  font-size: 0.92rem; border-bottom: 3px solid transparent;
}
.main-nav > a:hover, .nav-item > a:hover, .main-nav > a.active, .nav-item > a.active {
  color: #fff; border-bottom-color: var(--red); text-decoration: none;
}
.nav-item { position: relative; }
.dropdown {
  display: none; position: absolute; top: 100%; left: 0; background: #fff;
  min-width: 200px; box-shadow: 0 12px 24px rgba(0,0,0,0.18); border-radius: var(--radius);
  overflow: hidden; z-index: 20;
}
.dropdown a { display: block; padding: 10px 16px; color: var(--ink); font-weight: 500; border-bottom: 1px solid var(--line); }
.dropdown a:last-child { border-bottom: none; }
.dropdown a:hover { background: var(--paper); text-decoration: none; }
.nav-item:hover .dropdown, .nav-item:focus-within .dropdown { display: block; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: #fff; margin: 5px 0; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none; flex-direction: column; align-items: stretch; width: 100%;
    background: var(--sumi); position: absolute; left: 0; right: 0; top: 100%;
    padding: 8px 0 16px; border-top: 1px solid #3a3833;
  }
  .main-nav.open { display: flex; }
  .site-header__inner { position: relative; flex-wrap: wrap; }
  .dropdown { position: static; box-shadow: none; background: #26241f; }
  .dropdown a { color: #d8d6cd; }
}

/* ---- Hero (Startseite) ---- */
.hero {
  position: relative; background: var(--sumi); color: #fff; overflow: hidden;
  min-height: 420px; display: flex; align-items: flex-end;
}
.hero__bg { position: absolute; inset: 0; object-fit: cover; width: 100%; height: 100%; opacity: 0.55; }
.hero__content { position: relative; z-index: 2; padding: 56px 24px; max-width: 1180px; margin: 0 auto; width: 100%; }
.hero__eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; font-size: 0.85rem; }
.hero h1 { color: #fff; margin-top: 8px; }
.hero p { max-width: 620px; color: #e6e4db; font-size: 1.05rem; }
.btn {
  display: inline-block; background: var(--red); color: #fff; font-weight: 700;
  padding: 12px 26px; border-radius: var(--radius); margin-top: 12px; text-transform: uppercase;
  letter-spacing: 0.05em; font-size: 0.85rem; border: none; cursor: pointer;
}
.btn:hover { background: var(--red-dark); text-decoration: none; }
.btn--ghost { background: transparent; border: 2px solid #fff; }
.btn--ghost:hover { background: rgba(255,255,255,0.12); }

/* ---- Sections ---- */
section.block { padding: 56px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 8px; }
.section-head a.more { font-weight: 700; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.06em; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08); border: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.card__img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--paper-alt); }
.card__body { padding: 18px 20px 22px; flex: 1; display: flex; flex-direction: column; }
.card__meta { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--red-dark); font-weight: 700; margin-bottom: 6px; }
.card h3 { margin-bottom: 8px; }
.card p { color: #4c4a44; font-size: 0.95rem; }
.card__link { margin-top: auto; font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---- Inhaltsseiten ---- */
.page-header { background: var(--paper-alt); padding: 40px 0 32px; border-bottom: 1px solid var(--line); }
.content { padding: 44px 0 60px; }
.content .wrap { max-width: 880px; }
.content h2 { margin-top: 1.4em; }
.content table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 0.92rem; }
.content table th, .content table td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.content table th { background: var(--paper-alt); font-weight: 700; }
.belt-list { list-style: none; margin: 1.4em 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.belt-list li { display: flex; align-items: center; gap: 14px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.belt-swatch { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(0,0,0,0.15); }

/* ---- News & Gallery ---- */
.news-detail img.hero-img { width: 100%; border-radius: var(--radius); margin-bottom: 24px; aspect-ratio: 16/9; object-fit: cover; }

/* Formatierungen aus dem Editor (Quill) auch auf der öffentlichen Seite darstellen */
.rich-content .ql-align-center { text-align: center; }
.rich-content .ql-align-right { text-align: right; }
.rich-content .ql-align-justify { text-align: justify; }
.rich-content .ql-indent-1 { margin-left: 2em; }
.rich-content .ql-indent-2 { margin-left: 4em; }
.rich-content .ql-indent-3 { margin-left: 6em; }
.rich-content .ql-indent-4 { margin-left: 8em; }
/* Schriftarten aus dem Editor – müssen zu views/admin/_editor-fonts.ejs passen,
   sonst sieht der Text im Editor anders aus als auf der Website. */
.rich-content .ql-font-worksans { font-family: 'Work Sans', sans-serif; }
.rich-content .ql-font-opensans { font-family: 'Open Sans', sans-serif; }
.rich-content .ql-font-montserrat { font-family: 'Montserrat', sans-serif; }
.rich-content .ql-font-serif { font-family: Georgia, 'Times New Roman', serif; }
.rich-content .ql-font-merriweather { font-family: 'Merriweather', Georgia, serif; }
.rich-content .ql-font-lora { font-family: 'Lora', Georgia, serif; }
.rich-content .ql-font-playfair { font-family: 'Playfair Display', Georgia, serif; }
.rich-content .ql-font-robotoslab { font-family: 'Roboto Slab', Georgia, serif; }
.rich-content .ql-font-headline { font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.03em; }
.rich-content .ql-font-oswald { font-family: 'Oswald', 'Bebas Neue', sans-serif; }
.rich-content .ql-font-monospace { font-family: 'Courier New', monospace; }
.rich-content .ql-size-small { font-size: 0.75em; }
.rich-content .ql-size-large { font-size: 1.5em; }
.rich-content .ql-size-huge { font-size: 2.25em; }
.rich-content blockquote { border-left: 4px solid var(--gold); margin: 1.2em 0; padding: 0.4em 0 0.4em 1.2em; color: #4c4a44; font-style: italic; }
.rich-content pre {
  background: var(--sumi); color: #e7e5dd; padding: 14px 16px; border-radius: var(--radius);
  overflow-x: auto; font-family: 'Courier New', monospace; font-size: 0.88rem;
}
.rich-content img { border-radius: var(--radius); margin: 0.6em 0; }
.gallery-year h2 { margin-top: 2em; border-bottom: 2px solid var(--gold); display: inline-block; padding-bottom: 4px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 20px 0 40px; }
.gallery-thumb { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #fff; }
.gallery-thumb img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.gallery-thumb__label { padding: 10px 12px; font-size: 0.85rem; font-weight: 600; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.photo-grid img { aspect-ratio: 1/1; object-fit: cover; border-radius: var(--radius); }

/* ---- Kontaktformular ---- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  font-family: inherit; font-size: 0.95rem; background: #fff;
}
textarea { min-height: 130px; resize: vertical; }
.alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; font-weight: 600; }
.alert--success { background: #e4efe2; color: #2c5a2a; border: 1px solid #b9d8b4; }
.alert--error { background: #f7e2e1; color: var(--red-dark); border: 1px solid #e6b9b6; }

/* ---- Footer ---- */
.site-footer { background: var(--sumi); color: #cfcdc4; padding: 40px 0 10px; font-size: 0.9rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; padding-bottom: 24px; }
.footer-grid strong { color: #fff; font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.04em; font-size: 1.05rem; }
.footer-grid a { color: #cfcdc4; }
.footer-bottom { border-top: 1px solid #3a3833; padding: 14px 24px 0; font-size: 0.78rem; color: #9c9a91; }

/* ---- Admin ---- */
.admin-shell { max-width: 1080px; margin: 0 auto; padding: 32px 24px 60px; }
.admin-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.admin-nav { display: flex; gap: 8px; margin-bottom: 24px; }
.admin-nav a { padding: 8px 16px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: 0.9rem; }
.admin-nav a.active { background: var(--sumi); color: #fff; border-color: var(--sumi); }
table.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; }
table.admin-table th, table.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 0.92rem; }
table.admin-table th { background: var(--paper-alt); }
.row-actions { display: flex; gap: 8px; }
.row-actions button, .row-actions a { font-size: 0.8rem; padding: 6px 10px; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: var(--radius); }
.btn-danger { background: var(--red); color: #fff; border: none; cursor: pointer; }
.login-box { max-width: 380px; margin: 90px auto; background: #fff; padding: 36px; border-radius: var(--radius); border: 1px solid var(--line); }
.thumb-strip { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.thumb-strip figure { margin: 0; width: 130px; }
.thumb-strip img { border-radius: var(--radius); border: 1px solid var(--line); aspect-ratio: 1/1; object-fit: cover; }
.thumb-strip figcaption { text-align: center; margin-top: 4px; }
.help-text { color: #6c6a63; font-size: 0.85rem; }

/* ---- Team-Karten (Vorstand, Trainer) ---- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; margin: 24px 0; }
.team-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; border-top: 4px solid var(--gold); }
.team-card h3 { margin: 0 0 10px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: #6c6a63; }
.team-card .team-name { font-weight: 700; font-size: 1.05rem; margin: 0 0 6px; color: var(--sumi); }
.team-card .team-role { font-size: 0.9rem; line-height: 1.5; margin: 0 0 8px; }
.team-card .team-contact { font-size: 0.85rem; color: #4a483f; margin: 8px 0 0; line-height: 1.6; }

/* ---- Inhalts-Seiten (übernommene Texte) ---- */
.rich-content h2 { margin-top: 32px; margin-bottom: 12px; color: var(--sumi); border-bottom: 2px solid var(--gold); padding-bottom: 6px; display: inline-block; }
.rich-content blockquote { border-left: 4px solid var(--red); background: var(--paper-alt); margin: 24px 0; padding: 16px 20px; font-style: italic; font-size: 1.1rem; border-radius: 0 var(--radius) var(--radius) 0; }
.rich-content table { width: 100%; border-collapse: collapse; margin: 16px 0; background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.rich-content table th, .rich-content table td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 0.92rem; }
.rich-content table th { background: var(--paper-alt); }
.rich-content ul { line-height: 1.7; }

/* ---- Downloads & Listen in Inhaltsseiten ---- */
.rich-content h3 { margin-top: 22px; margin-bottom: 8px; font-size: 1.05rem; color: var(--sumi); }
.rich-content .download-list { list-style: none; padding: 0; }
.rich-content .download-list li { padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; }
.rich-content pre { background: var(--sumi); color: #f5f3ee; padding: 12px 16px; border-radius: var(--radius); overflow-x: auto; font-size: 0.85rem; }

/* ---- Foto auf Team-Karten ---- */
.team-card .team-photo { width: 100%; max-width: 160px; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; margin-bottom: 12px; display: block; }

/* ---- Logo im Seitenkopf (falls public/img/logo.* vorhanden) ---- */
.brand__logo { height: 52px; width: auto; display: block; }
@media (max-width: 600px) { .brand__logo { height: 42px; } }
