/* ============================================================
   E-Papers TN — Frontend styles
   v0.0.3

   Changelog:
   0.0.3 - Pages individuelles par publication (header, liseuse intégrée, breadcrumb).
           Suppression de la modale (remplacée par la page dédiée).
           Cartes : <a> au lieu de <button>.
   0.0.2 - Ratio couverture cartes : 2/3 (au lieu de 3/4).
   0.0.1 - Initialisation.
   ============================================================ */

/* ── Header page ────────────────────────────────────────── */

.epapers-header {
  padding: 2rem 0 0;
}

.epapers-header__title {
  /* Les styles h1 (Bricolage Grotesque 800, 24/31/42px, #1E1E1E)
     sont appliqués par le thème — pas d'override ici. */
  margin: 0;
}

.epapers-header__desc {
  margin: .75rem 0 0;
  line-height: 1.6;
  color: #1E1E1E;
  max-width: 680px;
}

/* ── Filtres ─────────────────────────────────────────────── */

.epapers-filters {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding: 2rem 0 0;
}

.epapers-filters__group {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.epapers-filters__group + .epapers-filters__group::before {
  content: '';
  display: block;
  width: 1.5px;
  height: 1.5rem;
  background: #1E1E1E;
}

.epapers-filters__btn {
  display: inline-block;
  font-size: 16px;
  font-weight: 500;
  padding: .6rem 1.25rem;
  border: 1.5px solid #1E1E1E;
  background: transparent;
  color: #1E1E1E;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
  text-decoration: none;
}

.epapers-filters__btn:hover {
  background: #1E1E1E;
  color: #fff;
}

.epapers-filters__btn.is-active {
  background: #1E1E1E;
  color: #fff;
}

.epapers-filters:not(.epapers-filters--sub) .epapers-filters__group {
  gap: 1.5rem;
}

.epapers-filters:not(.epapers-filters--sub) .epapers-filters__btn {
  padding-top: 1.75rem;
  padding-bottom: 1.75rem;
  padding-left: 2.5rem;
  padding-right: 2.5rem;
  font-size: 32px;
  font-weight: 700;
}

.epapers-filters__btn--hebdo.is-active,
.epapers-filters__btn--hebdo:hover {
  background: #D90058;
  border-color: #D90058;
  color: #fff;
}

.epapers-filters__btn--hebdo.is-active {
  cursor: default;
}

.epapers-filters__btn--hs.is-active,
.epapers-filters__btn--hs:hover {
  background: #8EA111;
  border-color: #8EA111;
  color: #fff;
}

.epapers-filters__btn--hs.is-active {
  cursor: default;
}

.epapers-filters--sub {
  padding-top: 1.25rem;
  gap: .75rem;
}

.epapers-filters__select {
  font-size: 16px;
  font-weight: 500;
  padding: .6rem 1.25rem;
  border: 1.5px solid #1E1E1E;
  background: transparent;
  color: #1E1E1E;
  cursor: pointer;
  appearance: auto;
  outline: none;
}

/* ── Grille ─────────────────────────────────────────────── */

.epapers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 3rem;
  padding: 2rem 0;
}

/* ── Carte ───────────────────────────────────────────────── */

.epaper-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 0;
  box-shadow: 4px 4px 10px 0px #1E1E1E26;
  cursor: pointer;
  text-align: left;
  border: none;
  padding: 0;
  width: calc(100% - 20px);
  margin-left: auto;
  margin-top: 20px;
  position: relative;
  z-index: 0;
  text-decoration: none;
  color: inherit;
}

.epaper-card::after {
  content: '';
  position: absolute;
  z-index: -1;
  width: 75%;
  aspect-ratio: 2 / 3;
  background: #d90058;
  left: -20px;
  top: -20px;
  opacity: .25;
}

.epaper-card:focus-visible {
  outline: 2px solid #1E1E1E;
  outline-offset: 2px;
}

/* Couverture — ratio portrait 2:3 */
.epaper-card__cover {
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #FFFBF2;
  position: relative;
  border-radius: 0;
}

.epaper-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}

.epaper-card:hover .epaper-card__cover img {
  transform: scale(1.03);
}

