

.header-title a,
.header-title a:link,
.header-title a:visited,
.header-title a:hover,
.header-title a:active {
  color: inherit !important;
  text-decoration: none !important;
  cursor: pointer;
}
/* =========================================================
   RESPONSIVE COMMUN
   ========================================================= */

@media (max-width: 760px) {

  .page-shell {
    width: 100%;
    padding-top: 12px;
  }

  /* En-tête mobile */
  .site-header {
    width: calc(100% - 24px);
    height: 164px;
    min-height: 0;
    aspect-ratio: auto;
  }

  .header-eyebrow {
    top: 12%;
    left: 0%;
    width: 78%;
    height: 27%;
    padding-left: 18px;
    box-sizing: border-box;
    justify-content: flex-start;
    text-align: left;
    font-size: clamp(14px, 3.2vw, 20px);
    letter-spacing: .02em;
  }

  .header-title {
    top: 52%;
    left: 8%;
    text-align: left;
    font-size: clamp(34px, 8vw, 52px);
    letter-spacing: .02em;
  }

  .header-crest {
    top: 12%;
    right: 3%;
    width: 25%;
    height: 80%;
  }

  /* Grille principale */
  .home-content {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    width: calc(100% - 24px);
    margin-top: 16px;
  }

  .main-content-box,
  .content-page {
    min-height: 500px;
    padding: 14px;
  }

  /* Menu latéral */
  .sidebar {
    gap: 14px;
  }

  .bio-portrait {
    width: 82px;
  }

  .menu-card-title {
    font-size: 1.6rem;
  }

  .bio-content,
  .menu-list li,
  .subject-list li {
    font-size: 1.1rem;
  }

  .visitor-digit {
    font-size: clamp(24px, 6vw, 2.5rem);
  }

  .subscribe-title {
    font-size: 1.6rem;
  }

  .subscribe-subtitle {
    font-size: 1.2rem;
  }

  .sidebar-footer {
    font-size: 1rem;
  }

  /* Retour en haut */
  .back-to-top {
    margin-top: 20px;
  }

  .back-to-top a {
    font-size: 1.25rem;
  }

 .back-to-top-icon {
  width: 55px;
  height: auto;
  }

  /* Articles */
  .blog-intro {
    font-size: 1.4rem;
    margin-bottom: 24px;
  }

  .article-date {
    min-height: 44px;
    margin-bottom: 20px;
    font-size: 1.35rem;
    transform: translateX(12px);
  }

  .article-title {
    font-size: 1.7rem;
    margin-bottom: 14px;
  }

  .article-excerpt {
    font-size: 1.15rem;
  }

  .article-read-more {
    margin-left: 10px;
  }

  .article-comments,
  .article-likes {
    font-size: 1.05rem;
    gap: 6px;
  }

  .article-comments img {
    width: 25px;
    height: 25px;
  }

  .article-likes img {
    width: 24px;
    height: 24px;
  }

  .article-preview {
    margin-bottom: 26px;
  }

  .subscription-intro {
    padding-right: 87px;
    box-sizing: border-box;
  }
}


/* =========================================================
   PETITS ÉCRANS
   ========================================================= */

@media (max-width: 420px) {

  .site-header {
    height: 150px;
    min-height: 0;
  }

  .header-eyebrow {
    width: 78%;
    font-size: clamp(17px, 3.8vw, 23px);
    letter-spacing: .03em;
  }

  .header-title {
    font-size: clamp(32px, 8vw, 42px);
    letter-spacing: .01em;
  }

  .bio-content {
    font-size: .95rem;
  }

  .bio-portrait {
    width: 72px;
    margin-right: 9px;
  }

  .menu-card-title {
    font-size: 1.4rem;
  }

  .menu-list li,
  .subject-list li {
    padding-left: 28px;
    font-size: 1rem;
  }

  .menu-list,
  .subject-list {
    padding-inline: 6px;
  }

  .blog-intro {
    font-size: 1.2rem;
  }

  .article-title {
    font-size: 1.5rem;
  }

  .article-excerpt {
    font-size: 1.05rem;
  }

  .article-comments {
    font-size: .95rem;
  }
}


/* =========================================================
   MENU LATÉRAL COULISSANT
   ========================================================= */

/* Masqué par défaut */
.mobile-menu-toggle,
.menu-backdrop {
  display: none;
}


