/* ============================================================
   OTHERWRLD — global.css
   Cadre neutre : la couleur vient des photos.
   Turquoise = interactif.  Doré = payé/statut.  Rien d'autre.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://api.fontshare.com/v2/css?f[]=clash-display@500,600&display=swap');

:root {
  /* ── Turquoise : seul accent interactif ── */
  --teal:        #3EC9B6;
  --teal-deep:   #1E8577;
  --teal-glow:   #7FE8D8;
  --teal-ghost:  rgba(62, 201, 182, 0.12);

  /* ── Doré : un métal, pas une couleur. Réservé au statut payant. ── */
  --gold-dark:   #7A5A28;
  --gold:        #C8A25B;
  --gold-lit:    #F2E0B0;
  --gold-metal:  linear-gradient(100deg,
                   var(--gold-dark) 0%,
                   var(--gold)      28%,
                   var(--gold-lit)  45%,
                   var(--gold)      62%,
                   var(--gold-dark) 100%);

  --r-sm: 6px;
  --r:    10px;
  --r-lg: 16px;

  --shadow:    0 2px 12px rgba(0,0,0,0.40);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.55);

  --nav-h: 58px;
}

/* ── DARK (défaut) ─────────────────────────────────────── */
:root,
[data-theme="dark"] {
  --bg:           #080C0E;
  --bg-grad:      radial-gradient(120% 80% at 50% 0%, #0D1418 0%, #080C0E 60%);
  --surface:      #0F1519;
  --surface-2:    #141C21;
  --surface-lift: linear-gradient(180deg, #141C21 0%, #0F1519 100%);
  --edge:         #1E282E;
  --edge-soft:    #172025;

  --text:         #E9EFF0;
  --text-dim:     #8C9AA1;
  --text-faint:   #5A676E;

  --chrome:       rgba(8, 12, 14, 0.82);
}

/* ── LIGHT ─────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:           #EEF1F1;
  --bg-grad:      radial-gradient(120% 80% at 50% 0%, #F8FAFA 0%, #EEF1F1 60%);
  --surface:      #FFFFFF;
  --surface-2:    #F6F8F8;
  --surface-lift: linear-gradient(180deg, #FFFFFF 0%, #F6F8F8 100%);
  --edge:         #DCE3E3;
  --edge-soft:    #E7ECEC;

  --text:         #0D1518;
  --text-dim:     #5D6B71;
  --text-faint:   #8C9AA1;

  --teal:         #17998A;
  --teal-deep:    #0F6E62;
  --teal-glow:    #0B5750;
  --teal-ghost:   rgba(23, 153, 138, 0.10);

  --chrome:       rgba(238, 241, 241, 0.85);
  --shadow:       0 2px 12px rgba(13, 21, 24, 0.08);
  --shadow-lg:    0 8px 40px rgba(13, 21, 24, 0.14);
}

/* ── RESET ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

/* ── TYPE ──────────────────────────────────────────────── */
h1, h2, h3 {
  font-family: 'Clash Display', 'Inter', sans-serif;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h1 { font-size: 30px; }
h2 { font-size: 21px; }
h3 { font-size: 16px; }

.wordmark {
  font-family: 'Clash Display', sans-serif;
  font-weight: 500;
  font-size: 17px;
  letter-spacing: 0.24em;
  color: var(--text);
  white-space: nowrap;
}

.eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.num { font-variant-numeric: tabular-nums; }

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-glow); }

/* ── FOCUS ─────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
:focus:not(:focus-visible) { outline: none; }

/* ── BOUTONS ───────────────────────────────────────────── */
.btn {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: var(--r);
  cursor: pointer;
  white-space: nowrap;
  transition: filter .16s ease, border-color .16s ease, color .16s ease;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background-image: linear-gradient(168deg, var(--teal) 0%, var(--teal-deep) 100%);
  color: #04120F;
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.10); }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--edge);
}
.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--teal-deep);
}

.btn-quiet {
  background: var(--surface-2);
  color: var(--text-dim);
}
.btn-quiet:hover:not(:disabled) { color: var(--text); }

/* ── LE MÉTAL : la signature ───────────────────────────────
   Tout ce qui a été payé capte la lumière.
   Rare sur la page, donc ça ne fait pas de bruit — ça signale. */
@keyframes sheen {
  0%, 100% { background-position:   0% 50%; }
  50%      { background-position: 100% 50%; }
}

.btn-gold {
  background-image: var(--gold-metal);
  background-size: 220% 100%;
  color: #211605;
  font-weight: 600;
  animation: sheen 7s ease-in-out infinite;
}
.btn-gold:hover:not(:disabled) { filter: brightness(1.08); }

.gold-text {
  background-image: var(--gold-metal);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 600;
  animation: sheen 7s ease-in-out infinite;
}

.gold-edge {
  border: 1px solid transparent;
  background-image: var(--surface-lift), var(--gold-metal);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  background-size: auto, 220% 100%;
  animation: sheen 9s ease-in-out infinite;
}

.chip-gold {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background-image: var(--gold-metal);
  background-size: 220% 100%;
  color: #211605;
  animation: sheen 7s ease-in-out infinite;
}

/* ── CHIPS NEUTRES (tags contenu — jamais dorés) ───────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  background: var(--surface);
}
.chip-teal {
  border-color: var(--teal-deep);
  color: var(--teal);
  background: var(--teal-ghost);
}

/* ── SURFACES ──────────────────────────────────────────── */
.card {
  background-image: var(--surface-lift);
  border: 1px solid var(--edge);
  border-radius: var(--r-lg);
  overflow: hidden;
}

/* ── CHAMPS ────────────────────────────────────────────── */
input, textarea, select {
  font: inherit;
  font-size: 14px;
  width: 100%;
  padding: 10px 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--r);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--teal-deep);
  box-shadow: 0 0 0 3px var(--teal-ghost);
}

label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 6px;
}

/* ── NAVBAR ────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  background: var(--chrome);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--edge-soft);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}
.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
}
.nav-links a:hover { color: var(--text); }

/* ── MASONRY ───────────────────────────────────────────── */
.masonry {
  column-count: 4;
  column-gap: 12px;
  padding: 12px;
}
@media (max-width: 1280px) { .masonry { column-count: 3; } }
@media (max-width: 860px)  { .masonry { column-count: 2; } }
@media (max-width: 520px)  { .masonry { column-count: 1; padding: 10px; } }

.masonry > * {
  break-inside: avoid;
  margin-bottom: 12px;
}

/* ── VIGNETTE PHOTO ────────────────────────────────────── */
.tile {
  display: block;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--edge-soft);
  transition: border-color .18s ease, transform .18s ease;
}
.tile:hover {
  border-color: var(--teal-deep);
  transform: translateY(-2px);
}
.tile img { width: 100%; }

.tile-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px 10px;
}
.tile-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile-author {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 1px;
}
.tile-votes {
  font-size: 12px;
  color: var(--text-faint);
  flex-shrink: 0;
  padding-top: 1px;
}

/* ── ÉTATS ─────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 72px 20px;
  color: var(--text-dim);
}
.empty h3 { color: var(--text); margin-bottom: 6px; }

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-faint);
  font-size: 13px;
}

.error {
  padding: 11px 14px;
  border-radius: var(--r);
  font-size: 13px;
  color: #F2B8B8;
  background: rgba(180, 60, 60, 0.10);
  border: 1px solid rgba(180, 60, 60, 0.30);
}

/* ── MOTION ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
