/* styles.css — Sierra Leone Events */

/* ---------- tokens ---------- */
:root {
  --paper:   #F4EFE3;        /* warm bone base */
  --paper-2: #FBF8EF;        /* raised surface / cards */
  --paper-3: #ECE5D5;        /* sunken / hover wells */
  --ink:     #1B1813;        /* near-black warm */
  --ink-2:   #4A443A;        /* secondary text */
  --ink-3:   #8A8275;        /* muted / meta */
  --line:    rgba(27,24,19,0.14);
  --line-2:  rgba(27,24,19,0.08);

  /* accent pair — overridden by Tweaks at runtime */
  --accent:    #1C7D4A;
  --accent-ink:#0F4A2C;
  --accent-2:  #E2592B;
  --on-accent: #FBF8EF;

  --shadow-sm: 0 1px 2px rgba(27,24,19,.06), 0 2px 6px rgba(27,24,19,.05);
  --shadow-md: 0 4px 14px rgba(27,24,19,.10), 0 12px 30px rgba(27,24,19,.08);
  --shadow-lg: 0 10px 30px rgba(27,24,19,.14), 0 28px 60px rgba(27,24,19,.12);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-card: 16px;           /* tweakable */

  --font-display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;

  --maxw: 1200px;
}

[data-theme="dark"] {
  --paper:   #161310;
  --paper-2: #211D18;
  --paper-3: #2C2720;
  --ink:     #F4EFE3;
  --ink-2:   #C8C0B2;
  --ink-3:   #8E8674;
  --line:    rgba(244,239,227,0.16);
  --line-2:  rgba(244,239,227,0.09);
  --on-accent:#FBF8EF;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 6px 18px rgba(0,0,0,.45);
  --shadow-lg: 0 16px 44px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.01em;
}
.app-bg {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 88% -8%, color-mix(in oklab, var(--accent) 9%, transparent), transparent 60%),
    radial-gradient(900px 500px at -6% 4%, color-mix(in oklab, var(--accent-2) 7%, transparent), transparent 55%),
    var(--paper);
}

button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 800; line-height: 1.02; letter-spacing: -0.03em; margin: 0; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent-ink); display: inline-flex; align-items: center; gap: 8px;
}
[data-theme="dark"] .eyebrow { color: color-mix(in oklab, var(--accent) 70%, white); }
.eyebrow::before { content:""; width: 22px; height: 2px; background: var(--accent); display:inline-block; }

/* ---------- top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(12px);
  background: color-mix(in oklab, var(--paper) 82%, transparent);
  border-bottom: 1px solid var(--line-2);
}
.nav-inner { display: flex; align-items: center; gap: 18px; height: 68px; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-ink));
  color: var(--on-accent); display: grid; place-items: center;
  font-weight: 800; font-size: 17px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.brand-mark::after { content:""; position:absolute; inset:0; background: radial-gradient(circle at 70% 20%, rgba(255,255,255,.35), transparent 55%); }
.brand small { display:block; font-family: var(--font-body); font-weight: 600; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-top: -2px; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: 14px; }
.nav-link {
  padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14.5px; color: var(--ink-2);
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--paper-3); color: var(--ink); }
.nav-link.active { background: var(--ink); color: var(--paper); }
.nav-spacer { flex: 1; }
.nav-saved { display:flex; align-items:center; gap:7px; font-weight:600; font-size:14px; color: var(--ink-2); padding: 8px 12px; border-radius: 999px; }
.nav-saved:hover { background: var(--paper-3); }
.nav-saved .heart { color: var(--accent-2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 700; font-size: 15px; border: none; border-radius: 999px;
  padding: 12px 22px; transition: transform .12s, box-shadow .15s, background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-ink); box-shadow: var(--shadow-md); }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: color-mix(in oklab, var(--ink) 86%, var(--accent)); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink); background: var(--paper-2); }
.btn-lg { padding: 15px 28px; font-size: 16.5px; }
.btn-sm { padding: 9px 16px; font-size: 13.5px; }
.btn-block { width: 100%; }

/* ---------- chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px;
  font-weight: 600; font-size: 13.5px; border: 1.5px solid var(--line); color: var(--ink-2);
  background: var(--paper-2); transition: all .14s; cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }

.cat-tag {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 11.5px;
  letter-spacing: .04em; text-transform: uppercase; padding: 5px 11px; border-radius: 999px;
}
.pill {
  display:inline-flex; align-items:center; gap:6px; font-weight:700; font-size:12.5px;
  padding: 5px 11px; border-radius: 999px; background: var(--paper-3); color: var(--ink-2);
}
.pill.free { background: color-mix(in oklab, var(--accent) 16%, var(--paper-2)); color: var(--accent-ink); }
[data-theme="dark"] .pill.free { color: color-mix(in oklab, var(--accent) 75%, white); }

/* ---------- poster art (placeholder) ---------- */
.poster { position: relative; overflow: hidden; border-radius: var(--r-card); background: #222; isolation: isolate; }
.poster .pg { position: absolute; inset: 0; }
.poster .pgrain { position:absolute; inset:0; opacity:.10; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.poster .pglyph { position: absolute; font-family: var(--font-display); font-weight: 800; color: rgba(255,255,255,.13);
  line-height: .8; letter-spacing: -.04em; right: -.06em; bottom: -.12em; user-select: none; }
.poster .pmeta { position: absolute; left: 16px; top: 14px; right: 16px; display:flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.poster .pcity { color: rgba(255,255,255,.92); font-weight: 700; font-size: 13px; letter-spacing: .02em; text-shadow: 0 1px 8px rgba(0,0,0,.4); }
.poster .parc { position:absolute; border: 2px solid rgba(255,255,255,.16); border-radius: 50%; }

.datechip {
  background: var(--paper-2); color: var(--ink); border-radius: 11px; padding: 6px 9px 7px;
  text-align: center; line-height: 1; box-shadow: var(--shadow-sm); min-width: 50px;
}
.datechip .dc-m { font-weight: 800; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); }
[data-theme="dark"] .datechip .dc-m { color: color-mix(in oklab, var(--accent) 72%, white); }
.datechip .dc-d { font-family: var(--font-display); font-weight: 800; font-size: 22px; margin-top: 3px; }

/* ---------- event cards ---------- */
.ecard {
  background: var(--paper-2); border: 1px solid var(--line-2); border-radius: var(--r-card);
  overflow: hidden; transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .18s, border-color .18s;
  display: flex; flex-direction: column; box-shadow: var(--shadow-sm); cursor: pointer; height: 100%;
}
.ecard:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line); }
.ecard .poster { border-radius: 0; }
.ecard-body { padding: 16px 16px 17px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.ecard-title { font-family: var(--font-display); font-weight: 700; font-size: 19px; line-height: 1.08; letter-spacing: -.02em; }
.ecard-meta { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13.5px; font-weight: 500; }
.ecard-meta svg { flex: none; color: var(--ink-3); }
.ecard-foot { margin-top: auto; padding-top: 12px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line-2); }
.ecard-going { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }

