/* Deeply Curious — consolidation responsive et fonctionnelle, v1.3.0. */

/*
 * Système typographique éditorial : Newsreader remplace Fraunces sans toucher
 * à Manrope (interface/texte) ni aux signatures Cormorant Upright et Rye.
 * Cette couche finale couvre aussi les anciens gabarits dont le CSS est stocké
 * dans WordPress ; les prochains articles héritent automatiquement du choix.
 */
body :where(
  .dc-home-v6 .brand,
  .dc-home-v6 h1,
  .dc-home-v6 .feature-copy h2,
  .dc-home-v6 .section-head h2,
  .dc-home-v6 .story-card h3,
  .dc-home-v6 .statement p,
  .dc-site-header .dc-brand,
  .dc-site-footer .dc-brand,
  .dc-archive-title,
  .dc-archive-card .wp-block-post-title a,
  .dc-page-hero h1,
  .dc-story-query-card .wp-block-post-title a,
  .dc-article h1,
  .dc-article .dc-deck,
  .dc-article-body .dc-lead,
  .dc-article-body h2,
  .dc-article-body .dc-pullquote,
  .dc-related-card span,
  .dc-newsletter__copy h2,
  .dc-comments-heading,
  .dc-comments-panel .wp-block-comment-author-name,
  .dc-comments-panel .comment-reply-title,
  .dc-legal .dc-brand,
  .dc-legal h1,
  .dc-legal .dc-standfirst,
  .dc-legal .dc-prose h2,
  .dc-mailpage .dc-brand,
  .dc-mailpage h1,
  .dc-mailpage h2,
  .dc-mailpage h3
) {
  font-family: "Newsreader", Georgia, serif !important;
}

/* Les quatre noms de rubrique de l'accueil gardent leur dessin validé. */
body .dc-home-v6 .category-card h3 {
  font-family: "Cormorant Upright", Georgia, serif !important;
}

body :where(
  .dc-home-v6,
  .dc-site-header,
  .dc-site-footer,
  .dc-legal,
  .dc-mailpage,
  .dc-newsletter
) *,
body :where(
  .dc-home-v6,
  .dc-site-header,
  .dc-site-footer,
  .dc-legal,
  .dc-mailpage,
  .dc-newsletter
) *::before,
body :where(
  .dc-home-v6,
  .dc-site-header,
  .dc-site-footer,
  .dc-legal,
  .dc-mailpage,
  .dc-newsletter
) *::after {
  box-sizing: border-box;
}

body:is(.dc-home-v6, .dc-legal, .dc-mailpage) *,
body:is(.dc-home-v6, .dc-legal, .dc-mailpage) *::before,
body:is(.dc-home-v6, .dc-legal, .dc-mailpage) *::after {
  box-sizing: border-box;
}

/* Supprime le block-gap que le thème place avant les headers standards. */
body .wp-site-blocks > :where(.dc-site-header, .site-header) {
  margin-block-start: 0 !important;
}

/* Identité validée : coins légers, inclinaison historique conservée. */
body.dc-home-v6 .brand-mark,
body.dc-legal .dc-mark,
body :is(
  .dc-home-v6 .brand-mark,
  .dc-site-header .dc-brand-mark,
  .dc-legal .dc-mark,
  .dc-mail-mark,
  .dc-mp-brand-mark,
  .dc404-brand img
) {
  border-radius: 8px !important;
}

/* Les pages légales ne doivent jamais sacrifier du texte à overflow-x:clip. */
body .dc-legal :where(.dc-layout, .dc-layout > *, .dc-prose, .dc-aside) {
  min-width: 0 !important;
  max-width: 100%;
}

body .dc-legal .dc-table-scroll {
  width: 100%;
  max-width: 100%;
  margin: 22px 0 28px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: #c6a767 rgba(245, 241, 233, .12);
  scrollbar-width: thin;
}

body .dc-legal .dc-table-scroll .dc-table {
  display: table !important;
  width: 100% !important;
  min-width: 580px !important;
  max-width: none !important;
  margin: 0 !important;
  overflow: visible !important;
}

body .dc-legal .dc-table-scroll:focus-visible {
  outline: 3px solid #c6a767 !important;
  outline-offset: 4px;
}

