/* ============================================================
   Familien-Tagebuch — Stylesheet
   Mobil zuerst; ab 900 px die weitere Ansicht.
   Design aus den Mockups (~/dev/sofia-family-webapp/mockups).
   ============================================================ */

@import url('fonts.css');

*, *::before, *::after { box-sizing: border-box; }

:root {
  --paper:  #FBF8F4;
  --card:   #FFFFFF;
  --ink:    #1B1815;
  --ink-2:  #6C625A;
  --ink-3:  #A79C92;
  --line:   #ECE5DB;
  --line-2: #F5F0E8;
  --accent: #A9543A;
  --heart:  #CF463C;
  --ok:     #4F7A5B;
  --r:      18px;
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;

  --top-h: 62px;
  --tab-h: 74px;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
  min-height: 100vh;
}
@media (min-width: 900px) { body { padding-bottom: 0; } }

a { color: var(--accent); }
img { max-width: 100%; }

/* ------------------------------------------------------------ Kopf */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px 11px;
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line-2);
  padding-top: max(13px, env(safe-area-inset-top));
}
.top .mark {
  font-family: var(--serif); font-size: 21px; font-weight: 500;
  letter-spacing: -.01em; font-variation-settings: 'opsz' 40;
  color: var(--ink); text-decoration: none;
}
.top .sub { font-size: 11.5px; color: var(--ink-3); letter-spacing: .02em; }
.top .spacer { flex: 1; }
.navlinks { display: none; gap: 4px; }
.navlinks a {
  font-size: 13.5px; font-weight: 500; color: var(--ink-2); text-decoration: none;
  padding: 7px 13px; border-radius: 999px;
}
.navlinks a[aria-current="page"] { background: #EFE7DB; color: var(--ink); }
@media (min-width: 900px) {
  .top { padding: 16px 34px; gap: 26px; }
  .navlinks { display: flex; }
}

.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-2); text-decoration: none;
  display: grid; place-items: center; cursor: pointer; font-size: 15px; flex: none;
}
.spacewitch {
  font: inherit; font-size: 12.5px; color: var(--ink-2);
  border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 6px 11px;
}

/* ------------------------------------------------------------ Tab-Leiste */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr); align-items: center;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabs a {
  display: grid; gap: 3px; justify-items: center; text-decoration: none;
  font-size: 10px; font-weight: 500; color: var(--ink-3); padding: 4px 0;
}
.tabs svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.tabs a[aria-current="page"] { color: var(--accent); }
.tabs .fab {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--ink); color: #FFF7EC;
  display: grid; place-items: center; font-size: 22px; font-weight: 300;
  box-shadow: 0 8px 20px -6px rgba(0,0,0,.45); margin-top: -4px;
}
@media (min-width: 900px) { .tabs { display: none; } }

