/* ========================================
   nau.talk — var35: Magazine Grid
   Mixed modules: topics, polls, comments, questions
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&family=DM+Serif+Display&display=swap');

:root {
  --bg: #F7F5F0;
  --surface: #FFFFFF;
  --border: #E4E0D6;
  --ink: #0A0A0F;
  --ink2: #6B6660;
  --accent: #FF6B35;
  --accent-lt: #FF8F60;
  --glow: rgba(255,107,53,.12);
  --glow-s: rgba(255,107,53,.05);
  --success: #16a34a;
  --r: 12px;
  --t: .2s ease;
  --ui: 'DM Sans', system-ui, sans-serif;
  --serif: 'DM Serif Display', Georgia, serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--ui); font-size: 16px; line-height: 1.6; color: var(--ink); background: var(--bg); min-height: 100vh; position: relative; }

body::before { content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .04; mix-blend-mode: multiply; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); background-size: 256px; }
body > * { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
.wrap { max-width: 996px; margin: 0 auto; padding: 0 24px; }
.grad { background: linear-gradient(135deg, var(--accent), var(--accent-lt)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ============================================================ HEADER */
.header { position: sticky; top: 0; z-index: 100; background: rgba(247,245,240,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); }
.header::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, var(--accent), transparent 70%); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { font-family: var(--ui); font-weight: 700; font-size: 20px; letter-spacing: -.02em; }
.nav { display: flex; gap: 28px; }
.nav a { font-size: 14px; font-weight: 500; color: var(--ink2); transition: color var(--t); }
.nav a:hover, .nav a.active { color: var(--ink); }
.btn-login { font-family: var(--ui); font-size: 13px; font-weight: 500; padding: 7px 18px; border-radius: 8px; border: 1px solid var(--border); background: 0; color: var(--ink); cursor: pointer; transition: all var(--t); }
.btn-login:hover { border-color: var(--accent); box-shadow: 0 0 16px var(--glow); }

/* ============================================================ 6-COL GRID */
.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
  padding: 32px 24px 64px;
}
.span-2 { grid-column: span 6; }
.span-3 { grid-column: span 6; }
.span-4 { grid-column: span 6; }
.span-6 { grid-column: span 6; }

@media (min-width: 640px) {
  .span-2 { grid-column: span 3; }
  .span-3 { grid-column: span 3; }
  .span-4 { grid-column: span 6; }
  .span-6 { grid-column: span 6; }
}
@media (min-width: 960px) {
  .span-2 { grid-column: span 2; }
  .span-3 { grid-column: span 3; }
  .span-4 { grid-column: span 4; }
  .span-6 { grid-column: span 6; }
}

/* ============================================================ MOD-TOPIC */
.mod-topic {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transition: all var(--t);
  cursor: pointer;
}
.mod-topic::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--cat, var(--accent)); }
.mod-topic:hover { border-color: color-mix(in srgb, var(--cat) 40%, var(--border)); box-shadow: 0 6px 30px var(--glow-s); transform: translateY(-2px); }

.topic-body { padding: 26px 24px 20px; flex: 1; display: flex; flex-direction: column; }
.topic-cat { font-family: var(--mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--cat, var(--accent)); margin-bottom: 10px; }
.topic-title { font-family: var(--serif); font-size: 19px; font-weight: 400; line-height: 1.25; letter-spacing: -.01em; margin-bottom: 8px; }
.topic-title--lg { font-size: clamp(24px, 3vw, 32px); }
.topic-ctx { font-size: 13px; line-height: 1.5; color: var(--ink2); margin-top: auto; }

.topic-stats { display: flex; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 50%, var(--surface)); }
.st { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 4px; text-align: center; border-right: 1px solid var(--border); transition: background var(--t); }
.st:last-child { border-right: 0; }
.mod-topic:hover .st { background: color-mix(in srgb, var(--cat) 4%, transparent); }
.st svg { width: 22px; height: 22px; color: var(--ink2); transition: color var(--t); }
.mod-topic:hover .st svg { color: var(--cat, var(--accent)); }
.st b { font-family: var(--ui); font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.st small { font-family: var(--mono); font-size: 9px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--ink2); line-height: 1; display: none; }

/* Show labels on bigger cards */
.span-4 .st small,
.span-3 .st small { display: block; }

.st--live b { color: var(--success); }
.st--live svg { color: var(--success) !important; }
.st--live { position: relative; }
.st--live::after { content: ''; width: 5px; height: 5px; background: var(--success); border-radius: 50%; position: absolute; top: 10px; right: 10px; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }
.st--zero { opacity: .25; }

