/* ==========================================================
   OCI – Boîte à outils
   Cartes calquées sur les cartes d'actualités du thème hub-child
   ========================================================== */

.oci-bao-grid {
  display: grid;
  grid-template-columns: repeat(var(--oci-bao-cols, 3), minmax(0, 1fr));
  gap: 2rem;
  margin: 0;
  scroll-margin-top: 200px; /* ancre /boite-a-outils/#rubrique : laisse le titre visible sous le header */
}

@media (max-width: 1024px) {
  .oci-bao-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .oci-bao-grid { grid-template-columns: 1fr; gap: 1.25rem; }
}

/* ---------- Couleurs par rubrique ----------
   Bleu (couleur principale du site) par défaut, rouge pour les bons plans. */
.oci-bao-card,
.oci-bao-fiche {
  --oci-bao-accent: var(--e-global-color-primary, #213ba8);
}
.oci-rubrique--bons-plans {
  --oci-bao-accent: #FF4B6B;
}

/* ---------- Carte ---------- */

.oci-bao-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.oci-bao-card:hover,
.oci-bao-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px 0 rgba(0, 0, 0, 0.12);
}

.oci-bao-thumb { margin: 0; }
.oci-bao-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.oci-bao-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  padding: 26px 26px 28px;
}

/* Titre : même typo que les titres des cartes d'actualités */
.oci-bao-card .oci-bao-title {
  margin: 0;
  font-family: "Urbanist", sans-serif;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.2;
  color: #000;
}

/* Toute la carte est cliquable */
.oci-bao-link { color: inherit; text-decoration: none; }
.oci-bao-link:hover { color: inherit; }
.oci-bao-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 30px;
}
.oci-bao-link:focus-visible { outline: none; }
.oci-bao-link:focus-visible::after {
  outline: 3px solid var(--oci-bao-accent);
  outline-offset: 3px;
}

.oci-bao-excerpt {
  font-size: 17px;
  line-height: 1.55;
  color: #1a1a1a;
}
.oci-bao-excerpt p { margin: 0; }

/* Bouton : contour arrondi, comme « En savoir plus » des actualités */
.oci-bao-cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 22px;
  border: 1px solid var(--oci-bao-accent);
  border-radius: 99px;
  color: var(--oci-bao-accent);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.3;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.oci-bao-card:hover .oci-bao-cta,
.oci-bao-card:focus-within .oci-bao-cta {
  background-color: var(--oci-bao-accent);
  color: #fff;
}
.oci-bao-ext { display: inline-block; transition: transform 0.2s ease; }
.oci-bao-card:hover .oci-bao-ext { transform: translate(2px, -2px); }

/* ---------- Page de détail d'une fiche ----------
   Le style principal vient du thème (classe single-post ajoutée par le plugin).
   Ici : seulement les compléments propres aux fiches. */

.oci-bao-single .lqd-yolo-header { text-align: center; }

/* Pastille de rubrique à la couleur de la rubrique (le thème la met en couleur secondaire) */
.oci-bao-single .oci-bao-fiche .lqd-yolo-cat {
  background-color: var(--oci-bao-accent);
}

.oci-bao-fiche-intro {
  max-width: 720px;
  margin: 20px auto 0;
  font-size: 21px;
  line-height: 1.5;
  font-weight: 500;
  color: #1a1a1a;
}

.oci-bao-single .lqd-yolo-body { margin-top: 48px; }
.oci-bao-single .lqd-yolo-body ul,
.oci-bao-single .lqd-yolo-body ol { margin: 0 0 1.4em; padding-left: 1.3em; }
.oci-bao-single .lqd-yolo-body li { margin-bottom: 0.4em; font-weight: 500; }
.oci-bao-single .lqd-yolo-body figure { margin: 1.5em 0; }
.oci-bao-single .lqd-yolo-body img {
  display: block;
  max-width: 100%;
  height: auto;
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.08);
}
.oci-bao-single .wp-block-embed__wrapper iframe {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 20px;
}

.oci-bao-fiche-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  margin: 56px 0 90px;
  padding-top: 40px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.oci-bao-button {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 99px;
  background: var(--oci-bao-accent, #213ba8);
  border: 1px solid var(--oci-bao-accent, #213ba8);
  color: #fff !important;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.oci-bao-button:hover {
  background: transparent;
  color: var(--oci-bao-accent, #213ba8) !important;
}

.oci-bao-back {
  font-weight: 600;
  text-decoration: none;
  color: var(--oci-bao-accent, #213ba8);
}
.oci-bao-back:hover { text-decoration: underline; }
