/* ==========================================================================
   Guide algues (template-guide-algues.php) et plans d'action par algue
   (template-plan-algue.php) — 1.8.9.
   Le corps de texte est celui des articles (single.css) ; ici, seulement ce qui
   manque sur une page : l'encadré final, le calculateur dans le texte, l'impression.
   ========================================================================== */

/* ── Encadré final du texte (« Et toi, quelle algue as-tu ? ») ──
   Même rendu que l'encadré « cta-final » des articles du guide débutants. */
.guide-algues .article-body .cta-final {
    background: linear-gradient(135deg, #1a4d2e 0%, #27ae60 100%);
    color: #ffffff;
    padding: 2rem 1.5rem;
    border-radius: 12px;
    margin: 3rem 0 2rem;
    text-align: center;
    box-shadow: 0 5px 20px rgba(26, 77, 46, 0.3);
}
.guide-algues .article-body .cta-final p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 0 0 0.5rem;
}
.guide-algues .article-body .cta-final p:last-child { margin-bottom: 0; }
.guide-algues .article-body .cta-final .cta-final__title {
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

/* ── Photos datées du récit : légende lisible, verticales à taille raisonnable ──
   Le thème n'a aucun style de figure : la légende collait au paragraphe suivant. */
.guide-algues .article-body figure.wp-block-image { margin: 2rem 0; }
.guide-algues .article-body figure.wp-block-image img { display: block; margin: 0 auto 0.6rem; }
.guide-algues .article-body figure.wp-block-image img[width="768"][height="1024"] { max-width: min(100%, 480px); }
.guide-algues .article-body figcaption {
    font-size: 0.9rem;
    font-style: italic;
    color: #56675b;
    text-align: center;
    line-height: 1.5;
}

/* ── Calculateur posé dans le texte ──
   Le corps d'article donne ses marges et tailles à tout <p> : on rend au calculateur
   les siennes (calculateur-diagnostic.css). */
.guide-algues .diag-calc-section--guide {
    padding: 0;
    margin: 2.5rem 0;
    scroll-margin-top: 90px; /* les boutons-ancres ne cachent pas le haut sous l'en-tête fixe */
}
.guide-algues .diag-calc-section--guide p { margin-top: 0; }
.guide-algues .diag-card-header__titre {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
    color: var(--blanc, #fff);
}
.guide-algues .diag-card-header p { margin-bottom: 0; line-height: 1.5; }
.guide-algues .diag-calc-section--guide .step-question { margin-bottom: 0.4rem; }
.guide-algues .diag-calc-section--guide .step-question-sub { margin-bottom: 1.5rem; }

/* base.css fait de tout .form-row une grille à 2 colonnes (formulaires de contact) : ici, un champ par ligne. */
.guide-algues .diag-calc-section--guide .form-row { display: block; }
.guide-algues .diag-calc-section--guide .form-row input { width: 100%; max-width: none; box-sizing: border-box; }

/* Six cartes : 2 colonnes, 3 dès que la place le permet. Double classe : cette feuille
   est chargée avant calculateur-diagnostic.css, qui fixe 2 colonnes. */
.algue-cards-grid.algue-cards-grid--6 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) {
    .algue-cards-grid.algue-cards-grid--6 { grid-template-columns: repeat(3, 1fr); }
}
/* Les images du corps d'article (single.css : marges, coins, curseur loupe) ne valent
   pas pour les photos des cartes. */
.article-body .algue-card .algue-card__img {
    margin: 0;
    border-radius: 0;
    cursor: pointer;
}
.algue-card > span { display: block; }
.algue-card__body .algue-card__titre,
.algue-card__body .algue-card__desc { display: block; }
.algue-card .algue-card__img-placeholder { display: flex; }

/* ── Plan d'action ── */
.plan-algue { padding: 2rem 0 3rem; }
.plan-algue__entete { text-align: center; margin-bottom: 2rem; }
.plan-algue__marque {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-primary, #2d7d46);
    margin: 0 0 0.5rem;
}
.plan-algue__titre { margin: 0 0 0.5rem; }
.plan-algue__date { font-size: 0.9rem; color: #56675b; margin: 0 0 1.25rem; }
.plan-algue__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.plan-algue__corps { padding: 0; }
.plan-algue__rappel { font-size: 0.9rem; color: #56675b; text-align: center; margin-top: 2.5rem; }
/* Rappel réservé au papier (Guide Express) : masqué à l'écran, rétabli par la feuille d'impression. */
.plan-algue__rappel--impression { display: none; }

/* ── Pages à imprimer : chapeau, tableaux, boutons du texte (Guide Express, 1.8.13) ── */
.plan-algue__corps .guide-express__chapeau { font-size: 1.1rem; line-height: 1.7; color: #3d4a42; }
.plan-algue__corps .guide-express__action { text-align: center; margin: 1.5rem 0 2rem; }

.plan-algue__corps table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.75rem; font-size: 0.95rem; }
.plan-algue__corps .wp-block-table { margin: 0; overflow-x: auto; }
.plan-algue__corps th,
.plan-algue__corps td { padding: 0.6rem 0.75rem; border: 1px solid #d5ddd7; text-align: left; vertical-align: top; }
.plan-algue__corps thead th { background: #eef5f0; color: #1d5230; font-weight: 700; }
.plan-algue__corps tbody th { font-weight: 600; background: transparent; }

.plan-algue__corps .poissons-debutants__titre { font-size: 1.15rem; margin: 1.5rem 0 0.25rem; color: var(--color-primary, #2d7d46); }
.poissons-debutants__table { table-layout: fixed; }
.poissons-debutants__table th:first-child { width: 40%; }
.poissons-debutants__table td { white-space: nowrap; }

@media (max-width: 600px) {
    .plan-algue__corps table { font-size: 0.85rem; }
    .plan-algue__corps th,
    .plan-algue__corps td { padding: 0.45rem 0.4rem; }
    /* Le tableau garde la largeur du texte : colonnes fixes, libellés qui passent à la ligne. */
    .plan-algue__corps .poissons-debutants__table { table-layout: fixed; font-size: 0.8rem; }
    .poissons-debutants__table th:first-child { width: 34%; }
    .poissons-debutants__table th:nth-child(2) { width: 19%; }
    .poissons-debutants__table th:nth-child(3) { width: 27%; }
    .poissons-debutants__table thead th { font-size: 0.7rem; }
    .plan-algue__corps .poissons-debutants__table th,
    .plan-algue__corps .poissons-debutants__table td { padding: 0.45rem 0.3rem; }
    .plan-algue__corps h3.poissons-debutants__titre { font-size: 1.1rem; }
    /* Un titre long (celui du Guide Express) tenait sur six lignes. */
    .plan-algue .plan-algue__titre { font-size: 1.7rem; line-height: 1.25; }
}

@media (max-width: 340px) {
    .poissons-debutants__table thead th { font-size: 0.6rem; }
}

@media print {
    /* 1.8.13 : même liste que le rapport Bac Vivant (rapport.css). Avant, le bandeau de cookies
       (.aqua-consent) et les boutons flottants du mobile s'imprimaient sur chaque page et
       cachaient le texte : le sélecteur visait un identifiant qui n'existe pas. */
    #wpadminbar, .site-header, header.site-header, .site-footer, footer, .mobile-nav-buttons,
    .aqua-consent, .he-sticky-bar, .aqua-lead-overlay, .menu-toggle, #reading-progress-bar,
    .plan-algue__actions, .lead-modal, .aqua-lead-modal { display: none !important; }
    html { margin-top: 0 !important; }
    /* .article-body est une colonne flex : un conteneur flex ne se coupe pas entre deux pages,
       tout le texte partait donc en page 2 et la première page restait presque vide. */
    .plan-algue__corps { display: block; }
    .plan-algue__entete { margin-bottom: 1rem; }
    .plan-algue { padding: 0; }
    .plan-algue a { color: #1f5c38; text-decoration: underline; }
    .plan-algue__rappel { display: block; }
    body { background: #fff; }

    /* Une ligne de tableau n'est jamais coupée entre deux pages, un titre ne reste pas seul
       en bas de page, et un bouton du texte s'imprime comme un lien avec son adresse. */
    .plan-algue__corps tr,
    .plan-algue__corps th,
    .plan-algue__corps td { break-inside: avoid; page-break-inside: avoid; }
    .plan-algue__corps thead { display: table-header-group; }
    .plan-algue__corps h2,
    .plan-algue__corps h3 { break-after: avoid; page-break-after: avoid; }
    .plan-algue__corps .wp-block-table { overflow: visible; }
    /* Un tableau de tranche reste entier avec son titre, et l'ensemble est resserré pour le papier. */
    .poissons-debutants__tranche { break-inside: avoid; page-break-inside: avoid; }
    .plan-algue__corps table { font-size: 9.5pt; margin: 0.5rem 0 1rem; }
    .plan-algue__corps th,
    .plan-algue__corps td { padding: 0.3rem 0.6rem; }
    .plan-algue__corps h2 { font-size: 15pt; margin: 1.4rem 0 0.7rem; padding-bottom: 0.4rem; }
    .plan-algue__corps .poissons-debutants__titre { font-size: 12pt; margin: 0.9rem 0 0.2rem; }
    .plan-algue__corps p { margin-bottom: 0.7rem; }
    .plan-algue__titre { font-size: 22pt; }
    .plan-algue__corps .guide-express__action { text-align: left; margin: 0.5rem 0 1rem; }
    .plan-algue__corps .guide-express__action a.aq-btn { display: inline; padding: 0; border: 0; background: none; box-shadow: none; color: #1f5c38; min-height: 0; }
    .plan-algue__corps .guide-express__action a.aq-btn::after { content: " (" attr(href) ")"; font-weight: 400; }
}
