/*
Theme Name: Blocksy Alexandre Munoz
Description: Thème enfant Blocksy — identité noir carbone / rouge course du site d'Alexandre Munoz. V1.
Template: blocksy
Version: 1.0.9
Author: Paul Houzé
Text Domain: blocksy-alexandre
*/

:root {
  --am-noir: #0B0B0D;
  --am-surface: #141416;
  --am-surface2: #1B1B1E;
  --am-sep: #232326;
  --am-sep2: #2C2C30;
  --am-rouge: #E10600;
  --am-rouge-hover: #C10500;
  --am-blanc: #F2F0EA;
  --am-gris: #B8B6AF;
  --am-gris2: #6E6D68;
  --am-gris3: #5A5A5E;
  --am-vert: #2E7D4F;
  --am-oswald: 'Oswald', sans-serif;
  --am-inter: 'Inter', system-ui, sans-serif;
}

body {
  background: var(--am-noir);
  color: var(--am-blanc);
  font-family: var(--am-inter);
}

body a { text-decoration: none; }

h1, h2, h3, .site-title {
  font-family: var(--am-oswald);
  color: var(--am-blanc);
}

/* ---------- Header Blocksy ---------- */
.ct-header, [data-header] .ct-container {
  background: rgba(11, 11, 13, 0.92);
}
.ct-header {
  border-bottom: 1px solid var(--am-sep);
}
.ct-header a, .ct-header .site-title, .ct-header [data-id] a {
  color: var(--am-gris);
}
.ct-header a:hover { color: var(--am-blanc); }
.ct-header .current-menu-item > a,
.ct-header [aria-current="page"] {
  color: var(--am-rouge) !important;
}
.site-title {
  font-family: var(--am-oswald);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--am-blanc);
}
.site-title::before {
  content: "95";
  color: var(--am-rouge);
  font-weight: 600;
  margin-right: 7px;
}

/* ---------- Structure générale ---------- */
.site-main { background: var(--am-noir); }
.am-wrap {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}
.am-section {
  padding-top: 72px;
  padding-bottom: 72px;
  border-bottom: 1px solid var(--am-sep);
}
.am-kicker {
  font-family: var(--am-oswald);
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--am-gris2);
  text-transform: uppercase;
  margin-bottom: 20px;
}
.am-kicker strong { color: var(--am-rouge); font-weight: 500; }

/* ---------- Placeholders photos ---------- */
.am-placeholder {
  background: var(--am-surface);
  border: 1px dashed var(--am-sep2);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--am-gris3);
  font-size: 13px;
  text-align: center;
  padding: 12px;
  min-height: 160px;
}
.am-placeholder p { color: var(--am-gris3); margin: 0; font-size: 13px; }

