/* The Royal Blues 1987 – Stylesheet
   Bewusst ohne externe Schriften/CDNs (Datenschutz, schnelle Ladezeit). */

/* Olde English: nur für den Logo-Schriftzug „The Royal Blues“. */
@font-face {
  font-family: "Olde English";
  src: url("fonts/OldeEnglish.ttf") format("truetype");
  font-display: swap;
}

:root {
  /* Royal-Blau vom Fanclub-Schal */
  --blue: #2400b8;
  --blue-dark: #18007f;
  --blue-deep: #0e004a;
  --blue-light: #ece9fc;
  --blue-mid: #5b45e0;
  --ink: #15142e;
  --muted: #5b5a78;
  --line: #dddbee;
  --bg: #f6f5fc;
  --card: #ffffff;
  --ok: #18794e;
  --warn: #b54708;
  --danger: #c0262d;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 30, 70, .06), 0 6px 20px rgba(0, 30, 70, .07);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Arial Narrow", "Roboto Condensed", "Segoe UI", system-ui, sans-serif;
  --font-logo: "Olde English", "Old English Text MT", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 var(--font);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; }
img { max-width: 100%; height: auto; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-dark); }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; letter-spacing: -.01em; color: var(--blue-deep); }
h2 { font-size: 1.6rem; margin: 2rem 0 .75rem; }
h3 { font-size: 1.25rem; margin: 1.5rem 0 .5rem; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.section { padding-top: 40px; padding-bottom: 64px; }
.skip { position: absolute; left: -9999px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: #fff; padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--blue-mid); outline-offset: 2px; }

/* ---------- Kopf ---------- */
.site-header {
  background: var(--blue);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(0, 20, 50, .25);
}
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; margin-right: auto; }
.brand:hover { color: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--font-logo); font-weight: 400; font-size: 2rem; letter-spacing: .01em; }
.brand-text small { font-size: .74rem; opacity: .8; letter-spacing: .08em; text-transform: uppercase; }
.logo { flex-shrink: 0; display: block; width: auto; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3)); }
@media (max-width: 420px) { .brand-text strong { font-size: 1.45rem; } .brand-text small { display: none; } }

.main-nav { display: flex; gap: 2px; }
.main-nav a {
  color: #fff;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: .95rem;
  opacity: .88;
}
.main-nav a:hover { background: rgba(255, 255, 255, .12); opacity: 1; color: #fff; }
.main-nav a[aria-current="page"] { background: #fff; color: var(--blue); opacity: 1; }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  width: 44px;
  height: 44px;
  padding: 10px;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
}
.nav-toggle span { display: block; height: 3px; background: #fff; border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .main-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--blue-dark);
    flex-direction: column;
    padding: 8px 16px 16px;
    box-shadow: 0 10px 20px rgba(0, 20, 50, .3);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px; font-size: 1.05rem; }
}

.admin-bar { background: #fff6d6; border-bottom: 1px solid #f0dc96; font-size: .9rem; }
.admin-bar .wrap { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding-top: 8px; padding-bottom: 8px; }

/* ---------- Hero (Startseite) ---------- */
.hero {
  position: relative;
  color: #fff;
  background:
    radial-gradient(ellipse at 25% 45%, rgba(130, 110, 255, .45), transparent 60%),
    linear-gradient(160deg, var(--blue) 0%, var(--blue-dark) 65%, var(--blue-deep) 100%);
  overflow: hidden;
}
.hero .wrap {
  padding-top: 48px;
  padding-bottom: 56px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 40px;
  align-items: center;
}
.hero-wappen { width: 100%; max-width: 520px; height: auto; justify-self: center; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .45)); }
.hero-kicker { text-transform: uppercase; letter-spacing: .14em; font-weight: 800; font-size: .9rem; margin: 0 0 8px; display: inline-block; background: #fff; color: var(--blue); padding: 4px 14px; clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 100%, 0 100%); }
.hero h1 {
  color: #fff;
  font-family: var(--font-logo);
  font-weight: 400;
  font-size: clamp(3rem, 7.5vw, 5.6rem);
  margin: 0;
  line-height: 1;
  text-shadow: 0 4px 24px rgba(0, 0, 0, .35);
}
.hero-sub { font-size: .95rem; letter-spacing: .14em; text-transform: uppercase; opacity: .8; margin: 6px 0 0; font-weight: 600; }
.hero-lead { font-size: 1.15rem; max-width: 34em; margin: 20px 0 24px; opacity: .92; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; list-style: none; }
.chips li { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25); padding: 6px 14px; border-radius: 999px; font-size: .9rem; font-weight: 600; }
@media (max-width: 800px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 16px; text-align: center; padding-top: 28px; padding-bottom: 40px; }
  .hero-wappen { max-width: 340px; }
  .hero-lead { margin-left: auto; margin-right: auto; }
  .chips { justify-content: center; }
}

