/* MohB Links — oeffentliche Seite
   Farben und Schrift kommen als CSS-Variablen aus dem Theme (lib/render.php themeCss):
   --bg (Farbe, Verlauf oder Bild), --bg-solid, --text, --btn-bg, --btn-text, --font.
   Knopfstil und -form ueber Klassen am body: bs-fill|outline|soft|hard, sh-square|round|pill.
   ─────────────────────────────────────────────────────── */

@import url('/assets/fonts/montserrat.css');

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--bg-solid); min-height: 100%; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* Hintergrund als feste Ebene: Verlauf und Bild bleiben beim Scrollen stehen (auch auf iOS) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg);
}

.sh-square { --r: 0px; --rt: 0px; --rc: 0px; }
.sh-round  { --r: 14px; --rt: 9px; --rc: 16px; }
.sh-pill   { --r: 999px; --rt: 999px; --rc: 22px; }

.wrap {
  position: relative;
  max-width: 580px;
  margin: 0 auto;
  padding: 56px 16px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ── Kopf ── */
.share {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: color-mix(in srgb, var(--text) 12%, transparent);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background .15s;
}
.share:hover { background: color-mix(in srgb, var(--text) 20%, transparent); }

.profile { text-align: center; margin-bottom: 14px; }
.avatar {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto 14px;
  border-radius: 50%;
  object-fit: cover;
  background: color-mix(in srgb, var(--text) 10%, transparent);
}
.av-rounded .avatar { border-radius: 24px; }
.profile h1 { font-size: 1.5rem; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.bio { margin: 8px auto 0; max-width: 44ch; font-size: 1rem; text-wrap: balance; opacity: .85; overflow-wrap: anywhere; }

.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin: 4px 0 22px;
}
.socials a {
  display: flex;
  padding: 7px;
  border-radius: 50%;
  color: var(--text);
  transition: transform .15s ease, opacity .15s;
}
.socials a:hover { transform: scale(1.12); }
.blocks + .socials { margin: 26px 0 0; }

/* ── Bausteine ── */
.blocks { display: flex; flex-direction: column; gap: 14px; }

.lnk {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 12px 64px;
  border: 2px solid transparent;
  border-radius: var(--r);
  color: var(--btn-text);
  background: var(--btn-bg);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
  letter-spacing: -.01em;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: transform .1s ease, box-shadow .1s ease, background .1s ease;
  -webkit-tap-highlight-color: transparent;
}
.lnk:hover { transform: scale(1.02); }
.lnk:active { transform: scale(.99); }
.lnk:focus-visible, .share:focus-visible, .socials a:focus-visible, .gate-btn:focus-visible, .embed-load:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 3px;
}

.bs-outline .lnk { background: transparent; border-color: var(--btn-bg); }
.bs-outline .lnk:hover { background: color-mix(in srgb, var(--btn-bg) 14%, transparent); }
/* Kachel: gefuellt mit feinem Rand in Textfarbe, fuer dunkle Hintergruende */
.bs-tile .lnk { border: 1px solid color-mix(in srgb, var(--text) 16%, transparent); }
.bs-tile .lnk:hover { transform: none; background: color-mix(in srgb, var(--btn-bg) 85%, var(--text)); }
.bs-soft .lnk { box-shadow: 0 6px 18px rgba(0, 0, 0, .18), 0 1px 3px rgba(0, 0, 0, .12); }
.bs-hard .lnk { border-color: var(--text); box-shadow: 4px 4px 0 var(--text); }
.bs-hard .lnk:hover { transform: translate(-1px, -1px); box-shadow: 5px 6px 0 var(--text); }
.bs-hard .lnk:active { transform: translate(2px, 2px); box-shadow: 1px 2px 0 var(--text); }

.lnk-thumb {
  position: absolute;
  left: 8px;
  top: 50%;
  width: 48px;
  height: 48px;
  transform: translateY(-50%);
  border-radius: var(--rt);
  object-fit: cover;
}
.lnk-icon { display: flex; align-items: center; justify-content: center; }