@media (max-width: 760px) {

  .main-column {
    position: relative;
    --menu-icon-size: 61px; /* Modifier ici : 48px, 64px, 80px... */
  }

  /* =========================================================
     ICONE DU MENU MOBILE
     IMPORTANT : page-end.php déplace le bouton dans .main-column.
     Il ne se trouve donc plus dans .site-header au moment du rendu.
     ========================================================= */
  .main-column > .mobile-menu-toggle {
    position: absolute;
    z-index: 5;
    top: 70px;
    right: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: max(44px, var(--menu-icon-size));
    height: max(44px, var(--menu-icon-size));
    min-width: 0;
    min-height: 0;
    padding: 0;
    box-sizing: border-box;
    transform: translateY(-50%);
    border: 0;
    border-radius: 5px;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .main-column > .mobile-menu-toggle > img {
    display: block;
    width: var(--menu-icon-size);
    height: var(--menu-icon-size);
    min-width: 0;
    min-height: 0;
    max-width: none;
    max-height: none;
    flex: 0 0 auto;
    object-fit: contain;
  }

  .mobile-menu-toggle:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
  }

  .blog-intro {
    padding-right: 62px;
  }


  /* -------------------------------------------------------
     TIROIR MOBILE
     ------------------------------------------------------- */

  .sidebar {
    position: fixed;
    z-index: 1002;

    top: 0;
    right: 0;
    bottom: 0;

    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;

    width: min(85vw, 400px);
    max-width: 100%;

    height: 100vh;
    height: 100dvh;
    min-height: 0;

    box-sizing: border-box;

    gap: 14px;
    padding: 12px;

    /* Défilement vertical indépendant */
    overflow-x: hidden;
    overflow-y: auto;

    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;

    background: #fff;
    box-shadow: -12px 0 32px rgba(0, 0, 0, .28);

    /* Position fermée */
    transform: translate3d(105%, 0, 0);
    visibility: hidden;

    transition:
      transform .28s ease,
      visibility 0s linear .28s;
  }


  /* Les blocs gardent leur hauteur naturelle.
     Ils ne sont plus comprimés pour tenir dans l'écran. */
  .sidebar > * {
    flex: 0 0 auto;
    min-height: max-content;
  }


  /* Position ouverte */
  body.mobile-menu-open .sidebar {
    transform: translate3d(0, 0, 0);
    visibility: visible;

    transition:
      transform .28s ease,
      visibility 0s;
  }


  /* -------------------------------------------------------
     ARRIÈRE-PLAN ASSOMBRI
     ------------------------------------------------------- */

  .menu-backdrop {
    position: fixed;
    z-index: 1001;

    inset: 0;

    display: block;

    width: 100%;
    height: 100%;

    padding: 0;
    border: 0;

    background: rgba(0, 0, 0, .48);

    opacity: 0;
    visibility: hidden;

    transition:
      opacity .28s ease,
      visibility 0s linear .28s;
  }


  body.mobile-menu-open .menu-backdrop {
    opacity: 1;
    visibility: visible;

    transition:
      opacity .28s ease,
      visibility 0s;
  }


  /* Empêche le défilement de la page située derrière le menu */
  body.mobile-menu-open {
    position: fixed;
    width: 100%;
    overflow: hidden;
  }
.header-crest-link {
  position: absolute;
  top: 12%;
  right: 3%;
  width: 25%;
  height: 80%;
  display: block;
}

.header-crest-link .header-crest {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

}


/* =========================================================
   ACCESSIBILITÉ : RÉDUCTION DES ANIMATIONS
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

  .sidebar,
  .menu-backdrop {
    transition-duration: .01ms !important;
  }

}

/* Correction du débordement horizontal sur mobile */
@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .page-shell,
  .home-content,
  .main-column,
  .main-content-box,
  .content-page {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
  }

  .home-content {
    width: calc(100% - 24px);
  }

  .main-content-box,
  .content-page {
    width: 100%;
  }

  .content-page img,
  .main-content-box img,
  .content-page input,
  .content-page textarea {
    max-width: 100%;
  }
}

/* Retour à l'accueil : agrandissement sur mobile uniquement */
@media (max-width: 760px) {

  .back-to-top {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 30px auto 0;
  }

  .back-to-top a {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.6rem;
    line-height: 1.3;
    text-align: center;
  }

  .back-to-top-icon {
    width: 80px;
    height: auto;
    flex-shrink: 0;
  }
}

 
/* Fermeture de la visionneuse Pangram */
.gia-viewer-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 15px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: white;
  color: #111;
  font-size: 30px;
  line-height: 1;
}

