/* Hurricane Memories — feuille de style reprise de la maquette V5 validee.
   Projet HDKart – Responsable du projet : Stéphane Logisse
   Ne pas modifier les regles hm-* sans validation graphique. */
:root{--red:#ff5a00;--black:#121847;--hm-panel:#161b3d;--hm-line:#343956}
*{box-sizing:border-box}
html{background:#0b1035}body{margin:0;padding:0;background:#0b1035;color:#fff}
body.hm-body{font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;font-size:16px;line-height:normal;min-height:100vh;display:flex;flex-direction:column}
.hm-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px clamp(18px,5vw,70px);border-bottom:1px solid #232848;background:#0c1030}
.hm-bar img{width:130px;height:auto;display:block}
.hm-bar a{color:#d1d2d7;text-decoration:none;font-weight:700;font-size:14px}
.hm-bar a:hover{color:var(--red)}
.hm-main{flex:1 1 auto}
.hm-page{background:var(--black);color:#fff;min-height:65vh;padding:32px clamp(20px,5vw,70px) 72px;max-width:1440px;margin:0 auto;width:100%}
.hm-more{display:block;margin:26px auto 0;background:#1c2242;color:#fff;border:1px solid var(--hm-line);border-radius:12px;padding:13px 22px;font-weight:800;cursor:pointer;min-height:46px}
.hm-more:hover{background:#272e50}
.hm-more[disabled]{opacity:.6;cursor:wait}
.hm-empty{text-align:center;color:#b9bed4;padding:40px 10px}
.hm-pagination{text-align:center;color:#8f96b5;font-size:13px;margin-top:14px}
dialog.hm-dialog{display:none}
dialog.hm-dialog[open]{display:block}
#hmDialog{overscroll-behavior:contain}
.hm-photo{display:block;width:100%;cursor:zoom-in}
.hm-photo:focus-visible{outline:3px solid #ff8a5b;outline-offset:3px}
.hm-footer{padding:22px clamp(18px,5vw,70px);border-top:1px solid #232848;color:#8f96b5;font-size:13px;display:flex;justify-content:space-between;gap:14px;flex-wrap:wrap}
.hm-footer a{color:#b9bed4;text-decoration:none}
.hm-footer a:hover{color:var(--red)}
@media(max-width:700px){.hm-bar img{width:110px}}

#memoriesPage,#memoriesAlbumPage{background:var(--black);color:#fff;min-height:65vh;padding:32px clamp(20px,5vw,70px) 72px;font-family:inherit} .hm-top{display:block;color:#d1d2d7;text-decoration:none;font-weight:700;font-size:14px;margin-bottom:30px}.hm-top:hover{color:var(--red)}.hm-heading{text-align:center;margin:10px auto 42px}.hm-logo{width:min(300px,75%);height:auto;display:block;margin:0 auto 18px}.hm-heading h1{font-size:clamp(29px,5vw,56px);line-height:1.05;margin:0;font-weight:900;letter-spacing:-.025em}.hm-heading p{color:#d1d2d7;margin:16px 0}.hm-line{width:60px;height:4px;background:var(--red);margin:18px auto}.hm-albums{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,220px));justify-content:center;gap:32px}.hm-album{text-align:center;text-decoration:none;color:#fff;display:block}.hm-circle{display:block;width:100%;aspect-ratio:1;border-radius:50%;border:3px solid var(--red);padding:5px;transition:transform .2s,box-shadow .2s}.hm-circle img{width:100%;height:100%;object-fit:cover;border-radius:50%}.hm-album:hover .hm-circle{transform:scale(1.04);box-shadow:0 0 28px #ff5a0066}.hm-album strong{display:block;font-size:19px;margin:15px 0 5px}.hm-album small,.hm-note{color:#b9bed4}.hm-note{text-align:center;font-size:13px;margin:34px 0 0}.hm-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:14px}.hm-grid button{padding:0;border:0;background:none;overflow:hidden;border-radius:10px}.hm-grid img{width:100%;aspect-ratio:4/3;object-fit:cover;display:block}.hm-dialog{background:#090d24;color:white;border:1px solid #ffffff33;border-radius:14px;width:min(95vw,1000px);padding:18px}.hm-dialog::backdrop{background:#000d}.hm-dialog img{width:100%;max-height:70vh;object-fit:contain}.hm-controls{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:12px 0}.hm-controls button,.hm-controls a{background:#20294e;color:white;border:0;border-radius:8px;padding:10px;text-decoration:none}.hm-controls button:hover{background:var(--red)}@media(max-width:600px){.hm-albums{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.hm-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.hm-album strong{font-size:15px}}@media(prefers-reduced-motion:reduce){.hm-circle{transition:none}}

.hm-dialog{max-height:95dvh;overflow:auto}.hm-controls{flex-wrap:wrap}.hm-controls button,.hm-controls a{cursor:pointer;min-height:44px}.hm-dialog:fullscreen{width:100%;height:100%;max-width:none;max-height:none;border:0;border-radius:0;margin:0;display:flex;flex-direction:column;justify-content:center}.hm-dialog:fullscreen img{max-height:68dvh;min-height:0;flex:1;touch-action:pan-y}.hm-dialog img{touch-action:pan-y}#hmFeedback{font-size:13px;color:#ffb36b;margin:4px 0;overflow-wrap:anywhere}@media(max-width:600px){.hm-dialog{padding:10px}.hm-controls{gap:6px}.hm-controls button,.hm-controls a{font-size:12px;padding:8px}.hm-dialog img{max-height:55dvh}}

#hmDialog{box-sizing:border-box;background:#101332;border:1px solid #343956;border-radius:12px;padding:14px;width:min(96vw,1000px);max-width:96vw;max-height:96dvh;color:#fff;overflow:auto;margin:auto}
#hmDialog button,#hmDialog a{font:inherit;color:#fff;border:0;cursor:pointer;text-decoration:none;background:none;display:flex;align-items:center;justify-content:center;gap:8px;min-height:36px;padding:7px;border-radius:8px}
#hmDialog svg{width:19px;height:19px;flex:none;color:#ff8000}#hmDialog button:hover,#hmDialog a:hover{background:#272e50}#hmDialog button:focus-visible,#hmDialog a:focus-visible{outline:2px solid #ff8000;outline-offset:2px}
.hm-v5-head,.hm-v5-head>div,.hm-v5-nav{display:flex;align-items:center;justify-content:space-between;gap:8px}.hm-v5-head{font-size:14px;margin-bottom:8px}.hm-v5-head>div{gap:2px}.hm-v5-head button{min-width:34px}.hm-v5-head button svg{color:#fff!important;width:16px!important;height:16px!important}
#hmFull{display:block;width:100%;height:auto;max-height:calc(96dvh - 226px);object-fit:contain;border-radius:12px;background:#080b20;touch-action:pan-y}
.hm-v5-nav{padding:5px 0 12px;border-bottom:1px solid #343956;margin-bottom:14px}.hm-v5-nav button{min-width:40px}.hm-v5-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.hm-v5-actions button{background:#1c2242!important;flex-direction:column;min-height:68px!important;font-size:12px!important}.hm-v5-actions button:hover,#hmCopy:hover{background:#30395b!important}#hmCopy{width:100%;background:#1c2242!important;margin-top:10px;min-height:40px!important}#hmFeedback:empty{display:none}
#hmDialog:fullscreen{width:100%;max-width:none;height:100%;max-height:none;border:0;border-radius:0;justify-content:center}#hmDialog:fullscreen #hmFull{max-height:calc(100dvh - 230px);flex:0 1 auto}
@media(max-width:600px){#hmDialog{padding:10px}.hm-v5-actions{gap:5px}.hm-v5-actions button{font-size:11px!important;min-height:58px!important;padding:5px!important}#hmFull{max-height:calc(94dvh - 210px)}.hm-v5-head{font-size:12px}.hm-v5-nav{margin-bottom:9px;padding-bottom:8px}}

/* Les attributs width/height servent au CLS ; la hauteur doit rester auto pour que le ratio 4/3 s'applique. */
.hm-grid img{height:auto}


/* Verrouillage du defilement de la page derriere la visionneuse. */
html.hm-dialog-open,html.hm-dialog-open body{overflow:hidden}

/* Legende de la photo dans la visionneuse. */
.hm-caption{margin:10px auto 0;max-width:min(92vw,920px);padding:0 16px;text-align:center;font-size:.95rem;line-height:1.4;color:rgba(255,255,255,.88)}
/* Focus visible (accessibilite clavier). */
.hm-album:focus-visible,.hm-photo:focus-visible,.hm-dialog button:focus-visible,.hm-dialog a:focus-visible,.hm-more:focus-visible{outline:3px solid #ff8000;outline-offset:3px}
/* Animations desactivables. */
@media (prefers-reduced-motion: reduce){
  .hm-album,.hm-photo,.hm-dialog *,.hm-more{animation:none!important;transition:none!important}
}

/* Largeur du site (V5) : barre utilitaire, en-tete et pied de page centres sur 1440 px. */
.utility,header.header,footer.site-footer{max-width:1440px;margin-left:auto;margin-right:auto;width:100%}

/* Plein écran : Chromium refuse <dialog>, on agrandit la visionneuse sur <html>. */
html.hm-fs-page #hmDialog,html.hm-fs-page .hm-dialog{width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;margin:0;border:0;border-radius:0;padding:10px;display:flex;flex-direction:column;justify-content:center}
html.hm-fs-page #hmDialog img,html.hm-fs-page .hm-dialog img{max-height:68dvh;min-height:0;flex:1 1 auto;width:100%;object-fit:contain;touch-action:pan-y}


/* ------------------------------------------------------------------
   Visionneuse compacte : tient dans la hauteur visible, sans défilement.
   ------------------------------------------------------------------ */
dialog.hm-dialog[open]{
  display:flex;
  flex-direction:column;
  width:min(1200px, calc(100vw - 32px));
  max-width:calc(100vw - 32px);
  height:calc(100dvh - 32px);
  max-height:calc(100dvh - 32px);
  margin:auto;
  padding:10px 12px 12px;
  gap:0;
  overflow:hidden;
  border-radius:12px;
}
#hmDialog .hm-v5-head{flex:0 0 auto;font-size:13px;margin:0 0 4px;min-height:32px;line-height:1.2}
#hmDialog .hm-v5-head button{width:32px;height:32px;min-width:32px;padding:0}
#hmDialog .hm-stage{
  flex:1 1 0;
  min-height:0;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  border-radius:8px;
  background:#080b20;
}
#hmDialog #hmFull{
  width:auto;
  height:auto;
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  object-position:center;
  border-radius:8px;
  background:transparent;
}
#hmDialog .hm-caption{flex:0 0 auto;margin:5px 0 0;font-size:12px;line-height:1.3;max-height:2.6em;overflow:hidden}
#hmDialog .hm-v5-nav{flex:0 0 auto;padding:3px 0 5px;margin:0 0 5px;gap:8px}
#hmDialog .hm-v5-nav button{min-width:34px;min-height:30px}
#hmDialog #hmDownload{display:inline-flex;align-items:center;gap:7px;font-size:12px;min-height:30px}
#hmDialog #hmDownload svg{width:17px;height:17px;color:#ff7a2f}
#hmDialog .hm-v5-actions{flex:0 0 auto;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
#hmDialog .hm-v5-actions button{
  display:flex;
  flex-direction:row;
  align-items:center;
  justify-content:center;
  gap:8px;
  height:40px;
  min-height:40px!important;
  padding:0 10px!important;
  font-size:12.5px!important;
  background:#232a4e!important;
  border:1px solid #343956;
  border-radius:10px;
  white-space:nowrap;
}
#hmDialog .hm-v5-actions button svg{width:18px;height:18px;flex:0 0 18px;color:#ff7a2f}
#hmDialog .hm-v5-actions button:hover{background:#30395b!important}
#hmDialog #hmCopy{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  height:36px;
  min-height:36px!important;
  margin-top:6px;
  font-size:12.5px;
  border-radius:10px;
  background:#232a4e!important;
}
#hmDialog #hmCopy svg{width:16px;height:16px;flex:0 0 16px;color:#ff7a2f}
#hmDialog #hmFeedback{flex:0 0 auto;margin:4px 0 0;font-size:12px}
html.hm-fs-page #hmDialog,html.hm-fs-page .hm-dialog{
  width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;padding:10px;border:0;border-radius:0;justify-content:flex-start;overflow:hidden;
}
html.hm-fs-page #hmDialog .hm-stage,html.hm-fs-page .hm-dialog .hm-stage{flex:1 1 0;min-height:0;display:flex;align-items:center;justify-content:center;overflow:hidden}
html.hm-fs-page #hmDialog #hmFull,html.hm-fs-page .hm-dialog img{width:auto;height:auto;max-width:100%;max-height:100%;flex:0 1 auto;object-fit:contain}
@media (max-width:560px){
  dialog.hm-dialog[open]{width:calc(100vw - 24px);max-width:calc(100vw - 24px);height:calc(100dvh - 24px);max-height:calc(100dvh - 24px);padding:8px}
  #hmDialog .hm-v5-head{font-size:12px;min-height:30px}
  #hmDialog .hm-v5-head button{width:30px;height:30px;min-width:30px}
  #hmDialog .hm-v5-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  #hmDialog .hm-v5-actions button{height:38px;min-height:38px!important;font-size:12px!important;gap:6px}
  #hmDialog #hmCopy{height:34px;min-height:34px!important;font-size:12px}
  #hmDialog .hm-v5-nav button{min-height:28px}
}
@media (max-height:620px){
  #hmDialog .hm-v5-head{margin-bottom:2px}
  #hmDialog .hm-v5-actions button{height:36px;min-height:36px!important}
  #hmDialog #hmCopy{height:32px;min-height:32px!important;margin-top:4px}
  #hmDialog .hm-caption{display:none}
}

/* Priorité finale : la fenêtre occupe l'espace disponible avec 16 px de marge. */
#hmDialog{overflow:hidden!important}
#hmDialog[open]{
  display:flex!important;
  flex-direction:column!important;
  width:min(1000px, calc(100vw - 32px))!important;
  max-width:min(1000px, calc(100vw - 32px))!important;
  height:calc(100dvh - 32px)!important;
  max-height:calc(100dvh - 32px)!important;
  margin:auto!important;
  padding:10px 12px 12px!important;
  overflow:hidden!important;
  gap:0!important;
}
html.hm-fs-page #hmDialog{
  width:100vw!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important;
  margin:0!important;padding:10px!important;border:0!important;border-radius:0!important;
}
