/* ==========================================================================
   page-modules.css — Restylage typographique des pages CMS
   --------------------------------------------------------------------------
   Scopé sous .page-module (contenu principal) et .sidebar-module (aside).
   N'affecte JAMAIS la home, le slider, le header ou le footer.
   Rollback : supprimer ce fichier + retirer le <link> dans base.html.twig.
   ========================================================================== */

/* --- Variables locales (en cas de besoin de tweak global) ---------------- */
:root {
  --pm-brand: #323946;
  --pm-brand-soft: #4a5160;
  --pm-accent: #44bef1;
  --pm-accent-dark: #24a3d8;
  --pm-accent-darker: #1985ad;
  --pm-border: #e6e9ef;
  --pm-bg-soft: #f4f7f9;
  --pm-bg-zebra: #f9fafc;
}

/* ==========================================================================
   1. RYTHME VERTICAL ENTRE MODULES
   --------------------------------------------------------------------------
   Note: .my-4 de Bootstrap utilise !important — on doit forcer aussi.
   ========================================================================== */
.post-info .page-module.my-4,
.post-info .page-module {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
.post-info .page-module + .page-module,
.post-info .page-module.my-4 + .page-module.my-4 {
  margin-top: 60px !important;
}
@media (max-width: 767px) {
  .post-info .page-module + .page-module,
  .post-info .page-module.my-4 + .page-module.my-4 {
    margin-top: 40px !important;
  }
}

/* Espace bas avant le footer pour les pages CMS */
.post-info .page-module:last-child {
  padding-bottom: 80px;
}
@media (max-width: 767px) {
  .post-info .page-module:last-child {
    padding-bottom: 50px;
  }
}

/* ==========================================================================
   2. TITRES
   ========================================================================== */

/* h2 = titre du module (rendu par _main.html.twig si isShowTitle) */
.page-module > h2 {
  position: relative;
  color: var(--pm-brand);
  font-weight: 600;
  font-size: 2.15rem;
  line-height: 1.25;
  margin: 0 0 32px;
  padding-bottom: 18px;
}
.page-module > h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 48px;
  height: 3px;
  background: var(--pm-accent);
}
@media (max-width: 767px) {
  .page-module > h2 {
    font-size: 1.7rem;
    margin-bottom: 24px;
  }
}

/* h3 dans le contenu (sous-section, ex: "Une gestion responsable et solidaire") */
.page-module h3 {
  color: var(--pm-brand);
  font-weight: 600;
  font-size: 1.55rem;
  line-height: 1.3;
  margin: 40px 0 16px;
  padding-left: 16px;
  border-left: 3px solid var(--pm-accent);
}
.page-module h3:first-child,
.page-module > *:first-child h3:first-child {
  margin-top: 0;
}
@media (max-width: 767px) {
  .page-module h3 {
    font-size: 1.3rem;
    margin: 30px 0 14px;
  }
}

/* h4 (rare) */
.page-module h4 {
  color: var(--pm-brand);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.35;
  margin: 26px 0 12px;
}

/* ==========================================================================
   3. CORPS DE TEXTE
   ========================================================================== */
.page-module p {
  color: var(--pm-brand-soft);
  font-size: 1.55rem;
  line-height: 1.7;
  margin: 0 0 20px;
}
.page-module p:last-child {
  margin-bottom: 0;
}
@media (max-width: 767px) {
  .page-module p {
    font-size: 1.1rem;
    line-height: 1.65;
  }
}

.page-module strong,
.page-module b {
  color: var(--pm-brand);
  font-weight: 600;
}

.page-module em {
  font-style: italic;
  color: inherit;
}

/* Liens dans le corps */
.page-module a:not(.btn):not(.list-group-item):not(.slide-btn-ghost) {
  color: var(--pm-accent-dark);
  text-decoration: underline;
  text-decoration-color: rgba(36, 163, 216, 0.4);
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.page-module a:not(.btn):not(.list-group-item):not(.slide-btn-ghost):hover {
  color: var(--pm-accent-darker);
  text-decoration-color: currentColor;
}

/* ==========================================================================
   4. LISTES
   ========================================================================== */
.page-module ul {
  list-style: none;
  padding-left: 0;
  margin: 0 0 20px;
}
.page-module ul li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 12px;
  color: var(--pm-brand-soft);
  font-size: 1.55rem;
  line-height: 1.65;
}
.page-module ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 7px;
  height: 7px;
  background: var(--pm-accent);
  border-radius: 1px;
}