.epaper-card__cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1E1E1E;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Corps de la carte */
.epaper-card__body {
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.epaper-card__title {
  font-size: 17px;
  font-weight: 500;
  color: #1E1E1E;
  line-height: 1.3;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.epaper-card__date {
  font-size: 14px;
  color: #1E1E1E;
  opacity: .75;
  margin: 0;
}

/* Badges sur l'image */
.epaper-card__badges {
  position: absolute;
  bottom: 8px;
  left: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.epaper-card__badge {
  display: inline-block;
  font-size: 14px;
  font-weight: 800;
  padding: 2px 4px;
  color: #fff;
}

.epaper-card__badge--lang {
  background: #1E1E1E;
}

.epaper-card__badge--public {
  background: #8EA111;
}

.epaper-card__badge--reserved {
  background: #D90058;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.epaper-card__badge--reserved svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

/* Carte hors-série */
.epaper-card--hs::after {
  background: #B5CE11;
}

/* Carte CTA "Accès libre" — 2 colonnes, page 1 hebdomadaires */
.epapers-cta-card {
  grid-column: span 1;
  display: flex;
  background: #8EA111;
  color: #fff;
  text-decoration: none;
  width: calc(100% - 20px);
  margin-left: auto;
  margin-top: 20px;
  position: relative;
  z-index: 0;
  box-shadow: 4px 4px 10px 0px #1E1E1E26;
  transition: background .15s;
}

.epapers-cta-card::after {
  content: '';
  position: absolute;
  z-index: -1;
  width: 75%;
  aspect-ratio: 2 / 3;
  background: #EDF3D8;
  left: -20px;
  top: -20px;
}

.epapers-cta-card:hover {
  background: #7a8e0e;
}

.epapers-cta-card--subscribe {
  background: #D90058;
}

.epapers-cta-card--subscribe::after {
  background: #d90058;
  opacity: .25;
}

.epapers-cta-card--subscribe .epapers-cta-card__inner {
  background: #D90058;
}

.epapers-cta-card--subscribe:hover {
  background: #b80049;
}

.epapers-cta-card--subscribe .epapers-cta-card__label {
  color: #fff;
}

.epapers-cta-card__inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .875rem;
  padding: 2rem 1.75rem;
  position: relative;
  z-index: 1;
  background: #8EA111;
  width: 100%;
}

.epapers-cta-card__label {
  display: inline-block;
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #fff;
  padding-bottom: 10px;
  border-bottom: 4px solid #fff;
  align-self: flex-start;
}

.epapers-cta-card__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
}

.epapers-cta-card__sub {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  color: #fff;
}

.epapers-cta-card__btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  background: transparent;
  border: 2px solid #fff;
  padding: .6rem 1.25rem;
  align-self: flex-start;
  margin-top: .25rem;
  transition: background .15s;
}

.epapers-cta-card__btn svg {
  width: 15px;
  height: 15px;
  transition: transform .15s;
}

.epapers-cta-card:hover .epapers-cta-card__btn {
  background: rgba(255, 255, 255, .15);
}

.epapers-cta-card:hover .epapers-cta-card__btn svg {
  transform: translateX(3px);
}

.epapers-cta-card__link {
  font-size: 18px;
  font-weight: 500;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
  align-self: flex-start;
}

.epapers-cta-card__link:hover {
  opacity: .8;
}

.epapers-cta-card__deco {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 110px;
  height: 110px;
  color: #fff;
  opacity: .08;
  z-index: 0;
}



/* Carte sans PDF */
.epaper-card--disabled {
  opacity: .5;
  cursor: default;
}
.epaper-card--disabled:hover {
  transform: none;
  box-shadow: 4px 4px 10px 0px #1E1E1E26;
}

/* Compteur */
.epapers-count {
  font-size: 16px;
  font-weight: 600;
  color: #1E1E1E;
  margin: 1rem 0 0;
  text-align: center;
}

.epapers-count__sep {
  margin: 0 .35rem;
}

/* Message vide */
.epapers-empty {
  color: #1E1E1E;
  font-style: italic;
  grid-column: 1 / -1;
}

/* ── Pagination ──────────────────────────────────────────── */

.epapers-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  padding: 2rem 0 1rem;
  flex-wrap: wrap;
}

.epapers-pagination__btn,
.epapers-pagination__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 .5rem;
  border: 1.5px solid #1E1E1E;
  background: transparent;
  color: #1E1E1E;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, color .15s;
  cursor: pointer;
}

.epapers-pagination__btn svg {
  width: 18px;
  height: 18px;
}

.epapers-pagination__btn:hover,
.epapers-pagination__page:hover {
  background: #1E1E1E;
  color: #fff;
}

.epapers-pagination__page.is-active {
  background: #1E1E1E;
  color: #fff;
  cursor: default;
}

.epapers-pagination__btn.is-disabled {
  opacity: .3;
  cursor: default;
  pointer-events: none;
}

