/* ============================================================
   Conviviera — riviera-warm forum styles
   ============================================================ */

:root {
  --cream: #faf3e6;
  --paper: #fffdf8;
  --ink: #29241c;
  --muted: #857a68;
  --terra: #c8502e;
  --terra-dark: #a53f21;
  --terra-soft: #f7ddd2;
  --pine: #1e4d48;
  --pine-soft: #dcebe4;
  --sun: #e9a13b;
  --awn2: #f6e7ce;
  --line: #eadfc9;
  --danger: #a02929;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(41, 36, 28, 0.05), 0 10px 28px -14px rgba(41, 36, 28, 0.22);
  --font-body: "Inter", -apple-system, "Segoe UI", sans-serif;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background:
    radial-gradient(1100px 480px at 85% -120px, rgba(233, 161, 59, 0.16), transparent 65%),
    radial-gradient(900px 420px at -10% -80px, rgba(200, 80, 46, 0.08), transparent 60%),
    var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; width: 100%; padding-bottom: 56px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 22px; width: 100%; }

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

/* ------------------------------------------------ awning stripe -- */
.awning {
  position: relative;
  height: 12px;
  background: repeating-linear-gradient(90deg, var(--terra) 0 22px, var(--awn2) 22px 44px);
}
.awning::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 11px;
  height: 9px;
  background-image:
    radial-gradient(circle at 11px 0, var(--terra) 8.4px, transparent 9px),
    radial-gradient(circle at 11px 0, var(--awn2) 8.4px, transparent 9px);
  background-size: 44px 9px;
  background-position: 0 0, 22px 0;
  background-repeat: repeat-x;
}

/* ----------------------------------------------------- header -- */
.site-head { padding: 20px 0 14px; }
.head-row { display: flex; align-items: center; gap: 26px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--terra);
}
.brand:hover { text-decoration: none; }
.brand .sun { flex: none; }
.wordmark {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 27px;
  letter-spacing: 0.01em;
  color: var(--ink);
  transform: translateY(-1px);
}

.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  padding: 7px 13px;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 500;
  font-size: 14.5px;
}
.nav a:hover { background: rgba(200, 80, 46, 0.09); text-decoration: none; }
.nav a.on { background: var(--terra-soft); color: var(--terra-dark); font-weight: 600; }

.badge {
  display: inline-block;
  margin-left: 7px;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--terra);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
  transform: translateY(-1px);
}

