/* ==========================================================================
   theHunter — Carnet de chasse
   Direction artistique : carnet de terrain de naturaliste / carte topo.
   Palette bois, mousse, cuir, laiton sur fond parchemin.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg:            #F4F0E4;
  --bg-paper:      #FBF8F0;
  --ink:           #2A2620;
  --ink-soft:      #5B5548;
  --forest:        #1E2B20;
  --forest-light:  #2E4030;
  --moss:          #4A5D3A;
  --leather:       #8B5E34;
  --leather-dark:  #6E4A29;
  --brass:         #C9A227;
  --rust:          #A23E24;
  --diamond:       #3E7C93;
  --line:          rgba(42, 38, 32, 0.14);
  --line-strong:   rgba(42, 38, 32, 0.28);
  --shadow:        0 2px 0 rgba(42,38,32,0.08);
  --radius:        3px;
  --font-display:  'Fraunces', Georgia, serif;
  --font-body:     'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: -1px -1px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--forest);
  margin: 0 0 0.5em;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 600; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }

p { max-width: 68ch; }
a { color: var(--leather-dark); }
a:hover { color: var(--rust); }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Navbar ---------- */
.navbar {
  background: var(--forest);
  border-bottom: 3px solid var(--brass);
  color: #EFE9D8;
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: #F4F0E4;
  text-decoration: none;
}
.brand .mark {
  width: 34px; height: 34px;
  border: 2px solid var(--brass);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  color: var(--brass);
}
.nav-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav-links a {
  color: #D8D2BE;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-links a:hover, .nav-links a.active { color: #fff; background: rgba(255,255,255,0.08); }
.nav-links .btn { margin-left: 6px; }
.nav-toggle {
  display: none;
  background: none; border: 1px solid rgba(255,255,255,0.25); color: #EFE9D8;
  border-radius: var(--radius); width: 38px; height: 34px; font-size: 1.1rem; cursor: pointer;
}
.nav-dropdown { position: relative; }
.nav-dropdown summary {
  list-style: none; cursor: pointer;
  color: #D8D2BE; padding: 8px 12px; border-radius: var(--radius); font-size: 0.92rem; font-weight: 500;
}
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary:hover, .nav-dropdown summary.active { color: #fff; background: rgba(255,255,255,0.08); }
.nav-dropdown .dropdown-menu {
  position: absolute; right: 0; top: 100%; margin-top: 6px;
  background: var(--bg-paper); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: 0 6px 16px rgba(0,0,0,0.18); min-width: 200px; padding: 6px; z-index: 30;
}
.nav-dropdown .dropdown-menu a {
  display: block; padding: 9px 12px; color: var(--ink); text-decoration: none; font-size: 0.9rem; border-radius: 4px;
}
.nav-dropdown .dropdown-menu a:hover { background: rgba(139,94,52,0.08); }
.dropdown-sep { border: none; border-top: 1px solid var(--line); margin: 6px 4px; }
/* Ferme le menu quand on clique ailleurs, via le focus natif de <details> + un clic extérieur */
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    padding-top: 10px;
  }
  .nav-links.open { display: flex; }
  .nav-dropdown .dropdown-menu { position: static; box-shadow: none; margin-top: 4px; }
  .navbar .container { flex-wrap: wrap; }
}
.lang-switch {
  margin-left: 6px;
  background: rgba(255,255,255,0.08);
  color: #EFE9D8;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius);
  padding: 6px 8px;
  font-size: 0.82rem;
}
.lang-switch option { color: var(--ink); }
.user-search-wrap { position: relative; }
.user-search-results {
  display: none;
  position: absolute;
  z-index: 20;
  top: 100%; left: 0; right: 0;
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(42,38,32,0.12);
  max-height: 220px;
  overflow-y: auto;
}
.user-search-item { padding: 9px 12px; font-size: 0.9rem; cursor: pointer; }
.user-search-item:hover, .user-search-item.active { background: rgba(139,94,52,0.08); }
.user-chip { display: inline-flex; align-items: center; gap: 4px; }
.user-chip-remove {
  border: none; background: none; cursor: pointer;
  color: var(--ink-soft); font-size: 1rem; line-height: 1; padding: 0 0 0 2px;
}
.user-chip-remove:hover { color: var(--rust); }

