/* ============================================================
   Domivae — Chrome public (nav + footer) PARTAGÉ.
   Reprend à l'identique la barre/footer de l'accueil (site.css) mais
   SCOPÉ sous .pubchrome → cohabite avec app.css sans collision
   (.btn/.hero/.section d'app.css ne sont jamais touchés).
   Utilisé par layouts/public.php (annonces, contact, faq, légales…).
   Fonts Quicksand/Urbanist déjà importées par app.css.
   ============================================================ */
.pubchrome {
  --color-navy: #011D2D;
  --color-teal: #007E85;
  --color-coral: #F5945D;
  --border-subtle: #EAEAEA;
  --border-default: #D6D6D6;
  --fg-1: #1E1E1E;
  --font-display: 'Quicksand', 'Trebuchet MS', system-ui, sans-serif;
  --font-body: 'Urbanist', 'Helvetica Neue', system-ui, sans-serif;
  --radius-sm: 10px;
  --radius-md: 14px;
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --ease-standard: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ============ NAV ============ */
/* La barre colle en haut PENDANT tout le scroll : le sticky doit porter sur le
   wrapper (enfant direct de <body>), pas sur .nav — .pubchrome ne fait que la
   hauteur de la nav, donc un sticky posé dessus n'a aucune course et disparaît
   au premier scroll. */
.pubchrome-nav { position: sticky; top: 0; z-index: 60; }
.pubchrome .nav {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 40px; border-bottom: 1px solid var(--border-subtle);
  background: rgba(251,251,251,0.9); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  transition: padding var(--dur-base) var(--ease-standard), box-shadow var(--dur-base) var(--ease-standard);
}
/* État condensé une fois la page défilée (classe posée par site-chrome.js) */
.pubchrome-nav.is-scrolled .nav { padding-top: 8px; padding-bottom: 8px; box-shadow: 0 6px 20px rgba(1,29,45,0.07); }
.pubchrome-nav.is-scrolled .nav .brand img { width: 28px; height: 28px; }

/* Jauge de progression de lecture, collée sous la barre */
.pubchrome-nav .nav-progress { height: 3px; background: transparent; }
.pubchrome-nav .nav-progress i { display: block; height: 100%; width: 0; background: var(--color-teal); transition: width 90ms linear; }

/* Repère de section courante — visible seulement quand les liens sont repliés */
.pubchrome .nav-section { display: none; }

/* Retour en haut — dans la zone du pouce, sous le bouton de signalement éventuel */
.pubchrome.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 55;
  width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%; cursor: pointer;
  background: var(--color-navy); color: #fff;
  box-shadow: 0 8px 22px rgba(1,29,45,0.28);
  opacity: 0; transform: translateY(8px);
  transition: opacity var(--dur-base) var(--ease-standard), transform var(--dur-base) var(--ease-standard), background var(--dur-fast);
}
.pubchrome.to-top.is-visible { opacity: 1; transform: none; }
.pubchrome.to-top[hidden] { display: none; }
.pubchrome.to-top:hover { background: var(--color-teal); }

/* La barre restant visible en permanence, les ancres doivent s'arrêter SOUS elle
   (sinon le titre de section se retrouve caché derrière). */
html:has(.pubchrome-nav) { scroll-padding-top: 92px; }

/* Burger — masqué au-dessus de 900px (les liens sont visibles en ligne) */
.pubchrome .nav-burger { display: none; }
.pubchrome .nav .links a.only-mobile { display: none; }
.pubchrome .nav .brand { display: flex; align-items: center; gap: 11px; }
.pubchrome .nav .brand img { width: 34px; height: 34px; }
.pubchrome .nav .brand .word { font-family: var(--font-display); font-weight: 700; font-size: 23px; color: var(--color-navy); letter-spacing: -0.4px; }
.pubchrome .nav .links { display: flex; align-items: center; gap: 4px; margin-left: 30px; }
.pubchrome .nav .links a { font-size: 14.5px; font-weight: 500; color: var(--fg-1); padding: 8px 12px; border-radius: var(--radius-sm); transition: color var(--dur-fast) var(--ease-standard), background var(--dur-fast) var(--ease-standard); text-decoration: none; }
.pubchrome .nav .links a:hover { color: var(--color-teal); background: rgba(0,126,133,0.07); }
.pubchrome .nav .links a.active { color: var(--color-teal); background: rgba(0,126,133,0.10); }
.pubchrome .nav .spacer { flex: 1; }
.pubchrome .nav .link-login { font-size: 14.5px; font-weight: 600; color: var(--color-navy); padding: 10px 10px; text-decoration: none; }
.pubchrome .nav .link-login:hover { color: var(--color-teal); }

