/*
Theme Name: Arcade Neon
Theme URI: https://semperludo.fr
Author: Semper Ludo
Description: Theme de blocs (FSE) pour site de tests et news jeux video. Mobile first, note sur 10 en badge, bento grids. Toute la charte vit dans theme.json.
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
Version: 1.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: arcade-neon
Tags: blog, news, full-site-editing, block-patterns, one-column, two-columns, custom-colors, dark-mode
*/

/* Feuille volontairement minimale : couleurs, typo et espacements sont dans theme.json.
   Ici uniquement ce que theme.json ne sait pas exprimer. */

:root {
  --an-badge-9: var(--wp--preset--color--lime);
  --an-badge-7: var(--wp--preset--color--cyan);
  --an-badge-5: var(--wp--preset--color--jaune);
  --an-badge-0: var(--wp--preset--color--rose);
  --an-radius-card: 24px;
  --an-radius-btn: 14px;
}

/* ---------- Badge de note /10 ---------- */
.an-score {
  display: grid;
  place-items: center;
  width: clamp(56px, 14vw, 104px);
  aspect-ratio: 1;
  border-radius: clamp(18px, 4vw, 30px);
  background: var(--an-badge-9);
  color: var(--wp--preset--color--nuit);
  line-height: 1;
  flex: none;
}
.an-score--7 { background: var(--an-badge-7); }
.an-score--5 { background: var(--an-badge-5); }
.an-score--0 { background: var(--an-badge-0); }
.an-score__value {
  font-family: var(--wp--preset--font-family--titre);
  font-size: clamp(26px, 7vw, 44px);
}
.an-score__max { font-size: clamp(10px, 2vw, 12px); font-weight: 700; margin-top: 2px; }
.an-score--float { animation: an-float 4s ease-in-out infinite; }

@keyframes an-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .an-score--float { animation: none; } }

