/* =================================================================
   POKÉMON CAPTURE — Coque immersive (shell)
   Header sticky · Navigation plein écran · Loader Pokéball ·
   Voile de transition cinématographique.
   (Le CSS critique minimal du loader/voile/barre est aussi inliné
    dans header.php pour éviter tout flash au 1er rendu.)
   ================================================================= */

/* ----------------------------------------------------------------
   1. HEADER STICKY (verre sombre)
   ---------------------------------------------------------------- */
.pc-header {
  position: fixed; inset: 0 0 auto 0; z-index: 1000;
  height: var(--pc-header-h);
  display: flex; align-items: center;
  /* on ne transitionne PAS backdrop-filter (repaint coûteux) */
  transition: background .4s var(--pc-ease), box-shadow .4s var(--pc-ease);
}
.pc-header__inner {
  width: 100%; max-width: var(--pc-maxw); margin-inline: auto;
  padding-inline: clamp(18px, 5vw, 40px);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}

/* Barre lisible partout (sombre translucide) ; au scroll : verre plus dense + ombre.
   Sur une page à hero sombre, elle se fond dans le hero ; sur une page claire,
   elle reste un bandeau sombre net. */
.pc-header {
  background: rgba(7, 11, 22, .82);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  backdrop-filter: saturate(140%) blur(8px);
}
.pc-header.is-scrolled {
  background: var(--pc-ink-glass);
  box-shadow: 0 10px 40px -18px rgba(0,0,0,.7);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
/* Sur les pages à hero sombre : barre transparente en haut (cinéma), opaque au scroll */
.pc-has-hero .pc-header:not(.is-scrolled) {
  background: linear-gradient(to bottom, rgba(7,11,22,.6), rgba(7,11,22,0));
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
/* Mobile : pas de flou (repaint trop coûteux au scroll) → fond opaque lisible */
@media (max-width: 768px) {
  .pc-header { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(7,11,22,.92); }
  .pc-has-hero .pc-header:not(.is-scrolled) { background: linear-gradient(to bottom, rgba(7,11,22,.6), rgba(7,11,22,0)); }
}
/* Quand le menu plein écran est ouvert, la barre reste lisible */
.pc-nav-open .pc-header { background: transparent; box-shadow: none; border-color: transparent; }

/* Marque / logo */
.pc-brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; font-family: var(--pc-font-display); font-weight: 700; font-size: 1.22rem; letter-spacing: -.01em; }
.pc-brand:hover { color: #fff; }
.pc-brand img { height: 50px; width: auto; }
.pc-brand--logo img { height: 50px; width: auto; max-width: 220px; object-fit: contain; }
.pc-brand__mark { width: 38px; height: 38px; flex: 0 0 auto; }
.pc-brand__txt { white-space: nowrap; }
@media (max-width: 420px) { .pc-brand__txt { display: none; } }

/* Cluster droite */
.pc-header__actions { display: flex; align-items: center; gap: 10px; }

.pc-icon-btn {
  display: inline-flex; align-items: center; gap: 9px;
  height: 44px; padding: 0 16px; border-radius: 999px;
  background: rgba(255,255,255,.08); color: #fff;
  border: 1px solid rgba(255,255,255,.14);
  font-family: var(--pc-font-display); font-weight: 600; font-size: .9rem;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background .25s, border-color .25s, transform .25s var(--pc-ease);
}
.pc-icon-btn:hover { background: rgba(255,255,255,.16); color: #fff; transform: translateY(-1px); }
.pc-icon-btn svg { width: 18px; height: 18px; }
.pc-icon-btn--square { padding: 0; width: 44px; justify-content: center; }
@media (max-width: 600px) { .pc-menu-btn__label { display: none; } .pc-menu-btn { width: 44px; padding: 0; justify-content: center; } }

/* Hamburger animé (3 traits → croix) */
.pc-burger { width: 20px; height: 14px; position: relative; flex: 0 0 auto; }
.pc-burger span { position: absolute; left: 0; right: 0; height: 2px; background: currentColor; border-radius: 2px; transition: transform .35s var(--pc-ease), opacity .2s; }
.pc-burger span:nth-child(1) { top: 0; }
.pc-burger span:nth-child(2) { top: 6px; }
.pc-burger span:nth-child(3) { top: 12px; }
.pc-nav-open .pc-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.pc-nav-open .pc-burger span:nth-child(2) { opacity: 0; }
.pc-nav-open .pc-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ----------------------------------------------------------------
   2. NAVIGATION PLEIN ÉCRAN (immersive)
   ---------------------------------------------------------------- */
.pc-overlay {
  position: fixed; inset: 0; z-index: 990;
  background:
    radial-gradient(1100px 700px at 80% -10%, rgba(79,70,229,.32), transparent 60%),
    radial-gradient(900px 600px at 0% 110%, rgba(246,181,10,.10), transparent 55%),
    var(--pc-ink);
  color: var(--pc-on-dark);
  display: flex; flex-direction: column;
  /* caché par défaut, sans bloquer le DOM (SEO : les liens restent présents) */
  opacity: 0; visibility: hidden; pointer-events: none;
  clip-path: circle(0% at calc(100% - 60px) 44px);
  transition: opacity .4s var(--pc-ease), visibility .4s, clip-path .6s var(--pc-ease-2);
}
.pc-nav-open .pc-overlay {
  opacity: 1; visibility: visible; pointer-events: auto;
  clip-path: circle(150% at calc(100% - 60px) 44px);
}
.pc-overlay__watermark {
  position: absolute; right: -8%; bottom: -14%; width: min(60vh, 560px); opacity: .05;
  pointer-events: none; transform: rotate(-12deg);
}
.pc-overlay__inner {
  width: 100%; max-width: var(--pc-maxw); margin-inline: auto;
  max-height: 100vh; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: calc(var(--pc-header-h) + 5vh) clamp(22px, 6vw, 56px) 8vh;
}
/* Méga-menu 2 colonnes (desktop) : nav à gauche, collections SCROLLABLES à droite */
@media (min-width: 861px) {
  .pc-overlay__inner {
    display: grid; grid-template-columns: minmax(210px, 290px) 1fr;
    gap: clamp(30px, 4vw, 64px); align-items: start;
    height: 100vh; max-height: 100vh; overflow: hidden;
  }
  .pc-overlay__collections {
    max-height: calc(100vh - var(--pc-header-h) - 13vh);
    overflow-y: auto; overscroll-behavior: contain; padding-right: 8px;
  }
}
/* Scrollbar fine et discrète (desktop + mobile) */
.pc-overlay__inner, .pc-overlay__collections { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.28) transparent; }
.pc-overlay__inner::-webkit-scrollbar, .pc-overlay__collections::-webkit-scrollbar { width: 10px; }
.pc-overlay__inner::-webkit-scrollbar-thumb, .pc-overlay__collections::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.22); border-radius: 999px; border: 3px solid transparent; background-clip: content-box;
}
.pc-overlay__inner::-webkit-scrollbar-thumb:hover, .pc-overlay__collections::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,.4); background-clip: content-box;
}
/* Apparition douce du panneau collections */
.pc-overlay__collections { opacity: 0; transform: translateY(16px); }
.pc-nav-open .pc-overlay__collections { animation: pc-menu-in .6s var(--pc-ease) .3s forwards; }