/* ------------------------------------------------------------ Feed */
.wrap { padding: 14px 14px 30px; display: grid; gap: 14px; }
@media (min-width: 900px) {
  .wrap { max-width: 620px; margin: 0 auto; padding: 26px 20px 60px; gap: 20px; }
  .wrap.wide { max-width: 1100px; }
  /* Ein einzelnes Hochformat wird auf grossen Bildschirmen sonst sehr hoch.
     Deckeln statt beschneiden: das Bild bleibt vollständig, nur kleiner. */
  .shots.n1 { display: flex; justify-content: center; background: #F7F2EA; }
  .shots.n1 img { max-height: 74dvh; width: auto; max-width: 100%; }
}

.post { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; scroll-margin-top: 80px; }
.post-head { display: flex; align-items: center; gap: 10px; padding: 13px 14px 11px; }
.ava {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 600;
}
.ava.lg { width: 42px; height: 42px; font-size: 14px; }
.ava.sm { width: 26px; height: 26px; font-size: 10px; }
.who { display: grid; line-height: 1.28; min-width: 0; }
.who b { font-size: 13.5px; font-weight: 600; }
.who span { font-size: 11.5px; color: var(--ink-3); }
.role {
  font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); background: #F6EDE6; padding: 3px 7px; border-radius: 6px; white-space: nowrap;
}
.role.only { color: #7A6A2F; background: #F6F1DF; }

.post-title {
  font-family: var(--serif); font-size: 19px; font-weight: 500; line-height: 1.22;
  font-variation-settings: 'opsz' 30; letter-spacing: -.012em; margin: 0 14px 9px;
}
.post-title a { color: inherit; text-decoration: none; }
.post-text { margin: 0 14px 13px; font-size: 14.2px; line-height: 1.58; color: #3A342E; white-space: pre-wrap; }

.shots { display: grid; gap: 3px; background: var(--line-2); }
.shots a { display: block; overflow: hidden; }
.shots img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; background: var(--line-2); }
.shots.n1 { grid-template-columns: 1fr; }
.shots.n2 { grid-template-columns: 1fr 1fr; }
.shots.n2 img { aspect-ratio: 1/1; }
.shots.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.shots.n3 img { aspect-ratio: 1/1; }
.shots.n3 a:first-child { grid-row: 1 / span 2; }
.shots.n3 a:first-child img { aspect-ratio: auto; height: 100%; }
.shots.n4, .shots.nx { grid-template-columns: 1fr 1fr; }
.shots.n4 img, .shots.nx img { aspect-ratio: 1/1; }
.more { position: relative; }
.more::after {
  content: attr(data-more); position: absolute; inset: 0;
  background: rgba(20,17,14,.5); color: #fff;
  display: grid; place-items: center; font-size: 20px; font-weight: 500;
  pointer-events: none;
}

.acts { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line-2); }
.act {
  appearance: none; border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 6px 11px; cursor: pointer; text-decoration: none;
  font: inherit; font-size: 12.5px; font-weight: 500; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px; transition: .16s;
}
.act:hover { border-color: #DED3C5; }
.act .glyph { font-size: 13px; line-height: 1; transition: transform .22s cubic-bezier(.3,1.6,.5,1); }
.act.on { color: var(--heart); border-color: #F1D3CF; background: #FDF3F1; }
.act.on .glyph { transform: scale(1.22); }
.act.quiet { border: 0; color: var(--ink-3); }
.likers { margin-left: auto; font-size: 11.5px; color: var(--ink-3); text-align: right; }

.threads { padding: 2px 14px 14px; display: grid; gap: 11px; }
.cmt { display: flex; gap: 9px; }
.cmt .bubble { background: #F7F3ED; border-radius: 4px 13px 13px 13px; padding: 8px 11px; font-size: 13px; line-height: 1.5; }
.cmt .bubble b { font-size: 12.5px; display: block; margin-bottom: 2px; }
.cmt .bubble time { color: var(--ink-3); font-size: 10.5px; margin-left: 6px; font-weight: 400; }
.cmt-new { display: flex; gap: 9px; align-items: center; }
.cmt-new input {
  flex: 1; min-width: 0; border: 1px solid var(--line); background: #FCFAF7;
  border-radius: 999px; padding: 9px 14px; font: inherit; font-size: 13px; color: var(--ink);
}
.cmt-new input::placeholder { color: var(--ink-3); }
.cmt-new button { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; padding: 0 4px; }

.monat {
  font-family: var(--serif); font-size: 13px; font-weight: 500; color: var(--ink-2);
  letter-spacing: .02em; padding: 6px 4px 0; font-variation-settings: 'opsz' 14;
  display: flex; align-items: center; gap: 10px;
}
.monat::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ------------------------------------------------------------ Galerie */
.gal-head { padding: 20px 16px 8px; }
.gal-head h1, .seite h1 {
  font-family: var(--serif); font-size: 25px; font-weight: 400; margin: 0;
  font-variation-settings: 'opsz' 60; letter-spacing: -.02em;
}
.gal-head p { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-3); }
.gal-monat {
  position: sticky; top: var(--top-h); z-index: 12;
  padding: 14px 16px 8px; background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
  font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2);
}
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 0 2px; }
.grid img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; cursor: zoom-in; }
@media (min-width: 900px) {
  .gal-head { max-width: 1100px; margin: 0 auto; padding: 26px 34px 10px; }
  .gal-monat { padding-inline: 34px; max-width: 1100px; margin: 0 auto; }
  .grid { grid-template-columns: repeat(6, 1fr); gap: 4px; max-width: 1100px; margin: 0 auto; padding: 0 34px; }
}

