/* =========================================================
   Lorem & Placeholder Tools — Stylesheet
   Vanilla CSS, kein Framework. Light + Dark (prefers-color-scheme).
   ========================================================= */

:root {
  --bg: #ffffff;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --border: #e7e9ee;
  --text: #16181d;
  --text-muted: #656b76;
  --accent: #2b3038;      /* zurückhaltendes Anthrazit statt bunter Akzent */
  --accent-hover: #14171c;
  --accent-soft: #f4f5f7; /* dezentes Grau für Flächen */
  --ok: #1f2937;
  --shadow: 0 1px 2px rgba(16, 24, 40, .03), 0 2px 10px rgba(16, 24, 40, .045);
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 960px;
  --sky-w: 160px;
  --gap-page: 24px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); letter-spacing: -.01em; }
h3 { font-size: 1.1rem; }
p  { margin: 0 0 1em; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gap-page); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; gap: 20px;
  height: 64px;
}
.brand { font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; color: var(--text); }
.brand span { color: var(--accent); }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a { color: var(--text-muted); font-weight: 500; font-size: .95rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.lang-switch {
  display: inline-flex; border: 1px solid var(--border); border-radius: 999px;
  overflow: hidden; font-size: .82rem; font-weight: 600;
}
.lang-switch a { padding: 5px 11px; color: var(--text-muted); }
.lang-switch a[aria-current="true"] { background: var(--accent); color: #fff; }
.lang-switch a:hover { text-decoration: none; }
.nav-toggle { display: none; }

@media (max-width: 640px) {
  .nav-links { display: none; }
}

/* ---------- Page layout with skyscrapers ---------- */
.layout {
  display: grid;
  grid-template-columns: var(--sky-w) minmax(0, 1fr) var(--sky-w);
  gap: 24px;
  max-width: calc(var(--maxw) + 2 * (var(--sky-w) + 24px));
  margin: 0 auto;
  padding: 0 var(--gap-page);
  align-items: start;
}
.main { min-width: 0; padding: 8px 0 40px; }

/* Skyscraper ad rails — hidden below 1200px */
.sky {
  position: sticky; top: 84px;
  align-self: start;
}
@media (max-width: 1199px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sky { display: none; }
}
/* Keine festen Skyscraper konfiguriert -> Rails ausblenden, Inhalt zentriert */
.layout.no-rails { grid-template-columns: minmax(0, 1fr); }
.layout.no-rails .sky { display: none; }

/* ---------- Ad slots (placeholder) ---------- */
.ad {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(
    45deg, var(--accent-soft), var(--accent-soft) 10px,
    transparent 10px, transparent 20px);
  border: 1px dashed color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .78rem; font-weight: 600; text-align: center;
  overflow: hidden;
}
.ad::before { content: "Anzeige"; position: absolute; top: 6px; left: 8px; font-size: .62rem; opacity: .6; text-transform: uppercase; letter-spacing: .06em; }
.ad-sky { width: var(--sky-w); height: 600px; }
.ad-footer { width: 100%; max-width: 728px; height: 90px; margin: 0 auto 24px; }
.ad[hidden] { display: none; }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 40px; text-align: center; }
.hero p.lead { font-size: 1.15rem; color: var(--text-muted); max-width: 60ch; margin: 0 auto 28px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .95rem; cursor: pointer;
  border: 1px solid transparent; background: var(--accent); color: #fff;
  transition: background .15s, transform .05s, border-color .15s;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: var(--accent-soft); border-color: var(--accent); }
.btn.ok { background: var(--ok); }

/* ---------- Cards / sections ---------- */
.section { padding: 40px 0; scroll-margin-top: 80px; }
.section + .section { border-top: 1px solid var(--border); }
.section-head { margin-bottom: 24px; }
.section-head p { color: var(--text-muted); max-width: 65ch; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px;
}

.tool-grid { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 24px; }
@media (max-width: 760px) { .tool-grid { grid-template-columns: 1fr; } }

/* ---------- Form controls ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 7px; }
.field .hint { color: var(--text-muted); font-weight: 400; font-size: .8rem; }

input[type="text"], input[type="number"], select, textarea {
  width: 100%; padding: 10px 12px; font: inherit;
  color: var(--text); background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
textarea { min-height: 260px; resize: vertical; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9rem; line-height: 1.55; }

.row { display: flex; gap: 12px; align-items: flex-end; }
.row > * { flex: 1; }

/* Slider + coupled number */
.slider-row { display: flex; align-items: center; gap: 12px; }
input[type="range"] { flex: 1; accent-color: var(--accent); }
.slider-row input[type="number"] { width: 90px; flex: none; }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { padding: 9px 16px; border: 0; background: var(--bg-elev); color: var(--text-muted); font: inherit; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }

.checkbox { display: flex; align-items: center; gap: 9px; }
.checkbox input { width: auto; }

.color-row { display: flex; align-items: center; gap: 12px; }
input[type="color"] { width: 46px; height: 40px; padding: 2px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-elev); cursor: pointer; }

/* ---------- Output areas ---------- */
.output-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.output-toolbar .count { margin-left: auto; color: var(--text-muted); font-size: .82rem; }

.preview-wrap {
  display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(45deg, var(--border) 25%, transparent 25%),
    linear-gradient(-45deg, var(--border) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--border) 75%),
    linear-gradient(-45deg, transparent 75%, var(--border) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px; min-height: 220px; overflow: auto;
}
.preview-wrap img, .preview-wrap canvas { max-width: 100%; height: auto; box-shadow: var(--shadow); display: block; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg);
  padding: 11px 20px; border-radius: 999px; font-weight: 600; font-size: .9rem;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- FAQ ---------- */
.faq details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 4px 18px; margin-bottom: 12px;
}
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details > p { color: var(--text-muted); padding-bottom: 8px; margin: 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-elev); padding: 32px 0; margin-top: 24px; }
.footer-cols { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; }
.footer-cols nav { display: flex; flex-direction: column; gap: 8px; }
.footer-cols a { color: var(--text-muted); font-size: .9rem; }
.footer-legal { margin-top: 24px; color: var(--text-muted); font-size: .82rem; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.footer-legal .sep { opacity: .4; }
.btn-link { background: none; border: 0; color: var(--text-muted); font: inherit; font-size: .82rem; cursor: pointer; padding: 0; text-decoration: underline; }

/* ---------- Cookie modal ---------- */
.cookie-backdrop {
  position: fixed; inset: 0; background: rgba(10, 12, 20, .55);
  backdrop-filter: blur(2px);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 100; padding: 16px;
}
.cookie-backdrop[hidden] { display: none; }
.cookie-modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  max-width: 520px; width: 100%; padding: 26px; margin-bottom: 4vh;
}
.cookie-modal h2 { font-size: 1.25rem; }
.cookie-modal p { color: var(--text-muted); font-size: .92rem; }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.cookie-actions .btn { flex: 1; justify-content: center; min-width: 130px; }
.cookie-prefs { margin: 14px 0 4px; display: none; }
.cookie-prefs.show { display: block; }
.cookie-prefs .checkbox { margin-bottom: 10px; align-items: flex-start; }
.cookie-prefs .checkbox small { display: block; color: var(--text-muted); font-weight: 400; }
@media (min-width: 560px) { .cookie-backdrop { align-items: center; } .cookie-modal { margin-bottom: 0; } }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
