/*
  hostea-blog.css
  Kit de lecture pour les pages d'article du blog HOSTEA (Odoo Online, thème par défaut, Bootstrap 5).

  Pose dans Odoo : coller ce fichier dans la feuille de style personnalisee du site
  (Site > Configuration > Assets techniques > Ajouter un fichier CSS personnalise dans web.assets_frontend,
  ou équivalent user_custom_rules.scss / editeur de code du thème).

  Portee volontairement limitee aux pages du blog : tous les selecteurs sont prefixes
  par un ancetre du blog (.website_blog, #o_wblog_post_content, #o_wblog_post_sidebar_col,
  .o_wblog_post_page_cover, .o_record_cover_container) pour ne rien casser hors blog.
*/

/* ---------------------------------------------------------------------
   1. Variables de couleur / rythme, scopees au blog uniquement
   --------------------------------------------------------------------- */
.website_blog {
  --hostea-ink: #1a1c1c;
  --hostea-navy: #003b6d;
  --hostea-navy-hover: #002a4d;
  --hostea-pale: #f0f4f8;
  --hostea-border: #d8e0e8;
  --hostea-measure: 68ch; /* largeur de mesure indépendante du conteneur */
}

/* ---------------------------------------------------------------------
   2. Corps de texte : graisse, couleur, taille, interligne, mesure
   --------------------------------------------------------------------- */
.website_blog .o_wblog_read_text,
.website_blog .o_wblog_post_content_field {
  font-weight: 400;
  color: var(--hostea-ink);
  font-size: 18px;
  line-height: 1.6;
}

/* La largeur de mesure s'applique aux blocs de texte eux-mêmes,
   pas au conteneur (qui reste gere par Bootstrap / le thème). */
.website_blog .o_wblog_post_content_field > p,
.website_blog .o_wblog_post_content_field > ul,
.website_blog .o_wblog_post_content_field > ol,
.website_blog .o_wblog_post_content_field > blockquote,
.website_blog .o_wblog_post_content_field .geo-quick-answer,
.website_blog .o_wblog_post_content_field .hostea-key-takeaway {
  max-width: var(--hostea-measure);
}

.website_blog .o_wblog_post_content_field li {
  color: var(--hostea-ink);
}

@media (max-width: 767.98px) {
  .website_blog .o_wblog_read_text,
  .website_blog .o_wblog_post_content_field {
    font-size: 17px;
  }
}

/* ---------------------------------------------------------------------
   3. Titres : interligne resserre, rythme vertical genereux
   --------------------------------------------------------------------- */
.website_blog .o_wblog_post_content_field h2,
.website_blog .o_wblog_post_content_field h3 {
  line-height: 1.2;
  color: var(--hostea-ink);
}

.website_blog .o_wblog_post_content_field h2 {
  margin-top: 3rem;
  margin-bottom: 1.25rem;
}

.website_blog .o_wblog_post_content_field h3 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

/* Pas de marge haute excessive quand un titre suit immédiatement
   le titre principal de l'article (premier élément du flux). */
.website_blog .o_wblog_post_content_field h2:first-child,
.website_blog .o_wblog_post_content_field > h1 + h2 {
  margin-top: 1.5rem;
}

/* ---------------------------------------------------------------------
   4. Liens : marine souligne, lisible, distinct des boutons
   --------------------------------------------------------------------- */