.epapers-pagination__gap {
  padding: 0 .25rem;
  color: #1E1E1E;
  opacity: .4;
  font-size: 15px;
  line-height: 36px;
}

/* ── Page individuelle ──────────────────────────────────── */

.epaper-single__breadcrumb {
  padding: 1.5rem 0 1rem;
  font-size: 14px;
  color: #1E1E1E;
  display: flex;
  align-items: center;
  gap: .25rem;
  flex-wrap: wrap;
}

.epaper-single__breadcrumb a {
  color: #1E1E1E;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.epaper-single__breadcrumb a:hover {
  opacity: .7;
}

.epaper-single__breadcrumb span[aria-hidden] {
  margin: 0 .25rem;
  opacity: .4;
}

.epaper-single__breadcrumb [aria-current] {
  opacity: .6;
}

.epaper-single__header {
  display: flex;
  gap: 5rem;
  align-items: flex-start;
  padding: 1rem 0 2rem;
}

.epaper-single__cover {
  flex-shrink: 0;
  width: 350px;
}

.epaper-single__cover img {
  width: 100%;
  display: block;
  box-shadow: 4px 4px 10px 0px #1E1E1E26;
  transition: transform .3s ease;
}

.epaper-single__cover--clickable {
  cursor: pointer;
}

.epaper-single__cover--clickable:hover img {
  transform: scale(1.03);
}

.epaper-single__info {
  flex: 1;
  min-width: 0;
}

.epaper-single__title {
  margin: 0;
}

.epaper-single__meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: .75rem;
  font-size: 15px;
  color: #1E1E1E;
  flex-wrap: wrap;
}

.epaper-single__date {
  opacity: .6;
}

.epaper-single__badge {
  display: inline-block;
  font-size: 14px;
  font-weight: 800;
  padding: 2px 6px;
  color: #fff;
}

.epaper-single__badge--lang {
  background: #1E1E1E;
}

.epaper-single__badge--public {
  background: #8EA111;
}

/* Description */
.epaper-single__description {
  margin-top: 1.25rem;
  font-size: 18px;
  line-height: 1.7;
  color: #1E1E1E;
}

.epaper-single__description p {
  margin: 0 0 .75rem;
}

.epaper-single__description p:last-child {
  margin-bottom: 0;
}

/* Boutons d'action */
.epaper-single__actions {
  display: flex;
  gap: .75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.epaper-single__btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: 15px;
  font-weight: 500;
  padding: .6rem 1.25rem;
  border: 1.5px solid #1E1E1E;
  cursor: pointer;
  transition: background .15s, color .15s;
  text-decoration: none;
  font-family: inherit;
}

.epaper-single__btn svg {
  width: 18px;
  height: 18px;
}

.epaper-single__btn--read {
  background: #d90058;
  color: #fff;
  border-color: #d90058;
}

.epaper-single__btn--read:hover {
  background: #b80049;
  border-color: #b80049;
}

.epaper-single__btn--download {
  background: transparent;
  color: #1E1E1E;
}

.epaper-single__btn--download:hover {
  background: #1E1E1E;
  color: #fff;
}

/* ── Modale liseuse ─────────────────────────────────────── */

.epapers-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  backdrop-filter: blur(4px);
}

/* Transitions */
.epapers-modal-enter      { transition: opacity .2s ease; }
.epapers-modal-enter-start { opacity: 0; }
.epapers-modal-enter-end   { opacity: 1; }
.epapers-modal-leave      { transition: opacity .15s ease; }
.epapers-modal-leave-start { opacity: 1; }
.epapers-modal-leave-end   { opacity: 0; }

.epapers-modal__inner {
  position: relative;
  width: 100%;
  max-width: 80vw;
  height: 95vh;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0, 0, 0, .5);
}

/* Header */
.epapers-modal__header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #1c1f21;
  padding: .875rem 1.25rem;
  color: #fff;
}

.epapers-modal__header-info {
  display: flex;
  align-items: center;
  gap: .875rem;
  min-width: 0;
}

.epapers-modal__header-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  color: rgba(255, 255, 255, .45);
}

.epapers-modal__title {
  margin: 0;
  font-size: .95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
  line-height: 1.3;
}

.epapers-modal__meta {
  margin: .2rem 0 0;
  font-size: .775rem;
  color: rgba(255, 255, 255, .5);
  display: flex;
  align-items: center;
  gap: .4rem;
  line-height: 1;
}

.epapers-modal__meta-sep {
  opacity: .4;
}