/* ---------- Hero ---------- */
.am-hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: center;
  padding: 100px 0 60px;
  overflow: hidden;
  border-bottom: 1px solid var(--am-sep);
}
.am-hero::before {
  content: "95";
  position: absolute;
  top: -40px;
  right: 0;
  font-family: var(--am-oswald);
  font-weight: 600;
  font-size: clamp(240px, 32vw, 460px);
  line-height: 1;
  color: #131315;
  pointer-events: none;
}
.am-hero > * { position: relative; }
.am-hero h1 {
  font-size: clamp(52px, 8vw, 104px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0 0 22px;
}
.am-hero-sub {
  max-width: 540px;
  color: var(--am-gris);
  font-size: 17px;
}
.am-hero-sub strong { color: var(--am-blanc); font-weight: 500; }
.am-hero-photo { height: 420px; margin-top: 48px; }

/* ---------- Boutons ---------- */
.wp-block-button.am-btn-rouge .wp-block-button__link {
  background: var(--am-rouge);
  color: #fff;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 500;
  padding: 13px 24px;
  border: 0;
}
.wp-block-button.am-btn-rouge .wp-block-button__link:hover { background: var(--am-rouge-hover); }
.wp-block-button.am-btn-ghost .wp-block-button__link {
  background: transparent;
  color: var(--am-blanc);
  border: 1px solid var(--am-sep2);
  border-radius: 3px;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 23px;
}
.wp-block-button.am-btn-ghost .wp-block-button__link:hover { border-color: var(--am-gris2); }

/* ---------- Bandeau course (shortcode) ---------- */
.am-band { border-bottom: 1px solid var(--am-sep); }
.am-band-grid { display: grid; grid-template-columns: 1fr 1.3fr; }
.am-band-cell { padding: 22px 28px; }
.am-band-cell + .am-band-cell { border-left: 1px solid var(--am-sep); }
.am-band-label {
  font-family: var(--am-oswald);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--am-gris2);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.am-band-value { font-family: var(--am-oswald); font-size: 20px; letter-spacing: 0.5px; color: var(--am-blanc); }
.am-band-value a { color: var(--am-rouge); }
.am-band-live { border-left: 3px solid var(--am-rouge); padding: 24px 28px; }
.am-live-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.am-live-badge {
  background: var(--am-rouge);
  color: #fff;
  font-family: var(--am-oswald);
  font-size: 12px;
  letter-spacing: 2px;
  padding: 5px 12px;
  border-radius: 2px;
  text-transform: uppercase;
  animation: am-pulse 2s infinite;
}
@keyframes am-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.65; } }
.am-live-title { font-family: var(--am-oswald); font-size: 22px; color: var(--am-blanc); }
.am-live-sessions { display: flex; gap: 24px; flex-wrap: wrap; font-size: 14px; color: var(--am-gris); margin-bottom: 16px; }
.am-live-links { display: flex; gap: 10px; flex-wrap: wrap; }
.am-live-links a {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 3px;
}
.am-live-links a.rouge { background: var(--am-rouge); color: #fff; }
.am-live-links a.ghost { border: 1px solid var(--am-sep2); color: var(--am-blanc); }
.am-band-note { font-size: 12px; color: var(--am-gris3); padding: 0 28px 14px; }

/* ---------- Pyramide ---------- */
.am-pyr .wp-block-column {
  background: var(--am-surface);
  border-top: 3px solid var(--am-sep2);
  padding: 20px;
}
.am-pyr .wp-block-column.am-done { border-top-color: var(--am-vert); }
.am-pyr .wp-block-column.am-active { border-top-color: var(--am-rouge); }
.am-pyr-status { font-family: var(--am-oswald); font-size: 15px; letter-spacing: 0.5px; margin: 14px 0 4px; color: var(--am-blanc); }
.am-pyr-status .ok { color: var(--am-vert); }
.am-pyr-status .dot { color: var(--am-rouge); }
.am-pyr p:not(.am-pyr-status) { font-size: 13px; color: var(--am-gris); margin: 0; }
.am-pyr .am-placeholder { min-height: 52px; }

/* ---------- Actualités ---------- */
.am-news .wp-block-column {
  background: var(--am-surface);
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.15s;
}
.am-news .wp-block-column:hover { transform: translateY(-3px); }
.am-news .am-placeholder { min-height: 170px; border-radius: 0; border-left: 0; border-right: 0; border-top: 0; }
.am-news-body { padding: 16px 18px 20px; }
.am-news-date {
  font-family: var(--am-oswald);
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--am-rouge);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.am-news-title { font-size: 15px; font-weight: 500; line-height: 1.45; color: var(--am-blanc); margin: 0; }
.am-news-more { font-size: 14px; color: var(--am-gris); }
.am-news-more:hover { color: var(--am-blanc); }
.am-news-more strong { color: var(--am-rouge); font-weight: 400; }

/* ---------- Plus qu'un pilote ---------- */
.am-muco h2 {
  font-weight: 500;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.35;
  letter-spacing: 0.3px;
  margin: 0 0 16px;
}
.am-muco p { color: var(--am-gris); font-size: 15px; }
.am-muco-link { color: var(--am-blanc); border-bottom: 1px solid var(--am-rouge); padding-bottom: 2px; font-size: 14px; }

/* ---------- Partenaires ---------- */
.am-partners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 40px;
}
.am-partners-grid p {
  background: var(--am-surface);
  border-radius: 3px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--am-gris2);
  text-align: center;
  padding: 8px;
  margin: 0;
  filter: grayscale(1);
  transition: filter 0.15s, color 0.15s;
}
.am-partners-grid p:hover { filter: none; color: var(--am-gris); }
.am-cta-dossier {
  background: var(--am-surface);
  border-left: 3px solid var(--am-rouge);
  padding: 32px;
}
.am-cta-dossier h3 { font-weight: 500; font-size: 24px; letter-spacing: 0.5px; margin: 0 0 10px; }
.am-cta-dossier p { color: var(--am-gris); font-size: 14px; }

/* ---------- Drapeaux ---------- */
.am-flag {
  border-radius: 2px;
  outline: 1px solid rgba(242, 240, 234, 0.15);
  outline-offset: -1px;
  vertical-align: -2px;
  flex-shrink: 0;
}

