/* =========================================================================
   Im Alter Fische — Website
   Stil orientiert an Bluesky / Twitter: klare Sans-Serif-Typografie (Inter),
   Weiß als Grundfläche, Blautöne als Leitfarbe, Post-/Tweet-Optik.
   ========================================================================= */

/* ---- Design-Tokens ---------------------------------------------------- */
:root {
  --paper:      #ffffff;   /* reine weiße Grundfläche */
  --paper-2:    #f4f8fd;   /* zart blau getönte Sektion */
  --ink:        #0f1720;   /* fast-schwarzes Slate (Überschriften/Text) */
  --ink-soft:   #33414f;   /* Fließtext */
  --muted:      #5b6b7b;   /* Meta, Handle, Datum */
  --line:       #e2e9f0;   /* kühle Haarlinie */
  --line-soft:  #eef3f9;

  --blue:       #1185fe;   /* Bluesky-Blau – Leitfarbe */
  --blue-strong:#0a6bdb;   /* für Hover/aktiv */
  --blue-tint:  #eaf3ff;   /* Chip-/Hover-Fläche */

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

  --measure: 64ch;         /* Lesebreite für Fließtext */
  --wrap: 46rem;           /* Twitter-artige, ruhige Spaltenbreite */
  --wrap-wide: 64rem;      /* für Raster (Universen) */
  --gap: clamp(1.1rem, 4vw, 2rem);
  --radius: 16px;          /* großzügige Rundungen wie in den Apps */
}

/* ---- Reset / Grundlagen ---------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: clamp(1.02rem, 0.4vw + 0.95rem, 1.12rem);
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

/* ---- Layout-Helfer ---------------------------------------------------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gap); }
.wrap--wide { max-width: var(--wrap-wide); }
.measure { max-width: var(--measure); }
.stack > * + * { margin-top: 1.2rem; }
.eyebrow {
  font-size: 0.78rem; letter-spacing: 0.02em; color: var(--blue);
  font-weight: 700; margin: 0 0 0.7rem; text-transform: none;
}

/* ---- Typografie ------------------------------------------------------- */
h1, h2, h3 { font-weight: 800; line-height: 1.14; letter-spacing: -0.03em; color: var(--ink); }
h1 { font-size: clamp(2rem, 5vw, 3.3rem); margin: 0 0 0.4em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.05rem); margin: 0 0 0.5em; }
h3 { font-size: clamp(1.12rem, 1.4vw, 1.28rem); font-weight: 700; margin: 0 0 0.35em; }

a.link, .prose a {
  color: var(--blue); font-weight: 500;
  transition: color .15s ease;
}
a.link:hover, .prose a:hover { color: var(--blue-strong); text-decoration: underline; text-underline-offset: 2px; }

/* ---- Kopfzeile / Navigation ------------------------------------------ */
.site-header {
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 85%, transparent);
  backdrop-filter: saturate(1.2) blur(12px);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.85rem; }