/* Boutons header */
.epapers-modal__header-actions {
  display: flex;
  align-items: center;
  gap: .375rem;
  flex-shrink: 0;
}

.epapers-modal__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, .65);
  cursor: pointer;
  transition: background .15s, color .15s;
  text-decoration: none;
}

.epapers-modal__btn svg {
  width: 18px;
  height: 18px;
}

.epapers-modal__btn:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

/* Loader */
.epapers-modal__loader {
  position: absolute;
  inset: 56px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: #f5f3ef;
  color: #1E1E1E;
  font-size: .85rem;
  pointer-events: none;
}

.epapers-modal__spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #EDF3D8;
  border-top-color: #1E1E1E;
  border-radius: 50%;
  animation: epapers-spin .7s linear infinite;
}

@keyframes epapers-spin {
  to { transform: rotate(360deg); }
}

/* Iframe */
.epapers-modal__iframe {
  flex: 1;
  width: 100%;
  border: none;
  display: block;
  background: #f5f3ef;
  transition: opacity .25s ease;
}

.epaper-single__no-pdf {
  color: #1E1E1E;
  font-style: italic;
  padding: 2rem 0;
}

/* Lien retour */
.epaper-single__back {
  padding: 2rem 0 1rem;
}

.epaper-single__back-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: 15px;
  font-weight: 500;
  color: #1E1E1E;
  text-decoration: none;
  padding: .6rem 1.25rem;
  border: 1.5px solid #1E1E1E;
  transition: background .15s, color .15s;
}

.epaper-single__back-link svg {
  width: 18px;
  height: 18px;
}

.epaper-single__back-link:hover {
  background: #1E1E1E;
  color: #fff;
}

/* ── Page restreinte (403) ───────────────────────────────── */

.epapers-restricted__hero {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  align-items: start;
  padding-bottom: 3rem;
}

.epapers-restricted__hero-left {
  min-width: 0;
}

.epapers-restricted__hero-right {
  min-width: 0;
  padding-top: 1.5rem;
}

.epapers-restricted__h1 {
  margin: 0;
  padding: 1.5rem 0 0;
}

.epapers-restricted__subtitle {
  margin: .75rem 0 2rem;
  font-size: 18px;
  line-height: 1.6;
  color: #1E1E1E;
  opacity: .7;
}

.epapers-restricted__intro {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding: 1rem 0 2rem;
}

.epapers-restricted__cover-img {
  width: 100%;
  display: block;
  box-shadow: 4px 4px 10px 0px #1E1E1E26;
}

.epapers-restricted__pub-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1E1E1E;
}

.epapers-restricted__pub-date {
  margin: .5rem 0 0;
  font-size: 18px;
  font-weight: 500;
  color: #1E1E1E;
  opacity: .7;
}

/* Colonnes */
.epapers-restricted {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
}

.epapers-restricted__col {
  border-radius: 10px;
  overflow: hidden;
}

.epapers-restricted__col-inner {
  padding: 2.5rem;
}

/* Colonne abonnement */
.epapers-restricted__col--subscribe {
  background: #d90058;
  color: #fff;
}

.epapers-restricted__col--subscribe .epapers-restricted__heading {
  color: #fff;
}

.epapers-restricted__col--subscribe .epapers-restricted__text {
  color: #f0ede8;
}

/* Colonne connexion */
.epapers-restricted__col--login {
  background: #fff;
  box-shadow: 4px 4px 10px 0px #1E1E1E26;
}

/* Éléments communs */
.epapers-restricted__icon {
  width: 40px;
  height: 40px;
  margin-bottom: 1.25rem;
  opacity: .7;
}

.epapers-restricted__heading {
  margin: 0 0 .75rem;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.25;
}

.epapers-restricted__text {
  margin: 0 0 1.5rem;
  font-size: 18px;
  line-height: 1.6;
}

/* Liste d'avantages */
.epapers-restricted__benefits {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.epapers-restricted__benefits li {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  font-size: 18px;
  line-height: 1.4;
  color: #fff;
}

.epapers-restricted__benefits svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: #B5CE11;
  margin-top: 1px;
}

/* CTA abonnement */
.epapers-restricted__cta {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .85rem 2rem;
  background: #fff;
  color: #d90058;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0;
  transition: background .15s, transform .15s;
}

.epapers-restricted__cta svg {
  width: 20px;
  height: 20px;
  transition: transform .15s;
}

.epapers-restricted__cta:hover {
  background: #f0f0f0;
}