/* ---------- Carte de test ---------- */
.an-card {
  position: relative;
  border-radius: var(--an-radius-card);
  background: var(--wp--preset--color--violet-nuit);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.an-card:hover, .an-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 18px 34px -14px rgba(0, 0, 0, .7);
}
.an-card { overflow: visible; }
.an-card__media { overflow: hidden; border-radius: var(--an-radius-card) var(--an-radius-card) 0 0; background: var(--wp--preset--color--violet-nuit); height: 150px; }
.an-card__media .wp-block-post-featured-image { margin: 0; height: 100%; }
.an-card__media .wp-block-post-featured-image a { display: block; height: 100%; }
.an-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Article sans image mise en avant : bloc colore plutot qu'un trou */
.an-card__media:not(:has(img)) {
  background: linear-gradient(135deg, #22E1FF, #2B1050);
}
/* Badge en debord du visuel, comme la maquette */
.an-card__score { position: absolute; top: 122px; right: 14px; z-index: 2; }
.an-card__score .an-score { width: 52px; border-radius: 16px; }
.an-card__score .an-score__value { font-size: 20px; }
.an-card__score .an-score__max { display: none; }
.an-card__body { padding: 18px; }
.an-card__title { font-family: var(--wp--preset--font-family--titre); font-size: 18px; line-height: 1.15; margin: 6px 0 0; }
.an-card__title a { color: inherit; }
.an-card__body .wp-block-post-excerpt { margin-top: 8px; }
.an-card a { text-decoration: none; }
.an-card a:hover { text-decoration: underline; }

/* ---------- Barres de sous-notes ---------- */
.an-subscores { display: flex; flex-direction: column; gap: 12px; }
.an-subscore { display: flex; align-items: center; gap: 14px; }
.an-subscore__label { flex: 0 0 110px; font-size: 14px; font-weight: 700; color: var(--wp--preset--color--lavande); }
.an-subscore__track { flex: 1; height: 11px; border-radius: 999px; background: var(--wp--preset--color--bordure); overflow: hidden; }
.an-subscore__fill { display: block; height: 100%; border-radius: 999px; background: var(--an-badge-9); }
.an-subscore__num { font-family: var(--wp--preset--font-family--titre); font-size: 15px; width: 36px; text-align: right; }

/* ---------- Verdict (on adore / on rale) ---------- */
.an-verdict { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 600px) { .an-verdict { grid-template-columns: 1fr 1fr; } }
.an-verdict__col { border-radius: var(--an-radius-card); padding: clamp(16px, 4vw, 22px); }
.an-verdict__col--plus { background: #12281C; }
.an-verdict__col--moins { background: #2B1226; }
.an-verdict__title { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.an-verdict__col--plus .an-verdict__title { color: var(--wp--preset--color--lime); }
.an-verdict__col--moins .an-verdict__title { color: var(--wp--preset--color--rose); }
.an-verdict ul { margin: 12px 0 0; padding-left: 18px; line-height: 1.9; }

/* ---------- Barre d'action flottante (mobile) ---------- */
.an-actionbar {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 90;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 24px;
  background: color-mix(in srgb, var(--wp--preset--color--violet-nuit) 92%, transparent);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
}
.an-actionbar a {
  flex: 1;
  min-height: 48px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-size: 12px;
  font-weight: 700;
  color: var(--wp--preset--color--lavande);
  text-decoration: none;
}
.an-actionbar a[aria-current="page"] { color: var(--wp--preset--color--lime); }
.an-actionbar a.is-primary { background: var(--wp--preset--color--rose); color: var(--wp--preset--color--nuit); }
@media (min-width: 782px) { .an-actionbar { display: none; } }

/* ---------- Reglages fins ---------- */
body { overflow-x: hidden; }
.wp-block-post-content > * { max-width: 100%; }
.an-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--wp--preset--color--lavande); }
.an-meta { font-size: 14px; color: var(--wp--preset--color--lavande); }
.an-hero-overlay { background: linear-gradient(to top, rgba(14, 11, 26, .96) 10%, rgba(14, 11, 26, .25) 60%, transparent); }
.skip-link:focus { position: fixed; top: 12px; left: 12px; z-index: 100; padding: 12px 18px; background: var(--wp--preset--color--lime); color: var(--wp--preset--color--nuit); border-radius: 12px; }

/* ---------- Accueil : bento ---------- */
.an-bento { display: grid; gap: clamp(14px, 3vw, 20px); grid-template-columns: 1fr; }
@media (min-width: 900px) { .an-bento { grid-template-columns: 1.6fr 1fr; align-items: stretch; } }
.an-bento > .wp-block-query, .an-bento__side { min-width: 0; }
.an-bento__side { display: grid; gap: clamp(14px, 3vw, 20px); grid-template-rows: 1fr 1fr; }
.an-bento__card { padding: clamp(20px, 4vw, 26px); display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.an-bento__title { font-family: var(--wp--preset--font-family--titre); font-size: clamp(20px, 4.5vw, 24px); line-height: 1.15; margin: 0; }
.an-bento__card p { margin: 0; }
.an-bento__cta { font-weight: 700; }
.an-bento__cta a, .an-bento__card--dossier a { color: inherit; text-decoration: none; }

.an-hero { position: relative; background: linear-gradient(135deg, #221A3D, #0E0B1A); }
.an-hero img.wp-block-cover__image-background { object-fit: cover; }
.an-hero .wp-block-cover__inner-container { width: 100%; }
.an-hero__score { position: absolute; top: clamp(14px, 3vw, 24px); right: clamp(14px, 3vw, 24px); z-index: 2; }
.an-hero__title { font-family: var(--wp--preset--font-family--titre); font-size: clamp(28px, 6vw, 46px); line-height: 1.03; margin: 14px 0 0; max-width: 20ch; }
.an-hero__title a { color: inherit; text-decoration: none; }
.an-hero__excerpt { margin-top: 10px; max-width: 46ch; }
.an-pill {
  display: inline-block; margin: 0; padding: 6px 13px; border-radius: 999px;
  background: var(--wp--preset--color--rose); color: var(--wp--preset--color--nuit);
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
}

/* ---------- Titre de section + filtres ---------- */
.an-section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.an-section-head__title { font-family: var(--wp--preset--font-family--titre); font-size: clamp(22px, 5vw, 26px); margin: 0; }
.an-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; font-size: 13px; }
.an-chips a {
  padding: 8px 14px; border-radius: 999px; background: var(--wp--preset--color--violet-nuit);
  color: var(--wp--preset--color--lavande); text-decoration: none;
}
.an-chips a:hover { color: #fff; }
.an-chips a.is-active { background: var(--wp--preset--color--lime); color: var(--wp--preset--color--nuit); font-weight: 700; }

/* Grille de tests : fluide, 1 a 5 colonnes selon la largeur */
.an-grid {
  display: grid !important;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}
@media (min-width: 1700px) { .an-grid { grid-template-columns: repeat(5, 1fr); } }
.an-grid > li { list-style: none; margin: 0; }
@media (min-width: 1200px) {
  .an-card__media { height: 178px; }
  .an-card__score { top: 150px; }
}

/* Cases bento : texte, meta calee en bas (maquette) */
.an-bento__card .wp-block-query, .an-bento__card .wp-block-post-template { min-width: 0; }
.an-bento__card .wp-block-post-template { display: flex; flex-direction: column; height: 100%; }
.an-bento__card .wp-block-post-template > li { list-style: none; margin: 0; display: flex; flex-direction: column; gap: 10px; height: 100%; }
.an-bento__card .an-meta { margin-top: auto; }
.an-bento__card .an-eyebrow { margin-bottom: 2px; }