/* ------------------------------------------------------------ Seiten (Familie, Formulare) */
.seite { padding: 20px 16px 40px; }
@media (min-width: 900px) { .seite { max-width: 620px; margin: 0 auto; padding-top: 28px; } }
.seite h1 { margin-bottom: 4px; }
.seite > .lead { margin: 0 0 18px; font-size: 12.5px; color: var(--ink-3); }
.seite h2 {
  font-family: var(--serif); font-size: 20px; font-weight: 500; margin: 28px 0 4px;
  font-variation-settings: 'opsz' 30;
}

.prow, .nrow {
  display: flex; align-items: center; gap: 11px; padding: 12px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px;
}
.prow .who, .nrow .who { flex: 1; }
.nrow.col { display: grid; gap: 9px; }
.nrow label { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }

.sw { appearance: none; border: 0; cursor: pointer; flex: none; width: 44px; height: 27px; border-radius: 99px; background: #DDD4C7; position: relative; transition: background .2s; }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s cubic-bezier(.3,1.4,.5,1); }
.sw.on { background: var(--accent); }
.sw.on::after { transform: translateX(17px); }

.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 13px; font: inherit; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.chip.on { background: var(--ink); color: #FBF6EE; border-color: var(--ink); }

.field { margin-top: 15px; }
.field label { display: block; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px; }
.field .opt { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink-3); font-size: 11px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--card);
  padding: 12px 13px; font: inherit; font-size: 15px; color: var(--ink); resize: vertical;
}
.field input:focus, .field textarea:focus { outline: 2px solid #E4D6CB; outline-offset: 1px; }

.btn {
  display: block; width: 100%; margin-top: 18px; padding: 14px; border: 0; border-radius: 14px;
  background: var(--accent); color: #FFF6F0; font: inherit; font-size: 14.5px; font-weight: 600;
  cursor: pointer; text-align: center; text-decoration: none;
}
.btn.ghost { background: none; color: var(--ink-3); font-weight: 500; margin-top: 8px; }
.btn.dashed { background: #FCF8F2; border: 1px dashed #D9CDBD; color: var(--accent); }

.drop {
  border: 1.5px dashed #D8CCBC; border-radius: 16px; background: #FCF9F4;
  padding: 24px 16px; text-align: center; cursor: pointer; display: block;
}
.drop .big { font-size: 26px; color: var(--accent); }
.drop b { display: block; font-size: 13.5px; margin-top: 7px; }
.drop span { font-size: 11.5px; color: var(--ink-3); }
.picked { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 11px; }
.picked img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 9px; }

.hinweis { border-radius: 12px; padding: 11px 13px; font-size: 13px; line-height: 1.5; margin: 14px 0 0; }
.hinweis.warn { background: #FDF2EF; border: 1px solid #F0D6CF; color: #8A3B2B; }
.hinweis.info { background: #F3F6F1; border: 1px solid #DCE5D8; color: #3F5A46; }
.hinweis code { font-size: 12px; word-break: break-all; }

.leer { text-align: center; padding: 60px 24px; color: var(--ink-3); }
.leer .big { font-size: 34px; }
.leer p { font-size: 14px; line-height: 1.6; margin: 12px 0 0; }

/* ------------------------------------------------------------ Anmeldeseiten */
.mitte { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.karte { width: 100%; max-width: 380px; }
.karte .marke {
  font-family: var(--serif); font-size: 30px; font-weight: 400; text-align: center;
  font-variation-settings: 'opsz' 72; letter-spacing: -.02em; margin: 0 0 4px;
}
.karte .unter { text-align: center; font-size: 12.5px; color: var(--ink-3); margin: 0 0 22px; }
.karte .box { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }

/* ------------------------------------------------------------ Lightbox */
.lb { position: fixed; inset: 0; z-index: 80; background: rgba(14,12,10,.95); display: none; place-items: center; }
.lb.on { display: grid; }
.lb img { max-width: 100%; max-height: 82dvh; object-fit: contain; }
.lb .lbfoot { position: absolute; bottom: max(22px, env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; }
.lb .lbfoot a { color: #E7DED0; font-size: 12.5px; }
.lb .lbclose { position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px; color: #E7DED0; font-size: 26px; text-decoration: none; padding: 8px 12px; }