/* ---------- Page Saison : calendrier ---------- */
.am-sn { margin-top: 8px; }
.am-sn-item {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--am-sep);
  border-left: 3px solid var(--am-sep2);
  background: transparent;
  transition: background 0.15s;
}
.am-sn-item:hover { background: var(--am-surface); }
.am-sn-done { border-left-color: var(--am-vert); }
.am-sn-live { border-left-color: var(--am-rouge); background: var(--am-surface); }
.am-sn-upcoming { opacity: 0.85; }
.am-sn-n {
  font-family: var(--am-oswald);
  font-size: 26px;
  font-weight: 600;
  color: var(--am-gris3);
  min-width: 44px;
}
.am-sn-live .am-sn-n { color: var(--am-rouge); }
.am-sn-done .am-sn-n { color: var(--am-gris2); }
.am-sn-main { flex: 1.2; }
.am-sn-circuit {
  font-family: var(--am-oswald);
  font-size: 18px;
  letter-spacing: 0.5px;
  color: var(--am-blanc);
}
.am-sn-circuit span {
  font-family: var(--am-inter);
  font-size: 12px;
  color: var(--am-gris2);
  margin-left: 8px;
}
.am-sn-dates { font-size: 13px; color: var(--am-gris2); margin-top: 2px; }
.am-sn-res { flex: 1.4; font-family: var(--am-oswald); font-size: 15px; letter-spacing: 0.5px; color: var(--am-blanc); text-align: right; }
.am-sn-res a { color: var(--am-rouge); }
.am-sn-badge {
  background: var(--am-rouge);
  color: #fff;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 2px;
  animation: am-pulse 2s infinite;
}
.am-sn-avenir { color: var(--am-gris2); font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }
@media (max-width: 700px) {
  .am-sn-item { flex-wrap: wrap; gap: 10px; }
  .am-sn-res { text-align: left; flex-basis: 100%; }
}

/* ---------- Revue de presse ---------- */
.am-press-year {
  font-family: var(--am-oswald);
  font-size: 14px;
  letter-spacing: 2.5px;
  color: var(--am-rouge);
  margin: 38px 0 8px;
}
.am-press-item {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--am-sep);
}
.am-press-date {
  font-family: var(--am-oswald);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--am-gris2);
  min-width: 64px;
  white-space: nowrap;
}
.am-press-media {
  font-family: var(--am-oswald);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--am-gris);
  border: 1px solid var(--am-sep2);
  border-radius: 2px;
  padding: 2px 8px;
  white-space: nowrap;
}
.am-press-item a { color: var(--am-blanc); font-size: 15px; line-height: 1.5; }
.am-press-item a:hover { color: var(--am-rouge); }
.am-press-lang { font-size: 11px; color: var(--am-gris3); }
@media (max-width: 700px) {
  .am-press-item { flex-wrap: wrap; gap: 8px; }
}

/* ---------- Footer Blocksy ---------- */
.ct-footer, footer[data-id] {
  background: var(--am-noir);
  border-top: 1px solid var(--am-sep);
  color: var(--am-gris2);
}
.ct-footer a { color: var(--am-gris2); }
.ct-footer a:hover { color: var(--am-gris); }

/* ---------- Correctifs v1.0.1 (inspection Chrome) ---------- */
body.home .entry-header,
body.home .page-title,
body.home .hero-section { display: none; }

#header [data-row],
#header [data-row] > div {
  background: var(--am-noir) !important;
}
.ct-header-search,
[data-id="search"] { display: none !important; }

.ct-footer [data-row],
.ct-footer [data-row] > div,
footer[data-id] [data-row],
footer[data-id] [data-row] > div {
  background: var(--am-noir) !important;
}

.site-main a:not(.wp-block-button__link):not(.rouge):not(.ghost) { color: var(--am-gris); }
.site-main a:not(.wp-block-button__link):not(.rouge):not(.ghost):hover { color: var(--am-blanc); }
.am-muco-link { color: var(--am-blanc); }
.am-band-value a { color: var(--am-rouge); }
.am-news-more a strong { color: var(--am-rouge); }
.ct-footer a, .ct-footer .ct-copyright a { color: var(--am-gris2) !important; }
.ct-footer a:hover { color: var(--am-gris) !important; }

/* ---------- Verrouillage strict des images ----------
   Les dimensions sont imposées par le thème : les réglages manuels
   (poignées, alignements, largeurs personnalisées) sont neutralisés. */
