/*
Theme Name: Gîte en Règle
Description: Thème sur mesure reprenant le design d'origine de Gîte en Règle (police Manrope, bleu ardoise, cartes arrondies). Les styles de base viennent de /assets/style.css, partagé avec le diagnostic et le simulateur.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
Author: Gîte en Règle
Text Domain: gite-en-regle
*/

/* ------------------------------------------------------------------
   Ce fichier adapte les blocs WordPress au design d'origine.
   Les couleurs, la police et les composants (.card, .hero, .btn…)
   sont définis dans /assets/style.css.
   ------------------------------------------------------------------ */

/* Les sections construites avec des blocs « Groupe » gardent l'espacement d'origine */
body .site-main :where(.is-layout-flow, .is-layout-constrained) > * { margin-block-start: 0; }
body .site-main .is-layout-constrained > * { max-width: none; margin-left: 0; margin-right: 0; }

/* Titre décoratif (sur-titre) écrit comme un paragraphe */
body p.eyebrow { display: inline-block; }
body .dark .eyebrow { background: #2A3E4B; color: var(--apple); }

/* Boutons WordPress = boutons d'origine */
body .wp-block-buttons.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
body .wp-block-buttons > .wp-block-button { margin: 0; }
body .wp-block-button .wp-block-button__link {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 14px;
  font: inherit; font-size: 1rem; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; background: var(--primary); color: #fff;
  transition: background .15s, transform .15s; box-shadow: none;
}
body .wp-block-button .wp-block-button__link:hover { background: var(--primary-dark); color: #fff; }
body .wp-block-button .wp-block-button__link:active { transform: translateY(1px); }
body .wp-block-button.is-style-outline .wp-block-button__link { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
body .wp-block-button.is-style-outline .wp-block-button__link:hover { background: var(--primary-soft); color: var(--primary); }
body .wp-block-button.btn-apple .wp-block-button__link { background: var(--apple); color: var(--ink); }
body .wp-block-button.btn-apple .wp-block-button__link:hover { background: #8CC56F; color: var(--ink); }

/* Coches */
:root {
  --ger-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E");
}
body ul.reassure { list-style: none; padding: 0; margin: 20px 0 0; }
body ul.reassure li { display: inline-flex; align-items: center; gap: 6px; }
body ul.reassure li::before, body ul.feature-list li::before {
  content: ""; flex: 0 0 auto; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: var(--ger-check) center / contain no-repeat; mask: var(--ger-check) center / contain no-repeat;
}
body ul.feature-list li::before { width: 18px; height: 18px; margin-top: 3px; background: var(--apple); }

/* Icônes des cartes (classe ic-… sur un bloc Groupe « card ») */
body .card[class*="ic-"]::before {
  content: ""; display: block; width: 44px; height: 44px; border-radius: 12px; margin-bottom: 14px;
  background: var(--primary-soft) center / 22px no-repeat;
}
body .card.ic-enregistrement::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F4E6B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='4' width='12' height='17' rx='2'/%3E%3Cpath d='M9 4h6v3H9z'/%3E%3Cpath d='M9 13l2 2 4-4'/%3E%3C/svg%3E"); }
body .card.ic-fiscalite::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F4E6B' stroke-width='2' stroke-linecap='round'%3E%3Crect x='5' y='3' width='14' height='18' rx='2'/%3E%3Cpath d='M8 7h8M8 12h.01M12 12h.01M16 12h.01M8 16h.01M12 16h.01M16 16h.01'/%3E%3C/svg%3E"); }
body .card.ic-commune::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F4E6B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-7-6-7-12a7 7 0 0 1 14 0c0 6-7 12-7 12z'/%3E%3Ccircle cx='12' cy='9' r='2.5'/%3E%3C/svg%3E"); }
body .card.ic-document::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F4E6B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 3v5h5M9 13h6M9 17h6'/%3E%3C/svg%3E"); }

/* Questions fréquentes (bloc « Détails ») */
body details.wp-block-details > summary { font-weight: 700; }
body details.wp-block-details > :not(summary) { color: var(--muted); }

/* Contenu des pages et articles */
.entry > *:last-child { margin-bottom: 0; }
.entry h2 { font-size: 1.35rem; margin-top: 1.4em; }
.entry h3 { margin-top: 1.4em; }
.entry > h2:first-child, .entry > h3:first-child { margin-top: 0; }
.entry img { max-width: 100%; height: auto; border-radius: 12px; }
.entry ul, .entry ol { padding-left: 1.3em; margin: 0 0 1em; }
.entry li { margin-bottom: .35em; }
.entry blockquote { margin: 1.2em 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--primary); color: var(--muted); }
.entry figure { margin: 1.2em 0; }
.entry figcaption { color: var(--muted); font-size: .88rem; margin-top: 6px; }
.entry table { width: 100%; border-collapse: collapse; }
.entry td, .entry th { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.entry .wp-block-buttons { margin: 1.2em 0; }
.page-head { margin-bottom: 24px; }
.page-head .meta { color: var(--muted); font-size: .92rem; margin: 0; }

/* Liste d'articles */
.post-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.post-list .card h2 { font-size: 1.2rem; }
.post-list .card h2 a { color: var(--ink); text-decoration: none; }
.post-list .card h2 a:hover { color: var(--primary); }
.post-list .meta { color: var(--muted); font-size: .88rem; margin-bottom: 8px; }
.pagination { display: flex; gap: 10px; margin-top: 24px; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-weight: 700; }

/* Barre d'administration WordPress (visible seulement connecté) */
.admin-bar .site-header { top: 32px; }

@media (max-width: 860px) {
  .post-list { grid-template-columns: 1fr; }
  body .wp-block-columns { flex-wrap: wrap !important; }
}