/* ---------- Seitentitel ---------- */
.page-title { background: linear-gradient(160deg, var(--blue), var(--blue-dark)); color: #fff; position: relative; overflow: hidden; }
.page-title::after {
  content: "";
  position: absolute;
  right: max(16px, calc(50% - 560px));
  top: 50%;
  width: 220px;
  height: 200px;
  transform: translateY(-50%) rotate(-8deg);
  background: url("img/krone-gross.webp") center / contain no-repeat;
  opacity: .14;
  pointer-events: none;
}
.page-title .wrap { padding-top: 40px; padding-bottom: 40px; position: relative; z-index: 1; }
.page-title h1 { color: #fff; margin: 0; font-size: clamp(2rem, 5vw, 3rem); text-transform: uppercase; letter-spacing: .02em; }
.page-title p { margin: 6px 0 0; opacity: .85; }
@media (max-width: 600px) { .page-title::after { width: 140px; height: 130px; right: 8px; } }

/* ---------- Inhalte ---------- */
.prose { max-width: 760px; }
.prose > :first-child { margin-top: 0; }
.prose img { border-radius: 10px; display: block; margin: 24px auto; box-shadow: var(--shadow); }
.prose blockquote { margin: 24px 0; padding: 12px 20px; border-left: 4px solid var(--blue); background: var(--blue-light); border-radius: 0 10px 10px 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .3em 0; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 16px; }
.section-head h2 { margin: 0; }
.muted { color: var(--muted); }
.empty { color: var(--muted); font-style: italic; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 11px 20px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.2;
}
.btn:hover { background: var(--blue-dark); color: #fff; }
.btn-light { background: #fff; color: var(--blue); }
.btn-light:hover { background: var(--blue-light); color: var(--blue-dark); }
.btn-ghost { background: transparent; color: var(--blue); box-shadow: inset 0 0 0 2px var(--blue); }
.btn-ghost:hover { background: var(--blue-light); color: var(--blue-dark); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #961c22; }
.btn-small { padding: 6px 12px; font-size: .88rem; border-radius: 8px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- Termine ---------- */
.termin-list { display: grid; gap: 14px; padding: 0; margin: 0; list-style: none; }
.termin { display: flex; gap: 18px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.termin-date {
  flex: 0 0 74px;
  height: 80px;
  background: var(--blue);
  color: #fff;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.termin-date .d { font-size: 2rem; font-weight: 800; font-family: var(--font-head); }
.termin-date .m { text-transform: uppercase; font-size: .8rem; font-weight: 700; letter-spacing: .08em; margin-top: 4px; }
.termin-date .y { font-size: .72rem; opacity: .8; margin-top: 2px; }
.termin h3 { margin: 0 0 4px; }
.termin-meta { color: var(--muted); font-size: .92rem; margin: 0 0 6px; }
.termin-text { margin: 0; }
.termin.past .termin-date { background: #8a97ab; }
.termin.past { opacity: .85; }
details.past-list { margin-top: 40px; }
details.past-list summary { cursor: pointer; font-weight: 700; color: var(--blue); padding: 8px 0; }
details.past-list .termin-list { margin-top: 12px; }

/* ---------- Alben ---------- */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.album-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.album-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0, 30, 70, .15); color: var(--ink); }
.album-card .cover { aspect-ratio: 4 / 3; background: var(--blue-light) center / cover no-repeat; position: relative; }
.album-card .count { position: absolute; right: 10px; bottom: 10px; background: rgba(14, 0, 74, .78); color: #fff; font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.album-card .info { padding: 14px 16px 16px; }
.album-card h3 { margin: 0 0 2px; font-size: 1.1rem; }
.album-card .date { color: var(--muted); font-size: .88rem; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.photo-grid a { display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--blue-light); }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.photo-grid a:hover img { transform: scale(1.05); }
@media (max-width: 500px) { .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; } }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(0, 10, 25, .94); z-index: 200; display: none; align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 94vw; max-height: 86vh; border-radius: 6px; box-shadow: 0 10px 50px rgba(0, 0, 0, .5); }
.lightbox button { position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 0; width: 52px; height: 52px; border-radius: 50%; font-size: 26px; cursor: pointer; }
.lightbox button:hover { background: rgba(255, 255, 255, .25); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: #cfd9e8; font-size: .9rem; }
@media (max-width: 600px) { .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; } }

/* ---------- Gästebuch ---------- */
.gb-entry { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 14px; }
.gb-entry header { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.gb-entry strong { color: var(--blue-deep); }
.gb-entry time { color: var(--muted); font-size: .88rem; }
.gb-entry p { margin: 0; overflow-wrap: anywhere; }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 24px; }

/* ---------- Formulare ---------- */
.form { display: grid; gap: 16px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: .95rem; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
input[type=text], input[type=password], input[type=date], input[type=time], input[type=url], select, textarea {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus { border-color: var(--blue-mid); outline: none; box-shadow: 0 0 0 3px rgba(91, 69, 224, .22); }
textarea { min-height: 140px; resize: vertical; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.flash { padding: 12px 16px; border-radius: 10px; margin: 0 0 20px; font-weight: 600; }
.flash-ok { background: #e3f5ec; color: var(--ok); }
.flash-error { background: #fde8e8; color: var(--danger); }
.flash-info { background: var(--blue-light); color: var(--blue-dark); }

/* ---------- Fuß ---------- */
.site-footer { background: var(--blue-deep); color: #d2cff0; font-size: .92rem; margin-top: 40px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; justify-content: space-between; padding-top: 32px; padding-bottom: 32px; }
.footer-brand { display: flex; gap: 16px; align-items: center; line-height: 1.4; }
.footer-brand strong { color: #fff; font-family: var(--font-logo); font-weight: 400; font-size: 1.5rem; }
.footer-brand .wappen { width: 110px; height: auto; flex-shrink: 0; }
.footer-s04 { display: flex; align-items: center; gap: 10px; color: #d2cff0; text-decoration: none; font-size: .85rem; }
.footer-s04:hover { color: #fff; }
.footer-s04 img { width: 44px; height: 44px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-nav a { color: #fff; }
.footer-claim { width: 100%; margin: 0; opacity: .6; font-size: .85rem; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 16px; }

/* ================= Admin ================= */
.admin-body { background: #eef2f8; }
.admin-top { background: var(--blue-deep); color: #fff; }
.admin-top .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.admin-top a { color: #fff; text-decoration: none; }
.admin-top .brand-text strong { font-family: var(--font-head); font-size: 1.05rem; text-transform: uppercase; letter-spacing: .04em; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 2px; margin-left: auto; }
.admin-nav a { padding: 6px 10px; border-radius: 8px; font-size: .92rem; opacity: .85; }
.admin-nav a:hover, .admin-nav a[aria-current="page"] { background: rgba(255, 255, 255, .14); opacity: 1; }
.admin-main { padding: 28px 0 60px; }
.admin-main h1 { margin: 0 0 20px; font-size: 1.9rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.tile { display: block; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; text-decoration: none; color: var(--ink); border-top: 4px solid var(--blue); }
.tile:hover { color: var(--ink); box-shadow: 0 10px 30px rgba(0, 30, 70, .14); }
.tile h2 { margin: 0 0 4px; font-size: 1.2rem; }
.tile p { margin: 0; color: var(--muted); font-size: .92rem; }
.badge { display: inline-block; background: var(--danger); color: #fff; border-radius: 999px; font-size: .78rem; font-weight: 800; padding: 1px 8px; margin-left: 6px; vertical-align: middle; }
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: #f3f6fb; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.table .actions { white-space: nowrap; text-align: right; }
.inline { display: inline; }
@media (max-width: 700px) {
  .table thead { display: none; }
  .table tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table td { display: block; border: 0; padding: 4px 14px; }
  .table .actions { text-align: left; }
}
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }

/* Editor */
.editor-wrap { border: 1.5px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; background: #f3f6fb; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.editor-toolbar button { min-width: 38px; height: 36px; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; font: inherit; font-size: .9rem; padding: 0 10px; color: var(--ink); }
.editor-toolbar button:hover { background: var(--blue-light); border-color: var(--blue-mid); }
.editor-toolbar .sep { width: 1px; background: var(--line); margin: 4px 4px; }
.editor-area { min-height: 380px; padding: 20px 24px; outline: none; max-width: none; }
.editor-area:focus { box-shadow: inset 0 0 0 2px rgba(91, 69, 224, .25); }
.editor-source { display: none; width: 100%; min-height: 380px; border: 0; border-radius: 0; font: 14px/1.5 ui-monospace, Consolas, monospace; padding: 16px; }
.editor-wrap.source .editor-area { display: none; }
.editor-wrap.source .editor-source { display: block; }

.upload-drop { border: 2px dashed var(--blue-mid); border-radius: var(--radius); padding: 28px; text-align: center; background: #fff; cursor: pointer; }
.upload-drop.drag { background: var(--blue-light); }
.upload-progress { margin-top: 12px; font-weight: 600; color: var(--blue-dark); }
.admin-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.admin-photo { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.admin-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.admin-photo .btn-row { padding: 8px; gap: 6px; }
.admin-photo.is-cover { outline: 3px solid var(--blue); }
.login-box { max-width: 420px; margin: 60px auto; }
.status { font-size: .8rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.status-wait { background: #fff1d6; color: var(--warn); }
.status-ok { background: #e3f5ec; color: var(--ok); }
