/* ============================================================
   EINSATZTAGEBUCH — Tiernotruf Saarland e.V.
   Designsprache: Rettungsdienst-Protokoll / Einsatzleitstelle
   ============================================================ */

:root{
  /* An die tatsächliche Markenpalette von tiernotrufsaarland.de angeglichen
     (Navy #0A192F, Neon-Akzent #E4FF00, Outfit/Manrope/JetBrains Mono) */
  --navy-deep:   #060e1c;
  --navy:        #0A192F;
  --navy-mid:    #122544;
  --hivis:       #E4FF00;
  --rescue-red:  #ff5b5b;
  --paper:       #f6f7f9;
  --paper-2:     #eceff3;
  --ink:         #0A192F;
  --ink-soft:    #4a5568;
  --line:        #dfe3ea;
  --white:       #ffffff;

  --font-display: 'Outfit', sans-serif;
  --font-body: 'Manrope', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius: 4px;
  --container: 1280px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img{ max-width:100%; display:block; }
a{ color: inherit; text-decoration: none; }
h1,h2,h3,h4{
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  margin: 0 0 .5em;
  letter-spacing: .01em;
}
.container{ max-width: var(--container); margin-inline:auto; padding-inline: 24px; }
.visually-hidden{ position:absolute; width:1px;height:1px; overflow:hidden; clip:rect(0,0,0,0); }

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- NAVBAR ---------- */
.tb-nav{
  position: fixed; top:0; left:0; right:0; z-index: 100;
  display:flex; align-items:center; justify-content: space-between;
  padding: 18px 28px;
  transition: background .3s ease, padding .3s ease, box-shadow .3s ease;
}
.tb-nav.is-scrolled{
  background: var(--navy);
  padding: 12px 28px;
  box-shadow: 0 4px 18px rgba(7,20,38,.25);
}
.tb-nav__brand{
  display:flex; align-items:center; gap:10px;
  font-family: var(--font-display);
  color:#fff; font-size: 1.05rem; letter-spacing:.02em;
}
.tb-nav__brand .dot{
  width:10px; height:10px; border-radius:50%; background: var(--rescue-red);
  box-shadow: 0 0 0 3px rgba(228,3,46,.25);
  animation: pulse 2.2s infinite;
}
@keyframes pulse{
  0%{ box-shadow: 0 0 0 0 rgba(228,3,46,.45); }
  70%{ box-shadow: 0 0 0 8px rgba(228,3,46,0); }
  100%{ box-shadow: 0 0 0 0 rgba(228,3,46,0); }
}
.tb-nav__link{
  color:#fff; font-size:.95rem; font-weight:500; opacity:.9;
  border-bottom: 2px solid transparent; padding-bottom:2px;
}
.tb-nav__link:hover{ opacity:1; border-color: var(--hivis); }
.tb-nav__actions{ display:flex; gap:14px; align-items:center; }
.btn{
  display:inline-flex; align-items:center; gap:8px;
  padding: 11px 22px; border-radius: var(--radius);
  font-weight:600; font-size:.92rem; border: 2px solid transparent;
  cursor:pointer; transition: transform .15s ease, background .2s ease, color .2s ease;
}
.btn:hover{ transform: translateY(-1px); }
.btn-hivis{ background: var(--hivis); color: var(--navy-deep); }
.btn-hivis:hover{ background:#ffe14d; }
.btn-outline-light{ border-color: rgba(255,255,255,.6); color:#fff; }
.btn-outline-light:hover{ background:#fff; color: var(--navy-deep); }
.btn-red{ background: var(--rescue-red); color:#fff; }
.btn-red:hover{ background:#c40227; }
.btn-navy{ background: var(--navy); color:#fff; }
.btn-navy:hover{ background: var(--navy-mid); }
.btn-ghost{ border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover{ border-color: var(--navy); }

/* ---------- HERO / PARALLAX ---------- */
.hero{
  position: relative;
  height: 100svh; min-height: 560px;
  display:flex; align-items:flex-end;
  overflow: hidden;
  isolation: isolate;
}
.hero__bg{
  position:absolute; inset:-8% -8%;
  overflow:hidden;
  will-change: transform;
  filter: saturate(1.05);
}
.hero__bg img{ display:block;width:100%;height:100%;object-fit:cover;object-position:center; }
.hero__scrim{
  position:absolute; inset:0;
  background:
    linear-gradient(180deg, rgba(7,20,38,.55) 0%, rgba(7,20,38,.35) 35%, rgba(7,20,38,.92) 100%);
}
.hero__content{
  position:relative; z-index:2; color:#fff;
  padding: 0 24px 64px;
  width:100%; max-width: var(--container); margin-inline:auto;
}
.hero__kicker{
  display:inline-flex; align-items:center; gap:8px;
  font-family: var(--font-mono); font-size:.8rem;
  background: rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.25);
  padding:6px 12px; border-radius:100px; margin-bottom: 20px;
}
.hero__kicker .dot{ width:7px;height:7px;border-radius:50%; background: var(--hivis); }
.hero h1{
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  max-width: 16ch;
}
.hero p{
  max-width: 52ch; font-size: 1.15rem; color: rgba(255,255,255,.85);
  margin-top: 14px;
}
.hero__stats{
  display:flex; flex-wrap:wrap; gap: 36px;
  margin-top: 40px; padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,.2);
}
.hero__stat b{
  display:block; font-family: var(--font-display); font-size:2.1rem; color: var(--hivis);
}
.hero__stat span{ font-size:.85rem; color: rgba(255,255,255,.7); }
.hero__scrolldown{
  position:absolute; bottom: 22px; left:50%; transform: translateX(-50%);
  z-index:3; color: rgba(255,255,255,.75); font-size:.75rem;
  display:flex; flex-direction:column; align-items:center; gap:6px;
}
.hero__scrolldown i{
  width:1px; height:26px; background: rgba(255,255,255,.5);
  animation: scrolldown 1.8s infinite;
}
@keyframes scrolldown{
  0%{ transform: scaleY(0); transform-origin: top; opacity:0; }
  40%{ transform: scaleY(1); transform-origin: top; opacity:1; }
  60%{ transform: scaleY(1); transform-origin: bottom; opacity:1; }
  100%{ transform: scaleY(0); transform-origin: bottom; opacity:0; }
}

/* ---------- SECTION HEADERS ---------- */
.section-head{
  display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between;
  gap: 20px; margin-bottom: 40px;
}
.section-head h2{ font-size: clamp(1.8rem, 3.4vw, 2.6rem); color: var(--navy); }
.section-head p{ color: var(--ink-soft); max-width: 60ch; }

/* ---------- FILTERBAR ---------- */
.filterbar{
  position: sticky; top:62px; z-index: 40;
  background: var(--paper); border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.filterbar__row{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.chip{
  border:1px solid var(--line); background:#fff; color: var(--ink-soft);
  padding: 8px 16px; border-radius: 100px; font-size:.88rem; font-weight:600;
  cursor:pointer; transition: all .15s ease;
}
.chip:hover{ border-color: var(--navy); color: var(--navy); }
.chip.is-active{ background: var(--navy); border-color: var(--navy); color:#fff; }
.filterbar__search{
  margin-left:auto; display:flex; align-items:center; gap:8px;
  border:1px solid var(--line); background:#fff; border-radius:100px; padding: 8px 16px;
  min-width: min(300px, 100%); flex: 1 1 240px; max-width: 440px;
}
.filterbar__search input{
  border:none; box-shadow:none !important; outline:none; font-family: var(--font-body); font-size:.9rem; width:100%; background:transparent; padding:0;
}
.filterbar__select{ width:auto; min-width:155px; border-radius:100px; font-size:.88rem; border-color:var(--line); }

/* ---------- LOGBOOK / TIMELINE FEED ---------- */
.logbook{ position:relative; padding: 70px clamp(18px,4vw,68px) 90px; }
.logbook::before{
  content:""; position:absolute; left:50%; top:0; bottom:0; width:2px;
  background: var(--line); transform: translateX(-50%);
}
.logbook__empty{ text-align:center; color: var(--ink-soft); padding: 60px 0; }

.entry{
  position:relative; display:grid; grid-template-columns: 1fr 1fr;
  gap: 0 56px; align-items:center;
  margin-bottom: 64px;
}
.entry::before{
  content:""; position:absolute; left:50%; top: 50%; width:14px; height:14px;
  background: var(--hivis); border:3px solid var(--navy); border-radius:50%;
  transform: translate(-50%,-50%); z-index:2;
}
.entry:nth-child(even) .entry__media{ order:2; }
.entry:nth-child(even) .entry__body{ order:1; text-align:right; }
.entry:nth-child(even) .entry__meta{ justify-content:flex-end; }
.entry:nth-child(even) .badge-row{ justify-content:flex-end; }

.entry__media{
  position:relative; border-radius: var(--radius); overflow:hidden;
  aspect-ratio: 4/3; background: var(--paper-2);
  box-shadow: 0 14px 34px rgba(7,20,38,.14);
}
.entry__media > a{ position:absolute; inset:0; display:block; z-index:1; }
.entry__media img{ width:100%; height:100%; object-fit:cover; transition: transform .5s ease; }
.entry:hover .entry__media img{ transform: scale(1.045); }
.entry__count{
  position:absolute; bottom:12px; left:12px;
  background: rgba(7,20,38,.75); color:#fff; font-family: var(--font-mono);
  font-size:.75rem; padding:5px 10px; border-radius:100px; z-index:2; pointer-events:none;
}
.entry:nth-child(even) .entry__count{ left:auto; right:12px; }

.entry__body{ padding: 8px 0; }
.entry__meta{
  display:flex; align-items:center; gap:10px; margin-bottom:10px;
  font-family: var(--font-mono); font-size:.82rem; color: var(--ink-soft);
}
.entry__meta .num{ color: var(--navy); font-weight:700; }
.entry__body h3{
  font-size: 1.7rem; color: var(--navy); margin-bottom:10px;
}
.entry__body h3 a{ transition: color .15s ease; }
.entry__body h3 a:hover{ color: var(--rescue-red); }
.entry__body p{ color: var(--ink-soft); margin: 0 0 16px; }
.badge-row{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom: 14px; }
.badge{
  display:inline-flex; align-items:center; gap:6px;
  font-size:.76rem; font-weight:700; padding: 5px 11px; border-radius:100px;
  border:1px solid var(--line); color: var(--ink-soft);
}
.badge-tierart{ background: var(--paper-2); }
.badge-status-laufend{ background:#fff4d6; border-color:#ffe08a; color:#8a6100; }
.badge-status-abgeschlossen{ background:#e4f6ea; border-color:#b6e6c6; color:#1e6b3a; }
.badge-status-uebergeben{ background:#e6eefc; border-color:#bcd3f6; color:#1d4f9c; }
.badge-status-verstorben{ background:#f7e6e8; border-color:#eec0c6; color:#8a1d2b; }
.entry__link{
  font-weight:700; font-size:.9rem; color: var(--navy); display:inline-flex; gap:6px; align-items:center;
}
.entry:hover .entry__link{ color: var(--rescue-red); }
.entry:focus-visible{ outline:3px solid var(--rescue-red); outline-offset:8px; border-radius:var(--radius); }

@media (max-width: 860px){
  .logbook::before{ left: 22px; }
  .entry{ grid-template-columns: 1fr; gap: 18px; margin-bottom: 46px; padding-left: 50px; }
  .entry::before{ left: 22px; top: 8px; transform: translate(-50%,0); }
  .entry:nth-child(even) .entry__media{ order:0; }
  .entry:nth-child(even) .entry__body{ order:0; text-align:left; }
  .entry:nth-child(even) .entry__meta,
  .entry:nth-child(even) .badge-row{ justify-content:flex-start; }
  .entry:nth-child(even) .entry__count{ left:12px; right:auto; }
}

/* ---------- FULLBLEED STAT / CTA BAND ---------- */
.band{ padding: 90px 0; }
.band-navy{ background: var(--navy); color:#fff; }
.band-navy .section-head h2{ color:#fff; }
.band-navy .section-head p{ color: rgba(255,255,255,.7); }

.stat-grid{ display:grid; grid-template-columns: repeat(4,1fr); gap: 1px; background: rgba(255,255,255,.15); border-radius: var(--radius); overflow:hidden; }
.stat-grid__item{ background: var(--navy); padding: 34px 24px; text-align:center; }
.stat-grid__item b{ display:block; font-family: var(--font-display); font-size: 2.6rem; color: var(--hivis); }
.stat-grid__item span{ font-size:.85rem; color: rgba(255,255,255,.7); }
@media (max-width: 720px){ .stat-grid{ grid-template-columns: repeat(2,1fr); } }

/* ---------- FOOTER ---------- */
footer{ background: var(--navy-deep); color: rgba(255,255,255,.65); padding: 56px 0 28px; font-size:.9rem; }
footer h4{ color:#fff; font-size:1.1rem; }
footer a:hover{ color: var(--hivis); }
.footer-grid{ display:grid; grid-template-columns: 2fr 1fr 1fr; gap:40px; margin-bottom:40px; }
.footer-bottom{ border-top:1px solid rgba(255,255,255,.12); padding-top:22px; display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; }
@media (max-width: 720px){ .footer-grid{ grid-template-columns:1fr; } }

/* ============================================================
   PROTOKOLL / EINSATZ-DETAILSEITE
   ============================================================ */
.protokoll-head{
  position:relative; isolation:isolate; overflow:hidden;
  background: var(--navy); color:#fff; padding: 150px 0 50px;
}
.protokoll-head__bg{ position:absolute; inset:-12% 0; z-index:-1; overflow:hidden; opacity:.44; transform:scale(1.08); will-change:transform; }
.protokoll-head__bg img{ display:block;width:100%;height:100%;object-fit:cover;object-position:center; }
.protokoll-head::after{ content:""; position:absolute; inset:0; z-index:0; background:linear-gradient(180deg,rgba(7,20,38,.58),rgba(7,20,38,.94)); pointer-events:none; }
.protokoll-head > .container-fluid{ position:relative; z-index:1; }
.protokoll-stamp{
  display:inline-flex; align-items:center; gap:10px;
  font-family: var(--font-mono); font-size:.85rem;
  border:1px solid rgba(255,255,255,.35); padding:8px 14px; border-radius: var(--radius);
  margin-bottom: 22px; letter-spacing:.03em;
}
.protokoll-head h1{ font-size: clamp(2rem, 4.6vw, 3.4rem); max-width: 22ch; }
.protokoll-head .sub{ color: rgba(255,255,255,.75); margin-top:10px; font-size:1.05rem; }
.protokoll-headmeta{ display:flex; flex-wrap:wrap; gap:28px; margin-top: 30px; }
.protokoll-headmeta div span{ display:block; font-size:.78rem; color: rgba(255,255,255,.55); margin-bottom:3px; }
.protokoll-headmeta div b{ font-family: var(--font-display); font-size:1.15rem; font-weight:500; }

.protokoll-body{ padding: 60px clamp(18px,4vw,68px) 100px; }
.protokoll-grid{ display:flex; flex-wrap:wrap; align-items:stretch; }
.protokoll-grid aside{ align-self:flex-start; }

.protokoll-hero-img{
  border-radius: var(--radius); overflow:hidden; margin-bottom: 40px;
  box-shadow: 0 20px 44px rgba(7,20,38,.16);
}
.protokoll-hero-img img{ width:100%; max-height: 560px; object-fit:cover; }

.field-block{ margin-bottom: 34px; padding-bottom: 34px; border-bottom:1px solid var(--line); }
.field-block:last-child{ border-bottom:none; }
.field-block h3{
  font-size: .85rem; text-transform:uppercase; letter-spacing:.08em;
  color: var(--rescue-red); margin-bottom: 12px; font-family: var(--font-mono); font-weight:600;
}
.field-block .content{ color: var(--ink); font-size: 1.02rem; white-space: pre-line; }
.field-block .content p{ margin: 0 0 1em; }

.gallery-grid{ margin-top: 10px; }
.gallery-grid a{ display:block; border-radius: var(--radius); overflow:hidden; aspect-ratio:1; }
.gallery-grid img{ width:100%; height:100%; object-fit:cover; transition: transform .3s ease; }
.gallery-grid a:hover img{ transform: scale(1.06); }

.sidebar-card{
  background:#fff; border:1px solid var(--line); border-radius: var(--radius);
  padding: 26px; margin-bottom: 24px;
}
.sidebar-card h4{ font-size:1rem; color: var(--navy); margin-bottom:16px; }
.sidebar-list{ list-style:none; margin:0; padding:0; }
.sidebar-list li{
  display:flex; justify-content:space-between; gap:10px;
  padding: 10px 0; border-bottom: 1px dashed var(--line); font-size:.92rem;
}
.sidebar-list li:last-child{ border-bottom:none; }
.sidebar-list li span:first-child{ color: var(--ink-soft); }
.sidebar-list li span:last-child{ font-weight:600; text-align:right; }

.status-banner{
  display:flex; align-items:center; gap:12px; padding: 16px 20px; border-radius: var(--radius);
  margin-bottom: 24px; font-weight:600;
}

.back-link{ display:inline-flex; align-items:center; gap:8px; color: rgba(255,255,255,.8); font-size:.9rem; margin-bottom: 24px; }
.back-link:hover{ color: var(--hivis); }

.lightbox{
  position:fixed; inset:0; background: rgba(7,20,38,.94); z-index:1000;
  display:none; align-items:center; justify-content:center; padding: 30px;
}
.lightbox.is-open{ display:flex; }
.lightbox img{ max-width:100%; max-height:88vh; border-radius:4px; }
.lightbox__close{ position:absolute; top:22px; right:28px; color:#fff; font-size:2rem; cursor:pointer; line-height:1; }

/* ---------- Reveal-on-scroll (single orchestrated pattern) ---------- */
.reveal{ opacity:0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible{ opacity:1; transform:none; }

/* ---------- Admin (leichtgewichtig, funktional) ---------- */
.admin-body{ background: var(--paper-2); min-height:100vh; font-family: var(--font-body); }
.admin-shell{ max-width: 980px; margin: 0 auto; padding: 40px 20px 80px; }
.admin-card{ background:#fff; border:1px solid var(--line); border-radius:6px; padding: 30px; margin-bottom:24px; }
.admin-topbar{ background: var(--navy); color:#fff; padding: 16px 0; margin-bottom: 30px; }
.admin-topbar .container{ display:flex; justify-content:space-between; align-items:center; }
.form-group{ margin-bottom: 20px; }
.form-group label{ display:block; font-weight:600; font-size:.88rem; margin-bottom:6px; }
.form-group .hint{ font-size:.8rem; color: var(--ink-soft); margin-top:4px; }
.form-control{
  width:100%; padding: 11px 14px; border:1px solid var(--line); border-radius:4px;
  font-family: var(--font-body); font-size: .95rem; background:#fff;
}
textarea.form-control{ resize: vertical; min-height: 110px; }
.form-row{ display:grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width:640px){ .form-row{ grid-template-columns:1fr; } }
.admin-table{ width:100%; border-collapse: collapse; font-size:.92rem; }
.admin-table th, .admin-table td{ text-align:left; padding: 12px 10px; border-bottom:1px solid var(--line); }
.admin-table th{ color: var(--ink-soft); font-size:.78rem; text-transform:uppercase; letter-spacing:.05em; }
.admin-table tr:hover{ background: var(--paper); }
.alert{ padding: 14px 18px; border-radius:4px; margin-bottom:20px; font-size:.92rem; }
.alert-success{ background:#e4f6ea; color:#1e6b3a; border:1px solid #b6e6c6; }
.alert-error{ background:#f7e6e8; color:#8a1d2b; border:1px solid #eec0c6; }
.thumb-preview{ display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
.thumb-preview img{ width:70px; height:70px; object-fit:cover; border-radius:4px; border:1px solid var(--line); }

@media (max-width: 767.98px){
  .filterbar{ top:54px; padding:12px 0; }
  .filterbar__search{ order:2; flex-basis:100%; max-width:none; }
  .filterbar__select{ flex:1 1 140px; min-width:0; }
  .protokoll-head{ padding-top:120px; }
  .protokoll-headmeta{ gap:16px 24px; }
  .hero__stats{ gap:20px; }
  .logbook{ padding-top:48px; padding-bottom:70px; }
  .protokoll-body{ padding-top:38px; padding-bottom:70px; }
}

/* Schlanke Navigation im eigenständigen Tagebuchbereich */
.d-none-mobile{ display:inline; }
@media (max-width:768px){ .d-none-mobile{ display:none; } }
