/**
 * Feuille de style ISOLÉE pour /tarifs/.
 *
 * Autonome, comme assets/css/offre-merci.css : ne suppose rien de l'état de
 * main.css en production. Contient les variables, les styles de base et les
 * composants réellement utilisés par cette page. Chargée UNIQUEMENT sur ce
 * template (voir templates/template-rates.php) et n'affecte donc aucune
 * autre page du site.
 */

:root {
    --forest: #17392f;
    --forest-2: #244c40;
    --sage-ink: #486b5c;
    --mist: #e8f0ec;
    --sand: #efe9dc;
    --clay-ink: #984025;
    --ink: #18372f;
    --text: #334a42;
    --muted: #5f716a;
    --paper: #fdfcf9;
    --white: #ffffff;
    --line: rgba(23, 57, 47, 0.16);
    --line-strong: rgba(23, 57, 47, 0.28);
    --shell: min(1220px, calc(100% - 64px));
    --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    --font-sans: Inter, "Avenir Next", "Segoe UI", Arial, sans-serif;
    --radius: 6px;
}

/* Base */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    line-height: 1.68;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

h1,
h2,
h3,
p,
blockquote {
    margin-top: 0;
}

h1,
h2,
h3 {
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: 0;
    overflow-wrap: break-word;
}

h1 {
    font-size: 4.5rem;
}

h2 {
    font-size: 3rem;
}

h3 {
    font-size: 1.5rem;
}

em {
    color: var(--sage-ink);
    font-weight: 400;
}

:where(a, button, summary, input, select, textarea):focus-visible {
    outline: 3px solid var(--clay-ink);
    outline-offset: 4px;
}

/* Layout primitives */
.shell {
    width: var(--shell);
    margin-inline: auto;
}

.narrow {
    max-width: 820px;
}

.center {
    text-align: center;
}

.section {
    padding: 104px 0;
}

.section--sand {
    background: var(--sand);
}

.eyebrow {
    margin-bottom: 20px;
    color: var(--clay-ink);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0;
    text-transform: uppercase;
}

.lead {
    max-width: 620px;
    font-size: 1.125rem;
    line-height: 1.7;
}

.center .lead {
    margin-inline: auto;
}

/* Buttons and links */
.button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border: 1px solid var(--forest);
    border-radius: var(--radius);
    background: var(--forest);
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0;
    text-align: center;
    transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.button:hover {
    border-color: var(--forest-2);
    background: var(--forest-2);
    color: var(--white);
    transform: translateY(-1px);
}

.text-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 0 7px;
    border-bottom: 1px solid currentColor;
    color: var(--forest);
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.3;
}

.text-link:hover {
    color: var(--clay-ink);
}

/* Shared inner-page layouts */
.split {
    display: grid;
    grid-template-columns: 0.7fr 1.3fr;
    gap: 80px;
}

.page-hero {
    padding: 120px 0;
    border-bottom: 1px solid rgba(23, 57, 47, 0.1);
    background: var(--mist);
}

.page-hero--compact {
    padding: 96px 0 72px;
}

/* SmartAgenda booking widget (classes générées par inc/smartagenda.php) */
.smartagenda-embed {
    margin-block: 8px;
}

.smartagenda-embed__frame {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: var(--smartagenda-height, 760px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--mist);
}

.smartagenda-embed__frame iframe {
    display: block;
    width: 100% !important;
    height: 100% !important;
    border: 0;
}

.smartagenda-embed__loading,
.smartagenda-embed__error {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 100%;
    margin: 0;
    padding: 24px;
    color: var(--muted);
    font-size: 0.95rem;
    text-align: center;
}

.smartagenda-embed__error {
    color: var(--clay-ink);
}

@media (max-width: 720px) {
    .smartagenda-embed__frame {
        height: min(var(--smartagenda-height, 760px), 620px);
    }
}

/* Hero — composition éditoriale asymétrique, alignée à gauche */
.rate-hero {
    padding: 72px 0 48px;
    border-bottom: 1px solid var(--line);
}

.rate-hero__content {
    max-width: 700px;
}

.rate-note {
    margin-top: 24px;
    color: var(--muted);
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
}

/* Sections numérotées (01-04) — grille à 3 colonnes : numéro / catégorie+prix / contenu */
.rate-section {
    padding-block: 72px;
}

.rate-section--compact {
    padding-block: 56px;
}

/* Présence légèrement supérieure de l'offre Arrêt du tabac : fond sauge
   extrêmement subtil (#7A9A88 à faible opacité), sans encadré ni bordure. */