.epapers-restricted__cta:hover svg {
  transform: translateX(3px);
}

/* Formulaire de connexion */
.epapers-restricted__form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.epapers-restricted__field {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.epapers-restricted__field label {
  font-size: 18px;
  font-weight: 600;
  color: #1E1E1E;
}

.epapers-restricted__field input[type="text"],
.epapers-restricted__field input[type="password"] {
  padding: .7rem 1rem;
  border: 1.5px solid #1E1E1E;
  background: #FFFBF2;
  font-size: 18px;
  color: #1E1E1E;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}

.epapers-restricted__field input:focus {
  border-color: #d90058;
}

.epapers-restricted__field--row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.epapers-restricted__remember {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: 18px;
  font-weight: 400;
  color: #1E1E1E;
  cursor: pointer;
}

.epapers-restricted__remember input {
  accent-color: #d90058;
}

.epapers-restricted__forgot {
  font-size: 18px;
  color: #d90058;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.epapers-restricted__forgot:hover {
  opacity: .7;
}

.epapers-restricted__error {
  font-size: 18px;
  color: #d90058;
  background: #FFF1F1;
  padding: .75rem 1rem;
  line-height: 1.4;
}

.epapers-restricted__submit {
  padding: .85rem 2rem;
  background: #1E1E1E;
  color: #fff;
  border: none;
  font-size: 18px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
}

.epapers-restricted__submit:hover {
  background: #333;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 480px) {
  .epapers-pagination__page[data-dist]:not([data-dist="1"]) {
    display: none;
  }

  .epapers-pagination__gap {
    display: none;
  }
}

/* ── Filtres mobile ──────────────────────────────────────── */

.epapers-filters-mobile {
  display: none;
}

@media (max-width: 640px) {
  /* Bouton filtres */
  .epapers-filters-mobile {
    display: flex;
    justify-content: center;
    padding: .75rem 0 0;
  }

  .epapers-filters-mobile__btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: 15px;
    font-weight: 600;
    color: #1E1E1E;
    background: transparent;
    border: 1.5px solid #1E1E1E;
    padding: .5rem 1.25rem;
    cursor: pointer;
    position: relative;
    font-family: inherit;
  }

  .epapers-filters-mobile__btn svg {
    width: 18px;
    height: 18px;
  }

  .epapers-filters-mobile__badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 10px;
    height: 10px;
    background: #D90058;
    border-radius: 50%;
    border: 2px solid #fff;
  }

  /* Masquer filtres niveau 2 sur mobile */
  .epapers-filters--sub {
    display: none;
  }

  /* Backdrop */
  .epapers-filters-mobile__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 998;
  }

  /* Modale centrée */
  .epapers-filters-mobile__drawer {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    background: #fff;
    z-index: 999;
    max-height: 80vh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  /* Animations entrée / sortie */
  .epapers-modal-enter      { transition: opacity .2s ease, transform .2s ease; }
  .epapers-modal-enter-start { opacity: 0; transform: translate(-50%, -50%) scale(.95); }
  .epapers-modal-enter-end   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  .epapers-modal-leave      { transition: opacity .15s ease, transform .15s ease; }
  .epapers-modal-leave-start { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  .epapers-modal-leave-end   { opacity: 0; transform: translate(-50%, -50%) scale(.95); }

  .epapers-filters-mobile__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.75rem;
    border-bottom: 1.5px solid #1E1E1E;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
  }

  .epapers-filters-mobile__title {
    font-size: 18px;
    font-weight: 700;
    color: #1E1E1E;
  }

  .epapers-filters-mobile__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #1E1E1E;
  }

  .epapers-filters-mobile__close svg {
    width: 20px;
    height: 20px;
  }

  .epapers-filters-mobile__body {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  .epapers-filters-mobile__section {
    display: flex;
    flex-direction: column;
    gap: .625rem;
  }

  .epapers-filters-mobile__section-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #1E1E1E;
    opacity: .5;
    margin: 0;
  }

  .epapers-filters-mobile__options {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
  }

  .epapers-filters-mobile__opt {
    display: inline-block;
    font-size: 16px;
    font-weight: 500;
    padding: .5rem 1rem;
    border: 1.5px solid #1E1E1E;
    color: #1E1E1E;
    text-decoration: none;
    transition: background .15s, color .15s;
  }

  .epapers-filters-mobile__opt.is-active {
    background: #1E1E1E;
    color: #fff;
  }

  .epapers-filters-mobile__opt.is-active.epapers-filters__btn--hebdo,
  .epapers-filters-mobile__section:has(.epapers-filters__btn--hebdo.is-active) .epapers-filters-mobile__opt.is-active {
    background: #D90058;
    border-color: #D90058;
  }
}

