/* =====================================================
   Horizon Magazine Manager — Base CSS
   Variables globales, reset, utilitaires partagés
   ===================================================== */

/* ─── Variables globales ───────────────────────────── */
:root {
  --hmm-accent:       #e63946;
  --hmm-gap:          24px;
  --hmm-radius:       8px;
  --hmm-cols:         3;
  --hmm-card-bg:      #ffffff;
  --hmm-text:         #1a1a2e;
  --hmm-text-muted:   #6c757d;
  --hmm-border:       #e9ecef;
  --hmm-overlay-dark: rgba(0, 0, 0, 0.65);
  --hmm-trans:        0.28s ease;
}

/* ─── Image wrapper — ratio garanti ────────────────── */
.hmm-img-wrap {
  display: block;
  width: 100%;
  overflow: hidden;
  position: relative;
  background-color: #f0f0f0;
  /* Forcer le respect du border-radius parent */
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: radial-gradient(white, black);
}

.hmm-img-wrap img.hmm-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform var(--hmm-trans);
}

/* ─── Format icons ─────────────────────────────────── */
.hmm-format-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity var(--hmm-trans);
  pointer-events: none;
  z-index: 3;
}

.hmm-format-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.hmm-card:hover .hmm-format-icon {
  opacity: 1;
}

/* ─── Meta bar ─────────────────────────────────────── */
.hmm-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--hmm-text-muted);
}

.hmm-meta__cat {
  display: inline-block;
  background: var(--hmm-accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: background var(--hmm-trans);
  line-height: 1.6;
}

.hmm-meta__cat:hover {
  background: color-mix(in srgb, var(--hmm-accent) 80%, #000);
  color: #fff;
  text-decoration: none;
}

.hmm-meta__date,
.hmm-meta__author,
.hmm-meta__comments,
.hmm-meta__readtime {
  font-size: 11px;
  color: var(--hmm-text-muted);
}

.hmm-meta__date time,
.hmm-meta__author a,
.hmm-meta__comments a {
  color: inherit;
  text-decoration: none;
}

.hmm-meta__author a:hover,
.hmm-meta__comments a:hover {
  color: var(--hmm-accent);
}

/* ─── Block heading ────────────────────────────────── */
.hmm-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.hmm-heading__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--hmm-title-color, var(--hmm-text));
  line-height: 1.2;
}

.hmm-heading__see-all {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hmm-accent);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.hmm-heading__see-all:hover {
  text-decoration: underline;
}

/* Heading style: line */
.hmm-heading--line .hmm-heading__title {
  padding-left: 14px;
  border-left: 4px solid var(--hmm-accent);
}

/* Heading style: border */
.hmm-heading--border {
  border-bottom: 2px solid var(--hmm-accent);
  padding-bottom: 10px;
}

/* Heading style: badge */
.hmm-heading--badge .hmm-heading__title {
  background: var(--hmm-accent);
  color: #fff;
  padding: 4px 14px;
  border-radius: 4px;
}

/* Heading style: highlight */
.hmm-heading--highlight .hmm-heading__title {
  background: linear-gradient(to bottom, transparent 50%, color-mix(in srgb, var(--hmm-accent) 20%, transparent) 50%);
}

/* Heading style: double */
.hmm-heading--double {
  border-top: 3px solid var(--hmm-accent);
  border-bottom: 1px solid var(--hmm-border);
  padding: 10px 0;
}

/* ─── Utility: clearfix ────────────────────────────── */
.hmm-clearfix::after {
  content: '';
  display: table;
  clear: both;
}

/* ─── Nouvelles variables v1.1 ──────────────────────── */
:root {
  --hmm-link:         inherit;
  --hmm-link-hover:   var(--hmm-accent);
  --hmm-title-color:  #1a1a2e;
  --hmm-meta-color:   #6c757d;
  --hmm-card-padding: 14px 16px 16px;
}

/* ─── Liens dans les cartes ─────────────────────────── */
.hmm-card a { color: var(--hmm-link); }
.hmm-card a:hover { color: var(--hmm-link-hover); }

/* ─── Card padding configurable ────────────────────── */
.hmm-card__body { padding: var(--hmm-card-padding); }

/* ─── Position méta ─────────────────────────────────── */
.hmm-meta--above-title  { order: -1; }
.hmm-meta--below-title  { order: 1; }
.hmm-meta--below-excerpt{ order: 3; }
.hmm-meta--on-image {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 4;
  background: rgba(0,0,0,.45);
  border-radius: 4px;
  padding: 3px 8px;
}
.hmm-meta--on-image .hmm-meta__cat { background: transparent; }
.hmm-meta--on-image .hmm-meta__date,
.hmm-meta--on-image .hmm-meta__author { color: rgba(255,255,255,.9); }

/* ─── Séparateur méta ───────────────────────────────── */
.hmm-meta__sep { margin: 0 4px; opacity: .4; }

/* ─── Bouton Lire la suite ──────────────────────────── */
.hmm-read-more-wrap {
  /* wrapper pour l'alignement */
}

.hmm-read-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  text-decoration: none;
  transition: all 0.22s ease;
  color: var(--hmm-accent, #6366f1);
  cursor: pointer;
}

/* Lien simple */
.hmm-read-more--link { background: none; border: none; padding: 0; }
.hmm-read-more--link:hover { text-decoration: underline; opacity: .8; }

/* Flèche */
.hmm-read-more--arrow { background: none; border: none; padding: 0; }
.hmm-read-more--arrow::after { content: ' →'; }
.hmm-read-more--arrow:hover { gap: 10px; }