/* list row variant */
.erow {
  display: grid; grid-template-columns: 132px 1fr auto; gap: 18px; align-items: center;
  background: var(--paper-2); border: 1px solid var(--line-2); border-radius: var(--r-card);
  padding: 13px; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s; cursor: pointer;
}
.erow:hover { transform: translateX(3px); box-shadow: var(--shadow-md); border-color: var(--line); }
.erow .poster { height: 96px; border-radius: 11px; }
.erow-mid { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.erow-title { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -.02em; line-height: 1.04; }
.erow-right { display: flex; flex-direction: column; align-items: flex-end; gap: 9px; text-align: right; }

/* magazine hero card */
.emag {
  grid-column: 1 / -1; display: grid; grid-template-columns: 1.1fr 1fr; gap: 0;
  background: var(--paper-2); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow-md); cursor: pointer; transition: transform .18s, box-shadow .18s;
}
.emag:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.emag .poster { border-radius: 0; min-height: 320px; }
.emag-body { padding: 30px 32px; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.emag-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(28px, 3vw, 40px); line-height: 1; letter-spacing: -.03em; }

/* ---------- inputs ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.field label .req { color: var(--accent-2); }
.input, .select, .textarea {
  font-family: inherit; font-size: 15px; color: var(--ink); background: var(--paper-2);
  border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; width: 100%;
  transition: border-color .14s, box-shadow .14s; -webkit-appearance: none;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent); }
.input.err, .select.err, .textarea.err { border-color: var(--accent-2); }
.textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.field-err { color: var(--accent-2); font-size: 12.5px; font-weight: 600; }
.field-hint { color: var(--ink-3); font-size: 12.5px; }

.searchbar { display: flex; align-items: center; gap: 10px; background: var(--paper-2); border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 18px; box-shadow: var(--shadow-sm); }
.searchbar input { border: none; background: transparent; outline: none; font-family: inherit; font-size: 15.5px; color: var(--ink); flex: 1; min-width: 0; }
.searchbar input::placeholder { color: var(--ink-3); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--paper); padding: 13px 20px; border-radius: 999px;
  font-weight: 600; font-size: 14.5px; box-shadow: var(--shadow-lg); z-index: 90;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; display: flex; align-items: center; gap: 10px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .ok { color: color-mix(in oklab, var(--accent) 70%, white); }

/* ---------- section headers ---------- */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.sec-head h2 { font-size: clamp(26px, 3.2vw, 40px); }
.sec-head p { color: var(--ink-2); margin: 6px 0 0; font-size: 15.5px; max-width: 46ch; }

/* ---------- entrance (resting state must be visible even if the
   animation clock never ticks in a given preview context) ---------- */
.rise { opacity: 1; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes marq { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .wrap { padding: 0 18px; }
  .nav-links { display: none; }
  .erow { grid-template-columns: 96px 1fr; }
  .erow-right { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; text-align: left; border-top: 1px solid var(--line-2); padding-top: 11px; }
  .emag { grid-template-columns: 1fr; }
  .emag .poster { min-height: 200px; }
}