/* Actions des articles : version mobile uniquement */
@media (max-width: 760px) {

  /* Organisation : commentaires | icône IA | like */
  .article-actions {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    column-gap: 12px;
  }

  /* Icône Sans IA seule, sans son texte */
  .article-actions > .article-no-ai {
    display: inline-flex;
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    align-items: center;
    margin: 0;
    padding: 0;
    gap: 0;
    font-size: 0;
    line-height: 0;
  }

 /* Sur mobile : conserver uniquement l'icône GIA */
.article-no-ai .gia-hover > span:not(.gia-tooltip) {
    display: none !important;
}

  .article-no-ai .gia-hover > img {
    display: block;
    width: 30px;
    height: 30px;
    object-fit: contain;
  }

  /* Like à droite */
  .article-actions > .article-like-form {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    margin: 0;
  }

  .article-actions .article-likes {
    grid-column: auto;
    grid-row: auto;
  }

}

 /* ==================================================
   ICÔNE GIA MOBILE : AGRANDISSEMENT / PAUSE
   ================================================== */

@keyframes gia-pulse {
    0% {
        transform: scale(1);
    }

    16.66% {
        transform: scale(1.3);
    }

    33.33% {
        transform: scale(1);
    }

    100% {
        transform: scale(1);
    }
}

/* Animation de l'icône GIA sur tous les écrans */
.article-no-ai .gia-hover > img {
    animation: gia-pulse 3s ease-in-out infinite;
    transform-origin: center center;
}

/* Animation du menu mobile : uniquement sur mobile */
@media (max-width: 760px) {
    .mobile-menu-toggle > img {
        animation: gia-pulse 3s ease-in-out infinite;
        transform-origin: center center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .article-no-ai .gia-hover > img {
        animation: none !important;
    }
}

/* Animation de commentaire uniquement sur les pages d'articles développés */
body:not(.home-page) .article-comments > img {
    animation: gia-pulse 3s ease-in-out infinite;
    animation-delay: 1.5s;
    transform-origin: center center;
}

/* Visionneuse Pangram tactile : conserver les proportions et utiliser l'espace disponible. */
@media (max-width: 760px) {
  .gia-viewer {
    padding: max(12px, env(safe-area-inset-top)) 8px max(12px, env(safe-area-inset-bottom));
  }
  .gia-viewer-image {
    max-width: 98vw;
    max-height: 94vh;
    max-height: 94dvh;
    object-fit: contain;
  }
}


/* Sur les petits écrans tactiles, l'aperçu au survol est masqué :
   l'ouverture se fait par toucher via la visionneuse mobile.
   Sur un ordinateur avec souris, même à 420 px, le survol reste actif. */
@media (max-width: 760px) and (hover: none) and (pointer: coarse) {
  .gia-tooltip,
  .gia-hover:hover .gia-tooltip,
  .gia-hover:focus-within .gia-tooltip {
    display: none !important;
  }
}


/* =========================================================
   BIOGRAPHIE : AGRANDISSEMENT RESPONSIVE
   Mode portrait : fenêtre adaptée à la hauteur disponible.
   Mode paysage : image affichée sur toute la largeur.
   ========================================================= */

/* Téléphones et tablettes en orientation portrait */
@media (max-width: 760px) and (orientation: portrait) {
  .biography-lightbox {
    padding:
      max(12px, env(safe-area-inset-top))
      12px
      max(12px, env(safe-area-inset-bottom));
  }

  .biography-lightbox-image {
    max-width: 94vw !important;
    max-height: 80vh !important;
    max-height: 80dvh !important;
  }
}

/* Téléphones et tablettes en orientation paysage */
@media (max-width: 960px) and (orientation: landscape) {
  .biography-lightbox {
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
    overflow-y: auto;
    padding:
      max(4px, env(safe-area-inset-top))
      0
      max(4px, env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }

  .biography-lightbox-image {
    display: block;
    width: 100vw !important;
    max-width: 100vw !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain;
    margin: 0 auto;
  }
}

/* Très petits écrans en portrait */
@media (max-width: 420px) and (orientation: portrait) {
  .biography-lightbox-image {
    max-width: 96vw !important;
    max-height: 76vh !important;
    max-height: 76dvh !important;
  }
}

/* Menu responsive : bouton rouge en attente de confirmation */
@media (max-width: 760px) {
    .sidebar .subscribe-box.is-pending {
        background-color: #f00000;
    }

    .sidebar .subscribe-box.is-pending:hover {
        background-color: #d90000;
    }
}