/* ⋮ neben dem Link: oeffnet die Teilen-Karte */
.lnk-wrap { position: relative; }
.lnk-more {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  color: var(--btn-text);
  background: transparent;
  opacity: .6;
  transform: translateY(-50%);
  cursor: pointer;
  transition: opacity .1s, background .1s;
}
.lnk-more:hover, .lnk-more:focus-visible { opacity: 1; background: color-mix(in srgb, var(--btn-text) 12%, transparent); }
.lnk-more:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.bs-outline .lnk-more { color: var(--btn-text); }
.lnk-wrap.is-featured .lnk-more { top: 10px; transform: none; color: #fff; background: rgba(0, 0, 0, .35); opacity: .9; }

/* Hervorgehoben: Karte mit grossem Bild */
.lnk-featured { flex-direction: column; padding: 0; overflow: hidden; border-radius: var(--rc); }
.lnk-featured .lnk-thumb { position: static; width: 100%; height: auto; aspect-ratio: 16 / 9; transform: none; border-radius: 0; }
.lnk-featured .lnk-title { padding: 16px 20px; font-size: 1.05rem; }
.lnk-featured.lnk-noimg { min-height: 96px; }

/* Aufmerksamkeit: nur einzelne Links, und nie bei reduzierter Bewegung */
@media (prefers-reduced-motion: no-preference) {
  .anim-pulse { animation: lk-pulse 2.4s ease-in-out infinite; }
  .anim-wobble { animation: lk-wobble 4s ease-in-out infinite; }
  .anim-shake { animation: lk-shake 4s ease-in-out infinite; }
  .anim-glow { animation: lk-glow 2.4s ease-in-out infinite; }
}
@keyframes lk-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes lk-wobble { 0%, 80%, 100% { transform: rotate(0); } 84% { transform: rotate(-2.5deg); } 88% { transform: rotate(2.5deg); } 92% { transform: rotate(-1.5deg); } 96% { transform: rotate(1deg); } }
@keyframes lk-shake { 0%, 84%, 100% { transform: translateX(0); } 86%, 90%, 94% { transform: translateX(-5px); } 88%, 92%, 96% { transform: translateX(5px); } }
@keyframes lk-glow { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--btn-bg) 0%, transparent); } 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--btn-bg) 35%, transparent); } }

.blk-header { margin-top: 12px; font-size: 1.02rem; font-weight: 700; text-align: center; }
.blk-text { font-size: .95rem; text-align: center; opacity: .88; overflow-wrap: anywhere; }

/* Einbettung: Platzhalter, bis jemand klickt */
.embed-title { margin-bottom: 8px; font-weight: 600; text-align: center; }
.embed-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: var(--h, auto);
  padding: 18px;
  border-radius: min(var(--rc), 16px);
  overflow: hidden;
  text-align: center;
  background: color-mix(in srgb, var(--text) 10%, transparent);
}
.embed-video .embed-box { height: auto; aspect-ratio: 16 / 9; }
.embed-box small { font-size: .75rem; opacity: .75; max-width: 36ch; }
.embed-box small a { color: inherit; }
.embed-load {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  color: var(--btn-text);
  background: var(--btn-bg);
  font: 600 .92rem var(--font);
  cursor: pointer;
}
.bs-outline .embed-load { color: var(--bg-solid); background: var(--btn-bg); }
.embed-box.is-loaded { padding: 0; }
.embed-box iframe { width: 100%; height: 100%; border: 0; display: block; }

/* E-Mail-Anmeldung */
.blk-signup {
  padding: 18px;
  border-radius: min(var(--rc), 18px);
  background: color-mix(in srgb, var(--text) 9%, transparent);
}
.signup-title { margin-bottom: 10px; font-weight: 700; text-align: center; }
.signup-row { display: flex; gap: 8px; }
.signup-row input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 2px solid color-mix(in srgb, var(--text) 25%, transparent);
  border-radius: min(var(--r), 12px);
  color: var(--text);
  background: color-mix(in srgb, var(--bg-solid) 70%, transparent);
  font: 500 .95rem var(--font);
}
.signup-row input::placeholder { color: var(--text); opacity: .6; }
.signup-row input:focus { outline: none; border-color: var(--text); }
.signup-row button {
  padding: 0 18px;
  border: 0;
  border-radius: min(var(--r), 12px);
  color: var(--btn-text);
  background: var(--btn-bg);
  font: 700 .92rem var(--font);
  cursor: pointer;
}
.bs-outline .signup-row button { color: var(--bg-solid); }
.signup-consent { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-size: .78rem; opacity: .85; text-align: left; }
.signup-consent input { margin-top: 2px; accent-color: var(--btn-bg); }
.signup-done, .signup-error { margin-top: 4px; font-weight: 600; text-align: center; }
.signup-error { margin-top: 10px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }

/* ── Fuss ── */
.foot { margin-top: auto; padding-top: 44px; text-align: center; font-size: .8rem; }
.legal { display: flex; justify-content: center; gap: 18px; margin-bottom: 14px; }
.legal a { color: var(--text); opacity: .75; }
.made {
  display: inline-flex;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text);
  background: color-mix(in srgb, var(--text) 10%, transparent);
  font-weight: 600;
  text-decoration: none;
}
.made:hover { background: color-mix(in srgb, var(--text) 18%, transparent); }

/* ── Hinweis auf sensible Inhalte (funktioniert ohne JavaScript) ── */
.gate-toggle { position: absolute; opacity: 0; pointer-events: none; }
.gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-solid);
}
.gate-toggle:checked + .gate { display: none; }
.gate-card { max-width: 360px; text-align: center; }
.gate-card h2 { margin-bottom: 8px; font-size: 1.2rem; }
.gate-card p { margin-bottom: 20px; opacity: .85; }
.gate-btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 999px;
  color: var(--btn-text);
  background: var(--btn-bg);
  font-weight: 700;
  cursor: pointer;
}