/* Menu principal : grandes entrées */
.pc-menu { list-style: none; padding: 0; margin: 0; }
.pc-menu > li { overflow: hidden; }
.pc-menu > li + li { margin-top: clamp(2px, 1vh, 10px); }
.pc-menu > li > a {
  display: inline-flex; align-items: baseline; gap: .5em;
  font-family: var(--pc-font-display); font-weight: 700;
  font-size: clamp(1.6rem, 4.2vw, 2.5rem); line-height: 1.12; letter-spacing: -.03em;
  color: #fff; padding: .1em 0; position: relative;
  transition: color .3s, transform .45s var(--pc-ease);
}
.pc-menu > li > a::before {
  content: ""; position: absolute; left: -2px; bottom: .14em; width: 0; height: .07em;
  background: linear-gradient(90deg, var(--pc-accent), var(--pc-gold));
  transition: width .45s var(--pc-ease); border-radius: 2px;
}
.pc-menu > li > a:hover { transform: translateX(12px); color: #fff; }
.pc-menu > li > a:hover::before { width: 100%; }

/* Panneau « Collections » du méga-menu */
.pc-collections-panel__head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.pc-collections-panel__total {
  display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 24px; padding: 0 9px;
  border-radius: 999px; background: rgba(79,70,229,.18); color: var(--pc-accent-ink);
  font-family: var(--pc-font-display); font-weight: 700; font-size: .8rem;
}
.pc-collections { display: grid; gap: 24px; }
.pc-collections__era {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--pc-font-display); font-size: .76rem; text-transform: uppercase; letter-spacing: .2em;
  color: var(--pc-accent-ink); margin-bottom: 12px;
}
.pc-collections__era::before {
  content: ""; flex: 0 0 auto; width: 22px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--pc-accent), var(--pc-gold));
}
.pc-collections__count { margin-left: auto; font-size: .72rem; letter-spacing: normal; color: var(--pc-on-dark-2); font-weight: 600; }
.pc-collections__list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px;
}
.pc-collections__list a {
  display: block; padding: 9px 13px; border-radius: 10px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09);
  color: var(--pc-on-dark); font-size: .92rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .2s, border-color .2s, transform .2s var(--pc-ease), color .2s;
}
.pc-collections__list a:hover {
  background: rgba(79, 70, 229, .22); border-color: var(--pc-accent); color: #fff; transform: translateY(-2px);
}

