/* ---------------------------------------------------------------------------
   szimpatikus2 — mobile-first stylesheet.
   No build step, no external fonts (the CSP blocks third-party origins).
--------------------------------------------------------------------------- */

:root {
  --bg:        #f4f3f0;
  --surface:   #ffffff;
  --border:    #e2e0dc;
  --text:      #17161a;
  --muted:     #6d6b74;
  --accent:    #d94f2b;
  --accent-in: #ffffff;
  --up:        #d94f2b;
  --down:      #3c62d4;
  --danger-bg: #fdecea;
  --danger-fg: #8c2318;
  --focus:     #3c62d4;

  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 1px 2px rgba(20, 18, 24, .06), 0 1px 1px rgba(20, 18, 24, .04);

  --wrap:      44rem;
  --tap:       2.75rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #121215;
    --surface:   #1a1a1f;
    --border:    #2c2c34;
    --text:      #eceaf0;
    --muted:     #9d9aa6;
    --accent:    #f2623a;
    --accent-in: #1a1a1f;
    --up:        #f2623a;
    --down:      #6f8ef0;
    --danger-bg: #3a1c18;
    --danger-fg: #ffb3a6;
    --focus:     #8aa2f5;
    --shadow:    0 1px 2px rgba(0, 0, 0, .4);
  }
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1rem;
}

main.wrap { flex: 1; padding-block: 1.25rem 3rem; }

a { color: inherit; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-in);
  padding: .625rem 1rem;
  z-index: 20;
}
.skip:focus { left: 0; }

/* --- top bar ------------------------------------------------------------ */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: env(safe-area-inset-top);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -.01em;
}

.brand-mark {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  flex: 0 0 auto;
}

.brand-name { font-size: 1.0625rem; }

/* --- composer ----------------------------------------------------------- */

.composer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.composer h1,
.composer h2 {
  margin: 0 0 .75rem;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -.01em;
}

.composer-form {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.composer-form-stack { flex-direction: column; align-items: stretch; }

.composer-form input[type="text"],
.composer-form textarea {
  flex: 1 1 14rem;
  min-width: 0;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .625rem .75rem;
  min-height: var(--tap);
}

.composer-form textarea { resize: vertical; }

.composer-form input::placeholder,
.composer-form textarea::placeholder { color: var(--muted); }

.composer-form-stack .btn { align-self: flex-start; }

/* --- buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  min-height: var(--tap);
  padding: .5rem 1rem;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.btn:hover { border-color: var(--muted); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-in);
}
.btn-primary:hover { filter: brightness(1.06); }

.btn.is-disabled {
  opacity: .45;
  pointer-events: none;
}

/* --- tabs --------------------------------------------------------------- */

.tabs {
  display: flex;
  gap: .25rem;
  margin-bottom: .875rem;
}

.tab {
  padding: .4375rem .875rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: .9375rem;
  font-weight: 600;
  color: var(--muted);
  min-height: 2.25rem;
  display: inline-flex;
  align-items: center;
}
.tab:hover { background: var(--surface); color: var(--text); }
.tab.is-active { background: var(--text); color: var(--bg); }

/* --- feed --------------------------------------------------------------- */

.feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .625rem;
}

/*
 * Votes sit in a row under the title rather than in a left-hand column: the
 * title then gets the full card width (Hungarian headlines are long) and a
 * card is ~85px instead of ~120px, so more posts fit on a phone screen.
 */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .75rem;
}

.card-detail { margin-bottom: 1.25rem; }

.card-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -.011em;
  overflow-wrap: anywhere;
}

.card-detail .card-title { font-size: 1.375rem; }

.card-title a { text-decoration: none; }
.card-title a:hover { color: var(--accent); }

.card-foot {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: .25rem;
  margin-left: -.25rem;
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: .8125rem;
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
  align-items: center;
}
.meta a { color: inherit; text-decoration: none; font-weight: 600; }
.meta a:hover { color: var(--text); }

/* --- vote widget -------------------------------------------------------- */

.vote {
  display: flex;
  align-items: center;
  gap: .125rem;
  flex: 0 0 auto;
  user-select: none;
}

.vote-form { margin: 0; display: flex; }

.vote-btn {
  display: grid;
  place-items: center;
  width: 2.375rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.vote-btn svg { width: 1.125rem; height: 1.125rem; fill: currentColor; }
.vote-btn:hover { background: var(--bg); color: var(--text); }
.vote-btn.up.is-active { color: var(--up); }
.vote-btn.down.is-active { color: var(--down); }

.vote-score {
  font-size: .875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 1.75rem;
  text-align: center;
  line-height: 1.2;
}
.vote-score.is-up { color: var(--up); }
.vote-score.is-down { color: var(--down); }

/* --- comments ----------------------------------------------------------- */

.section-heading {
  margin: 1.5rem 0 .75rem;
  font-size: 1rem;
  font-weight: 650;
}

.comments {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.comment {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem;
  scroll-margin-top: 4.5rem;
}

.comment:target {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}

.comment-text {
  margin: 0;
  overflow-wrap: anywhere;
}

.comment-foot {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: .375rem;
  margin-left: -.25rem;
}
.comment-foot .meta { margin: 0; }

/* --- misc --------------------------------------------------------------- */

.alert {
  margin: 0 0 .75rem;
  padding: .625rem .75rem;
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  color: var(--danger-fg);
  font-size: .9375rem;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 2.5rem 1rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin: 0;
}

.breadcrumb { margin: 0 0 .875rem; font-size: .9375rem; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: 1.25rem;
}
.pager-info { color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }

.pagestate { text-align: center; padding: 3rem 1rem; }
.pagestate-code {
  margin: 0;
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--muted);
  opacity: .5;
}
.pagestate h1 { margin: .25rem 0 1.5rem; font-size: 1.25rem; }

.prose { max-width: 38rem; }
.prose h1 { font-size: 1.5rem; letter-spacing: -.02em; margin-top: 0; }
.prose h2 { font-size: 1.0625rem; margin-top: 1.75rem; }
.prose li { margin-bottom: .375rem; }

/* --- wider screens ------------------------------------------------------ */

@media (min-width: 40rem) {
  .card { padding: .875rem 1rem; }
  .composer { padding: 1.25rem; }
  main.wrap { padding-block: 2rem 4rem; }
}