.page-module ol {
  padding-left: 28px;
  margin: 0 0 22px;
}
.page-module ol li {
  color: var(--pm-brand-soft);
  font-size: 1.55rem;
  line-height: 1.65;
  margin-bottom: 12px;
}
.page-module ol li::marker {
  color: var(--pm-accent);
  font-weight: 600;
}

@media (max-width: 767px) {
  .page-module ul li,
  .page-module ol li {
    font-size: 1.1rem;
  }
}

/* ==========================================================================
   5. BLOCKQUOTE
   ========================================================================== */
.page-module blockquote {
  margin: 30px 0;
  padding: 24px 28px;
  background: var(--pm-bg-soft);
  border-left: 4px solid var(--pm-accent);
  border-radius: 0 4px 4px 0;
}
.page-module blockquote p {
  color: var(--pm-brand);
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.6;
  margin: 0;
}
.page-module blockquote footer {
  display: block;
  margin-top: 12px;
  font-style: normal;
  font-size: 0.9rem;
  color: #6a7283;
}

/* ==========================================================================
   6. TABLEAU (CONDITIONS_TARIFAIRE)
   ========================================================================== */
.page-module table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  border: none;
}
.page-module table thead th {
  background: var(--pm-brand);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 18px;
  text-align: left;
  border: none;
}
.page-module table tbody td {
  padding: 16px 20px;
  border: none;
  border-bottom: 1px solid var(--pm-border);
  color: var(--pm-brand-soft);
  font-size: 1.1rem;
}
.page-module table tbody tr:last-child td {
  border-bottom: none;
}
.page-module table tbody tr:nth-child(even) td {
  background: var(--pm-bg-zebra);
}
.page-module table tbody td:first-child {
  font-weight: 500;
  color: var(--pm-brand);
}
.page-module table tbody td:last-child {
  font-weight: 600;
  color: var(--pm-accent-dark);
}

/* Compense les classes Bootstrap qui pourraient être présentes */
.page-module .table-bordered,
.page-module .table-bordered th,
.page-module .table-bordered td {
  border: none !important;
}