/* Plein (filled) — fond coloré */
.hmm-read-more--filled {
  background: var(--hmm-accent, #6366f1);
  color: #fff !important;
  padding: 8px 20px;
  border-radius: 4px;
  border: 2px solid transparent;
}
.hmm-read-more--filled:hover { filter: brightness(1.12); transform: translateY(-1px); }

/* Contour (outline) — transparent avec bordure */
.hmm-read-more--outline {
  background: transparent !important;
  padding: 6px 16px;
  border-radius: 4px;
  border: 2px solid currentColor !important;
}
.hmm-read-more--outline:hover { background: currentColor !important; filter: invert(1); }

/* Arrondi (pill) — fond coloré capsule */
.hmm-read-more--pill {
  background: var(--hmm-accent, #6366f1);
  color: #fff !important;
  padding: 7px 24px;
  border-radius: 50px;
  border: 2px solid transparent;
}
.hmm-read-more--pill:hover { filter: brightness(1.12); transform: translateY(-1px); }

/* Arrondi contour (pill-outline) — capsule transparente */
.hmm-read-more--pill-outline {
  background: transparent !important;
  padding: 6px 22px;
  border-radius: 50px;
  border: 2px solid currentColor !important;
}
.hmm-read-more--pill-outline:hover { opacity: .7; }

/* Sous-ligné (underline) — juste un trait sous le texte */
.hmm-read-more--underline {
  background: none !important;
  border: none !important;
  padding: 0 0 3px 0 !important;
  border-radius: 0 !important;
  border-bottom: 2px solid currentColor !important;
  text-transform: none;
  letter-spacing: 0;
}
.hmm-read-more--underline:hover { opacity: .7; padding-bottom: 4px !important; }

/* Trait gauche (border-left) */
.hmm-read-more--border-left {
  background: none !important;
  border: none !important;
  border-left: 3px solid currentColor !important;
  padding: 2px 0 2px 10px !important;
  border-radius: 0 !important;
  text-transform: none;
}
.hmm-read-more--border-left:hover { padding-left: 14px !important; }

/* Icône → à droite */
.hmm-read-more--arrow-right::after {
  content: ' →';
  display: inline-block;
  transition: transform 0.2s;
}
.hmm-read-more--arrow-right:hover::after { transform: translateX(4px); }

/* Icône + à gauche */
.hmm-read-more--icon-plus::before { content: '+ '; font-weight: 900; }

/* Pleine largeur */
.hmm-read-more[style*="width:100%"] { justify-content: center; }

/* ─── Heading sous-titre ────────────────────────────── */
.hmm-heading__left { display: flex; flex-direction: column; gap: 3px; }
.hmm-heading__sub  { font-size: 13px; color: var(--hmm-text-muted, #6c757d); font-weight: 400; }
.hmm-heading__icon { display: inline-flex; align-items: center; margin-right: 6px; }
.hmm-heading__icon svg { width: 18px; height: 18px; }

/* ─── Séparateurs presse (hmm-grid) ─────────────────── */
.hmm-grid--divider-v .hmm-grid__items {
  column-gap: 0;
  position: relative;
}
.hmm-grid--divider-v .hmm-grid__item {
  border-right: var(--hmm-divider-width, 1px) var(--hmm-divider-style, solid) var(--hmm-divider-color, #e9ecef);
  padding-right: var(--hmm-gap);
  padding-left: var(--hmm-gap);
}
.hmm-grid--divider-v .hmm-grid__item:last-child { border-right: none; }
.hmm-grid--divider-v .hmm-grid__item:first-child { padding-left: 0; }

.hmm-grid--divider-h .hmm-grid__item {
  border-bottom: var(--hmm-divider-width, 1px) var(--hmm-divider-style, solid) var(--hmm-divider-color, #e9ecef);
  padding-bottom: var(--hmm-gap);
}

/* ── Police globale Arial pour tous les modules HMM ─────────────────────
   Force Arial pour résister aux polices de thème
   ─────────────────────────────────────────────────────────────────────── */
.hmm-grid, .hmm-hero, .hmm-list, .hmm-ticker,
.hmm-focus, .hmm-author, .hmm-widget,
.hmm-card, .hmm-card__title, .hmm-card__excerpt,
.hmm-card__body, .hmm-meta, .hmm-heading,
.hmm-list__item, .hmm-list__title, .hmm-list__excerpt,
.hmm-hero__title, .hmm-hero__excerpt {
  font-family: Arial, Helvetica, sans-serif !important;
}

/* ─── Pagination HMM ────────────────────────────────────── */
.hmm-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 24px 0 8px;
}

/* Numéros */
.hmm-pagination--numbers .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 5px;
  border: 1.5px solid var(--hmm-accent, #6366f1);
  color: var(--hmm-accent, #6366f1);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all .18s;
}
.hmm-pagination--numbers .page-numbers:hover,
.hmm-pagination--numbers .page-numbers.current {
  background: var(--hmm-accent, #6366f1);
  color: #fff;
}
.hmm-pagination--numbers .page-numbers.dots {
  border: none;
  background: none;
}

/* Précédent / Suivant */
.hmm-pagination--prev-next { gap: 12px; }
.hmm-pagination__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 5px;
  border: 1.5px solid var(--hmm-accent, #6366f1);
  color: var(--hmm-accent, #6366f1);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all .18s;
}
.hmm-pagination__btn:hover {
  background: var(--hmm-accent, #6366f1);
  color: #fff;
}

/* Charger plus */
.hmm-pagination--load-more { justify-content: center; }
.hmm-pagination__load-more {
  padding: 10px 28px;
  border-radius: 30px;
}

/* Infini */
.hmm-pagination__spinner {
  display: block;
  text-align: center;
  font-size: 24px;
  color: var(--hmm-accent, #6366f1);
  animation: hmm-spin 1s linear infinite;
}
@keyframes hmm-spin { to { transform: rotate(360deg); } }