.head-user { display: flex; align-items: center; gap: 14px; }
.whoami { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.whoami-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.inline-form { display: inline; }

.linkish {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}
.linkish:hover { color: var(--terra-dark); text-decoration: underline; }

/* ---------------------------------------------------- buttons -- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--terra);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 10px 20px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 16px -8px rgba(200, 80, 46, 0.7);
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--terra-dark); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: 7px 14px; font-size: 13.5px; box-shadow: none; }
.btn-ghost { background: transparent; color: var(--terra-dark); border: 1.5px solid var(--terra); box-shadow: none; }
.btn-ghost:hover { background: var(--terra-soft); }
.btn-pine { background: var(--pine); box-shadow: 0 6px 16px -8px rgba(30, 77, 72, 0.7); }
.btn-pine:hover { background: #163c38; }
.btn-danger { background: var(--danger); box-shadow: none; }
.btn-danger:hover { background: #7f1f1f; }
.btn-quiet { background: transparent; color: var(--muted); border: 1.5px solid var(--line); box-shadow: none; font-weight: 500; }
.btn-quiet:hover { background: #fff; color: var(--ink); border-color: #d8cbb2; }

/* ------------------------------------------------------ flash -- */
.flash {
  margin: 8px 0 0;
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 500;
  border: 1px solid;
}
.flash-ok   { background: #eaf3ec; border-color: #cbe2d2; color: #1e5231; }
.flash-warn { background: #fdf3e0; border-color: #f0dcb4; color: #7a5410; }
.flash-err  { background: #fbe9e7; border-color: #f0ccc6; color: #8c2a1c; }

/* ------------------------------------------------------- hero -- */
.hero {
  position: relative;
  overflow: hidden;
  margin-top: 18px;
  background: linear-gradient(120deg, var(--pine) 0%, #2a635c 70%, #33756c 100%);
  color: #f6efdd;
  border-radius: 22px;
  padding: 42px 44px 40px;
  box-shadow: var(--shadow);
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 550;
  font-size: clamp(30px, 4.6vw, 44px);
  line-height: 1.12;
  margin: 0 0 10px;
  letter-spacing: 0.005em;
}
.hero h1 em { font-style: italic; color: var(--sun); }
.hero p { margin: 0; max-width: 56ch; color: #dbe7dd; font-size: 16px; }
.hero-cta { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero .btn { background: var(--sun); color: #3a2a10; box-shadow: none; }
.hero .btn:hover { background: #f4b155; }
.hero .btn-ghost { background: transparent; color: #f6efdd; border-color: rgba(246, 239, 221, 0.5); }
.hero .btn-ghost:hover { background: rgba(246, 239, 221, 0.12); }
.hero-sun {
  position: absolute;
  right: -70px;
  top: -90px;
  width: 300px;
  height: 300px;
  color: rgba(233, 161, 59, 0.25);
  pointer-events: none;
}
.hero-stats { display: flex; gap: 26px; margin-top: 26px; flex-wrap: wrap; }
.hero-stats .stat b { display: block; font-size: 22px; font-family: var(--font-display); color: #fff; }
.hero-stats .stat span { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.09em; color: #b9cec2; }

/* ----------------------------------------------------- layout -- */
.cols { display: grid; grid-template-columns: 1fr 300px; gap: 26px; margin-top: 26px; align-items: start; }

.section-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin: 4px 0 14px; }
h2.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  margin: 0;
}
.section-sub { color: var(--muted); font-size: 13.5px; }

/* ------------------------------------------------------ cards -- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 22px 24px; }

/* ------------------------------------------------ thread list -- */
.thread-list { display: flex; flex-direction: column; gap: 12px; }

.thread-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 15px;
  align-items: center;
  padding: 15px 18px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.thread-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 3px rgba(41, 36, 28, 0.05), 0 16px 34px -16px rgba(41, 36, 28, 0.3);
}
.thread-title { font-weight: 600; font-size: 16px; color: var(--ink); }
.thread-title:hover { color: var(--terra-dark); }
.thread-meta { color: var(--muted); font-size: 13px; margin-top: 3px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.thread-side { text-align: right; color: var(--muted); font-size: 12.5px; line-height: 1.45; white-space: nowrap; }
.thread-side b { display: block; color: var(--ink); font-size: 15px; }

.pin-flag, .lock-flag { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; }
.pin-flag { color: var(--sun); }
.lock-flag { color: var(--muted); }

.chip {
  display: inline-block;
  background: var(--pine-soft);
  color: var(--pine);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
}
a.chip:hover { text-decoration: none; background: #cfe3d8; }
.chip-terra { background: var(--terra-soft); color: var(--terra-dark); }
.chip-admin { background: var(--terra); color: #fff; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; padding: 2px 8px; }
.chip-pending { background: #fdf3e0; color: #7a5410; }
.chip-declined { background: #f3e5e2; color: #8c2a1c; }

.dot { opacity: 0.5; }

/* ---------------------------------------------------- avatars -- */
.av {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 39%;
  background: linear-gradient(145deg, hsl(var(--h), 55%, 48%), hsl(var(--h), 60%, 36%));
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  flex: none;
  user-select: none;
}
.av-sm { width: 28px; height: 28px; font-size: 13px; }
.av-lg { width: 52px; height: 52px; font-size: 21px; }

/* ---------------------------------------------------- sidebar -- */
.side-card { margin-bottom: 20px; }
.side-card h3 {
  margin: 0;
  padding: 15px 20px 12px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.cat-list { list-style: none; margin: 0; padding: 8px; }
.cat-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--ink);
  font-weight: 500;
  font-size: 14px;
}
.cat-list a:hover { background: var(--cream); text-decoration: none; }
.cat-list a.on { background: var(--terra-soft); color: var(--terra-dark); font-weight: 600; }
.cat-count { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.cat-blurb { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.side-note { padding: 14px 20px 17px; color: var(--muted); font-size: 13.5px; }
.side-note p { margin: 0 0 8px; }
.side-note p:last-child { margin: 0; }

/* ------------------------------------------------ empty state -- */
.empty {
  text-align: center;
  padding: 54px 30px;
  color: var(--muted);
}
.empty .sun { color: var(--sun); width: 42px; height: 42px; }
.empty h3 { font-family: var(--font-display); color: var(--ink); font-size: 21px; margin: 12px 0 6px; }
.empty p { margin: 0 0 18px; }

/* ------------------------------------------------------ posts -- */
.thread-page-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 3.6vw, 34px);
  line-height: 1.15;
  margin: 26px 0 6px;
}
.thread-page-meta { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }

.post { display: grid; grid-template-columns: 52px 1fr; gap: 16px; padding: 20px 22px; margin-bottom: 14px; }
.post-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.post-author { font-weight: 700; font-size: 15px; }
.post-time { color: var(--muted); font-size: 13px; }
.post-body { margin-top: 8px; overflow-wrap: break-word; }
.post-body a { text-decoration: underline; }
.post-op { border-left: 4px solid var(--sun); }
.post-actions { margin-left: auto; }

.mod-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 0 18px; }

/* ------------------------------------------------------ forms -- */
.form-card { max-width: 460px; margin: 40px auto 0; }
.form-card-wide { max-width: 640px; }
.form-title { font-family: var(--font-display); font-weight: 600; font-size: 26px; margin: 0 0 4px; }
.form-sub { color: var(--muted); font-size: 14.5px; margin: 0 0 20px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--muted); }
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field textarea,
.field select {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  padding: 10px 13px;
  font: inherit;
  font-size: 15px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--terra);
  box-shadow: 0 0 0 3.5px rgba(200, 80, 46, 0.14);
}
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 22px; flex-wrap: wrap; }
.form-foot .aside { color: var(--muted); font-size: 13.5px; }

.error-list { background: #fbe9e7; border: 1px solid #f0ccc6; color: #8c2a1c; border-radius: 12px; padding: 12px 16px 12px 32px; margin: 0 0 18px; font-size: 14px; }
.error-list li { margin: 2px 0; }

/* ------------------------------------------------------ admin -- */
.admin-grid { display: grid; gap: 30px; margin-top: 24px; }

.req-card { display: grid; grid-template-columns: 52px 1fr; gap: 16px; padding: 20px 22px; margin-bottom: 14px; }
.req-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.req-name { font-weight: 700; font-size: 16px; }
.req-mail { color: var(--muted); font-size: 13.5px; }
.req-intro {
  margin: 10px 0 14px;
  padding: 10px 16px;
  background: var(--cream);
  border-left: 3px solid var(--sun);
  border-radius: 0 10px 10px 0;
  font-style: italic;
  color: #55503f;
  overflow-wrap: break-word;
}
.req-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.table-wrap { overflow-x: auto; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .cell-user { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.admin-table .actions { display: flex; gap: 7px; flex-wrap: wrap; }

.inline-add { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 16px 20px 20px; }
.inline-add .field { margin: 0; flex: 1; min-width: 160px; }

/* ------------------------------------------------------ setup -- */
.setup-hero { text-align: center; margin: 46px 0 26px; }
.setup-hero .sun { color: var(--terra); width: 44px; height: 44px; }
.setup-hero h1 { font-family: var(--font-display); font-weight: 600; font-size: 34px; margin: 10px 0 6px; }
.setup-hero p { color: var(--muted); margin: 0; }

.check-list { list-style: none; margin: 0 0 22px; padding: 14px 18px; background: var(--cream); border-radius: 12px; font-size: 14px; }
.check-list li { display: flex; gap: 10px; align-items: center; padding: 3px 0; }
.check-ok::before { content: "✓"; color: #1e7a3c; font-weight: 800; }
.check-bad::before { content: "✕"; color: var(--danger); font-weight: 800; }

/* ----------------------------------------------------- footer -- */
.site-foot { background: var(--pine); color: #cfe0d3; margin-top: 40px; }
.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 22px; padding-bottom: 24px; flex-wrap: wrap; }
.foot-brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 18px; color: #f6efdd; }
.foot-brand .sun { color: var(--sun); }
.foot-note { font-size: 13px; opacity: 0.85; }

/* ------------------------------------------------- responsive -- */
@media (max-width: 900px) {
  .cols { grid-template-columns: 1fr; }
  .head-row { flex-wrap: wrap; gap: 12px 18px; }
  .nav { order: 3; flex-basis: 100%; }
  .hero { padding: 32px 26px; }
}
@media (max-width: 560px) {
  .thread-item { grid-template-columns: 38px 1fr; }
  .thread-side { display: none; }
  .av { width: 38px; height: 38px; font-size: 16px; }
  .post { grid-template-columns: 1fr; }
  .post .av-lg { width: 40px; height: 40px; font-size: 16px; }
  .whoami-name { display: none; }
}
