/*
 * Angelehnt an das WordPress-Theme Twenty Twenty-Five (Standardstil):
 * gleiche Farben, Schriften, Abstände und Schaltflächen.
 *
 * Die Schriftdateien liegen in assets/fonts/ und stammen aus dem Theme-Ordner
 * (siehe README). Fehlen sie, greift die Systemschrift.
 */
@font-face {
  font-family: Manrope;
  src: url('fonts/Manrope-VariableFont_wght.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fira Code';
  src: url('fonts/FiraCode-VariableFont_wght.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --base: #ffffff;
  --contrast: #111111;
  --accent-1: #ffee58;
  --accent-2: #f6cff4;
  --accent-3: #503aa8;
  --accent-4: #686868;
  --accent-5: #fbfaf3;
  --line: rgba(17, 17, 17, 0.2);
  --danger: #b3261e;

  --font-body: Manrope, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-mono: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --fs-small: 0.875rem;
  --fs-medium: clamp(1rem, 1rem + ((1vw - 0.2rem) * 0.196), 1.125rem);
  --fs-large: clamp(1.125rem, 1.125rem + ((1vw - 0.2rem) * 0.392), 1.375rem);
  --fs-xl: clamp(1.75rem, 1.75rem + ((1vw - 0.2rem) * 0.392), 2rem);
  --fs-xxl: clamp(2.15rem, 2.15rem + ((1vw - 0.2rem) * 1.333), 3rem);

  --gutter: clamp(20px, 5vw, 50px);
  --content: 645px;
  --wide: 1340px;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--base);
  color: var(--contrast);
  font-family: var(--font-body);
  font-size: var(--fs-large);
  font-weight: 300;
  line-height: 1.4;
  letter-spacing: -0.1px;
  -webkit-font-smoothing: antialiased;
}

a { color: currentColor; text-underline-offset: 0.1em; text-decoration-thickness: 1px; }
a:hover { text-decoration: none; }
:focus-visible { outline: 2px solid var(--contrast); outline-offset: 3px; }

h1, h2, h3 { font-weight: 400; line-height: 1.125; letter-spacing: -0.1px; margin: 0 0 1.2rem; text-wrap: balance; }
h1 { font-size: var(--fs-xxl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-small); font-weight: 500; text-transform: uppercase; letter-spacing: 1.4px; color: var(--accent-4); margin-bottom: 0.6rem; }
p { margin: 0 0 1.2rem; }

.wrap { width: 100%; max-width: calc(var(--content) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.wrap.wide { max-width: calc(var(--wide) + 2 * var(--gutter)); }
.wrap.narrow { max-width: calc(420px + 2 * var(--gutter)); }

.muted { color: var(--accent-4); }
.small { font-size: var(--fs-small); }
.lead { font-size: var(--fs-large); }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: var(--base); padding: 0.5rem 1rem; z-index: 10; }

/* ---------- Kopf- und Fußzeile ---------- */
.site-header { padding: 1.4rem 0; }
.header-inner, .footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 2rem; }
.site-title { margin: 0; font-size: var(--fs-large); font-weight: 700; letter-spacing: -0.5px; }
.site-title a { text-decoration: none; }
.site-title a:hover { text-decoration: underline; }
.site-title .sep { margin: 0 0.5em; font-weight: 300; color: var(--accent-4); }
.site-nav, .footer-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.6rem; font-size: var(--fs-medium); }
.site-nav a, .footer-nav a { text-decoration: none; }
.site-nav a:hover, .footer-nav a:hover { text-decoration: underline; }

.site-main { flex: 1; padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(3rem, 8vw, 6rem); }

.site-footer { padding: clamp(2rem, 5vw, 3.5rem) 0; border-top: 1px solid var(--line); font-size: var(--fs-medium); }
.footer-inner { align-items: flex-start; }
.footer-title { margin: 0 0 0.2rem; font-size: var(--fs-large); font-weight: 700; letter-spacing: -0.5px; }
.footer-title a { text-decoration: none; }
.site-footer p { margin-bottom: 0; }