/* Apparition échelonnée des entrées à l'ouverture */
.pc-menu > li { opacity: 0; transform: translateY(22px); }
.pc-nav-open .pc-menu > li { animation: pc-menu-in .55s var(--pc-ease) forwards; }
.pc-nav-open .pc-menu > li:nth-child(1) { animation-delay: .12s; }
.pc-nav-open .pc-menu > li:nth-child(2) { animation-delay: .18s; }
.pc-nav-open .pc-menu > li:nth-child(3) { animation-delay: .24s; }
.pc-nav-open .pc-menu > li:nth-child(4) { animation-delay: .30s; }
.pc-nav-open .pc-menu > li:nth-child(5) { animation-delay: .36s; }
.pc-nav-open .pc-menu > li:nth-child(6) { animation-delay: .42s; }
.pc-nav-open .pc-menu > li:nth-child(n+7) { animation-delay: .48s; }
@keyframes pc-menu-in { to { opacity: 1; transform: none; } }

/* Réseaux sociaux (optionnels, sous le menu) */
.pc-socials { display: flex; gap: 12px; margin-top: 36px; }
.pc-socials a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.08); color: #fff; transition: background .25s, transform .25s; }
.pc-socials a:hover { background: var(--pc-accent); transform: translateY(-2px); }
.pc-socials svg { width: 18px; height: 18px; }

/* ----------------------------------------------------------------
   3. FORMULAIRE DE RECHERCHE (réutilisable)
   ---------------------------------------------------------------- */
.pc-search-form { display: flex; align-items: center; gap: 8px; position: relative; }
/* Style CLAIR par défaut (fonctionne sur fond blanc : « aucun résultat », etc.) */
.pc-search-form input[type=search], .pc-search-form input[type=text] {
  flex: 1; height: 50px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--pc-line); background: #fff;
  color: var(--pc-text); font-size: 1rem;
}
.pc-search-form input::placeholder { color: var(--pc-muted); }
.pc-search-form button {
  height: 50px; width: 50px; flex: 0 0 auto; border-radius: 50%; border: 0;
  background: var(--pc-accent); color: #fff; display: grid; place-items: center;
  transition: background .25s, transform .25s var(--pc-ease);
}
.pc-search-form button:hover { background: var(--pc-accent-2); transform: scale(1.05); }
.pc-search-form button svg { width: 20px; height: 20px; }

/* Style SOMBRE automatique dans les contextes sombres (hero, menu plein écran, 404) */
.pc-hero .pc-search-form input,
.pc-overlay .pc-search-form input,
.pc-404 .pc-search-form input {
  background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.18); color: #fff;
}
.pc-hero .pc-search-form input::placeholder,
.pc-overlay .pc-search-form input::placeholder,
.pc-404 .pc-search-form input::placeholder { color: var(--pc-on-dark-2); }

