/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  position: relative;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

/* ── Footer ───────────────────────────────────────────────────── */
#page-footer {
  position: absolute;
  left: 0; right: 0;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  pointer-events: auto;
  user-select: none;
}
#page-footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s;
}
#page-footer a:hover { color: var(--text); }
/* Icône Instagram seule (Mélanie 2026-08-05) : alignement vertical dans la rangée */
#page-footer .footer-insta { display: inline-flex; align-items: center; }

/* ── Header ───────────────────────────────────────────────────── */
#header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 96px;
  display: flex;
  flex-direction: column;
  /* Pas de border-bottom ici : évite le 1px overflow (96px contenu = 40+56 exact) */
  /* Pas d'overflow ici : le clip horizontal est géré par clip-path JS sur #header-inner
     Laisser overflow: visible pour que les menus déroulants passent sous le header */
  z-index: 450;
  box-shadow: 0 1px 4px rgba(26,26,46,.06);
}

/* Top bar — transparente pour laisser passer la couleur du fond de page */
#header-top {
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: transparent;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 2; /* passe au-dessus de #header-inner en thème classique (sans backdrop-filter) */
}
#header-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'DM Serif Display', serif;
  font-weight: 400;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--text);
  user-select: none;
}
#header-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Bottom bar — barre de formulaire, non réductible */
#header-inner {
  flex: 0 0 56px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  min-width: max-content;
  background: var(--header-bg);
  -webkit-backdrop-filter: var(--header-backdrop);
  backdrop-filter: var(--header-backdrop);
  border-bottom: 1px solid var(--border);
}

/* Icônes dans la barre supérieure : juste l'icône, sans contour ni fond */
#header-top #btn-reset-layout,
#header-top #btn-views,
#header-top #btn-theme,
#header-top #btn-settings,
#header-top #btn-user {
  background: transparent;
  border: none;
}
#header-top #btn-reset-layout:hover,
#header-top #btn-views:hover,
#header-top #btn-theme:hover,
#header-top #btn-settings:hover,
#header-top #btn-user:hover {
  border: none;
  color: var(--text);
}

/* ── Badge notifications admin ───────────────────────────────── */
#btn-user {
  position: relative;
}
#notif-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 50px;
  background: #e03535;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  font-family: Inter, system-ui, sans-serif;
  line-height: 15px;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(224,53,53,.45);
  animation: notif-pop .2s ease-out;
}
#notif-badge[hidden] { display: none; }
@keyframes notif-pop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

#logo {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--gold);
  white-space: nowrap;
  letter-spacing: .05em;
}

#header-left { flex: 0 0 auto; }
#web-lib-burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color .15s;
}
#web-lib-burger:hover,
#web-lib-burger:active { color: var(--text); }
/* Caché sur téléphone/tablette UNIQUEMENT (pointer coarse obligatoire, comme la
   porte de mobile.js) : une fenêtre de SOURIS rétrécie sous 768 px gardait le
   burger caché sans burger mobile de remplacement = bibliothèque inaccessible
   (bug Mélanie 2026-08-03 ; l'ancien « max-width: 768px » seul suffisait à cacher). */
@media (max-width: 768px) and (pointer: coarse), (hover: none) and (pointer: coarse) { #web-lib-burger { display: none; } }
#header-center { flex: 1; }
#header-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Profile combo (in header, between logo and form) ─────────── */
#profile-combo-wrap {
  position: relative;
  flex-shrink: 0;
}

#p-search {
  width: 170px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0 28px 0 14px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b6880' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center;
  outline: none;
  cursor: pointer;
  transition: border-color .15s;
}
#p-search:focus { border-color: var(--indigo); cursor: text; }
#p-search::placeholder { color: var(--text); opacity: 0.75; }

/* ── Geocode suggestion list ──────────────────────────────── */
#geocode-wrap {
  position: relative;
  display: inline-flex;
}
#geocode-suggest-list, .pf-geo-suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 280px;
  max-width: 380px;
  background: var(--surface);
  -webkit-backdrop-filter: var(--surface-backdrop);
  backdrop-filter: var(--surface-backdrop);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(26,26,46,.14);
  z-index: 400;
  padding: 4px 0;
  overflow: hidden;
}
#geocode-suggest-list[hidden], .pf-geo-suggest[hidden] { display: none; }
.geocode-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 12px;
  cursor: pointer;
  transition: background .1s;
}
.geocode-item:hover { background: var(--hover-bg); }
.geocode-item-active {
  background: var(--indigo-l);
  border-left: 3px solid var(--indigo);
  padding-left: 9px;
}
.geocode-item-active .geocode-item-name { color: var(--indigo); }
.geocode-item-name    { font-size: 12px; font-weight: 600; color: var(--text); }
.geocode-item-country { font-size: 11px; font-weight: 500; color: var(--indigo); margin-top: 1px; }
.geocode-item-detail  { font-size: 10px; color: var(--text-muted); }

#profile-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  /* Largeur FIXE, identique pour les quatre onglets (demande Mélanie
     2026-08-17) : sans elle, le menu s'étire sur la ligne la plus large
     de l'onglet affiché (~700 px sur Célébrités, 290 px sur Mes thèmes). */
  width: min(700px, calc(100vw - 40px));
  max-height: 340px;
  overflow-y: auto;
  background: var(--surface);
  -webkit-backdrop-filter: var(--surface-backdrop);
  backdrop-filter: var(--surface-backdrop);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(26,26,46,.14);
  z-index: 200;
  padding: 4px 0;
}
#profile-dropdown[hidden] { display: none; }