/* Header compact : une seule logique jusqu'aux tablettes, sans lien caché. */
@media (max-width: 1050px) {
  :is(body.dc-home-v6, body .dc-home-v6) .header-inner,
  body .dc-site-header .dc-header-inner {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 52px 48px !important;
    align-items: center !important;
    gap: 8px !important;
    width: calc(100% - 28px) !important;
    min-height: 70px !important;
    margin-inline: auto !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .main-nav,
  body .dc-site-header .dc-main-nav {
    display: none !important;
    overflow: hidden !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .mobile-menu,
  body .dc-site-header .dc-mobile-menu {
    position: relative !important;
    display: block !important;
    justify-self: end !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .mobile-menu summary,
  body .dc-site-header .dc-mobile-menu summary {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 52px !important;
    min-height: 46px !important;
    padding: 0 !important;
    cursor: pointer !important;
    list-style: none !important;
    color: rgba(245, 241, 233, .78) !important;
    font: 800 9px/1 "Manrope", Arial, sans-serif !important;
    letter-spacing: .08em !important;
    text-transform: uppercase !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .mobile-menu summary::-webkit-details-marker,
  body .dc-site-header .dc-mobile-menu summary::-webkit-details-marker {
    display: none !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .mobile-menu summary::after,
  body .dc-site-header .dc-mobile-menu summary::after {
    content: "+" !important;
    margin-left: 6px !important;
    color: #c6a767 !important;
    font-size: 17px !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .mobile-menu[open] summary::after,
  body .dc-site-header .dc-mobile-menu[open] summary::after {
    content: "−" !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .mobile-nav,
  body .dc-site-header .dc-mobile-nav {
    position: absolute !important;
    top: calc(100% + 7px) !important;
    right: -55px !important;
    z-index: 140 !important;
    display: block !important;
    width: min(320px, calc(100vw - 28px)) !important;
    padding: 8px 18px 14px !important;
    overflow: visible !important;
    background: rgba(9, 11, 13, .99) !important;
    border: 1px solid rgba(245, 241, 233, .15) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45) !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .mobile-nav a,
  body .dc-site-header .dc-mobile-nav a {
    display: flex !important;
    align-items: center !important;
    min-height: 46px !important;
    padding: 10px 0 !important;
    color: #f5f1e9 !important;
    border-bottom: 1px solid rgba(245, 241, 233, .15) !important;
    font: 700 12px/1.25 "Manrope", Arial, sans-serif !important;
    text-decoration: none !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .mobile-nav a:last-child,
  body .dc-site-header .dc-mobile-nav a:last-child {
    border-bottom: 0 !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .search-link,
  body .dc-site-header .dc-header-action {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 48px !important;
    min-width: 48px !important;
    min-height: 46px !important;
    padding: 0 !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .search-link span,
  body .dc-site-header .dc-header-action span {
    display: none !important;
  }
}

@media (max-width: 560px) {
  :is(body.dc-home-v6, body .dc-home-v6) .header-inner,
  body .dc-site-header .dc-header-inner {
    grid-template-columns: minmax(0, 1fr) 42px 42px !important;
    width: calc(100% - 24px) !important;
    min-height: 64px !important;
    gap: 6px !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .mobile-menu summary,
  body .dc-site-header .dc-mobile-menu summary {
    width: 42px !important;
    font-size: 0 !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .mobile-menu summary::after,
  body .dc-site-header .dc-mobile-menu summary::after {
    margin-left: 0 !important;
    font-size: 20px !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .search-link,
  body .dc-site-header .dc-header-action {
    width: 42px !important;
    min-width: 42px !important;
  }
}

/* Le groupe Informations reste utilisable à toutes les largeurs. */
/* Le thème masque le quatrième groupe entre 1001 et 1099 px :
   l'override doit couvrir toute cette zone intermédiaire. */
@media (max-width: 1100px) {
  body .dc-site-footer .dc-footer-grid,
  :is(body.dc-home-v6, body .dc-home-v6) .footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 32px 24px !important;
  }

  body .dc-site-footer .dc-footer-brand,
  :is(body.dc-home-v6, body .dc-home-v6) .footer-brand {
    grid-column: 1 / -1 !important;
  }

  body .dc-site-footer .dc-footer-grid > div:last-child,
  :is(body.dc-home-v6, body .dc-home-v6) .footer-grid > div:last-child {
    display: block !important;
  }
}

@media (max-width: 560px) {
  body .dc-site-footer .dc-footer-grid,
  :is(body.dc-home-v6, body .dc-home-v6) .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 26px !important;
  }

  body .dc-site-footer .dc-footer-brand,
  :is(body.dc-home-v6, body .dc-home-v6) .footer-brand {
    grid-column: auto !important;
  }

  body .dc-site-footer .dc-footer-links a,
  :is(body.dc-home-v6, body .dc-home-v6) .footer-links a {
    display: flex !important;
    align-items: center !important;
    min-height: 44px !important;
  }
}

/* Pages MailPoet : alignement mobile et contrôle fantôme supprimé. */
body .dc-mailpage .dc-mail-main {
  width: min(1180px, calc(100% - 48px)) !important;
  max-width: 1180px !important;
  margin-inline: auto !important;
}

body .dc-mailpage fieldset:has(label[for="mailpoet_checkbox_1"]):not(:has(#mailpoet_checkbox_1)) {
  display: none !important;
}

@media (max-width: 620px) {
  body .dc-mailpage .dc-mail-main {
    width: calc(100% - 24px) !important;
  }
}

/* Les sources reçoivent une vraie cible tactile et une respiration régulière. */
body .dc-article .dc-sources summary {
  display: flex !important;
  align-items: center !important;
  min-height: 44px !important;
  padding: 8px 0 !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}

body .dc-article .dc-sources li + li {
  margin-top: 8px !important;
}

/*
 * Intertitres volontairement nus : aucun losange ni filet décoratif.
 * La règle neutralise le pseudo-élément historique du gabarit sur tous les
 * articles actuels et futurs, sans modifier leur contenu enregistré.
 */
body.single .dc-article-body h2::before {
  content: none !important;
  display: none !important;
}

/* Recherche : les longues chaînes restent dans le viewport. */
body.search .dc-archive-title {
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

/* Protection invisible du formulaire de commentaires. */
body .dc-comment-trap {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/*
 * Finition mobile 1.3.2.
 * La marque reste identifiable, le menu cesse de ressembler à un bouton
 * d'ajout et le footer conserve de vraies cibles tactiles sans occuper plus
 * d'un écran entier.
 */
@media (max-width: 560px) {
  :is(body.dc-home-v6, body .dc-home-v6) .header-inner,
  body .dc-site-header .dc-header-inner {
    grid-template-columns: minmax(0, 1fr) 44px 44px !important;
    min-height: 62px !important;
    gap: 6px !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .brand,
  body .dc-site-header .dc-brand {
    gap: 8px !important;
    min-width: 0 !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .brand > span,
  body .dc-site-header .dc-brand > span {
    min-width: 0 !important;
    font-size: 21px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .brand-mark,
  body .dc-site-header .dc-brand-mark {
    width: 31px !important;
    height: 30px !important;
    object-fit: contain !important;
    box-shadow:
      0 0 0 2px #fff,
      0 5px 20px rgba(0, 0, 0, .28) !important;
  }

  /* Pages Contact, 404 et légales : même respiration blanche, sans changer
     leurs dimensions propres. */
  body .dc-mark {
    object-fit: contain !important;
    box-shadow:
      0 0 0 2px #fff,
      0 5px 20px rgba(0, 0, 0, .28) !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .mobile-menu summary,
  body .dc-site-header .dc-mobile-menu summary,
  :is(body.dc-home-v6, body .dc-home-v6) .search-link,
  body .dc-site-header .dc-header-action {
    width: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }

  /* Certains gabarits historiques livrent seulement le libellé texte de la
     recherche. À cette largeur il est masqué visuellement : la loupe CSS
     garantit donc un contrôle visible sans modifier son nom accessible. */
  body .dc-site-header .dc-header-action {
    position: relative !important;
    color: rgba(245, 241, 233, .72) !important;
    font-size: 0 !important;
    line-height: 0 !important;
  }

  body .dc-site-header .dc-header-action::before {
    content: "" !important;
    display: block !important;
    width: 13px !important;
    height: 13px !important;
    box-sizing: border-box !important;
    border: 1.8px solid currentColor !important;
    border-radius: 50% !important;
    transform: translate(-1px, -1px) !important;
  }

  body .dc-site-header .dc-header-action::after {
    content: "" !important;
    position: absolute !important;
    top: calc(50% + 5px) !important;
    left: calc(50% + 4px) !important;
    width: 7px !important;
    height: 1.8px !important;
    background: currentColor !important;
    border-radius: 2px !important;
    transform: rotate(45deg) !important;
    transform-origin: left center !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .mobile-menu summary::after,
  body .dc-site-header .dc-mobile-menu summary::after {
    content: "" !important;
    display: block !important;
    width: 18px !important;
    height: 14px !important;
    margin: 0 !important;
    color: #c6a767 !important;
    background: linear-gradient(
      to bottom,
      currentColor 0 2px,
      transparent 2px 6px,
      currentColor 6px 8px,
      transparent 8px 12px,
      currentColor 12px 14px
    ) !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .mobile-menu[open] summary::after,
  body .dc-site-header .dc-mobile-menu[open] summary::after {
    background:
      linear-gradient(45deg, transparent 44%, currentColor 44% 56%, transparent 56%),
      linear-gradient(-45deg, transparent 44%, currentColor 44% 56%, transparent 56%) !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .hero {
    padding-block: 30px 40px !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .hero-copy > p:not(.hero-trust) {
    margin-top: 16px !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .hero-actions {
    margin-top: 20px !important;
    gap: 10px !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .hero-feature {
    margin-top: 28px !important;
  }

  body .dc-site-footer .dc-footer-grid,
  :is(body.dc-home-v6, body .dc-home-v6) .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: start !important;
    gap: 28px 22px !important;
    padding-block: 38px 30px !important;
  }

  body .dc-site-footer .dc-footer-brand,
  :is(body.dc-home-v6, body .dc-home-v6) .footer-brand {
    grid-column: 1 / -1 !important;
  }

  body .dc-site-footer .dc-footer-title,
  :is(body.dc-home-v6, body .dc-home-v6) .footer-title {
    margin-bottom: 10px !important;
  }

  body .dc-site-footer .dc-footer-links,
  :is(body.dc-home-v6, body .dc-home-v6) .footer-links {
    gap: 3px !important;
  }

  body .dc-site-footer .dc-footer-links a,
  :is(body.dc-home-v6, body .dc-home-v6) .footer-links a {
    min-height: 38px !important;
    padding-block: 5px !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
  }

  body .dc-site-footer .dc-footer-bottom,
  :is(body.dc-home-v6, body .dc-home-v6) .footer-bottom {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 4px 10px !important;
    padding-block: 16px 22px !important;
    font-size: 10px !important;
    line-height: 1.5 !important;
  }

  body .dc-site-footer .dc-footer-bottom span,
  :is(body.dc-home-v6, body .dc-home-v6) .footer-bottom span {
    display: inline-flex !important;
    align-items: center !important;
  }

  body .dc-site-footer .dc-footer-bottom span + span::before,
  :is(body.dc-home-v6, body .dc-home-v6) .footer-bottom span + span::before {
    content: "•" !important;
    margin-right: 10px !important;
    color: #c6a767 !important;
  }
}

@media (max-width: 360px) {
  :is(body.dc-home-v6, body .dc-home-v6) .brand,
  body .dc-site-header .dc-brand {
    gap: 6px !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .brand > span,
  body .dc-site-header .dc-brand > span {
    font-size: 18.5px !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .brand-mark,
  body .dc-site-header .dc-brand-mark {
    width: 27px !important;
    height: 26px !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .hero-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }

  :is(body.dc-home-v6, body .dc-home-v6) .hero-actions .text-link {
    width: 100% !important;
    justify-content: center !important;
  }

  body .dc-site-footer .dc-footer-grid,
  :is(body.dc-home-v6, body .dc-home-v6) .footer-grid {
    gap: 24px 18px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body *,
  body *::before,
  body *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
