/* Portal — dark editorial theme */
:root {
  --bg: #131310;
  --bg-raised: #1c1b17;
  --bg-inset: #0d0d0b;
  --border: #33312a;
  --text: #e8e3d8;
  --text-dim: #9b958a;
  --accent: #c9a227;
  --accent-dim: #8a7119;
  --danger: #c0392b;
  --radius: 6px;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3, .brand { font-family: var(--serif); font-weight: 600; }
h1 { font-size: 2rem; margin: 0 0 .5rem; }
h2 { font-size: 1.4rem; margin: 2rem 0 .75rem; border-bottom: 1px solid var(--border); padding-bottom: .4rem; }
h3 { font-size: 1.1rem; margin: 0 0 .25rem; }

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

/* ── Layout ── */
.wrap { max-width: 960px; margin: 0 auto; padding: 0 1.25rem; }
main.wrap { min-height: 70vh; padding-top: 1.5rem; padding-bottom: 3rem; }

/* ── Header ── */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-inset);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-top: .8rem;
  padding-bottom: .8rem;
  flex-wrap: wrap;
}
.brand {
  font-size: 1.5rem;
  letter-spacing: .12em;
  color: var(--text);
  text-transform: uppercase;
}
.brand:hover { text-decoration: none; color: var(--accent); }
nav.main-nav { display: flex; gap: 1.1rem; flex: 1; flex-wrap: wrap; }
nav.main-nav a { color: var(--text-dim); font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; }
nav.main-nav a:hover, nav.main-nav a.active { color: var(--accent); text-decoration: none; }
.session-box { display: flex; align-items: center; gap: .8rem; font-size: .9rem; color: var(--text-dim); }

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: .85rem;
  background: var(--bg-inset);
}
.site-footer .wrap { padding-top: 1rem; padding-bottom: 1.5rem; }

/* ── Hero ── */
.hero { padding: 3rem 0 2rem; text-align: center; }
.hero h1 { font-size: 2.6rem; letter-spacing: .04em; }
.hero p { color: var(--text-dim); max-width: 620px; margin: .5rem auto 0; font-size: 1.1rem; }

/* ── Cards / grids ── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.card .meta { color: var(--text-dim); font-size: .82rem; }
.card p { margin: 0; color: var(--text-dim); font-size: .92rem; }
.card a.title { font-family: var(--serif); font-size: 1.15rem; color: var(--text); }
.card a.title:hover { color: var(--accent); }

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: .8rem 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ── Video player ── */
.player { width: 100%; max-height: 70vh; background: #000; border-radius: var(--radius); }
.doc-frame { width: 100%; height: 75vh; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }

/* ── Forms ── */
form.panel, .panel {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1rem 0;
}
label { display: block; margin: .6rem 0 .2rem; font-size: .9rem; color: var(--text-dim); }
input[type=text], input[type=password], textarea, select, input[type=file] {
  width: 100%;
  background: var(--bg-inset);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .55rem .7rem;
  font: inherit;
}
textarea { min-height: 7rem; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 1px solid var(--accent-dim); }

button, .btn {
  font: inherit;
  background: var(--accent);
  color: #15130c;
  border: none;
  border-radius: var(--radius);
  padding: .55rem 1.2rem;
  cursor: pointer;
  font-weight: 600;
  margin-top: .8rem;
}
button:hover, .btn:hover { background: #e0b832; }
button.secondary { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
button.secondary:hover { color: var(--text); background: var(--bg-inset); }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
button.danger:hover { background: var(--danger); color: #fff; }
button:disabled { opacity: .5; cursor: default; }

.error-msg { color: #e74c3c; margin: .6rem 0 0; font-size: .92rem; min-height: 1.2em; }
.ok-msg { color: #7dba6a; margin: .6rem 0 0; font-size: .92rem; }
.muted { color: var(--text-dim); }
.small { font-size: .85rem; }

progress { width: 100%; height: 10px; margin-top: .6rem; }

/* ── Comments ── */
.comment {
  border-left: 2px solid var(--border);
  padding: .5rem 0 .5rem 1rem;
  margin: .8rem 0;
}
.comment .who { font-size: .85rem; color: var(--text-dim); margin-bottom: .15rem; }
.comment .who b { color: var(--accent); font-weight: 600; }
.comment p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ── Posts ── */
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.attachment {
  display: inline-block;
  margin-top: .6rem;
  padding: .4rem .8rem;
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  font-size: .9rem;
}

/* ── Tables (admin) ── */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--text-dim); font-weight: 600; text-transform: uppercase; font-size: .75rem; letter-spacing: .05em; }
td button { margin: 0 .2rem 0 0; padding: .25rem .7rem; font-size: .82rem; }

@media (max-width: 640px) {
  .hero h1 { font-size: 1.8rem; }
  .site-header .wrap { gap: .8rem; }
}