.rate-section--tabac {
    background: rgba(122, 154, 136, 0.08);
}

.rate-section + .rate-section {
    border-top: 1px solid var(--line);
}

.rate-grid {
    display: grid;
    grid-template-columns: 180px 0.85fr 1.35fr;
    gap: 56px;
    align-items: start;
}

.rate-grid__index {
    display: block;
    grid-column: 1;
    color: var(--clay-ink);
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 4rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.rate-grid__info {
    grid-column: 2;
}

.rate-grid__info .eyebrow {
    font-size: 0.9375rem;
    letter-spacing: 0.03em;
}

.rate-price {
    margin: 14px 0 8px;
    color: var(--clay-ink);
    font-family: var(--font-display);
    font-size: 2.5rem;
    line-height: 1;
}

.rate-meta {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 0.9375rem;
}

.rate-body {
    grid-column: 3;
}

.rate-body p {
    margin-bottom: 14px;
}

.rate-body .button {
    margin-top: 8px;
}

/* Liste éditoriale (programmes / individuelles / suivis) */
.rate-list {
    padding: 0;
    margin: 8px 0 0;
    list-style: none;
}

.rate-list li {
    border-top: 1px solid var(--line);
}

.rate-list li:last-child {
    border-bottom: 1px solid var(--line);
}

.rate-list button {
    display: flex;
    width: 100%;
    align-items: baseline;
    gap: 16px;
    padding: 20px 16px 20px 4px;
    border: 0;
    border-radius: var(--radius);
    background: none;
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    text-align: left;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease, padding-left 160ms ease;
}

.rate-list__label {
    flex: 1 1 auto;
}

.rate-list__meta {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.875rem;
}

.rate-list__price {
    flex: 0 0 auto;
    color: var(--clay-ink);
    font-family: var(--font-display);
    font-size: 1.375rem;
}

/* CTA de ligne : identifiable instantanément comme une action (vert profond,
   soulignement fin permanent, comme .text-link), sans devenir un bouton plein
   ni utiliser d'icône/flèche. */
.rate-list__cta {
    flex: 0 0 auto;
    padding-bottom: 2px;
    border-bottom: 1px solid currentColor;
    color: var(--forest);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition: color 160ms ease;
}

.rate-list button:hover,
.rate-list button:focus-visible {
    padding-left: 14px;
    background: var(--mist);
    color: var(--clay-ink);
}

.rate-list button:hover .rate-list__cta,
.rate-list button:focus-visible .rate-list__cta {
    color: var(--forest-2);
}

/* Séances de suivi : CTA de même famille visuelle mais légèrement secondaire
   par rapport aux CTA de réservation initiaux (poids réduit, opacité). */
.rate-section--compact .rate-list__cta {
    font-weight: 600;
    opacity: 0.82;
}

/*
 * Zone de réservation — point d'appel visuel premium : fond vert profond
 * (#344A3F, ≈ var(--text)), titre et texte ivoire, eyebrow et ligne verticale
 * en terracotta. Le widget SmartAgenda garde son propre fond clair habituel
 * (.smartagenda-embed__frame a déjà sa propre couleur, non affecté ici) :
 * lisibilité intacte, comme demandé.
 */
#tarifs-reservation {
    --reservation-accent: #c96a3a;
    background: var(--text);
}

#tarifs-reservation .eyebrow {
    color: var(--reservation-accent);
}

#tarifs-reservation h2 {
    color: var(--paper);
}

#tarifs-reservation .lead {
    color: rgba(253, 252, 249, 0.82);
}

.rate-reservation {
    padding-block: 64px;
    transition: padding-block 200ms ease;
}

.rate-reservation.is-active {
    padding-block: 96px;
}

.rate-reservation__status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
}

.rate-chosen {
    margin: 0;
    color: var(--reservation-accent);
    font-weight: 700;
}

.rate-placeholder {
    margin: 20px 0 0;
    padding-left: 16px;
    border-left: 2px solid var(--reservation-accent);
    color: rgba(253, 252, 249, 0.72);
}

#tarifs-reservation .smartagenda-embed {
    margin-top: 28px;
}

#tarifs-reservation .text-link {
    margin: 0;
    color: var(--paper);
}

#tarifs-reservation .text-link:hover {
    color: var(--reservation-accent);
}

/* Anneau de focus clavier clay-ink peu lisible sur fond vert profond :
   accent terracotta local pour conserver un focus visible et élégant. */