.profile-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background .1s;
  border-bottom: 1px solid var(--border);
}
.profile-item:last-child { border-bottom: none; }
.profile-item:hover { background: var(--hover-bg); }

/* Profil principal (étoilé) */
.profile-item-starred {
  background: color-mix(in srgb, var(--indigo) 6%, transparent);
}
.profile-item-starred:hover {
  background: color-mix(in srgb, var(--indigo) 11%, transparent);
}

/* Bloc info — colonne nom + signe zodiacal */
.profile-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.profile-item-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.profile-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Badge MOI */
.profile-badge-moi {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .05em;
  padding: 1px 7px;
  border-radius: 50px;
  background: color-mix(in srgb, var(--indigo) 14%, transparent);
  color: var(--indigo);
  flex-shrink: 0;
  line-height: 1.7;
}

/* Ligne signe zodiacal */
.profile-item-zodiac {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--text-muted);
}
.profile-zodiac-chip {
  font-size: 11px;
  font-family: "Astronomicon","Varela Round","Cormorant Garamond","EB Garamond","Segoe UI Symbol","Apple Symbols","DejaVu Sans",serif;
  flex-shrink: 0;
}

.profile-item-sub {
  font-size: 10.5px;
  font-family: Inter, system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.profile-star {
  width: 20px; height: 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
  transition: color .12s, transform .12s;
}
.profile-star:hover        { color: #e8a020; transform: scale(1.25); }
.profile-star-active       { color: #e8a020; }
.profile-star-active:hover { color: #c07810; transform: scale(1.15); }

.profile-heart {
  width: 20px; height: 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
  transition: color .12s, transform .12s;
}
.profile-heart:hover        { color: #e05c7a; transform: scale(1.25); }
.profile-heart-active       { color: #e05c7a; }
.profile-heart-active:hover { color: #c0405e; transform: scale(1.15); }

.profile-delete {
  width: 18px; height: 18px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  pointer-events: none;
  transition: color .1s, background .1s, opacity .15s;
  line-height: 1;
}
.profile-item:hover .profile-delete { opacity: 1; pointer-events: auto; }
.profile-delete:hover { color: #c94b4b; background: #fdecea; }

.profile-empty {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* ── Poignée de redimensionnement du menu (coin bas droit) ────── */
.profile-resize-grip {
  position: sticky;       /* reste au coin visible pendant le défilement */
  bottom: -4px;           /* compense le padding-bas du menu */
  height: 16px;
  margin-top: -16px;      /* ne prend pas de place : recouvre le coin */
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  pointer-events: none;   /* seul le coin est actif */
  z-index: 3;
}
.profile-resize-coin {
  pointer-events: auto;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  touch-action: none;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  background: repeating-linear-gradient(-45deg, var(--text-muted) 0 1.5px, transparent 1.5px 5px);
  border-bottom-right-radius: 10px;
  opacity: .4;
  transition: opacity .15s;
}
.profile-resize-coin:hover { opacity: .85; }

/* ── Onglets Mes thèmes / Célébrités / Nations / Événements ──── */
.profile-tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 4px 6px 0;
  gap: 2px;
  /* Barre FIXE pendant le défilement de la liste (demande Mélanie
     2026-08-17) ; top négatif = compense le padding-top 4px du menu,
     background hérité = celui du menu, thèmes compris (st-06). */
  position: sticky;
  top: -4px;
  z-index: 2;
  background: inherit;
  /* Thèmes translucides : sans ce flou, la liste transparaît sous la barre. */
  -webkit-backdrop-filter: var(--surface-backdrop);
  backdrop-filter: var(--surface-backdrop);
}
.profile-tab-btn {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 5px 8px 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  white-space: nowrap; /* libellés toujours sur une ligne */
  transition: color .15s, border-color .15s;
}
.profile-tab-btn:hover { color: var(--text); }
.profile-tab-active {
  color: var(--indigo) !important;
  border-bottom-color: var(--indigo);
}

/* ── Entête catégorie (onglet Public) ─────────────────────────── */
.profile-category-hdr {
  padding: 6px 12px 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ── Item public ──────────────────────────────────────────────── */
.profile-item-public {
  gap: 6px;
  cursor: pointer;
}
.profile-item-public:hover { background: var(--hover-bg); }
/* Avec la largeur fixe du menu, la sous-ligne (date · tags) des items
   publics peut se tronquer au lieu de déborder ; celle de Mes thèmes
   (date seule) garde son flex-shrink: 0. */
.profile-item-public .profile-item-sub {
  flex-shrink: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Cœur favori sur items publics */
.pub-fav-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0 2px;
  font-size: 12px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity .15s, color .15s, transform .15s;
}
.pub-fav-btn:hover { opacity: 1; color: #e05c7a; transform: scale(1.2); }
.pub-fav-btn.profile-heart-active { opacity: 1; color: #e05c7a; }

/* Badge Rodden Rating */
.rodden-badge {
  flex-shrink: 0;
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid currentColor;
  opacity: 0.85;
  cursor: default;
}