.website_blog .o_wblog_post_content_field a:not(.btn) {
  color: var(--hostea-navy);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.website_blog .o_wblog_post_content_field a:not(.btn):hover,
.website_blog .o_wblog_post_content_field a:not(.btn):focus-visible {
  color: var(--hostea-navy-hover);
}

.website_blog .o_wblog_post_content_field a:not(.btn):focus-visible {
  outline: 2px solid var(--hostea-navy);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------
   5. Bloc "Reponse rapide" (GEO) : fond pale, filet gauche, texte d'encre
   --------------------------------------------------------------------- */
.website_blog .o_wblog_post_content_field .geo-quick-answer {
  background: var(--hostea-pale);
  border-left: 4px solid var(--hostea-navy);
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: 4px;
  color: var(--hostea-ink);
}

.website_blog .o_wblog_post_content_field .geo-quick-answer strong {
  color: var(--hostea-navy);
}

.website_blog .o_wblog_post_content_field .geo-quick-answer p {
  margin: 8px 0 0;
  color: var(--hostea-ink);
}

/* ---------------------------------------------------------------------
   6. FAQ en accordeon natif : <details class="hostea-faq-item">
   --------------------------------------------------------------------- */
.website_blog .o_wblog_post_content_field .hostea-faq {
  margin: 24px 0;
  border-top: 1px solid var(--hostea-border);
}

.website_blog .o_wblog_post_content_field .hostea-faq-item {
  border-bottom: 1px solid var(--hostea-border);
}

.website_blog .o_wblog_post_content_field .hostea-faq-item summary {
  /* zone cliquable de 44px minimum, chevron en CSS pur (pas de JS) */
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 12px 4px;
  font-weight: 600;
  color: var(--hostea-ink);
}

.website_blog .o_wblog_post_content_field .hostea-faq-item summary::-webkit-details-marker {
  display: none;
}

.website_blog .o_wblog_post_content_field .hostea-faq-item summary::after {
  content: "";
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--hostea-navy);
  border-bottom: 2px solid var(--hostea-navy);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.website_blog .o_wblog_post_content_field .hostea-faq-item[open] summary::after {
  transform: rotate(-135deg);
}

.website_blog .o_wblog_post_content_field .hostea-faq-item summary:focus-visible {
  outline: 2px solid var(--hostea-navy);
  outline-offset: 2px;
  border-radius: 2px;
}

.website_blog .o_wblog_post_content_field .hostea-faq-item p {
  padding: 0 4px 16px;
  margin: 0;
  max-width: var(--hostea-measure);
}

/* ---------------------------------------------------------------------
   7. Tableaux responsive : wrapper a défilement + ombre indicatrice
   --------------------------------------------------------------------- */
.website_blog .o_wblog_post_content_field .hostea-table-wrap {
  overflow-x: auto;
  margin: 24px 0;
  -webkit-overflow-scrolling: touch;
  /* ombre indicatrice sur le bord droit quand le tableau deborde */
  background:
    linear-gradient(to right, white 30%, rgba(255, 255, 255, 0)),
    linear-gradient(to right, rgba(0, 0, 0, 0), white 70%) 100% 0,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0)),
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0)) 100% 0;
  background-repeat: no-repeat;
  background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
  background-attachment: local, local, scroll, scroll;
}

.website_blog .o_wblog_post_content_field .hostea-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.website_blog .o_wblog_post_content_field .hostea-table-wrap th,
.website_blog .o_wblog_post_content_field .hostea-table-wrap td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--hostea-border);
  text-align: left;
  white-space: nowrap;
}

.website_blog .o_wblog_post_content_field .hostea-table-wrap th {
  color: var(--hostea-ink);
  font-weight: 600;
  border-bottom: 2px solid var(--hostea-navy);
}

/* Colonnes de chiffres : alignees a droite (marquer avec la classe hostea-num) */
.website_blog .o_wblog_post_content_field .hostea-table-wrap td.hostea-num,
.website_blog .o_wblog_post_content_field .hostea-table-wrap th.hostea-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Ligne total : en gras (marquer avec la classe hostea-total sur le <tr>) */
.website_blog .o_wblog_post_content_field .hostea-table-wrap tr.hostea-total td,
.website_blog .o_wblog_post_content_field .hostea-table-wrap tr.hostea-total th {
  font-weight: 700;
  border-top: 2px solid var(--hostea-navy);
  border-bottom: none;
}

/* ---------------------------------------------------------------------
   8. Images inline avec légende
   --------------------------------------------------------------------- */
.website_blog .o_wblog_post_content_field figure {
  margin: 28px 0;
}

.website_blog .o_wblog_post_content_field figure img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.website_blog .o_wblog_post_content_field figcaption {
  margin-top: 8px;
  font-size: 14px;
  color: #4a4f54;
  text-align: center;
}

/* ---------------------------------------------------------------------
   9. Encadre "a retenir"
   --------------------------------------------------------------------- */
.website_blog .o_wblog_post_content_field .hostea-key-takeaway {
  background: #ffffff;
  border: 1px solid var(--hostea-border);
  border-left: 4px solid var(--hostea-ink);
  border-radius: 4px;
  padding: 16px 20px;
  margin: 28px 0;
}

.website_blog .o_wblog_post_content_field .hostea-key-takeaway p:last-child {
  margin-bottom: 0;
}

.website_blog .o_wblog_post_content_field .hostea-key-takeaway-title {
  display: block;
  font-weight: 700;
  color: var(--hostea-ink);
  margin-bottom: 8px;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.04em;
}

/* ---------------------------------------------------------------------
   10. Bloc auteur (fin d'article)
   --------------------------------------------------------------------- */
.website_blog .o_wblog_post_content_field .hostea-author-block {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 40px 0;
  padding: 20px;
  border: 1px solid var(--hostea-border);
  border-radius: 8px;
  max-width: none;
}

.website_blog .o_wblog_post_content_field .hostea-author-block img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.website_blog .o_wblog_post_content_field .hostea-author-block .hostea-author-name {
  font-weight: 700;
  color: var(--hostea-ink);
  display: block;
}

