/* Page d'accueil (index.php, includes/home/home.php) — maquette A « Portail ».
   S'appuie sur les variables de style.css : thème clair, sombre et système.
   Préfixe .hm-. */

.hm-wrap { box-sizing: border-box; width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.hm-muted { color: var(--text-muted); font-size: 12.5px; }
.hm-kicker { margin: 0; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.hm-clamp1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.hm-clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hm-wrap [hidden] { display: none !important; }

/* ---- Recherche : boutons devenus une ligne discrète --------------------- */
.hm-search-hint { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: 14px 0 0; font-size: 13px; color: var(--text-muted); }
.hm-search-hint.hidden { display: none; }
.hm-link-btn { padding: 4px 6px; border: 0; border-radius: 6px; background: none; color: var(--link); font: inherit; font-size: 13px; cursor: pointer; }
.hm-link-btn:hover { text-decoration: underline; background: var(--link-tint); }

/* ---- Services ----------------------------------------------------------------- */
.hm-services { display: flex; flex-direction: column; align-items: center; width: 100%; margin-top: 28px; }
.hm-favs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 0; padding: 0; list-style: none; max-width: 860px; }
.hm-svc {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; width: 88px; padding: 10px 2px 8px;
  border: 0; border-radius: 16px; background: none; color: var(--text) !important; font: inherit; font-size: 12.5px;
  text-align: center; text-decoration: none !important; cursor: pointer; transition: background 0.15s var(--ease);
}
.hm-svc:hover { background: var(--btn-bg); }
.hm-svc:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.hm-svc-ico {
  position: relative; display: flex; align-items: center; justify-content: center; flex: none; width: 50px; height: 50px; border-radius: 50%;
  background: radial-gradient(120% 80% at 30% 0%, rgba(255, 255, 255, 0.26), transparent 55%), var(--svc, #5f6368);
  color: #fff; box-shadow: 0 6px 16px -8px var(--svc, #000), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: transform 0.15s var(--ease);
}
.hm-svc:hover .hm-svc-ico { transform: translateY(-2px); }
.hm-svc-ico svg { width: 23px; height: 23px; }
.hm-svc-ico-sm { width: 34px; height: 34px; box-shadow: none; }
.hm-svc-ico-sm svg { width: 17px; height: 17px; }
.hm-svc-ico-more { background: var(--btn-bg); color: var(--text); border: 1px dashed var(--border-hover); box-shadow: none; }
.hm-svc-ico-more svg { width: 20px; height: 20px; }
.hm-svc-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-badge, .hm-svc-state {
  position: absolute; top: -3px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box;
  border: 2px solid var(--bg); border-radius: 10px; background: #ea4335; color: #fff; font-size: 11px; font-weight: 700; line-height: 16px;
}
.hm-svc-state { background: #e37400; font-size: 10px; }
.hm-svc.is-incident .hm-svc-state { background: #d93025; }
.hm-svc.is-maintenance .hm-svc-ico, .hm-svc.is-incident .hm-svc-ico { filter: grayscale(0.75); opacity: 0.75; }
.hm-svc-note { margin-top: -4px; font-size: 11px; font-weight: 700; color: var(--warning); }
.hm-svc.is-incident .hm-svc-note { color: var(--danger); }
.hm-pill { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #ea4335; color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; }

.hm-all {
  box-sizing: border-box; width: 100%; max-width: 1040px; margin-top: 14px; padding: 20px 22px;
  border: 1px solid var(--border); border-radius: 20px; background: var(--bg);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px 24px;
  box-shadow: 0 12px 32px -20px var(--shadow);
}
.hm-all[hidden] { display: none; }
.hm-all-group { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hm-all-group .hm-kicker { padding: 0 6px 6px; }
.hm-all-item { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 10px; color: var(--text) !important; text-decoration: none !important; text-align: left; }
.hm-all-item:hover { background: var(--btn-bg); }
.hm-all-text { display: flex; flex-direction: column; min-width: 0; }
.hm-all-name { font-size: 14px; }

/* ---- États (maintenance / incident) ------------------------------------------- */
.hm-state { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.hm-state-maintenance { background: var(--warning-bg); color: var(--warning); }
.hm-state-incident { background: var(--danger-bg); color: var(--danger); }
.hm-status {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 18px; padding: 12px 16px;
  border-radius: 14px; background: var(--warning-bg); border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent);
}
.hm-status.is-incident { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.hm-status-title { font-weight: 700; font-size: 14px; color: var(--text); }
.hm-status ul { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; }
.hm-status a { color: var(--text) !important; font-size: 13.5px; }
.hm-status a.hm-status-all { margin-left: auto; color: var(--link) !important; font-weight: 600; white-space: nowrap; }
/* ---- Raccourcis en pastilles (maquette C) ------------------------------------- */
.hm-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; max-width: 1080px; }
.hm-pill-svc {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 6px; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 20px; background: var(--bg); color: var(--text) !important;
  font: inherit; font-size: 14px; text-decoration: none !important; cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.hm-pill-svc:hover { background: var(--btn-bg); border-color: var(--border-hover); }
.hm-pill-svc:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.hm-pill-ico { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--svc, #5f6368); color: #fff; }
.hm-pill-ico svg { width: 15px; height: 15px; }
.hm-pill-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px; background: #d93025; color: #fff; font-size: 11px; font-weight: 700; }
.hm-pill-state { font-size: 11px; font-weight: 700; color: var(--warning); }
.hm-pill-svc.is-incident .hm-pill-state { color: var(--danger); }
.hm-pill-svc.is-maintenance .hm-pill-ico, .hm-pill-svc.is-incident .hm-pill-ico { filter: grayscale(0.75); opacity: 0.75; }
.hm-pill-more { padding: 0 16px; }
.hm-pill-more svg { width: 16px; height: 16px; color: var(--text-muted); }
.hm-pill { display: inline-block; padding: 0 6px; border-radius: 8px; background: #d93025; color: #fff; font-size: 11px; font-weight: 700; }

/* ---- « Nouveau sur Eyefind » (hm_render_new : services ouverts depuis < 7 jours) ---- */
.hm-new-tag {
  display: inline-block; margin-left: 2px; padding: 1px 7px; border-radius: 999px;
  background: color-mix(in srgb, #1a73e8 14%, transparent); color: var(--link);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em; line-height: 16px; vertical-align: 1px;
}
.hm-new {
  margin: 28px 0 0; padding: 16px 18px 18px; border: 1px solid color-mix(in srgb, #1a73e8 28%, var(--border));
  border-radius: 22px; background: linear-gradient(135deg, var(--link-tint), var(--bg) 70%);
}
.hm-new-head { display: flex; align-items: center; gap: 8px 14px; margin-bottom: 12px; }
.hm-new-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; color: var(--text); }
.hm-new-badge { padding: 2px 10px; border-radius: 999px; background: var(--link); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 0.03em; }
.hm-new-head a { margin-left: auto; font-size: 13px; color: var(--link) !important; white-space: nowrap; }
.hm-new-close { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text-muted); cursor: pointer; }
.hm-new-close:hover { background: var(--btn-bg); color: var(--text); }
.hm-new-close svg { width: 18px; height: 18px; fill: currentColor; }
.hm-new-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.hm-new-item {
  display: flex; align-items: flex-start; gap: 14px; padding: 14px; border: 1px solid var(--border); border-radius: 16px;
  background: var(--bg); color: var(--text) !important; text-decoration: none !important;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.hm-new-item:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.hm-new-item:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.hm-new-item .hm-svc-ico { width: 44px; height: 44px; }
.hm-new-item .hm-svc-ico svg { width: 21px; height: 21px; }
.hm-new-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hm-new-text strong { font-size: 15px; }
.hm-new-text span { font-size: 13.5px; line-height: 1.4; color: var(--text-muted); }
.hm-new-text small { margin-top: 2px; font-size: 12.5px; font-weight: 600; color: var(--link); }
.hm-new[hidden] { display: none !important; }

/* « Pour vous » : prochain événement du joueur */
.hm-tile-next { display: block; font-size: 13px; color: var(--text) !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-tile-next span { color: #ea3b7a; font-weight: 700; }
.hm-tile-next:hover { text-decoration: underline; }

/* ---- « Aujourd'hui à Los Santos » (maquette E, bento complet) ------------------- */
/* Rangées à hauteur fixe ; chaque rangée reçoit ses colonnes du PHP
   (--hm-cols, selon les blocs présents), donc jamais de trou. */
.hm-board { display: flex; flex-direction: column; gap: 14px; margin: 44px 0 0; }
.hm-board-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; margin-bottom: 4px; }
.hm-board-head h2 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.hm-board-head span { font-size: 13px; color: var(--text-muted); }
.hm-board-row { display: grid; grid-template-columns: var(--hm-cols, 1fr); gap: 14px; }
.hm-board-top { height: 400px; }
.hm-board-short { height: 176px; }
.hm-board-mid { height: 262px; }
.hm-board-lists { min-height: 262px; }
.hm-board-row > * { min-width: 0; min-height: 0; }
.hm-stack { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.hm-stack > .hm-tile { flex: 1; }

/* Bloc avec en-tête et liste */
.hm-panel {
  box-sizing: border-box; display: flex; flex-direction: column; min-width: 0; padding: 18px 20px;
  border: 1px solid var(--border); border-radius: 22px; background: var(--bg); overflow: hidden;
  color: var(--text) !important; text-decoration: none !important;
}
.hm-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.hm-panel-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; color: var(--text); }
.hm-panel-head a { font-size: 13px; color: var(--link) !important; white-space: nowrap; }
.hm-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.hm-sponso { margin-left: auto; font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.hm-panel-more { margin-top: auto; padding-top: 10px; font-size: 13.5px; font-weight: 600; color: var(--link) !important; }

.hm-list-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); color: var(--text) !important; text-decoration: none !important; }
.hm-list-row:hover .hm-list-title { text-decoration: underline; }
.hm-list-thumb { width: 48px; height: 48px; border-radius: 10px; overflow: hidden; background: var(--btn-bg); display: grid; place-items: center; font-size: 14px; font-weight: 800; color: var(--text-muted); }
.hm-list-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-thumb-wide { width: 84px; height: 56px; }
.hm-thumb-initials { border-radius: 12px; background: color-mix(in srgb, #9b6dff 22%, var(--bg)); color: #b794ff; }
.hm-thumb-logo { border-radius: 12px; background: #fff; color: #1a73e8; }
.hm-thumb-logo img { object-fit: contain; padding: 4px; box-sizing: border-box; }
.hm-list-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hm-list-title { font-size: 14px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-list-title.hm-clamp2 { white-space: normal; }
.hm-list-meta { font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-list-kicker { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.hm-list-price { color: var(--success); font-weight: 700; }

/* La une : photo en haut, titre dessous (jamais de texte sur la photo) */
.hm-une2 { padding: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; transition: border-color 0.15s var(--ease); }
.hm-une2:hover { border-color: var(--border-hover); }
.hm-une2-media { position: relative; overflow: hidden; background: linear-gradient(160deg, color-mix(in srgb, var(--oc) 55%, #1c2733), #1c2733); }
.hm-une2-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--ease); }
.hm-une2:hover .hm-une2-media img { transform: scale(1.03); }
.hm-une2-text { display: flex; flex-direction: column; gap: 6px; padding: 16px 22px 18px; }
.hm-une2-title { font-family: "Playfair Display", Georgia, serif; font-size: 24px; font-weight: 700; line-height: 1.22; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hm-une2:hover .hm-une2-title { text-decoration: underline; }

/* EyefindTube */
.hm-video-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 8px; }
.hm-video { display: flex; flex-direction: column; gap: 6px; min-height: 0; color: var(--text) !important; text-decoration: none !important; }
.hm-video-thumb { position: relative; flex: 1; min-height: 0; border-radius: 12px; overflow: hidden; background: var(--btn-bg); }
.hm-video-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hm-video:hover .hm-list-title { text-decoration: underline; }
.hm-duration { position: absolute; right: 6px; bottom: 6px; padding: 1px 6px; border-radius: 5px; background: rgba(0, 0, 0, 0.8); color: #fff; font-size: 11px; font-weight: 600; }

/* EyefindMatic */
.hm-matic-strip { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.hm-matic-strip a { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--btn-bg); }
.hm-matic-strip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s var(--ease); }
.hm-matic-strip a:hover img { transform: scale(1.05); }

/* Tuiles (météo, pour vous, collecte, sondage) */
.hm-tile {
  position: relative; box-sizing: border-box; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; min-width: 0;
  padding: 18px; border: 1px solid var(--border); border-radius: 22px; background: var(--bg); overflow: hidden;
  color: var(--text) !important; text-decoration: none !important; transition: transform 0.15s var(--ease), border-color 0.15s var(--ease);
}
a.hm-tile:hover { transform: translateY(-2px); border-color: var(--border-hover); }
a.hm-tile:focus-visible, .hm-panel a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.hm-tile-head { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-tile-big { display: flex; align-items: center; gap: 10px; font-size: 38px; font-weight: 400; line-height: 1; letter-spacing: -0.02em; }
.hm-tile-big-ep small { font-size: 15px; font-weight: 700; letter-spacing: 0; color: #c98a12; }
.hm-tile-foot { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-tile-links { display: flex; flex-wrap: wrap; gap: 2px 14px; white-space: normal; }
.hm-tile-links a, .hm-tile-cta { color: var(--link) !important; font-weight: 600; }
.hm-tile-title { font-size: 17px; font-weight: 600; line-height: 1.3; }
.hm-tile-text { font-size: 14px; line-height: 1.45; color: var(--text-muted); }
.hm-clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hm-tile-kicker { font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.hm-tile-weather { border: 0; background: linear-gradient(160deg, #2f74c0, #194f8c); color: #fff !important; }
.hm-tile-weather .hm-tile-head, .hm-tile-weather .hm-tile-foot { color: rgba(255, 255, 255, 0.85); }
.hm-tile-dons { border-color: color-mix(in srgb, var(--da) 40%, var(--border)); background: linear-gradient(140deg, color-mix(in srgb, var(--da) 16%, var(--bg)), var(--bg)); }
.hm-tile-dons .hm-tile-head { color: var(--da); font-weight: 600; }
.hm-tile-dons .hm-tile-cta { color: var(--da) !important; }
.hm-tile-amount { font-size: 34px; font-weight: 800; line-height: 1; }
.hm-bar { display: block; height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--da) 18%, transparent); overflow: hidden; }
.hm-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--da), var(--db)); }
.hm-tile-poll { background: linear-gradient(140deg, var(--link-tint), var(--bg)); }

/* Le reste du contenu, en liens */
.hm-bento-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 12px; margin: 22px 0 52px; font-size: 14px; color: var(--text-muted); }
.hm-bento-links a { color: var(--link) !important; }

@media (max-width: 1000px) {
  .hm-board-row { grid-template-columns: repeat(2, minmax(0, 1fr)); height: auto !important; }
  .hm-board-top > .hm-une2 { grid-column: 1 / -1; height: 380px; }
  .hm-board-mid > .hm-panel { grid-column: 1 / -1; height: 260px; }
  .hm-stack > .hm-tile, .hm-board-short > .hm-tile, .hm-board-mid > .hm-tile { min-height: 168px; }
  .hm-matic-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hm-wrap { padding: 0 14px; }
  .hm-board-row { grid-template-columns: minmax(0, 1fr); }
  .hm-board-top > .hm-une2 { height: 330px; }
  .hm-une2-title { font-size: 20px; }
  .hm-video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-video-grid > :nth-child(3) { display: none; }
  .hm-tile, .hm-panel:not(.hm-une2) { padding: 14px 16px; }
  .hm-une2-text { padding: 14px 16px 16px; }
  .hm-tile-big { font-size: 32px; }
  .hm-pill-svc { font-size: 13px; }
  .hm-new { padding: 14px; }
  .hm-new-head { flex-wrap: wrap; }
  .hm-new-head a { order: 3; margin-left: 0; }
  .hm-new-close { margin-left: auto; }
  .hm-new-list { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .hm-new-item:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  a.hm-tile:hover, .hm-une2:hover .hm-une2-media img, .hm-matic-strip a:hover img { transform: none; }
}