.msg-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--rust);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  transition: transform 0.06s ease, background-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--leather); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--leather-dark); color: #fff; }
.btn-brass { background: var(--brass); color: var(--forest); box-shadow: var(--shadow); }
.btn-brass:hover { background: #b8931f; color: var(--forest); }
.btn-outline { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--leather); color: var(--leather-dark); }
.btn-danger { background: transparent; border-color: var(--rust); color: var(--rust); }
.btn-danger:hover { background: var(--rust); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-ghost-light { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.25); }
.btn-ghost-light:hover { background: rgba(255,255,255,0.16); color: #fff; }

/* ---------- Cards / Panels ---------- */
.panel {
  background: var(--bg-paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 28px;
}
.card {
  background: var(--bg-paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card-body { padding: 18px 20px; }
.card-photo {
  aspect-ratio: 4/3;
  background: var(--forest-light) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.35);
  font-family: var(--font-display);
  font-size: 0.85rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* ---------- Badges (tags "tampon") ---------- */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 3px 9px;
  border-radius: 2px;
  border: 1px solid currentColor;
  line-height: 1.6;
}
.badge-pc { color: var(--moss); }
.badge-xbox { color: #3E7C93; }
.badge-ps { color: var(--leather-dark); }
.badge-normal { color: var(--ink-soft); }
.badge-rare { color: var(--diamond); }
.badge-diamond { color: #2E6FA0; background: rgba(62,124,147,0.08); }
.badge-greatone { color: var(--brass); background: rgba(201,162,39,0.12); }
.badge-male { color: var(--moss); }
.badge-female { color: var(--rust); }
.badge-public { color: var(--brass); }
.badge-private { color: var(--ink-soft); }

/* ---------- Forms ---------- */
label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 5px;
}
.field { margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=file], select, textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brass);
  outline-offset: 1px;
  border-color: var(--brass);
}
textarea { resize: vertical; min-height: 90px; }
.help-text { font-size: 0.8rem; color: var(--ink-soft); margin-top: 4px; }
fieldset { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 16px; margin: 0 0 18px; min-width: 0; }
legend { font-family: var(--font-display); padding: 0 8px; color: var(--forest); }
.radio-group { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-pill {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.88rem;
}
.radio-pill input { width: auto; }
.radio-pill:has(input:checked) { border-color: var(--leather); background: rgba(139,94,52,0.08); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
th { color: var(--ink-soft); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr:hover td { background: rgba(139,94,52,0.04); }

/* ---------- Alerts / flash ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 0.9rem; border: 1px solid; }
.alert-success { background: rgba(74,93,58,0.08); border-color: var(--moss); color: var(--moss); }
.alert-error   { background: rgba(162,62,36,0.08); border-color: var(--rust); color: var(--rust); }
.alert-info    { background: rgba(62,124,147,0.08); border-color: var(--diamond); color: var(--diamond); }

/* ---------- Hero ---------- */
.hero {
  background: var(--forest);
  color: #F4F0E4;
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid var(--brass);
}
.hero .container { padding-top: 72px; padding-bottom: 72px; position: relative; z-index: 1; }
.hero-eyebrow { color: var(--brass); font-weight: 600; font-size: 0.85rem; margin-bottom: 14px; }
.hero h1 { color: #fff; max-width: 16ch; }
.hero p { color: #C9C3AE; font-size: 1.08rem; max-width: 52ch; }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.contour {
  position: absolute; inset: 0; opacity: 0.12; pointer-events: none;
}

/* ---------- Stats ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 16px; margin: 24px 0; }
.stat {
  background: var(--bg-paper);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--leather);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat .num { font-family: var(--font-display); font-size: 1.9rem; color: var(--forest); display: block; }
.stat .label { font-size: 0.78rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- Map picker ---------- */
.map-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: auto;
  max-height: 520px;
  background: var(--forest-light);
  cursor: crosshair;
  user-select: none;
}
.map-wrap img { display: block; width: 100%; height: auto; transition: width 0.12s ease; }
.map-inner { position: relative; display: block; width: 100%; line-height: 0; }
.map-toolbar {
  display: flex; gap: 6px; margin-bottom: 8px;
}
.map-toolbar button {
  width: 34px; height: 34px;
  border: 1px solid var(--line-strong);
  background: var(--bg-paper);
  color: var(--ink);
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.map-toolbar button:hover { border-color: var(--leather); color: var(--leather-dark); }
.map-toolbar .zoom-level { align-self: center; font-size: 0.8rem; color: var(--ink-soft); margin-left: 4px; }
.map-pin {
  position: absolute;
  width: 20px; height: 20px;
  margin-left: -10px; margin-top: -20px;
  transform-origin: bottom center;
  pointer-events: none;
}
.map-empty {
  aspect-ratio: 16/10;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
  text-align: center;
  padding: 20px;
}
.coord-readout {
  display: flex; gap: 18px; margin-top: 10px;
  font-family: var(--font-body); font-size: 0.85rem; color: var(--ink-soft);
}
.coord-readout strong { color: var(--ink); }

/* ---------- Page header ---------- */
.page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  flex-wrap: wrap; gap: 16px; margin-bottom: 28px;
}
.page-head .eyebrow { color: var(--leather); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: auto;
  background: var(--forest);
  color: #9A947F;
  border-top: 3px solid var(--brass);
  padding: 28px 0;
  font-size: 0.85rem;
}
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

main { flex: 1; padding: 40px 0 60px; }

/* ---------- Filters bar ---------- */
.filters {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
  background: var(--bg-paper); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 16px; margin-bottom: 24px;
}
.filters .field { margin-bottom: 0; min-width: 160px; }

/* ---------- Utility ---------- */
.muted { color: var(--ink-soft); }
.mt-0 { margin-top: 0; }
.text-center { text-align: center; }
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--ink-soft);
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
}
.divider { border: none; border-top: 1px solid var(--line); margin: 28px 0; }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.auth-wrap { max-width: 420px; margin: 20px auto; }
.two-col { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 32px; align-items: start; }
.two-col > * { min-width: 0; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