@media (max-width: 640px) {
  .epapers-cta-card::after {
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 640px) {
  .epapers-filters__group + .epapers-filters__group::before {
    display: none;
  }

  /* Niveau 1 : empilés pleine largeur, padding réduit */
  .epapers-filters:not(.epapers-filters--sub) .epapers-filters__group {
    flex-direction: column;
    width: 100%;
    gap: .5rem;
  }

  .epapers-filters:not(.epapers-filters--sub) .epapers-filters__btn {
    font-size: 20px;
    padding: 1rem 1.5rem;
    text-align: center;
    justify-content: center;
    width: 100%;
  }

  .epapers-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Page individuelle */
  .epaper-single__header {
    flex-direction: column;
    gap: 1rem;
  }

  .epaper-single__cover {
    width: 120px;
  }

  /* Page restreinte */
  .epapers-restricted__hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

.epapers-restricted__hero-right {
    padding-top: 0;
  }

  .epapers-restricted {
    grid-template-columns: 1fr;
  }

  .epapers-restricted__col-inner {
    padding: 1.5rem;
  }

  .epapers-restricted__intro {
    gap: 1rem;
  }

  /* Modale */
  .epapers-modal {
    padding: 0;
  }

  .epapers-modal__inner {
    height: 100dvh;
    border-radius: 0;
    max-width: 100%;
  }

  .epapers-modal__title {
    font-size: .85rem;
  }
}

/* ── Liseuse PDF intégrée (page-publication-single) ─────── */

.epaper-reader-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .5rem 1rem;
  padding: .625rem 1.25rem;
  background: #FFFBF2;
  border-bottom: 1px solid #1E1E1E;
  flex-shrink: 0;
}

.epaper-reader-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #1e1e1e;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.epaper-reader-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .3rem .4rem;
  font-size: 18px;
  font-weight: 500;
  color: #1E1E1E;
}

.epaper-reader-breadcrumb a {
  color: #1E1E1E;
  text-decoration: none;
}

.epaper-reader-breadcrumb a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.epaper-reader-breadcrumb span[aria-hidden] {
  color: #1E1E1E;
  font-weight: 400;
}

.epaper-reader-header__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .75rem;
}

.epaper-reader-header__right .epaper-single__badge {
  display: flex;
  align-items: center;
  align-self: stretch;
}

.epaper-reader-download {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: 18px;
  font-weight: 500;
  color: #1e1e1e;
  text-decoration: none;
  padding: .375rem .75rem;
  border: 1.5px solid #1E1E1E;
  transition: background .15s;
}

.epaper-reader-download:hover {
  background: #EDF3D8;
}

.epaper-reader-download svg {
  width: 14px;
  height: 14px;
}

.epaper-reader-wrap {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Hauteur stable : 100svh (petit viewport, barre d'adresse visible) moins
     la distance mesurée une seule fois au chargement. Immunisée contre la
     barre d'adresse mobile et contre le scroll de page. */
  height: calc(100vh - var(--epaper-reader-top, 0px) - var(--epaper-reader-bottom, 0px));
  height: calc(100svh - var(--epaper-reader-top, 0px) - var(--epaper-reader-bottom, 0px));
}

/* Tablette (641-1023px) : barre thème h-16 (64px) en bas → on la soustrait. */
@media (min-width: 641px) and (max-width: 1023px) {
  .epaper-reader-wrap {
    --epaper-reader-bottom: 64px;
  }
}

.epaper-reader-canvas-wrap {
  flex: 1;
  overflow: hidden; /* remplacé par 'auto' via JS quand zoomé */
  background: #FFFBF2;
  position: relative;
  /* touch-action est géré dynamiquement par JS selon le niveau de zoom :
     none (pas zoomé) ou pan-x pan-y (zoomé). Voir updateNav(). */
  /* Empêche le scroll de s'échapper vers la page en bord de zone zoomée. */
  overscroll-behavior: contain;
}

/* Wrapper interne : centre quand page < zone, scroll quand zoomé.
   Les flèches sont des flex siblings du stage — elles se collent à la page. */
.epaper-reader-canvas-center {
  min-width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 0;
  gap: 10px;
}

#epaper-canvas {
  display: block;
  flex-shrink: 0;
  box-shadow: none;
  outline: 1px solid #1E1E1E;
}