.brand { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.03em; white-space: nowrap; display: inline-flex; align-items: center; gap: 0.5rem; }
.brand::before {
  content: ""; width: 1.15rem; height: 1.15rem; border-radius: 50%;
  background: linear-gradient(135deg, #48b0ff, var(--blue)); flex: none;
}
.brand.has-avatar::before { display: none; }
.brand__avatar {
  width: 1.7rem; height: 1.7rem; border-radius: 50%; overflow: hidden; flex: none;
  display: inline-grid; place-items: center; font-size: 0.62rem; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #48b0ff, var(--blue));
}
.brand:hover { color: var(--blue); }
.nav { display: flex; align-items: center; gap: clamp(0.5rem, 1.6vw, 1.4rem); flex-wrap: wrap; }
.nav a {
  font-size: 0.92rem; font-weight: 500; color: var(--muted);
  padding: 0.35rem 0; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }

/* ---- Hero ------------------------------------------------------------- */
.hero { padding-block: clamp(2.6rem, 7vw, 5rem) clamp(1.8rem, 4vw, 3rem); }
.hero h1 { max-width: 18ch; }
.hero__lead { max-width: 42ch; font-size: clamp(1.1rem, 0.6vw + 1rem, 1.3rem); color: var(--ink-soft); font-weight: 400; }
.hero__meta {
  display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 1.6rem;
  font-size: 0.9rem; color: var(--muted); font-weight: 500;
  background: var(--blue-tint); color: var(--blue-strong);
  padding: 0.4rem 0.85rem; border-radius: 999px;
}

/* ---- Sektionen -------------------------------------------------------- */
.section { padding-block: clamp(2.4rem, 6vw, 4.5rem); }
.section--tint { background: var(--paper-2); border-block: 1px solid var(--line); }
.section__head { margin-bottom: clamp(1.4rem, 3vw, 2.2rem); }
.prose { color: var(--ink-soft); }
.prose h2, .prose h3 { color: var(--ink); }

/* ---- Universen-Raster (App-artige Karten) ---------------------------- */
.grid-cards {
  display: grid; gap: 0.9rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
}
.u-card {
  --u: var(--blue);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem 1.4rem 1.2rem; display: flex; flex-direction: column; gap: 0.5rem;
  min-height: 9.5rem; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.u-card:hover {
  border-color: var(--u);
  box-shadow: 0 8px 24px -14px color-mix(in srgb, var(--u) 70%, transparent);
  transform: translateY(-2px);
}
.u-card__name { font-size: 1.18rem; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); line-height: 1.2; }
.u-card:hover .u-card__name { color: var(--u); }
.u-card__tag { color: var(--muted); font-size: 0.95rem; }
.u-card__count {
  margin-top: auto; font-size: 0.82rem; font-weight: 700; color: var(--u);
  display: inline-flex; align-items: center; gap: 0.35rem;
}
.u-card__count::after { content: "→"; transition: transform .15s; }
.u-card:hover .u-card__count::after { transform: translateX(3px); }

/* Emoji-Badge in Universumsfarbe */
.u-badge {
  width: 2.6rem; height: 2.6rem; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-size: 1.35rem; line-height: 1;
  background: color-mix(in srgb, var(--u) 16%, white);
  border: 1px solid color-mix(in srgb, var(--u) 30%, transparent);
}
.u-badge--lg { width: 4rem; height: 4rem; border-radius: 18px; font-size: 2.1rem; }
.hero .u-badge--lg { margin-bottom: 0.9rem; }

/* Grosse hervorgehobene Kachel (erstes Universum) */
.u-card--featured {
  flex-direction: row; align-items: flex-start; gap: 1.3rem; min-height: 0;
  margin-bottom: 0.9rem; padding: clamp(1.4rem, 3vw, 2rem);
  background: color-mix(in srgb, var(--u) 6%, white);
  border-color: color-mix(in srgb, var(--u) 28%, var(--line));
}
.u-feat__body { display: flex; flex-direction: column; gap: 0.5rem; }
.u-feat__label {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--u);
}
.u-card--featured .u-card__name { font-size: clamp(1.4rem, 2.6vw, 2rem); }
.u-feat__desc { color: var(--ink-soft); max-width: 60ch; margin: 0.2rem 0 0; }
@media (max-width: 560px) { .u-card--featured { flex-direction: column; } }

/* Vorschau-Streifen auf der Illustrationen-Kachel (Startseite) */
.u-gallery-strip { display: flex; gap: 0.5rem; margin-top: 0.3rem; overflow: hidden; }
.u-gallery-strip img {
  width: 66px; height: 66px; object-fit: cover; border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--u) 30%, var(--line)); flex: none;
}
@media (max-width: 560px) { .u-gallery-strip img:nth-child(n+4) { display: none; } }

/* Illustrationen-Galerie (Masonry via CSS-Spalten) */
.gallery { columns: 3 220px; column-gap: 0.9rem; margin-top: 1.5rem; }
.gallery__item { break-inside: avoid; margin: 0 0 0.9rem; }
.gallery__item > a {
  display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--paper-2);
}
.gallery__item img { width: 100%; height: auto; display: block; transition: transform .3s ease; }
.gallery__item > a:hover img { transform: scale(1.04); }
.gallery__item figcaption { font-size: 0.76rem; color: var(--muted); margin-top: 0.35rem; }

