/* ============================================================
   Orford-sur-le-Lac · shared theme
   Palette, base chrome, masthead, page hero, Web Awesome overrides.
   Page-specific styles live in the corresponding HTML file.
   ============================================================ */

:root {
  /* Trail palette */
  --forest:      #1f3a2e;
  --forest-deep: #0f241b;
  --moss:        #4a6b52;
  --paper:       #f4f1e8;
  --paper-warm:  #ebe6d8;
  --ochre:       #c08a2f;
  --clay:        #a4572e;
  --line:        #2a4235;
  --text:        #1a2821;
  --muted:       #5a6c64;
  --danger:      #9a3324;
  --success:     #2d6a4f;

  /* Retune Web Awesome's "brand" variant to forest green
     (applies to every <wa-button variant="brand">, focus rings, links…) */
  --wa-color-brand-fill-loud:    var(--forest);
  --wa-color-brand-fill-normal:  var(--moss);
  --wa-color-brand-fill-quiet:   #d9e4dd;
  --wa-color-brand-border-loud:  var(--forest);
  --wa-color-brand-border-normal: var(--moss);
  --wa-color-brand-border-quiet: rgba(31, 58, 46, 0.25);
  --wa-color-brand-on-loud:      var(--paper);
  --wa-color-brand-on-normal:    var(--forest-deep);
  --wa-color-brand-on-quiet:     var(--forest-deep);
  --wa-color-focus:              var(--moss);
  --wa-color-text-link:          var(--forest);
}

* { box-sizing: border-box; }

/* L'attribut hidden doit TOUJOURS gagner — sans ce garde, n'importe quelle
   classe posant un `display:` écrase silencieusement [hidden] (bug attrapé
   trois fois : dialogue de clôture, bannière d'assignation, filtre projet). */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--text);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ============================================================
   Masthead — identical top bar on every page.
   Rendered by <site-masthead> in shared/masthead.js.
   ============================================================ */
site-masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--forest-deep);
  color: var(--paper);
  position: relative;
  z-index: 10;
}
.masthead__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.masthead__mark {
  width: 28px;
  height: 28px;
  color: var(--paper);
  flex-shrink: 0;
}
.masthead__brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}
.masthead__name {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--paper);
  letter-spacing: -0.01em;
}
.masthead__sub {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(244, 241, 232, 0.6);
}
.masthead__nav {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.masthead__nav a {
  color: rgba(244, 241, 232, 0.78);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 16px;
  transition: background 0.15s, color 0.15s;
}
.masthead__nav a:hover,
.masthead__nav a:focus-visible {
  background: rgba(244, 241, 232, 0.1);
  color: var(--paper);
  outline: none;
}
.masthead__nav a[aria-current="page"] {
  background: rgba(244, 241, 232, 0.18);
  color: var(--paper);
}

/* ============================================================
   Page hero — same h1 + subtitle treatment on every page.
   ============================================================ */
.page-hero {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 20px 12px;
}
.page-hero h1 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: clamp(26px, 6vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--forest-deep);
  margin: 0;
}
.page-hero h1 em {
  font-style: italic;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  color: var(--clay);
}
.page-hero__subtitle {
  font-size: 14px;
  color: var(--muted);
  margin: 8px 0 0;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Footer — identical bottom bar on every page.
   Rendered by <site-footer> in shared/footer.js.
   Mirrors the masthead's dark palette so every page feels bookended.
   ============================================================ */
site-footer {
  display: block;
  padding: 14px 20px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  background: var(--forest-deep);
  color: rgba(244, 241, 232, 0.65);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-align: center;
  border-top: 1px solid rgba(244, 241, 232, 0.05);
  margin-top: auto; /* pin to bottom of flex-column layouts */
}
.site-footer__text { margin: 0; }
.site-footer__link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}
.site-footer__link:hover,
.site-footer__link:focus-visible {
  color: var(--paper);
  outline: none;
}