.website_blog .o_wblog_post_content_field .hostea-author-block .hostea-author-role {
  font-size: 14px;
  color: #4a4f54;
  display: block;
  margin-top: 2px;
}

/* ---------------------------------------------------------------------
   11. Encadre CTA de fin
   --------------------------------------------------------------------- */
.website_blog .o_wblog_post_content_field .hostea-cta-end {
  background: var(--hostea-navy);
  color: #ffffff;
  border-radius: 8px;
  padding: 32px 28px;
  margin: 40px 0 16px;
  text-align: center;
  max-width: none;
}

.website_blog .o_wblog_post_content_field .hostea-cta-end h3,
.website_blog .o_wblog_post_content_field .hostea-cta-end p {
  color: #ffffff;
}

.website_blog .o_wblog_post_content_field .hostea-cta-end .btn {
  margin-top: 12px;
}

/* ---------------------------------------------------------------------
   12. Articles lies : cartes 3 colonnes (1 colonne mobile)
   --------------------------------------------------------------------- */
.website_blog .hostea-related-articles {
  max-width: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 40px 0;
}

@media (max-width: 767.98px) {
  .website_blog .hostea-related-articles {
    grid-template-columns: 1fr;
  }
}

.website_blog .hostea-related-card {
  display: block;
  text-decoration: none;
  border: 1px solid var(--hostea-border);
  border-radius: 8px;
  overflow: hidden;
  color: var(--hostea-ink);
}

.website_blog .hostea-related-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.website_blog .hostea-related-card .hostea-related-card-body {
  padding: 14px 16px;
}

.website_blog .hostea-related-card .hostea-related-card-title {
  font-weight: 700;
  color: var(--hostea-ink);
  display: block;
  text-decoration: none;
}

.website_blog .hostea-related-card:hover .hostea-related-card-title {
  color: var(--hostea-navy);
}

/* ---------------------------------------------------------------------
   13. Sommaire (généré par hostea-blog.js) et temps de lecture
   --------------------------------------------------------------------- */
.website_blog .hostea-toc {
  border: 1px solid var(--hostea-border);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 24px 0 32px;
  background: #fafbfc;
  max-width: none;
}

.website_blog .hostea-toc-title {
  font-weight: 700;
  color: var(--hostea-ink);
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.website_blog .hostea-toc ol {
  margin: 0;
  padding-left: 20px;
}

.website_blog .hostea-toc li {
  margin-bottom: 4px;
}

.website_blog .hostea-toc a {
  color: var(--hostea-navy);
  text-decoration: none;
}

.website_blog .hostea-toc a:hover {
  text-decoration: underline;
}

/* Section courante mise en évidence par l'IntersectionObserver du JS */
.website_blog .hostea-toc a.hostea-toc-active {
  font-weight: 700;
  text-decoration: underline;
}

.website_blog #hostea-reading-time {
  color: #4a4f54;
  font-size: 14px;
}

/* ---------------------------------------------------------------------
   14. Retour en haut
   --------------------------------------------------------------------- */
.website_blog .hostea-back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--hostea-border);
  color: var(--hostea-navy);
  text-decoration: none;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}

.website_blog .hostea-back-to-top.hostea-visible {
  opacity: 1;
  visibility: visible;
}

.website_blog .hostea-back-to-top:hover,
.website_blog .hostea-back-to-top:focus-visible {
  color: var(--hostea-navy-hover);
  outline: none;
}

/* ---------------------------------------------------------------------
   15. Impression
   --------------------------------------------------------------------- */
@media print {
  .website_blog .hostea-back-to-top,
  .website_blog #o_wblog_post_sidebar_col,
  .website_blog .o_wblog_post_page_cover,
  .website_blog .o_wblog_social_links,
  .website_blog .hostea-cta-end,
  .website_blog #o_wblog_post_comments {
    display: none !important;
  }

  .website_blog .o_wblog_post_content_field {
    color: #000000;
    font-size: 12pt;
  }

  .website_blog .o_wblog_post_content_field a:not(.btn) {
    color: #000000;
  }

  /* Affiche l'URL des liens a l'impression, utile sans souris */
  .website_blog .o_wblog_post_content_field a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #555555;
  }
}

/* ---------------------------------------------------------------------
   Article posé via le bloc « Code intégré » (s_embed_code) : le bloc ajoute
   text-center et des marges pt16/pb16 ; on les neutralise pour l'article.
   --------------------------------------------------------------------- */
.website_blog .o_wblog_read_text .s_embed_code,
.website_blog .o_wblog_read_text .hostea-article {
  text-align: left;
}
.website_blog .o_wblog_read_text .s_embed_code {
  padding-top: 0;
  padding-bottom: 0;
}