/* ============================================================ MOD-POLL */
.mod-poll {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--r);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.poll-badge { font-family: var(--mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.poll-q { font-family: var(--serif); font-size: 20px; font-weight: 400; line-height: 1.2; }
.poll-bars { display: flex; flex-direction: column; gap: 6px; }
.bar { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); cursor: pointer; text-align: left; font-family: var(--ui); transition: border-color var(--t); min-height: 48px; }
.bar:hover { border-color: var(--accent); }
.bar--win { border-color: var(--accent); }
.bar-fill { position: absolute; inset: 0; width: var(--p); background: color-mix(in srgb, var(--accent) 10%, transparent); transition: width .5s ease; }
.bar--win .bar-fill { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.bar-label { position: relative; z-index: 1; font-size: 14px; font-weight: 500; line-height: 1.4; flex: 1; }
.bar-pct { position: relative; z-index: 1; font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--ink2); flex-shrink: 0; padding-top: 1px; }
.bar--win .bar-pct { color: var(--accent); }
.bar--voted { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.bar--voted .bar-label { font-weight: 700; }
[data-voted] [data-option] { cursor: default; }
[data-voted] [data-option]:hover { border-color: var(--border); }
[data-voted] .bar--voted:hover,
[data-voted] .bar--voted { border-color: var(--accent); }

/* ============================================================ MOD-COMMENT */
.mod-comment {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-left: 4px solid var(--border);
  transition: border-color var(--t);
}
.mod-comment:hover { border-left-color: var(--accent); }
.comment-head { display: flex; gap: 10px; align-items: center; }
.comment-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.comment-head strong { font-size: 14px; }
.comment-head .verified { color: var(--success); font-size: 12px; }
.comment-head small { font-size: 11px; color: var(--ink2); font-family: var(--mono); }
.mod-comment p { font-family: var(--serif); font-size: 15px; line-height: 1.5; font-style: italic; color: var(--ink); flex: 1; }
.comment-vote { font-family: var(--mono); font-size: 11px; color: var(--ink2); margin-top: auto; }

/* ============================================================ MOD-QUESTION */
.mod-question {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--r);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--t);
}
.mod-question:hover { border-color: var(--accent); }
.question-head { display: flex; gap: 10px; align-items: center; }
.question-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.question-head strong { font-size: 14px; }
.question-head small { font-size: 11px; color: var(--ink2); font-family: var(--mono); }
.question-text { font-family: var(--serif); font-size: 17px; font-weight: 400; line-height: 1.35; flex: 1; }
.question-text em { font-style: italic; color: var(--accent); }
.question-meta { font-family: var(--mono); font-size: 11px; color: var(--ink2); margin-top: auto; }

/* ============================================================ MOD-VOTE (full width) */
.mod-vote {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.vote-left { flex: 1; min-width: 240px; }
.vote-badge { font-family: var(--mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); display: block; margin-bottom: 6px; }
.vote-q { font-family: var(--serif); font-size: 18px; font-weight: 400; line-height: 1.25; }
.vote-bars { display: flex; gap: 8px; flex: 1; min-width: 300px; align-items: center; }
.vbar { position: relative; flex: 1; min-height: 48px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; background: var(--surface); cursor: pointer; text-align: left; font-family: var(--ui); transition: border-color var(--t); }
.vbar:hover { border-color: var(--accent); }
.vbar-fill { position: absolute; inset: 0; width: var(--p); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.vbar--win { border-color: var(--accent); }
.vbar--win .vbar-fill { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.vbar-label { position: relative; z-index: 1; font-size: 14px; font-weight: 600; line-height: 1.4; flex: 1; }
.vbar-pct { position: relative; z-index: 1; font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--ink2); }
.vbar--win .vbar-pct { color: var(--accent); }
.bar--voted.vbar { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.bar--voted.vbar .vbar-label { font-weight: 700; }
.vote-meta { font-family: var(--mono); font-size: 11px; color: var(--ink2); flex-shrink: 0; }

/* ============================================================ FOOTER */
.footer { border-top: 1px solid var(--border); padding: 48px 0; text-align: center; }
.footer-logo { font-family: var(--ui); font-weight: 700; font-size: 22px; margin-bottom: 8px; }
.footer-sub { font-size: 14px; color: var(--ink2); font-style: italic; margin-bottom: 16px; }
.footer-copy { font-size: 12px; font-family: var(--mono); color: var(--ink2); opacity: .6; }

/* ============================================================ RESPONSIVE */
@media (max-width: 639px) {
  .nav { display: none; }
  .grid { gap: 14px; padding: 24px 16px 48px; }
  .mod-vote { flex-direction: column; gap: 16px; }
  .vote-bars { flex-direction: column; min-width: 0; width: 100%; }
  .vbar { width: 100%; }

  /* Mobile: grössere Schriften für Kontext, Kommentare, Meta */
  .topic-ctx { font-size: 15px; line-height: 1.55; }
  .mod-comment p { font-size: 17px; line-height: 1.55; }
  .comment-head strong { font-size: 15px; }
  .comment-head small { font-size: 13px; }
  .comment-vote { font-size: 13px; }
  .question-text { font-size: 18px; }
  .question-meta { font-size: 13px; }
  .question-head strong { font-size: 15px; }
  .question-head small { font-size: 13px; }
  .poll-q { font-size: 18px; }
  .poll-meta { font-size: 13px; }
  .bar-label { font-size: 14px; }
  .bar-pct { font-size: 14px; }
  .poll-badge { font-size: 12px; }
  .vote-q { font-size: 17px; }
  .vote-badge { font-size: 12px; }
  .vote-meta { font-size: 13px; }
  .st b { font-size: 15px; }
  .st svg { width: 20px; height: 20px; }
  .footer-sub { font-size: 15px; }
  .footer-copy { font-size: 13px; }
}

/* Expandable text */
.expandable { position: relative; }
.expandable p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.expandable.is-open p {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}
.expand-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 0;
  background: none;
  border: none;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  text-transform: lowercase;
}
.expand-btn:hover { text-decoration: underline; }
.expandable.is-open .expand-btn::after { content: none; }
.expandable:not(.is-open) .expand-btn::after { content: ' →'; }
.expandable.is-open .expand-btn { color: var(--ink2); }

/* Mobile: 4 Zeilen statt 2 */
@media (max-width: 639px) {
  .expandable p { -webkit-line-clamp: 4; }
}

/* Infinite scroll loader */
.load-more { display: flex; justify-content: center; padding: 32px 0; }
.loader { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

::selection { background: var(--accent); color: var(--bg); }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