#tarifs-reservation :where(a, button):focus-visible {
    outline-color: var(--reservation-accent);
}

/*
 * .text-link force display:inline-flex, ce qui neutralise le display:none
 * natif de l'attribut [hidden] (une règle auteur l'emporte toujours sur la
 * feuille de style du navigateur, quelle que soit la spécificité). Correctif
 * identique à celui déjà validé sur /offre-decouverte/.
 */
#tarifs-reservation-change[hidden] {
    display: none;
}

/* Réassurance (texte et classes identiques à /offre-decouverte/) */
.section--reassurance {
    padding: 84px 0;
}

.reassurance-lead {
    position: relative;
    max-width: 680px;
    margin: 0 auto 20px;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 2.375rem;
    line-height: 1.32;
    text-wrap: balance;
}

.reassurance-lead::before {
    content: "";
    display: block;
    width: 32px;
    height: 1px;
    margin: 0 auto 28px;
    background: var(--line-strong);
}

.reassurance-methods {
    margin: 0;
    color: var(--muted);
    font-size: 0.875rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/*
 * Grille numéro/contenu (.rate-grid) — 3 colonnes distinctes à partir de
 * 1200px (numéro / catégorie+prix / description-liste+CTA). En dessous,
 * le numéro reste une colonne à part entière (2 colonnes, il chevauche les
 * deux lignes de contenu) jusqu'à 900px, puis empilement complet en dessous
 * (numéro au-dessus du contenu), avec une taille toujours généreuse.
 */
@media (max-width: 1199px) {
    .rate-grid {
        grid-template-columns: 140px 1fr;
        column-gap: 40px;
        row-gap: 8px;
    }

    .rate-grid__index {
        grid-row: 1 / span 2;
        font-size: 3rem;
    }

    .rate-grid__info {
        grid-column: 2;
        grid-row: 1;
    }

    .rate-body {
        grid-column: 2;
        grid-row: 2;
    }
}

@media (max-width: 899px) {
    .rate-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .rate-grid__index {
        grid-column: 1;
        grid-row: auto;
        font-size: 2.5rem;
    }

    .rate-grid__info,
    .rate-body {
        grid-column: 1;
        grid-row: auto;
    }
}

@media (max-width: 720px) {
    .rate-hero {
        padding: 56px 0 40px;
    }
}

/* Points de rupture globaux nécessaires (shell, typographie, .section, .split) */
@media (max-width: 1040px) {
    :root {
        --shell: min(960px, calc(100% - 48px));
    }

    h1 {
        font-size: 4rem;
    }

    h2 {
        font-size: 2.625rem;
    }

    .section {
        padding: 88px 0;
    }

    .split {
        grid-template-columns: 1fr;
        gap: 48px;
    }
}

@media (max-width: 720px) {
    :root {
        --shell: calc(100% - 32px);
    }

    body {
        font-size: 1rem;
    }

    h1 {
        font-size: 3.25rem;
    }

    h2 {
        font-size: 2.25rem;
    }

    h3 {
        font-size: 1.35rem;
    }

    .section {
        padding: 72px 0;
    }

    .page-hero--compact {
        padding: 64px 0 48px;
    }

    .rate-section {
        padding-block: 56px;
    }

    .rate-section--compact {
        padding-block: 48px;
    }

    .rate-price {
        font-size: 2rem;
    }

    .rate-body .button {
        width: 100%;
    }

    .rate-list button {
        flex-wrap: wrap;
        row-gap: 4px;
        padding-block: 18px;
    }

    .rate-list__cta {
        flex-basis: 100%;
    }
}

@media (max-width: 599px) {
    .rate-reservation {
        padding-block: 48px;
    }

    .rate-reservation.is-active {
        padding-block: 64px;
    }

    .section--reassurance {
        padding: 56px 0;
    }

    .reassurance-lead {
        margin: 0 auto 16px;
        font-size: 1.375rem;
        line-height: 1.4;
    }

    .reassurance-lead::before {
        margin: 0 auto 20px;
    }
}

@media (max-width: 420px) {
    :root {
        --shell: calc(100% - 24px);
    }

    /* Corrige une coupure interne du mot "accompagnement" (overflow-wrap:
       break-word hérité de la règle h1,h2,h3 de base, combiné à un h1 encore
       trop grand à cette largeur) sans toucher aux autres écrans. */
    .rate-hero h1 {
        font-size: 2.25rem;
        overflow-wrap: normal;
        word-break: normal;
        hyphens: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