/* ----------------------------------------------------------------
   4. LOADER POKÉBALL (1er chargement)
   ---------------------------------------------------------------- */
.pc-loader {
  position: fixed; inset: 0; z-index: 2000;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
  background:
    radial-gradient(900px 600px at 50% 30%, rgba(79,70,229,.30), transparent 60%),
    var(--pc-ink);
  color: #fff;
}
html.pc-loading .pc-loader { display: flex; }
/* Sortie profonde & cinématographique : fondu + léger zoom + drift + flou bref */
.pc-loader.is-hiding { animation: pc-loader-out .85s var(--pc-ease-smooth) forwards; pointer-events: none; }
@keyframes pc-loader-out {
  to { opacity: 0; visibility: hidden; transform: scale(1.08) translateY(-1.5%); filter: blur(7px); }
}
/* La Pokéball s'éloigne légèrement en sortant (profondeur) */
.pc-loader.is-hiding .pc-pokeball { animation: pc-pb-leave .85s var(--pc-ease-smooth) forwards; }
@keyframes pc-pb-leave { to { transform: scale(1.25); opacity: 0; } }

.pc-pokeball {
  --pb: 78px;
  width: var(--pb); height: var(--pb); border-radius: 50%; position: relative;
  background: linear-gradient(#fff 0 50%, #fff 50% 100%);
  border: 4px solid #0a0e1a;
  box-shadow: 0 18px 50px -10px rgba(79,70,229,.6);
  overflow: hidden;
  animation: pc-pb-spin 1.5s var(--pc-ease-2) infinite;
}
.pc-pokeball::before { /* moitié haute rouge */
  content: ""; position: absolute; inset: 0 0 50% 0;
  background: linear-gradient(#ff5350, #e23b39);
}
.pc-pokeball::after { /* bande noire */
  content: ""; position: absolute; top: 50%; left: -4px; right: -4px; height: 6px;
  transform: translateY(-50%); background: #0a0e1a;
}
.pc-pokeball__btn {
  position: absolute; top: 50%; left: 50%; width: 24px; height: 24px;
  transform: translate(-50%, -50%); border-radius: 50%; z-index: 2;
  background: #fff; border: 4px solid #0a0e1a;
  box-shadow: 0 0 0 3px #fff;
  animation: pc-pb-glow 1.5s ease-in-out infinite;
}
@keyframes pc-pb-spin { 0% { transform: rotate(0); } 60% { transform: rotate(380deg); } 100% { transform: rotate(720deg); } }
@keyframes pc-pb-glow { 0%, 100% { box-shadow: 0 0 0 3px #fff, 0 0 10px 2px rgba(255,255,255,.4); } 50% { box-shadow: 0 0 0 3px #fff, 0 0 22px 6px rgba(246,181,10,.85); } }

.pc-loader__brand { font-family: var(--pc-font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; }
.pc-loader__brand b { color: var(--pc-gold); }
.pc-loader__bar { width: min(220px, 56vw); height: 4px; border-radius: 4px; background: rgba(255,255,255,.14); overflow: hidden; }
.pc-loader__bar i { display: block; height: 100%; width: 30%; border-radius: 4px; background: linear-gradient(90deg, var(--pc-accent), var(--pc-gold)); animation: pc-loader-bar 1.1s var(--pc-ease) infinite; }
@keyframes pc-loader-bar { 0% { transform: translateX(-120%); width: 40%; } 60% { width: 70%; } 100% { transform: translateX(360%); width: 30%; } }

/* ----------------------------------------------------------------
   5. TRANSITION DE PAGE — View Transitions API (cross-document), FLUIDE & SANS ARRÊT.
   Le navigateur joue l'animation APRÈS que la nouvelle page est prête → aucun
   temps mort. Anime TOUTE la page (en-tête inclus) :
   1) la page rétrécit à 90% PUIS glisse vers la GAUCHE ;
   2) bref écran BLANC + Pokéball (le « pont », en mouvement, ne stagne pas) ;
   3) la nouvelle arrive DE LA DROITE à 90% PUIS grandit à 100%.
   SEO-SAFE : chaque page reste un document HTML rendu serveur (le navigateur
   n'anime que la bascule). Repli : navigation normale instantanée.
   ---------------------------------------------------------------- */
@view-transition { navigation: auto; }

@media (prefers-reduced-motion: no-preference) {
  /* Pont : écran blanc + Pokéball, visible brièvement entre les deux pages. */
  ::view-transition {
    background-color: #ffffff;
    background-repeat: no-repeat; background-position: center; background-size: 78px;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><circle cx="24" cy="24" r="21" fill="%23fff" stroke="%230a0e1a" stroke-width="3"/><path d="M3.2 24a20.8 20.8 0 0 1 41.6 0Z" fill="%23ff5350"/><rect x="3" y="21" width="42" height="6" fill="%230a0e1a"/><circle cx="24" cy="24" r="6.5" fill="%23fff" stroke="%230a0e1a" stroke-width="3"/></svg>');
  }
  /* SORTIE : rétrécit EN glissant vers la gauche + léger fondu (mouvement continu). */
  ::view-transition-old(root) { animation: pc-out .6s cubic-bezier(.4, 0, .2, 1) both; }
  @keyframes pc-out { to { opacity: 0; transform: translateX(-60%) scale(.85); } }
  /* ENTRÉE : arrive de la droite EN grandissant + fondu (mouvement continu). */
  ::view-transition-new(root) { animation: pc-in .7s cubic-bezier(.4, 0, .2, 1) .2s both; }
  @keyframes pc-in { from { opacity: 0; transform: translateX(60%) scale(.85); } }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ----------------------------------------------------------------
   5b. HERO cinématographique sombre (en-tête de page)
   ---------------------------------------------------------------- */
.pc-hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 600px at 12% -30%, rgba(79,70,229,.30), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(246,181,10,.08), transparent 55%),
    var(--pc-ink);
  color: var(--pc-on-dark);
  padding-top: calc(var(--pc-header-h) + clamp(36px, 8vw, 92px));
  padding-bottom: clamp(36px, 7vw, 84px);
}
.pc-hero__glow {
  position: absolute; inset: auto -10% -60% auto; width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(79,70,229,.25), transparent 60%);
  pointer-events: none;
}
.pc-hero--center { text-align: center; }
.pc-hero--center .pc-hero__lead { margin-inline: auto; }
.pc-hero .pc-breadcrumb { color: var(--pc-on-dark-2); margin-bottom: 14px; }
.pc-hero .pc-breadcrumb a { color: var(--pc-accent-ink); }
.pc-hero .pc-breadcrumb a:hover { color: #fff; }
.pc-hero__eyebrow { color: var(--pc-gold); }
.pc-hero__title { color: #fff; max-width: 20ch; }
.pc-hero--center .pc-hero__title { max-width: none; }
.pc-hero__lead { color: var(--pc-on-dark-2); font-size: 1.12rem; max-width: 62ch; margin-top: .7em; }
.pc-hero__search { margin-top: 26px; max-width: 540px; }
.pc-hero--center .pc-hero__search { margin-inline: auto; }
/* Le formulaire de recherche dans le hero hérite du style sombre par défaut */

/* ----------------------------------------------------------------
   6. Réglages mouvement réduit
   ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .pc-overlay { transition: opacity .2s, visibility .2s; clip-path: none !important; }
  .pc-pokeball, .pc-pokeball__btn, .pc-loader__bar i { animation: none !important; }
  .pc-loader.is-hiding { animation: none !important; display: none !important; }
  .pc-loader.is-hiding .pc-pokeball { animation: none !important; }
  .pc-menu > li { animation: none !important; opacity: 1; transform: none; }
  .pc-overlay__collections { animation: none !important; opacity: 1; transform: none; }
  .pc-js.pc-revealing .pc-site-main, .pc-js.pc-revealing .pc-footer { animation: none !important; }
}

/* Bloque le scroll arrière-plan quand le menu est ouvert */
.pc-nav-open, .pc-no-scroll { overflow: hidden; }

/* ---- Mobile : barre plus compacte, logo adapté ---- */
@media (max-width: 600px) {
  :root { --pc-header-h: 62px; }
  .pc-brand { font-size: 1.05rem; gap: 9px; }
  .pc-brand img, .pc-brand--logo img { height: 38px; }
  .pc-brand__mark { width: 32px; height: 32px; }
}