.epaper-reader-loading {
  position: absolute;
  inset: 0;
  z-index: 10; /* au-dessus des canvas-slot (z-index 1-2) */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #FFFBF2;
  color: #1E1E1E;
  gap: .75rem;
  font-size: 14px;
}

.epaper-reader-loading__spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #EDF3D8;
  border-top-color: #1E1E1E;
  border-radius: 50%;
  animation: epapers-spin .7s linear infinite;
}

.epaper-reader-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: .625rem 1rem;
  background: #FFFBF2;
  border-top: 1px solid #1E1E1E;
  flex-shrink: 0;
}

/* Bouton vignettes : positionné à gauche, hors du flux flex centré */
.epaper-reader-nav__btn--thumbs {
  position: absolute;
  left: 1rem;
  width: auto !important;
  padding: 0 .75rem;
  gap: .4rem;
}

.epaper-reader-nav__thumbs-label {
  font-size: 13px;
  font-weight: 500;
  color: #1e1e1e;
  white-space: nowrap;
}

.epaper-reader-nav--top {
  border-top: none;
  border-bottom: 1px solid #1E1E1E;
}

.epaper-reader-nav__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid #1E1E1E;
  border-radius: 6px;
  background: #FFFBF2;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.epaper-reader-nav__btn:hover:not(:disabled) {
  background: #EDF3D8;
  border-color: #1E1E1E;
}

.epaper-reader-nav__btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.epaper-reader-nav__btn svg {
  width: 20px;
  height: 20px;
  color: #1e1e1e;
}

.epaper-reader-nav__info {
  font-size: 14px;
  font-weight: 600;
  color: #1E1E1E;
  min-width: 80px;
  text-align: center;
}

.epaper-reader-nav__sep {
  width: 1px;
  height: 20px;
  background: #1E1E1E;
  flex-shrink: 0;
}

.epaper-reader-nav__zoom {
  font-size: 13px;
  font-weight: 500;
  color: #1E1E1E;
  min-width: 44px;
  text-align: center;
}

.epaper-reader-nav__btn.is-active {
  background: #EDF3D8;
  border-color: #1E1E1E;
  color: #1e1e1e;
}

/* Quand zoomé sur desktop : hauteur auto — le canvas prend sa place naturelle,
   la page scrolle verticalement, canvasWrap scrolle horizontalement (overflow:auto via JS). */
@media (min-width: 641px) {
  .epaper-reader-wrap.is-zoomed {
    height: auto;
    overflow: visible;
  }
  .epaper-reader-wrap.is-zoomed .epaper-reader-canvas-wrap {
    height: auto;
  }
}

/* ── Stage de transition slide ───────────────────────────── */

.epaper-canvas-stage {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 24px 0 rgba(30, 30, 30, 0.18);
}

.epaper-canvas-slot {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
}

/* ── Flèches latérales ───────────────────────────────────── */

.epaper-reader-arrow {
  flex-shrink: 0;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 72px;
  background: #FFFBF2;
  border: 1.5px solid #1E1E1E;
  border-radius: 6px;
  color: #1e1e1e;
  cursor: pointer;
  transition: background 150ms;
}

.epaper-reader-arrow:hover:not(:disabled) {
  background: #EDF3D8;
}

.epaper-reader-arrow:disabled {
  opacity: .2;
  cursor: not-allowed;
}

.epaper-reader-arrow svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* Quand zoomé : flèches fixées au centre de la zone canvas (pas du viewport entier).
   --epaper-canvas-top = distance viewport-top → haut du canvas (header site + top nav).
   Centre dans [canvas-top → 100vh] = canvas-top/2 + 50vh. */
.epaper-reader-arrow.is-zoomed {
  position: fixed;
  top: calc(var(--epaper-canvas-top, 0px) / 2 + 50vh);
  transform: translateY(-50%);
  z-index: 100;
}
.epaper-reader-arrow--prev.is-zoomed { left: 110px; } /* ~100px nav gauche thème + 10px marge */
.epaper-reader-arrow--next.is-zoomed { right: 10px; }

@media (max-width: 1023px) {
  .epaper-reader-arrow--prev.is-zoomed { left: 10px; }
}

/* ── Description publication ─────────────────────────────── */

.epaper-reader-description {
  background: #FFFBF2;
  border-top: 1px solid #EDF3D8;
  padding: 2rem 1.5rem 2.5rem;
}

.epaper-reader-description__inner {
  max-width: 720px;
  margin: 0 auto;
  font-size: 18px;
  line-height: 1.75;
  color: #1E1E1E;
}