/* ---- Geschichten als Posts (Bluesky/Twitter-Optik) ------------------- */
.stories { display: flex; flex-direction: column; gap: 1rem; }
.post {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  padding: 1.15rem 1.3rem 1.25rem; transition: border-color .15s, background .15s;
}
.post:hover { border-color: #cfe0f2; background: #fcfdff; }
.post__head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.7rem; }
.post__avatar {
  width: 2.5rem; height: 2.5rem; border-radius: 50%; flex: none; overflow: hidden;
  background: linear-gradient(135deg, #48b0ff, var(--blue));
  color: #fff; font-weight: 700; font-size: 0.9rem;
  display: grid; place-items: center; letter-spacing: 0;
}
.post__avatar img, .brand__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post__id { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.post__name { font-weight: 700; color: var(--ink); font-size: 0.98rem; }
.post__meta { color: var(--muted); font-size: 0.86rem; }
.post__meta .cat { color: var(--blue); font-weight: 600; }
.post__title { font-size: 1.15rem; font-weight: 700; margin: 0.1rem 0 0.5rem; letter-spacing: -0.02em; }
.post__text { color: var(--ink); font-size: 1.06rem; line-height: 1.62; white-space: pre-line; }
.post__text p { margin-bottom: 0.7em; }
.post__text p:last-child { margin-bottom: 0; }
.post__link {
  display: inline-flex; align-items: center; gap: 0.3rem; margin-top: 0.9rem;
  font-size: 0.88rem; font-weight: 600; color: var(--blue);
}
.post__link:hover { color: var(--blue-strong); }

/* ---- Publikationen (Wissenschaft) ------------------------------------ */
.pub-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.9rem; }
.pub {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  padding: 1.2rem 1.35rem; display: grid; gap: 0.3rem; transition: border-color .15s;
}
.pub:hover { border-color: #cfe0f2; }
.pub__head { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.15rem; }
.pub__type {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 0.22rem 0.62rem; border-radius: 999px; background: var(--blue-tint); color: var(--blue-strong);
}
.pub__type[data-art="wissenschaft"] { background: #ecebff; color: #4a45b0; }
.pub__type[data-art="presse"]       { background: #eaf3ff; color: #0a6bdb; }
.pub__type[data-art="interview"]    { background: #e8f7ee; color: #2c8a50; }
.pub__type[data-art="podcast"]      { background: #fbeaf4; color: #b0397c; }
.pub__type[data-art="feature"]      { background: #fff1e2; color: #b06519; }
.pub__type[data-art="radio/tv"]     { background: #fdecec; color: #c0443b; }
.pub__title { font-size: 1.18rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.pub__title a { color: inherit; }
.pub__title a:hover { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.pub__meta { font-size: 0.86rem; color: var(--muted); font-weight: 500; }
.pub__desc { color: var(--ink-soft); max-width: var(--measure); margin-top: 0.25rem; }
.pub__desc + div { margin-top: 0.5rem; }

/* ---- Romane ----------------------------------------------------------- */
.novel { padding-block: clamp(1.6rem, 4vw, 2.6rem); border-bottom: 1px solid var(--line); }
.novel:last-child { border-bottom: 0; }
.novel__title { font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 0.2em; }
.novel__sub { font-size: 0.84rem; font-weight: 600; color: var(--blue); margin-bottom: 0.9rem; }
.novel__desc { max-width: var(--measure); color: var(--ink-soft); }
.novel__actions { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 1.2rem; }

/* ---- Buttons (Bluesky-Pill) ------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: inherit; font-size: 0.92rem; font-weight: 600; letter-spacing: -0.01em;
  padding: 0.62rem 1.25rem; border-radius: 999px; cursor: pointer;
  background: var(--blue); color: #fff; border: 1px solid var(--blue);
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--blue-strong); border-color: var(--blue-strong); }
.btn--ghost { background: transparent; color: var(--blue); border-color: #bcd8f6; }
.btn--ghost:hover { background: var(--blue-tint); color: var(--blue-strong); border-color: var(--blue); }

/* ---- Kontaktformular -------------------------------------------------- */
.form { max-width: 34rem; display: grid; gap: 1rem; margin-top: 1.8rem; }
.field { display: grid; gap: 0.35rem; }
.field label { font-size: 0.88rem; font-weight: 600; color: var(--ink); }
.field input, .field textarea {
  font-family: inherit; font-size: 1rem; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 12px; padding: 0.7rem 0.85rem; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus {
  border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px var(--blue-tint);
}
.field textarea { min-height: 8rem; resize: vertical; }
.form__note { font-size: 0.88rem; color: var(--muted); }

/* ---- Fußzeile --------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 2rem; padding-block: 2.5rem 3rem; background: var(--paper-2); }
.site-footer__inner { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; align-items: baseline; }
.site-footer__name { font-size: 1.1rem; font-weight: 800; letter-spacing: -0.03em; }
.site-footer .nav a { font-size: 0.88rem; }
.site-footer__legal { font-size: 0.8rem; color: var(--muted); width: 100%; margin-top: 1.3rem; }
.site-footer__legalnav { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.site-footer__legalnav a { font-size: 0.8rem; }

/* ---- Gästebuch -------------------------------------------------------- */
.field__opt { font-weight: 400; color: var(--muted); }
.check { display: grid; grid-template-columns: auto 1fr; gap: 0.6rem; align-items: start;
  font-size: 0.9rem; color: var(--ink-soft); line-height: 1.45; cursor: pointer; }
.check input { margin-top: 0.15rem; width: 1.05rem; height: 1.05rem; accent-color: var(--blue); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
#gb-status.is-error { color: #c0443b; }
#gb-status.is-ok { color: #2c8a50; }
.gb-entries { margin-top: 2.6rem; }
.gb-entries h2 { margin-bottom: 1rem; }

/* ---- Suche ------------------------------------------------------------ */
.site-header__right { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.search-trigger {
  display: inline-grid; place-items: center; width: 2.3rem; height: 2.3rem; flex: none;
  border-radius: 999px; border: 1px solid var(--line); background: var(--paper);
  color: var(--ink-soft); cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.search-trigger:hover { background: var(--blue-tint); border-color: var(--blue); color: var(--blue-strong); }

.search-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 32, 0.45);
  backdrop-filter: blur(2px); display: flex; justify-content: center;
  padding: clamp(0.6rem, 5vw, 3.5rem) 1rem 1rem; overflow-y: auto;
}
.search-overlay[hidden] { display: none; }
.search-panel {
  background: var(--paper); width: 100%; max-width: 40rem; align-self: flex-start;
  border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: 0 24px 60px -20px rgba(15, 23, 32, 0.4); overflow: hidden;
}
.search-bar { display: flex; gap: 0.6rem; align-items: center; padding: 0.9rem 1rem; border-bottom: 1px solid var(--line); }
#search-input {
  flex: 1; font-family: inherit; font-size: 1.05rem; color: var(--ink); background: var(--paper);
  border: 0; padding: 0.4rem 0.2rem; outline: none;
}
.search-close {
  font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--muted); cursor: pointer;
  background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 0.85rem; flex: none;
}
.search-close:hover { color: var(--ink); border-color: var(--muted); }
.search-status { font-size: 0.85rem; color: var(--muted); padding: 0.7rem 1.1rem; }
.search-results { max-height: min(62vh, 40rem); overflow-y: auto; padding: 0 0.6rem 0.6rem; }
.sr { display: block; padding: 0.85rem 0.9rem; border-radius: 12px; transition: background .12s; }
.sr:hover { background: var(--paper-2); }
.sr + .sr { border-top: 1px solid var(--line-soft); }
.sr__meta { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: var(--muted); margin-bottom: 0.25rem; }
.sr__badge {
  width: 1.5rem; height: 1.5rem; border-radius: 7px; display: grid; place-items: center; font-size: 0.9rem;
  background: color-mix(in srgb, var(--u) 16%, white); border: 1px solid color-mix(in srgb, var(--u) 35%, white);
}
.sr__uni { font-weight: 600; color: color-mix(in srgb, var(--u, var(--blue)) 70%, var(--ink)); }
.sr__date { margin-left: auto; }
.sr__title { font-weight: 700; color: var(--ink); margin-bottom: 0.15rem; }
.sr__snip { font-size: 0.95rem; color: var(--ink-soft); line-height: 1.5; }
.sr__snip mark { background: #fff2ac; color: inherit; border-radius: 3px; padding: 0 0.1em; }

@media (max-width: 560px) {
  .search-trigger { width: 2.1rem; height: 2.1rem; }
}

/* ---- Kleinteiliges ---------------------------------------------------- */
.back-link { font-size: 0.9rem; font-weight: 600; color: var(--blue); display: inline-flex; gap: 0.35rem; }
.back-link:hover { color: var(--blue-strong); }
.empty { color: var(--muted); padding: 1.5rem; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; }
.amp { font-family: inherit; }

/* ---- Responsive ------------------------------------------------------- */
@media (max-width: 560px) {
  .site-header__inner { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .nav { gap: 0.6rem 1rem; }
  .hero h1 { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