.am-hero .wp-block-image,
.am-news .wp-block-image,
.am-muco .wp-block-image,
.am-hero .am-placeholder,
.am-news .am-placeholder,
.am-muco .am-placeholder {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
.am-hero .wp-block-image img,
.am-hero .am-placeholder img {
  width: 100% !important;
  height: 420px !important;
  object-fit: cover !important;
  border-radius: 4px 4px 0 0;
}
.am-news .wp-block-image img,
.am-news .am-placeholder img {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 3 / 2 !important;
  object-fit: cover !important;
}
.am-muco .wp-block-image img,
.am-muco .am-placeholder img {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 4 / 5 !important;
  object-fit: cover !important;
  border-radius: 4px;
}
.am-pyr .wp-block-image img,
.am-pyr .am-placeholder img {
  height: 52px !important;
  width: auto !important;
  margin: 0 auto;
  object-fit: contain !important;
}
.am-partners-grid .wp-block-image img {
  max-height: 40px !important;
  width: auto !important;
  object-fit: contain !important;
}

/* ---------- Cadrage réglable : bloc Bannière (Cover) + point focal ---------- */
.am-placeholder:has(.wp-block-cover) {
  border: 0; background: transparent; padding: 0; min-height: 0; display: block;
}
.am-placeholder:has(.wp-block-cover) > p { display: none; }
.am-hero .wp-block-cover {
  height: 420px !important;
  min-height: 0 !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 48px 0 0;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
}
.am-news .wp-block-cover {
  aspect-ratio: 3 / 2 !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden;
}
.am-muco .wp-block-cover {
  aspect-ratio: 4 / 5 !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  border-radius: 4px;
  overflow: hidden;
}
.am-hero .wp-block-cover .wp-block-cover__background,
.am-news .wp-block-cover .wp-block-cover__background,
.am-muco .wp-block-cover .wp-block-cover__background { opacity: 0 !important; }

/* Ajustement rapide sur un bloc Image : classes CSS additionnelles */
.am-cadrage-haut img { object-position: center top !important; }
.am-cadrage-bas img { object-position: center bottom !important; }

/* ---------- Images : jamais de débordement ---------- */
.site-main img { max-width: 100%; height: auto; }

/* Une image déposée dans un cadre pointillé remplace le cadre */
.am-placeholder:has(.wp-block-image) {
  border: 0;
  background: transparent;
  padding: 0;
  min-height: 0;
  display: block;
}
.am-placeholder:has(.wp-block-image) > p { display: none; }
.am-placeholder .wp-block-image { margin: 0; width: 100%; }
.am-placeholder img { display: block; width: 100%; }
.am-hero .am-placeholder img { height: 420px; object-fit: cover; border-radius: 4px 4px 0 0; }
.am-news .am-placeholder img { aspect-ratio: 3 / 2; object-fit: cover; }
.am-muco .am-placeholder img { aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; }
.am-pyr .am-placeholder img { height: 52px; width: auto; margin: 0 auto; object-fit: contain; }

/* ---------- Images : recadrage automatique des emplacements ---------- */
.am-hero .wp-block-image { margin: 48px 0 0; }
.am-hero .wp-block-image img { width: 100%; height: 420px; object-fit: cover; border-radius: 4px 4px 0 0; }
.am-news .wp-block-image { margin: 0; }
.am-news .wp-block-image img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.am-muco .wp-block-image img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; }
.am-pyr .wp-block-image { margin: 0 0 14px; }
.am-pyr .wp-block-image img { height: 52px; width: auto; object-fit: contain; }
.am-partners-grid .wp-block-image img { max-height: 40px; width: auto; object-fit: contain; filter: grayscale(1); }
.am-partners-grid .wp-block-image:hover img { filter: none; }

/* ---------- Hero intégré : la photo est le fond de la section ---------- */
body.home .ct-container-full { padding-top: 0 !important; padding-bottom: 0 !important; }
.am-hero .am-wrap { position: static; width: 100%; }
.am-hero .am-wrap > * { position: relative; z-index: 2; }
.am-hero:has(img)::before { display: none; }
.am-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(11,11,13,0.94) 0%, rgba(11,11,13,0.62) 46%, rgba(11,11,13,0.18) 100%),
    linear-gradient(0deg, rgba(11,11,13,0.92) 0%, rgba(11,11,13,0) 28%);
}
.am-hero:not(:has(img))::after { display: none; }
.am-hero .am-placeholder,
.am-hero .wp-block-image,
.am-hero .wp-block-cover {
  position: absolute !important;
  inset: 0 !important;
  z-index: 0;
  margin: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  border-radius: 0 !important;
}
.am-hero .am-placeholder { border: 0; background: var(--am-surface); }
.am-hero .am-placeholder img,
.am-hero .wp-block-image img,
.am-hero .wp-block-cover img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 0 !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .am-section { padding-top: 52px; padding-bottom: 52px; }
  .am-hero { min-height: 72vh; padding: 90px 0 48px; }
  .am-band-grid { grid-template-columns: 1fr; }
  .am-band-cell + .am-band-cell { border-left: 0; border-top: 1px solid var(--am-sep); }
}