/* Boutons du chrome (scopés — ne touchent pas les .btn d'app.css) */
.pubchrome .btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: none; cursor: pointer; font-family: var(--font-body); font-weight: 600; border-radius: var(--radius-md); transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-standard); white-space: nowrap; text-decoration: none; }
.pubchrome .btn .lu { width: 18px; height: 18px; stroke-width: 2; }
.pubchrome .btn:active { transform: scale(0.98); }
.pubchrome .btn-primary { padding: 12px 24px; font-size: 15px; background: var(--color-teal); color: #fff; box-shadow: 0 6px 16px rgba(0,126,133,0.22); }
.pubchrome .btn-primary:hover { background: #00696f; }

/* ============ FOOTER ============ */
.pubchrome .foot { background: var(--color-navy); color: rgba(255,255,255,0.7); padding: 64px 40px 40px; }
.pubchrome .foot .wrap { max-width: 1180px; margin: 0 auto; }
.pubchrome .foot .cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; }
.pubchrome .foot .brand { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.pubchrome .foot .brand img { width: 32px; height: 32px; }
.pubchrome .foot .brand .word { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: #fff; }
.pubchrome .foot .tagline { font-size: 15px; line-height: 1.6; max-width: 34ch; color: rgba(255,255,255,0.6); }
.pubchrome .foot h5 { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: #fff; margin: 0 0 16px; letter-spacing: 0.02em; }
.pubchrome .foot ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 11px; }
.pubchrome .foot ul a { font-size: 14.5px; color: rgba(255,255,255,0.68); transition: color var(--dur-fast); text-decoration: none; }
.pubchrome .foot ul a:hover { color: var(--color-coral); }
.pubchrome .foot .base { margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.12); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 13px; color: rgba(255,255,255,0.5); }
.pubchrome .foot .base .rgpd { display: inline-flex; align-items: center; gap: 7px; }
.pubchrome .foot .base .rgpd .lu { width: 15px; height: 15px; color: var(--color-teal); }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  /* Les liens passent dans un panneau déroulant ouvert par le burger —
     ne JAMAIS les masquer sans point d'entrée (sinon plus aucune navigation). */
  .pubchrome .nav { flex-wrap: wrap; }
  .pubchrome .nav-burger {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 42px; height: 42px; padding: 0 10px; margin-left: auto;
    background: none; border: 1px solid var(--border-default); border-radius: var(--radius-sm);
    cursor: pointer; order: 2;
  }
  .pubchrome .nav-burger span { display: block; height: 2px; background: var(--color-navy); border-radius: 2px; transition: transform var(--dur-base) var(--ease-standard), opacity var(--dur-fast); }
  .pubchrome .nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .pubchrome .nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .pubchrome .nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .pubchrome .nav .spacer { display: none; }
  .pubchrome .nav .links {
    order: 4; flex-basis: 100%; flex-direction: column; align-items: stretch;
    margin-left: 0; gap: 2px;
    max-height: 0; overflow: hidden; visibility: hidden;
    transition: max-height var(--dur-base) var(--ease-standard), visibility 0s linear var(--dur-base);
  }
  .pubchrome .nav .links.is-open {
    max-height: 70vh; overflow-y: auto; visibility: visible;
    padding: 8px 0 4px; margin-top: 8px; border-top: 1px solid var(--border-subtle);
    transition: max-height var(--dur-base) var(--ease-standard), visibility 0s;
  }
  /* Nom de la section lue, à côté de la marque : on sait où on est sans ouvrir le menu */
  .pubchrome .nav-section {
    display: block; order: 1; min-width: 0; margin-left: 10px; padding-left: 10px;
    border-left: 1px solid var(--border-default);
    font-size: 13.5px; font-weight: 600; color: var(--color-teal);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .pubchrome .nav-section:empty { display: none; }
  /* La marque se réduit à son logo : la place va au repère de section */
  .pubchrome .nav .brand .word { display: none; }

  .pubchrome .nav .links a { padding: 12px 8px; font-size: 16px; }
  .pubchrome .nav .links a.only-mobile { display: block; font-weight: 600; color: var(--color-navy); }
  .pubchrome .nav .link-login { display: none; }
  .pubchrome .nav .btn-primary { order: 3; padding: 10px 16px; font-size: 14px; }
  /* Pas de condensé en mobile : la barre doit rester lisible et cliquable */
  .pubchrome-nav.is-scrolled .nav { padding-top: 12px; padding-bottom: 12px; }
}
@media (max-width: 760px) {
  .pubchrome .nav { padding: 12px 18px; }
  .pubchrome .foot .cols { grid-template-columns: 1fr 1fr; gap: 32px; }
}