/* ---------- Schaltflächen ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 1rem 2.25rem;
  border: 1px solid var(--contrast);
  border-radius: 9999px;
  background: var(--contrast);
  color: var(--base);
  font: inherit; font-size: var(--fs-medium); font-weight: 400; line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.btn:hover { background: color-mix(in srgb, var(--contrast) 85%, transparent); }
.btn-outline { background: transparent; color: var(--contrast); }
.btn-outline:hover { background: var(--contrast); color: var(--base); }
.btn-small { padding: 0.55rem 1.25rem; font-size: var(--fs-small); }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: var(--base); }

.linklike { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.linklike:hover { text-decoration: underline; }
form.inline { display: inline; margin: 0; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }

/* ---------- Beitrag ---------- */
.eyebrow { font-size: var(--fs-small); font-weight: 500; text-transform: uppercase; letter-spacing: 1.4px; color: var(--accent-4); margin-bottom: 1.5rem; }

.cipher, .plain { white-space: pre-wrap; overflow-wrap: anywhere; }

.cipher.is-encoded { font-family: var(--font-mono); font-size: 0.9em; font-weight: 400; line-height: 1.6; letter-spacing: 0; }

.post .cipher {
  padding: clamp(1.25rem, 4vw, 2rem);
  border-radius: 16px;
  background: var(--accent-5);
  margin-bottom: 1.75rem;
  transition: background-color 0.25s;
}
.post .cipher.is-decoded { background: var(--accent-1); }
.post .actions { margin-bottom: 1.75rem; }

/* ---------- Formulare ---------- */
.form { display: flex; flex-direction: column; gap: 0.5rem; }
.form label { font-size: var(--fs-small); font-weight: 500; text-transform: uppercase; letter-spacing: 1.4px; color: var(--accent-4); margin-top: 0.75rem; }
.form input[type=text], .form input[type=password], .form textarea {
  width: 100%;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--base);
  color: var(--contrast);
  font: inherit; font-size: var(--fs-medium); line-height: 1.5;
}
.form textarea { resize: vertical; min-height: 9rem; }
.form input:focus, .form textarea:focus { outline: 2px solid var(--contrast); outline-offset: 1px; border-color: transparent; }
.form .btn, .form .actions { margin-top: 1rem; align-self: flex-start; }
.form .actions .btn { margin-top: 0; }

.notice { padding: 1rem 1.25rem; border-radius: 12px; margin-bottom: 1.5rem; font-size: var(--fs-medium); }
.notice p { margin: 0; }
.notice-ok { background: var(--accent-1); }
.notice-error { background: #fbe4e2; color: #6b1410; }
.notice-link { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-top: 0.6rem !important; font-family: var(--font-mono); font-size: var(--fs-small); }

/* ---------- Admin-Übersicht ---------- */
.compose { max-width: 900px; }
.list-title { margin-top: clamp(2.5rem, 6vw, 4rem); }

.entry { padding: 1.75rem 0; border-top: 1px solid var(--line); }
.entry-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.3rem 1.5rem; margin-bottom: 1.25rem; }
.entry-link { font-family: var(--font-mono); font-size: var(--fs-small); overflow-wrap: anywhere; }
.entry-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem 2.5rem; margin-bottom: 1.25rem; font-size: var(--fs-medium); }
.entry-cols > div { min-width: 0; }
.entry .plain, .entry .cipher { max-height: 16rem; overflow: auto; padding: 1rem 1.1rem; border-radius: 12px; background: var(--accent-5); }
.entry .plain { background: transparent; border: 1px solid var(--line); }

@media (max-width: 760px) {
  .entry-cols { grid-template-columns: 1fr; }
  .btn { padding: 0.9rem 1.6rem; }
  .btn-small { padding: 0.55rem 1.1rem; }
}

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

.notice-link .btn { font-family: var(--font-body); }