/* ============================================================
   Journal de suivi (.jr-*) — composant partagé carte + projets.
   Rendu par shared/journal.js. Tailles en `em` : la densité suit
   la taille de police du conteneur (popup compact, fiche aérée).
   L'ajout est une action SECONDAIRE : bouton petit et neutre —
   les boutons forts restent Résolu / Marquer terminé.
   ============================================================ */
.jr-entry { margin-bottom: 0.6em; line-height: 1.45; }
.jr-entry:last-child { margin-bottom: 0; }
.jr-entry__head { font-size: 0.92em; color: var(--muted); }
.jr-author { font-weight: 600; color: var(--forest-deep); }
.jr-date { cursor: help; }
.jr-entry--auto .jr-entry__text { color: var(--muted); font-style: italic; }

.jr-input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 1em;
  border: 1px solid rgba(31, 58, 46, 0.25);
  border-radius: 6px;
  padding: 0.45em 0.6em;
  background: var(--paper-warm);
  resize: vertical;
  margin-bottom: 0.6em;
}
.jr-actions {
  display: flex;
  align-items: center;
  gap: 0.7em;
  flex-wrap: nowrap;
}
.jr-add {
  flex-shrink: 0;
  font: inherit;
  font-size: 0.95em;
  font-weight: 600;
  color: var(--forest-deep);
  background: var(--paper-warm);
  border: 1px solid rgba(31, 58, 46, 0.3);
  border-radius: 999px;
  padding: 0.3em 1em;
  cursor: pointer;
  transition: background 0.12s ease;
}
.jr-add:hover { background: rgba(31, 58, 46, 0.12); }
.jr-add:disabled { opacity: 0.55; cursor: wait; }
.jr-by {
  font-size: 0.9em;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}
.jr-chip {
  font: inherit;
  font-size: 0.95em;
  font-weight: 600;
  color: var(--forest-deep);
  background: var(--paper-warm);
  border: 1px solid rgba(31, 58, 46, 0.3);
  border-radius: 999px;
  padding: 0.18em 0.8em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  max-width: 12em;
  min-width: 0;
}
.jr-chip:hover { background: rgba(31, 58, 46, 0.1); }
.jr-chip__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-chip wa-icon { font-size: 0.8em; color: var(--moss); flex-shrink: 0; }
.jr-name {
  font: inherit;
  font-size: 0.95em;
  border: 1px solid rgba(31, 58, 46, 0.3);
  border-radius: 999px;
  padding: 0.18em 0.8em;
  background: var(--paper-warm);
  min-width: 0;
  flex: 1;
  max-width: 11em;
}

/* ============================================================
   Aménagements — repères de carte (partagés comité/membre).
   Pastille ronde centrée sur le point, par opposition à la
   goutte des signalements. Types discrets (pont, pancarte) :
   plus petits et atténués. Icônes : shared/amenagements.js.
   ============================================================ */
.amen-pin {
  width: 28px; height: 28px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--forest);
  border: 2px solid var(--paper);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  color: var(--paper);
}
.amen-pin wa-icon { font-size: 13px; }
.amen-pin svg { width: 13px; height: 13px; }
.amen-pin--discret { width: 20px; height: 20px; opacity: 0.85; }
.amen-pin--discret wa-icon { font-size: 9px; }
.amen-pin--discret svg { width: 9px; height: 9px; }
/* Point en cours de création (pas encore enregistré) : ocre + halo. */
.amen-pin--new {
  background: var(--ochre);
  box-shadow: 0 0 0 4px rgba(232, 147, 39, 0.3);
}

/* ============================================================
   Web Awesome overrides — form controls + filled brand button.
   ============================================================ */
wa-input, wa-textarea, wa-select {
  --wa-form-control-background-color: var(--paper-warm);
  --wa-form-control-border-color: rgba(31, 58, 46, 0.25);
}
/* Force cream text/icon on dark-green filled brand buttons —
   the on-loud token doesn't always reach the shadow DOM reliably. */
wa-button[variant="brand"][appearance~="filled"]::part(base) {
  color: var(--paper);
}
