:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #1d2433;
  --muted: #667085;
  --border: #e3e6ee;
  --primary: #1f4fd1;      /* EU-ish blue */
  --primary-dark: #163a9c;
  --accent: #f5c400;       /* EU-ish yellow */
  --danger: #c0392b;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151c;
    --surface: #1b2029;
    --text: #e7eaf0;
    --muted: #9aa3b2;
    --border: #2c3340;
    --primary: #5b8cff;
    --primary-dark: #3f6fe0;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

a { color: var(--primary); }
code { background: var(--border); padding: 0 4px; border-radius: 4px; }

.container { max-width: 960px; margin: 0 auto; padding: 0 16px; }
main.container { padding-top: 24px; padding-bottom: 48px; min-height: 70vh; }

/* Header */
.site-header { background: var(--surface); border-bottom: 3px solid var(--accent); }
.header-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 12px; padding-bottom: 12px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
nav a { text-decoration: none; }

.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; padding: 20px 0; }

/* Buttons */
.btn {
  display: inline-block; background: var(--primary); color: #fff; border: 0; border-radius: var(--radius);
  padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--primary-dark); }
.btn-small { padding: 6px 12px; font-size: .9rem; color: #fff !important; }
.btn-danger { background: var(--danger); margin-top: 24px; }
.link-button { background: none; border: 0; color: var(--primary); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.link-button.danger { color: var(--danger); font-size: .85rem; }
form.inline { display: inline; }

/* Hero + filters */
.hero { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border-radius: var(--radius); padding: 28px; margin-bottom: 20px; }
.hero h1 { margin: 0 0 8px; }
.hero p { margin: 0 0 16px; opacity: .92; }
.hero .btn { background: var(--accent); color: #1d2433; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.filters input[type=search] { flex: 1 1 240px; }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; width: 100%;
}
.filters select { width: auto; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

/* Cards */
.cards { display: grid; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.card h2 { margin: 0 0 8px; font-size: 1.2rem; }
.card-link { text-decoration: none; color: var(--text); }
.card-link:hover h2 { color: var(--primary); }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag { background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; font-size: .85rem; }
.excerpt { margin: 0 0 10px; white-space: pre-line; }
.card-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; font-size: .9rem; }
.stars { color: #e0a800; letter-spacing: 1px; }
.muted { color: var(--muted); }
.empty { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 32px; text-align: center; color: var(--muted); }

.pagination { display: flex; justify-content: center; gap: 20px; margin-top: 20px; }

/* Post detail */
.post { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.post h1 { margin-top: 0; }
.post h2 { font-size: 1.1rem; margin-top: 28px; }
.text { white-space: pre-line; overflow-wrap: anywhere; }
.tips { background: var(--bg); border-left: 4px solid var(--accent); padding: 12px 16px; border-radius: 6px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin: 16px 0 0; }
.facts div { background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.facts dt { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.facts dd { margin: 2px 0 0; font-weight: 600; }

.comments { margin-top: 28px; }
.comment { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 10px; }

/* Forms */
.form { display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-top: 16px; }
.form.narrow { max-width: 380px; }
.form label { display: grid; gap: 4px; font-weight: 600; font-size: .95rem; }
.form button { justify-self: start; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px 16px; margin: 0; }
legend { font-weight: 700; padding: 0 6px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }

.flash { background: #e6f4ea; color: #1e5631; border: 1px solid #b7dfc3; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; }
.errors { background: #fdecea; color: #8a1c13; border: 1px solid #f5c2bd; border-radius: var(--radius); padding: 10px 14px; }
.errors ul { margin: 6px 0 0; padding-left: 20px; }

/* Honeypot: hidden from humans, visible to naive bots */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 600px) {
  .hero { padding: 20px; }
  .post { padding: 16px; }
  .filters select, .filters .btn { flex: 1 1 auto; }
}