.draft-note {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 6px 12px;
  color: #3d2c00;
  background: #FFCC56;
  font: 600 .75rem 'Montserrat', system-ui, sans-serif;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--bg-solid);
  background: var(--text);
  font-size: .85rem;
  font-weight: 600;
  transform: translateX(-50%);
}

.center { justify-content: center; }

/* ── Teilen-Karte (dialog), bewusst neutral hell, unabhaengig vom Theme ── */
.sheet {
  width: min(480px, 100%);
  max-height: 92vh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 24px 24px 0 0;
  color: #15171C;
  background: #fff;
  font-family: var(--font);
  overflow: auto;
}
.sheet::backdrop { background: rgba(10, 12, 18, .55); }
@media (min-width: 640px) { .sheet { margin: auto; border-radius: 24px; } }
.sheet-head { position: relative; padding: 20px 56px 8px; text-align: center; }
.sheet-head h2 { font-size: 1.05rem; }
.sheet-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #F1F2F4; font-size: 1rem; cursor: pointer; }
.sheet-card {
  margin: 10px 20px 0;
  padding: 20px;
  border-radius: 20px;
  color: var(--text);
  background: var(--bg-solid);
  text-align: center;
}
.sheet-img { display: block; width: 100%; max-height: 220px; margin-bottom: 14px; border-radius: 12px; object-fit: cover; }
.sheet-title { font-size: 1.15rem; line-height: 1.25; overflow-wrap: anywhere; }
.sheet-host { margin-top: 6px; font-size: .85rem; opacity: .8; }
.sheet-desc { margin-top: 10px; font-size: .85rem; line-height: 1.4; opacity: .85; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.sheet-open { display: inline-block; margin-top: 14px; padding: 8px 18px; border-radius: 999px; color: var(--btn-text); background: var(--btn-bg); font-weight: 700; font-size: .85rem; text-decoration: none; }
.bs-outline .sheet-open { color: var(--bg-solid); }
.sheet-targets { display: flex; gap: 6px; padding: 18px 14px; overflow-x: auto; scrollbar-width: none; }
.sheet-targets button { flex: 0 0 76px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0; border: 0; background: none; color: #15171C; font: 500 .72rem var(--font); cursor: pointer; }
.sheet-targets .ic { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #F1F2F4; color: #15171C; }
.sheet-targets button:hover .ic { filter: brightness(.94); }
.sheet-cta { display: block; padding: 16px 22px 22px; border-top: 1px solid #ECEDF0; color: #15171C; text-decoration: none; }
.sheet-cta b { display: block; font-size: .95rem; }
.sheet-cta span { display: block; margin-top: 4px; font-size: .8rem; color: #5B606B; }

/* QR-Code am Desktop-Rand: Seite schnell aufs Handy holen */
.qr-desktop { display: none; }
@media (min-width: 1100px) and (hover: hover) {
  .qr-desktop {
    position: fixed;
    right: 28px;
    bottom: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 12px 10px;
    border-radius: 16px;
    color: #15171C;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
    font: 600 .75rem var(--font);
  }
  .qr-desktop svg { width: 116px; height: 116px; order: 1; }
  .qr-desktop span { order: 2; }
  .qr-desktop svg .dark { fill: #15171C; }
}

@media (min-width: 640px) {
  body::after { content: ''; position: fixed; inset: 0; z-index: -1; background: rgba(0, 0, 0, .2); }
  .wrap {
    margin-top: 40px;
    min-height: calc(100vh - 40px);
    padding: 64px 28px 32px;
    border-radius: 24px 24px 0 0;
    background: var(--bg);
    background-attachment: fixed;
    box-shadow: 0 24px 32px rgba(0, 0, 0, .15);
  }
  .is-preview .wrap { margin-top: 0; border-radius: 0; box-shadow: none; }
  .is-preview::after { display: none; }
}

@media (max-width: 380px) {
  .lnk:not(.lnk-featured) { padding: 12px 56px; }
  .lnk { font-size: .95rem; }
}

/* ── Impressum und Datenschutz ── */
.legal-back { align-self: flex-start; margin-bottom: 18px; color: var(--text); font-weight: 600; font-size: .9rem; text-decoration: none; opacity: .85; }
.legal-back:hover { opacity: 1; }
.legal-doc { padding: 24px 22px; border-radius: min(var(--rc), 20px); background: color-mix(in srgb, var(--text) 7%, transparent); line-height: 1.6; font-size: .95rem; overflow-wrap: anywhere; }
.legal-doc h1 { margin-bottom: 14px; font-size: 1.4rem; }
.legal-doc h2 { margin: 22px 0 6px; font-size: 1.02rem; }
.legal-doc p { margin-bottom: 10px; }
.legal-doc a { color: inherit; }