/* --- Grille de cartes pour CONDITIONS_TARIFAIRE -------------------------- */
.page-module .bareme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 8px 0 24px;
}
.page-module .bareme-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--pm-border);
  border-radius: 8px;
  padding: 28px 18px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.page-module .bareme-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(50, 57, 70, 0.08);
  border-color: var(--pm-accent);
}
.page-module .bareme-rate {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--pm-brand);
  line-height: 1;
  letter-spacing: -1px;
  margin-bottom: 8px;
}
.page-module .bareme-duration {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  color: var(--pm-brand-soft);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.page-module .bareme-card--best {
  background: linear-gradient(135deg, #323946 0%, #3d4655 100%);
  border-color: var(--pm-brand);
  padding-top: 38px;
}
.page-module .bareme-card--best .bareme-rate {
  color: var(--pm-accent);
  font-size: 2.85rem;
}
.page-module .bareme-card--best .bareme-duration {
  color: rgba(255, 255, 255, 0.85);
}
.page-module .bareme-card--best:hover {
  border-color: var(--pm-accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(50, 57, 70, 0.18);
}
.page-module .bareme-badge {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--pm-accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 4px 10px;
  border-radius: 3px;
  white-space: nowrap;
}
@media (max-width: 767px) {
  .page-module .bareme-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .page-module .bareme-rate { font-size: 2rem; }
  .page-module .bareme-card--best .bareme-rate { font-size: 2.25rem; }
}

/* ==========================================================================
   7. LISTE_FICHIERS (download list)
   ========================================================================== */
.page-module .list-group {
  border: none;
}
.page-module .list-group-item {
  border: 1px solid var(--pm-border);
  border-radius: 4px;
  padding: 16px 20px;
  margin-bottom: 8px;
  background: #fff;
  color: var(--pm-brand);
  font-weight: 500;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.page-module .list-group-item:hover {
  border-color: var(--pm-accent);
  background: var(--pm-bg-zebra);
}
.page-module .list-group-item .btn {
  background: var(--pm-brand);
  border-color: var(--pm-brand);
  color: #fff;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 3px;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.page-module .list-group-item .btn:hover {
  background: var(--pm-accent);
  border-color: var(--pm-accent);
  color: #fff;
}

/* Section ASIDE retirée volontairement — l'aside garde son style d'origine. */

/* ==========================================================================
   9. TAUX VEDETTE — module hero affichant un taux vedette
   ========================================================================== */
.page-module .taux-vedette-hero {
  background: linear-gradient(135deg, #323946 0%, #3d4655 60%, #2a313d 100%);
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(50, 57, 70, 0.18);
  position: relative;
}
.page-module .taux-vedette-hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(68,190,241,0.18) 0%, rgba(68,190,241,0) 70%);
  pointer-events: none;
}
.page-module .taux-vedette-hero__inner {
  display: flex;
  align-items: stretch;
  position: relative;
  z-index: 1;
}
.page-module .taux-vedette-hero__rate {
  flex: 0 0 38%;
  max-width: 38%;
  background: rgba(255, 255, 255, 0.04);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 48px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.page-module .taux-vedette-hero__number {
  display: block;
  font-size: 5.5rem;
  font-weight: 700;
  color: var(--pm-accent);
  line-height: 0.95;
  letter-spacing: -3px;
  text-shadow: 0 4px 12px rgba(68, 190, 241, 0.25);
}
.page-module .taux-vedette-hero__label {
  display: block;
  margin-top: 14px;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.78);
  font-style: italic;
  letter-spacing: 0.3px;
}
.page-module .taux-vedette-hero__body {
  flex: 1 1 62%;
  padding: 48px 44px;
  color: #fff;
}
.page-module .taux-vedette-hero__description {
  color: rgba(255, 255, 255, 0.95) !important;
  font-size: 1.4rem !important;
  font-weight: 400;
  line-height: 1.55;
  margin: 0 0 14px;
}
.page-module .taux-vedette-hero__description strong {
  color: #fff !important;
  font-weight: 600;
}
.page-module .taux-vedette-hero__extra {
  color: rgba(255, 255, 255, 0.78) !important;
  font-size: 1.05rem !important;
  font-weight: 400;
  line-height: 1.55;
  margin: 0 0 22px;
}
.page-module .taux-vedette-hero__btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--pm-accent);
  color: #fff !important;
  padding: 14px 30px;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  text-decoration: none !important;
  border-radius: 4px;
  transition: background 0.25s ease, transform 0.25s ease;
}
.page-module .taux-vedette-hero__btn::after {
  content: '\f105';
  font-family: 'FontAwesome';
  font-size: 1.1rem;
  transition: transform 0.25s ease;
}
.page-module .taux-vedette-hero__btn:hover {
  background: var(--pm-accent-dark);
  transform: translateY(-2px);
}
.page-module .taux-vedette-hero__btn:hover::after {
  transform: translateX(4px);
}
.page-module .taux-vedette-hero__disclaimer {
  display: block;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.55) !important;
  font-size: 0.85rem !important;
  font-style: italic;
  line-height: 1.5;
}

@media (max-width: 767px) {
  .page-module .taux-vedette-hero__inner {
    flex-direction: column;
  }
  .page-module .taux-vedette-hero__rate,
  .page-module .taux-vedette-hero__body {
    flex: 1 1 auto;
    max-width: 100%;
  }
  .page-module .taux-vedette-hero__rate {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 36px 24px;
  }
  .page-module .taux-vedette-hero__number {
    font-size: 4rem;
  }
  .page-module .taux-vedette-hero__body {
    padding: 32px 26px 36px;
  }
  .page-module .taux-vedette-hero__description {
    font-size: 1.15rem !important;
  }
}