.epaper-reader-description__inner p {
  margin: 0 0 1em;
}

.epaper-reader-description__inner p:last-child {
  margin-bottom: 0;
}

.epaper-reader-description__inner strong,
.epaper-reader-description__inner b {
  font-weight: 600;
  color: #1e1e1e;
}

.epaper-reader-description__inner em,
.epaper-reader-description__inner i {
  font-style: italic;
}

.epaper-reader-description__inner a {
  color: #D90058;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.epaper-reader-description__inner a:hover {
  color: #1e1e1e;
}

.epaper-reader-description__inner ul,
.epaper-reader-description__inner ol {
  margin: 0 0 1em 1.25em;
  padding: 0;
}

.epaper-reader-description__inner li {
  margin-bottom: .35em;
}

.epaper-reader-description__back {
  max-width: 720px;
  margin: 2rem auto 0;
}

.epaper-reader-back-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: 15px;
  font-weight: 500;
  color: #1E1E1E;
  text-decoration: none;
  padding: .6rem 1.1rem;
  border: 1.5px solid #1E1E1E;
  transition: background 150ms;
}

.epaper-reader-back-link:hover {
  background: #EDF3D8;
  color: #1e1e1e;
}

.epaper-reader-back-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ── Panneau vignettes (overlay) ─────────────────────── */

/* Le panneau se superpose à la zone canvas — le PDF garde sa taille complète.
   epaper-reader-canvas-wrap a position:relative, ce qui sert de contexte. */
.epaper-thumbs-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0;
  overflow: hidden;
  transition: width 0.25s ease;
  background: rgba(26, 26, 26, 0.96);
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.epaper-thumbs-panel.is-open {
  width: 190px;
}

.epaper-thumbs-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.epaper-thumb {
  position: relative;
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color 0.15s;
  flex-shrink: 0;
}

.epaper-thumb.is-active {
  border-color: #d90058;
}

.epaper-thumb canvas {
  display: block;
  width: 100%;
  height: auto;
}

.epaper-thumb__num {
  position: absolute;
  bottom: 3px;
  right: 5px;
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  line-height: 1;
}

@media (max-width: 640px) {
  .epaper-thumbs-panel {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    width: 100% !important;
    height: 0;
    transition: height 0.25s ease;
    z-index: 200;
    flex-direction: column-reverse;
  }
  .epaper-thumbs-panel.is-open {
    height: 220px;
    width: 100% !important;
  }
  .epaper-thumbs-list {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px;
    gap: 8px;
  }
  .epaper-thumb {
    flex-shrink: 0;
    width: 80px;
  }
}

@media (max-width: 640px) {
  /* Barre du haut — colonne sur mobile */
  .epaper-reader-header {
    grid-template-columns: 1fr;
    gap: .35rem;
  }

  .epaper-reader-title {
    text-align: center;
    white-space: normal;
  }

  .epaper-reader-breadcrumb {
    justify-content: center;
  }

  .epaper-reader-header__right {
    justify-content: center;
  }

  /* Barre du bas — tout sur une ligne, très compact */
  .epaper-reader-nav {
    gap: .3rem;
    padding: .4rem .5rem;
  }

  .epaper-reader-nav__sep {
    width: 1.5rem;
    background: transparent;
  }

  .epaper-reader-nav__btn {
    width: 30px;
    height: 30px;
  }

  .epaper-reader-nav__btn svg {
    width: 16px;
    height: 16px;
  }

  .epaper-reader-nav__info {
    font-size: 12px;
    min-width: 52px;
  }

  .epaper-reader-nav__zoom {
    font-size: 12px;
    min-width: 34px;
  }

  #epaper-spread,
  #epaper-spread-sep,
  .epaper-reader-nav__btn--thumbs {
    display: none;
  }

  .epaper-reader-arrow {
    display: none;
  }

  /* Masquer le menu fixe du thème (barre verte en bas) sur la page liseuse */
  menu.bg-tn-soft-green {
    display: none !important;
  }

  /* Mise en page mobile : hauteur auto, PDF pleine largeur, page scrolle normalement */
  .epaper-reader-wrap {
    height: auto;
    overflow: visible;
    --epaper-reader-bottom: 0px;
  }

  .epaper-reader-canvas-wrap {
    flex: none;
    height: auto;
    overflow: visible;
  }

  .epaper-reader-canvas-center {
    min-height: 0;
    gap: 0;
  }

  .epaper-reader-description__inner {
    font-size: 16px;
  }
}
