/* ==========================================================================
   Natur'à'tout : adaptations WordPress
   Relie la charte aux couleurs réglables dans Apparence > Éditeur > Styles,
   et ajuste les blocs du noyau (navigation, requêtes, images, listes).
   ========================================================================== */

:root {
  --nt-foret: var(--wp--preset--color--foret, #1f3a2b);
  --nt-foret-2: var(--wp--preset--color--foret-clair, #2d5340);
  --nt-creme: var(--wp--preset--color--creme, #f5f0e6);
  --nt-papier: var(--wp--preset--color--papier, #fbf9f4);
  --nt-terre: var(--wp--preset--color--terre, #a94a28);
  --nt-terre-2: var(--wp--preset--color--terre-fonce, #8a3a1e);
  --nt-ocre: var(--wp--preset--color--ocre, #c9953f);
  --nt-encre: var(--wp--preset--color--encre, #1b201c);
  --nt-gris: var(--wp--preset--color--gris, #575d57);
  --nt-ligne: var(--wp--preset--color--ligne, #ddd4c3);
}

/* Les grilles du thème gèrent leurs propres espacements */
.nt-deux > *, .nt-trois > *, .nt-domaines > *, .nt-domaine > *, .nt-realisation > *,
.nt-ressource > *, .nt-appel > *, .nt-service > *, .nt-colonnes-texte > *,
.nt-equipe > *, .nt-pied__grille > *, .nt-ouverture__grille > *, .nt-partenaires > *,
.nt-liste-domaines > *, .nt-ressources > * {
  margin-block: 0;
}
.nt-deux--bas { align-items: end; }
.nt-intro-section { margin-bottom: clamp(24px, 4vw, 48px) !important; }
.nt-section--haut-reduit { padding-top: clamp(16px, 3vw, 40px); }

/* ---------- En-tête ---------- */
.nt-entete-part {
  position: sticky;
  top: 0;
  z-index: 50;
}
.admin-bar .nt-entete-part { top: 32px; }
@media (max-width: 782px) { .admin-bar .nt-entete-part { top: 46px; } }
@media (max-width: 600px) { .admin-bar .nt-entete-part { top: 0; } }

.nt-entete { padding-block: 0; }
.nt-entete__interne { gap: 20px; }
.nt-entete__actions { gap: clamp(12px, 2vw, 28px); }
.nt-entete .wp-block-site-logo { line-height: 0; }
.nt-entete .wp-block-site-logo img { height: auto; max-height: 54px; width: auto; }
.nt-entete .wp-block-navigation__container { gap: clamp(4px, 1.4vw, 22px); }
.nt-entete .wp-block-navigation-item__content:hover { color: var(--nt-terre); }
.nt-entete .wp-block-navigation .current-menu-item > a,
.nt-entete .wp-block-navigation a[aria-current="page"] { color: var(--nt-terre); }

/* Bouton d'ouverture du menu mobile */
.nt-entete .wp-block-navigation__responsive-container-open {
  min-width: 46px;
  min-height: 46px;
  justify-content: center;
  border: 1.5px solid var(--nt-foret);
  border-radius: var(--nt-rayon);
  color: var(--nt-foret);
}

/* Menu mobile ouvert */
.nt-entete .wp-block-navigation__responsive-container.is-menu-open {
  background: var(--nt-creme);
  color: var(--nt-foret);
  padding: max(24px, env(safe-area-inset-top, 0px)) max(var(--nt-gouttiere), env(safe-area-inset-left, 0px)) 32px;
}
.nt-entete .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
  padding-top: 64px;
  align-items: stretch;
}
.nt-entete .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
  align-items: stretch;
  gap: 0;
  width: 100%;
}
.nt-entete .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
  border-bottom: 1px solid var(--nt-ligne);
}
.nt-entete .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
  font-size: 1.35rem;
  padding: 16px 0;
}
.nt-entete .wp-block-navigation__responsive-container-close {
  top: 20px;
  right: max(var(--nt-gouttiere), env(safe-area-inset-right, 0px));
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--nt-foret);
  border-radius: var(--nt-rayon);
}

@media (max-width: 600px) {
  .nt-entete__cta .wp-block-button__link { padding: 10px 14px; font-size: 0.9rem; min-height: 46px; }
}
@media (max-width: 420px) {
  .nt-entete__cta { display: none; }
}

/* ---------- Boutons ---------- */
.wp-block-button.nt-btn .wp-block-button__link { min-height: 50px; }
.wp-block-button.is-style-contour .wp-block-button__link {
  background: transparent;
  color: var(--nt-foret);
  border: 2px solid var(--nt-foret);
}
.wp-block-button.is-style-contour .wp-block-button__link:hover { background: var(--nt-foret); color: var(--nt-creme); }

/* ---------- Styles de blocs ---------- */
p.is-style-etiquette {
  font-family: var(--nt-mono);
  font-size: var(--nt-t-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--nt-terre);
}
p.is-style-chapo { font-size: var(--nt-t-l); line-height: 1.55; max-width: 58ch; }
p.is-style-a-completer {
  font-family: var(--nt-mono);
  font-size: 0.85rem;
  padding: 16px 18px;
  border: 1px dashed var(--nt-ocre);
  border-radius: var(--nt-rayon);
  background: color-mix(in srgb, var(--nt-ocre) 10%, transparent);
}
.wp-block-group.is-style-fond-foret { background: var(--nt-foret); color: var(--nt-sur-foret); }
.wp-block-group.is-style-fond-foret :is(h1, h2, h3, h4) { color: var(--nt-creme); }
.wp-block-group.is-style-fond-papier { background: var(--nt-papier); }

/* ---------- Images ---------- */
.wp-block-image.nt-photo { margin-block: 0; }
.wp-block-image.nt-photo img { width: 100%; }
.nt-ouverture .wp-block-image.nt-photo img { aspect-ratio: 5 / 6; max-height: 78vh; object-fit: cover; }
.nt-ratio-bandeau img { aspect-ratio: 21 / 9; object-fit: cover; }
.wp-block-post-featured-image.nt-photo img { border-radius: var(--nt-rayon); }
@media (max-width: 960px) {
  .nt-ouverture .wp-block-image.nt-photo img { aspect-ratio: 4 / 3; max-height: none; }
  .nt-ratio-bandeau img { aspect-ratio: 3 / 2; }
}

/* ---------- Repères sous l'ouverture ---------- */
.nt-repere p { margin: 0; }

/* ---------- Listes éditoriales ---------- */
.nt-faits, .nt-coordonnees, .nt-sommaire { padding-left: 0; list-style: none; }
.nt-sommaire li { margin: 0; }
.nt-domaine h3 { margin: 0; }
.nt-domaine p { margin: 0 0 10px; }
.nt-liste-domaines { border-top: 2px solid var(--nt-foret); }

/* ---------- Fiche de réalisation ---------- */
.nt-fiche p { margin: 6px 0 0; max-width: 60ch; }
.nt-fiche .nt-fiche__titre {
  font-family: var(--nt-mono);
  font-size: var(--nt-t-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--nt-terre);
  margin-top: 18px;
}
.nt-fiche .nt-fiche__titre:first-child { margin-top: 0; }
.nt-meta-ligne { margin-bottom: 14px; }
p.nt-meta-ligne { font-family: var(--nt-mono); font-size: var(--nt-t-xs); color: var(--nt-gris); }
.nt-meta-ligne .wp-block-post-terms a { color: var(--nt-terre); text-decoration: none; }

/* ---------- Ressources ---------- */
.nt-ressource .nt-type { margin: 0; }
.nt-ressource h3 { margin: 0 0 4px; }
.nt-ressource .wp-block-buttons { margin: 0; }
.nt-titre-liste { font-size: var(--nt-t-xl); margin: 48px 0 16px; }
.nt-titre-liste:first-child { margin-top: 0; }

/* ---------- Requêtes d'articles ---------- */
.nt-requete .wp-block-post-title { font-size: var(--nt-t-l); letter-spacing: -0.01em; margin: 8px 0; }
.nt-requete .wp-block-post-title a { color: var(--nt-foret); text-decoration: none; }
.nt-requete .wp-block-post-title a:hover { color: var(--nt-terre); }
.nt-requete .wp-block-post-excerpt { color: var(--nt-gris); }
.nt-requete .wp-block-post-excerpt__more-text { display: none; }
.nt-requete .wp-block-post-featured-image { margin-bottom: 14px; }
.nt-requete .nt-meta-ligne { gap: 6px 16px; margin: 0; }
.nt-requete .wp-block-post-template.nt-grille-articles { gap: 48px 32px; }

/* Accueil : un article à la une, deux en liste */
.nt-requete--une .wp-block-post-template {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 28px clamp(28px, 4vw, 56px);
  list-style: none;
  padding: 0;
  margin: 0;
}
.nt-requete--une .wp-block-post-template > li:first-child { grid-row: span 2; }
.nt-requete--une .wp-block-post-template > li:first-child .wp-block-post-title { font-size: var(--nt-t-xl); }
.nt-requete--une .wp-block-post-template > li:not(:first-child) {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  column-gap: 20px;
  align-content: start;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--nt-ligne);
}
.nt-requete--une .wp-block-post-template > li:not(:first-child) > .wp-block-post-featured-image { grid-row: 1 / span 3; margin: 0; }
.nt-requete--une .wp-block-post-template > li:not(:first-child) > * { grid-column: 2; margin-block: 0; }
.nt-requete--une .wp-block-post-template > li:not(:first-child) > .wp-block-post-featured-image { grid-column: 1; }
.nt-requete--une .wp-block-post-template > li:not(:first-child) .wp-block-post-excerpt { display: none; }
@media (max-width: 960px) {
  .nt-requete--une .wp-block-post-template { grid-template-columns: minmax(0, 1fr); }
  .nt-requete--une .wp-block-post-template > li:first-child { grid-row: auto; }
}
@media (max-width: 640px) {
  .nt-requete--une .wp-block-post-template > li:not(:first-child) { grid-template-columns: 96px minmax(0, 1fr); column-gap: 14px; }
}

/* Pagination */
.nt-pagination { gap: 8px; margin-top: 56px; font-family: var(--nt-titre); }
.nt-pagination .page-numbers,
.nt-pagination .wp-block-query-pagination-previous,
.nt-pagination .wp-block-query-pagination-next {
  display: inline-grid;
  place-items: center;
  min-width: 46px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--nt-ligne);
  border-radius: var(--nt-rayon);
  color: var(--nt-foret);
  text-decoration: none;
  font-weight: 600;
}
.nt-pagination .page-numbers.current { background: var(--nt-foret); color: var(--nt-creme); border-color: var(--nt-foret); }

/* ---------- Article ---------- */
.nt-titre-article { font-size: var(--nt-t-2xl); }
.nt-prose > * { max-width: 66ch; }
.nt-retour-blog { margin-bottom: var(--nt-section); }

/* ---------- Recherche ---------- */
.nt-recherche .wp-block-search__input {
  min-height: 50px;
  padding: 12px 14px;
  font-family: var(--nt-texte);
  background: var(--nt-papier);
  border: 1.5px solid var(--nt-ligne);
  border-radius: var(--nt-rayon);
}
.nt-recherche .wp-block-search__button { margin-left: 8px; }

/* ---------- Pied de page ---------- */
.nt-pied-part { margin-top: 0; }
.nt-pied .wp-block-site-logo {
  display: inline-block;
  background: var(--nt-creme);
  padding: 12px 16px;
  border-radius: var(--nt-rayon);
  margin-bottom: 20px;
  line-height: 0;
}
.nt-pied .wp-block-list { padding-left: 0; list-style: none; }
.nt-pied__bas p { margin: 0; }

/* ---------- Formulaires (WPForms, Contact Form 7) ---------- */
.wpforms-form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
.wpforms-form select, .wpforms-form textarea,
.wpcf7-form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
.wpcf7-form select, .wpcf7-form textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  font-family: var(--nt-texte);
  font-size: 1rem;
  color: var(--nt-encre);
  background: var(--nt-papier);
  border: 1.5px solid var(--nt-ligne);
  border-radius: var(--nt-rayon);
}
.wpforms-form label, .wpcf7-form label {
  font-family: var(--nt-titre);
  font-weight: 600;
  font-size: var(--nt-t-s);
  color: var(--nt-foret);
}
.wpforms-form button[type="submit"], .wpcf7-form input[type="submit"] {
  min-height: 50px;
  padding: 13px 24px;
  font-family: var(--nt-titre);
  font-weight: 700;
  color: #fff;
  background: var(--nt-terre);
  border: 0;
  border-radius: var(--nt-rayon);
  cursor: pointer;
}
.wpforms-form button[type="submit"]:hover, .wpcf7-form input[type="submit"]:hover { background: var(--nt-terre-2); }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .nt-pied__grille { grid-template-columns: minmax(0, 1fr); }
}
