/* ==================================================================
   Tauchalben – Grau/Blau, ruhig, mobil zuerst
   ================================================================== */

:root {
  --deep:        #0f2a3c;
  --deep-2:      #17435c;
  --ink:         #16232e;
  --bg:          #eef2f6;
  --surface:     #ffffff;
  --line:        #d7e0e8;
  --line-soft:   #e6ecf2;
  --muted:       #5d7385;
  --accent:      #1c6b95;
  --accent-dark: #14536f;
  --accent-soft: #e4eef4;
  --danger:      #a33a34;

  --radius:      12px;
  --shadow-sm:   0 1px 2px rgba(15, 42, 60, .06);
  --shadow-md:   0 10px 24px -12px rgba(15, 42, 60, .35);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 20px;
}

.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;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Kopfbereich ---------- */

.masthead {
  background: linear-gradient(165deg, var(--deep-2) 0%, var(--deep) 70%);
  color: #eaf1f6;
}

.masthead-inner {
  padding-block: 44px 40px;
}

/* ---------- Wortmarke ---------- */

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 60px;
  height: 60px;
  flex: 0 0 auto;
  border-radius: 14px;
  object-fit: contain;
}

.brand-text { min-width: 0; }

@media (min-width: 640px) {
  .brand { gap: 22px; }
  .brand-mark { width: 88px; height: 88px; border-radius: 18px; }
}

.bar-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.bar-brand img { border-radius: 6px; }

.eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #8fb2c7;
}

.masthead h1 {
  margin: 0;
  font-size: clamp(1.9rem, 6vw, 2.9rem);
  font-weight: 650;
  letter-spacing: -.02em;
  line-height: 1.1;
}

.masthead .lead {
  margin: 10px 0 0;
  max-width: 46ch;
  color: #bdd2e0;
}

.masthead .meta-line {
  margin: 20px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .14);
  font-size: 13px;
  color: #93b4c8;
}

/* ---------- Werkzeugleiste ---------- */

main.wrap { padding-block: 28px 56px; }

.toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 26px;
}

.search input {
  width: 100%;
  min-width: 0;
  padding: 10px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.search { width: 100%; }

@media (min-width: 640px) {
  .search { width: 280px; }
}

.no-hits {
  margin: 0 0 24px;
  color: var(--muted);
}

/* ---------- Jahresabschnitte ---------- */

.year { margin-bottom: 44px; }

.year-rail {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.year-rail h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: .04em;
  color: var(--deep);
}

.year-count {
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (min-width: 900px) {
  .year {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 32px;
    margin-bottom: 52px;
  }
  .year-rail {
    display: block;
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
    border-right: 1px solid var(--line);
    padding-right: 20px;
    position: sticky;
    top: 24px;
    align-self: start;
  }
  .year-rail h2 { font-size: 1.35rem; }
  .year-count { display: block; margin-top: 4px; }
}

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

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--line);
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--accent-soft);
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.card:hover .card-media img { transform: scale(1.04); }

.badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 3px 9px;
  font-size: 11px;
  letter-spacing: .04em;
  color: #fff;
  background: rgba(15, 42, 60, .72);
  border-radius: 999px;
  backdrop-filter: blur(2px);
}

.card-body { padding: 14px 16px 16px; }

.card-body h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 620;
  letter-spacing: -.01em;
  line-height: 1.3;
}

.card-date {
  margin: 5px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Leerer Zustand ---------- */

.empty {
  padding: 56px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.empty h2 { margin: 0 0 8px; font-size: 1.15rem; }
.empty p { margin: 0; color: var(--muted); }

/* ---------- Hinweise ---------- */

.notice {
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px;
  margin: 0 0 22px;
}
.notice-ok    { border-color: #b9d7c4; background: #eef7f1; color: #235b3b; }
.notice-error { border-color: #e0bcb9; background: #fbf0ef; color: #8d322c; }

/* ---------- Fuß ---------- */

.foot {
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
}
.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  padding-block: 18px;
}

/* ==================================================================
   Adminbereich
   ================================================================== */

.admin { background: var(--bg); }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(165deg, var(--deep-2), var(--deep));
}

.login-box {
  width: 100%;
  max-width: 360px;
  padding: 30px 28px 26px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .5);
}
.login-box .eyebrow { color: var(--muted); }
.login-box h1 { margin: 0 0 18px; font-size: 1.4rem; letter-spacing: -.01em; }
.login-box label { display: block; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.login-box input {
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}
.login-box .btn { width: 100%; margin-top: 6px; }
.login-back { margin: 16px 0 0; font-size: 13px; text-align: center; }

.admin-bar {
  background: var(--deep);
  color: #e7eff5;
}
.admin-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 14px;
}
.admin-bar nav { display: flex; gap: 16px; }
.admin-bar a { color: #9fc0d3; text-decoration: none; font-size: 14px; }
.admin-bar a:hover { color: #fff; text-decoration: underline; }

.admin-main { padding-block: 26px 60px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.panel h2 {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -.01em;
}
.panel .count {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

/* Formular */

.album-form {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .album-form { grid-template-columns: 1fr 200px; }
  .field-wide { grid-column: 1 / -1; }
  .form-actions { grid-column: 1 / -1; }
}

.field { display: block; font-size: 13px; color: var(--muted); }
.field input {
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.form-actions { display: flex; gap: 10px; align-items: center; }

/* Buttons */

.btn {
  display: inline-block;
  padding: 9px 16px;
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-quiet {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--line);
}
.btn-quiet:hover { background: var(--accent-soft); }
.btn-danger {
  background: var(--surface);
  color: var(--danger);
  border-color: #e2c4c1;
}
.btn-danger:hover { background: #fbf0ef; }

/* Albumliste */

.album-list { list-style: none; margin: 0; padding: 0; }

.album-list li {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--line-soft);
}
.album-list li:first-child { border-top: 0; padding-top: 0; }

.row-thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--accent-soft);
}

.row-main { min-width: 0; }
.row-main strong { display: block; font-weight: 620; }
.row-meta { display: block; font-size: 13px; color: var(--muted); }
.row-meta .warn { color: #9a6a1f; }
.row-url {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
  text-decoration: none;
}
.row-url:hover { color: var(--accent); text-decoration: underline; }

.row-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.inline { display: inline; margin: 0; }

@media (min-width: 860px) {
  .album-list li { grid-template-columns: 88px 1fr auto; align-items: center; }
  .row-thumb { width: 88px; height: 66px; }
  .row-actions { grid-column: auto; margin-top: 0; justify-content: flex-end; }
}

.muted { color: var(--muted); }

/* ---------- Bewegung sparsam ---------- */

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .card:hover { transform: none; }
  .card:hover .card-media img { transform: none; }
}
