/*
Theme Name:  L'Asie en 1000 mots
Theme URI:   https://asie1000mots-cetase.org
Description: Thème de blocs enfant de Twenty Twenty-Five pour le bulletin L'Asie en 1000 mots (CÉTASE, Université de Montréal). Unilingue français. Articles, chercheurs (auteurs), taxonomies Pays et Thèmes.
Author:      ZAA
Author URI:  https://zaa.cc
Template:    twentytwentyfive
Version:     1.0.0
Requires at least: 6.7
Requires PHP: 7.4
License:     GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: asie1000mots
*/

/* ============================================================
   Alias vers les presets du theme.json (une seule source).
   ============================================================ */
:root {
  --blanc:      var(--wp--preset--color--base);
  --encre:      var(--wp--preset--color--contrast);
  --vert:       var(--wp--preset--color--vert);
  --vert-fonce: var(--wp--preset--color--vert-fonce);
  --vert-pale:  var(--wp--preset--color--vert-pale);
  --terre:      var(--wp--preset--color--terre);
  --gris:       var(--wp--preset--color--gris);
  --filet:      var(--wp--preset--color--filet);
}

/* Taille de base en %, jamais en px (PLAYBOOK §12u). */
html { font-size: 100%; }


/*  pagination */

.wp-block-query-pagination .page-numbers,
.wp-block-query-pagination .wp-block-query-pagination-next,
.wp-block-query-pagination .wp-block-query-pagination-previous {
    text-align: center;
    display: inline-block;
    border: 1px solid var(--wp--preset--color--primary);
    padding: 6px 18px !important;
    transition: background-color 250ms;
    background: #ffffff;
    border-radius: 15px !important;
    font-size: 0.96rem;
    font-weight: 700;
    line-height: 1em;
    margin: 0.3em;
    text-decoration: none;
}

.wp-block-query-pagination .page-numbers.dots {
    background: none;
}

.wp-block-query-pagination .page-numbers:hover,
.wp-block-query-pagination .wp-block-query-pagination-next:hover,
.wp-block-query-pagination .wp-block-query-pagination-previous:hover,
.wp-block-query-pagination .page-numbers.current {
    background-color: #111;
    border-color: #111;
    color: #fff;
    text-decoration: none !important;
}

.wp-block-query-pagination .page-numbers.dots:hover {
    background: #fff;
    color: #111;
    border-color: var(--wp--preset--color--primary);
}

.wp-block-query-pagination .is-arrow-arrow {
    margin: 0;
}

.wp-block-query-pagination.sombre .page-numbers,
.wp-block-query-pagination.sombre .wp-block-query-pagination-next,
.wp-block-query-pagination.sombre .wp-block-query-pagination-previous {
    background: #111;
    color: #bbb;
}
.wp-block-query-pagination.sombre .page-numbers:hover,
.wp-block-query-pagination.sombre .wp-block-query-pagination-next:hover,
.wp-block-query-pagination.sombre .wp-block-query-pagination-previous:hover,
.wp-block-query-pagination.sombre .page-numbers.current {
    background-color: #aaa;
    border-color: #111;
    color: #111;
}
.wp-block-query-pagination.sombre .page-numbers.dots:hover {
    background: #111;
    color: #bbb;
}


/* ---- Accessibilité ---------------------------------------- */
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
summary:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--terre);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Liens de contenu soulignés (WCAG 1.4.1) ; les navigations, titres de
   cartes, pagination et boutons sont exclus. */
.entry-content a:not(.wp-element-button),
.a1m-card__body .wp-block-post-excerpt a,
.a1m-site-lien a,
.a1m-auteur__nom a,
.wp-block-footnotes a,
.a1m-footer a,
.a1m-auteurs a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
a:hover, a:focus-visible { color: var(--terre); }

/* Paragraphes liés vides (liaison sans valeur) : ne rien afficher. */
p:empty { display: none; }

/* ---- En-tête ----------------------------------------------- */
.a1m-topbar {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--filet);
  gap: 1rem 1.5rem;
}
.a1m-topbar .wp-block-site-title {
  font-weight: 800;
  font-size: var(--wp--preset--font-size--large);
  margin: 0;
}
.a1m-topbar .wp-block-site-title a { text-decoration: none; }
.a1m-nav { flex: 1 1 auto; }
.a1m-nav .wp-block-navigation-item__content {
  padding: 0.25rem 0.1rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.a1m-nav .current-menu-item > .wp-block-navigation-item__content,
.a1m-nav .wp-block-navigation-item__content:hover {
  border-bottom-color: var(--terre);
  color: var(--terre);
}
.a1m-search { max-width: 16rem; margin: 0; }
.a1m-search .wp-block-search__input {
  border: 1px solid var(--gris);
  border-radius: 4px 0 0 4px;
  padding: 0.35rem 0.6rem;
  background: var(--blanc);
  color: var(--encre);
}
.a1m-search .wp-block-search__button {
  background: var(--vert);
  color: var(--blanc);
  border: 1px solid var(--vert);
  border-radius: 0 4px 4px 0;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}
.a1m-search .wp-block-search__button:hover,
.a1m-search .wp-block-search__button:focus-visible {
  background: var(--vert-fonce);
  border-color: var(--vert-fonce);
  color: var(--blanc);
}
.a1m-banner { margin: 1rem 0 0; }
.a1m-banner img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
}

@media (max-width: 781px) {
  .a1m-topbar { flex-direction: column; align-items: stretch; }
  .a1m-topbar .wp-block-site-title { order: 1; }
  .a1m-search { order: 2; max-width: none; }
  .a1m-nav { order: 3; }
}

/* ---- Mise en page : contenu + colonne droite ---------------- */
.a1m-main { padding-top: 2rem; padding-bottom: 3rem; }
.a1m-sidebar {
  background: var(--vert-pale);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  font-size: var(--wp--preset--font-size--small);
}
.a1m-sidebar h2 {
  font-size: var(--wp--preset--font-size--medium);
  font-weight: 800;
  margin: 0 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--filet);
}
.a1m-sidebar h2 + * { margin-block-start: 0; }
.a1m-sidebar .wp-block-categories-list,
.a1m-sidebar .wp-block-categories-list .children,
.a1m-titres .wp-block-post-template,
.a1m-titres { list-style: none; padding-left: 0; margin-left: 0; }
.a1m-sidebar .wp-block-categories-list li,
.a1m-titres .wp-block-post-template > li { padding: 0.3rem 0; border-bottom: 1px dotted var(--filet); }
.a1m-sidebar .wp-block-categories-list li:last-child,
.a1m-titres .wp-block-post-template > li:last-child { border-bottom: 0; }
.a1m-sidebar .wp-block-categories-list a { text-decoration: none; }
.a1m-sidebar .wp-block-categories-list a:hover { text-decoration: underline; }
.a1m-titres .wp-block-post-title {
  font-size: var(--wp--preset--font-size--small);
  font-weight: 600;
  margin: 0;
}
.a1m-titres .wp-block-post-title a { text-decoration: none; }
.a1m-titres .wp-block-post-title a:hover { text-decoration: underline; }
.a1m-sidebar + .a1m-sidebar { margin-top: 1.5rem; }

/* ---- Cartes d'articles ------------------------------------- */
.a1m-cards > li { list-style: none; }
.a1m-card {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--filet);
  gap: 1.25rem;
  align-items: flex-start;
}
.a1m-cards > li:last-child .a1m-card { border-bottom: 0; }
.a1m-card__logo { flex: 0 0 180px; margin: 0; }
.a1m-card__logo img { width: 180px; height: auto; border-radius: 4px; display: block; }
.a1m-card__body { flex: 1 1 0; min-width: 0; }
.a1m-card__body > * { margin-block-start: 0; }
.a1m-card__body .wp-block-post-title {
  font-size: var(--wp--preset--font-size--x-large);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 0.25rem;
}
.a1m-card__body .wp-block-post-title a { text-decoration: none; }
.a1m-card__body .wp-block-post-title a:hover { text-decoration: underline; }
.a1m-card__body .wp-block-post-excerpt { margin-top: 0.5rem; }
.a1m-card__body .wp-block-post-excerpt p { margin: 0; }
.a1m-meta {
  color: var(--gris);
  font-size: var(--wp--preset--font-size--small);
  gap: 0.3em;
  margin-bottom: 0.25rem;
}
.a1m-meta:has(.a1m-auteurs:not(:empty)) .wp-block-post-date::after { content: ","; }
@media (max-width: 600px) {
  .a1m-card { flex-wrap: wrap; }
  .a1m-card__logo { flex-basis: 100%; }
}

/* ---- Article ---------------------------------------------- */
.a1m-surtitre {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: var(--wp--preset--font-size--small);
  color: var(--gris);
  margin-bottom: 0.25rem;
}
.a1m-article-titre { margin-bottom: 0.25rem; }
.a1m-soustitre {
  font-size: var(--wp--preset--font-size--x-large);
  color: var(--gris);
  margin-top: 0;
}
.a1m-article .a1m-meta { margin: 0.5rem 0 1.5rem; font-size: var(--wp--preset--font-size--medium); }
.a1m-logo { margin: 0 0 1.5rem; }
.a1m-logo img { max-width: 100%; height: auto; border-radius: 4px; }
.a1m-chapo { font-weight: 600; font-size: 1.05em; }
.a1m-site-lien {
  margin-top: 2rem;
  padding: 0.75rem 1rem;
  background: var(--vert-pale);
  border-left: 4px solid var(--vert);
}
.wp-block-footnotes {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--filet);
  font-size: var(--wp--preset--font-size--small);
  color: var(--gris);
}
.a1m-auteurs-detail { margin-top: 2.5rem; border-top: 1px solid var(--filet); padding-top: 1.5rem; }
.a1m-auteur {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}
.a1m-auteur__photo { flex: 0 0 90px; }
.a1m-auteur__photo img { width: 90px; height: 90px; object-fit: cover; border-radius: 50%; display: block; }
.a1m-auteur__nom { font-weight: 700; margin: 0 0 0.25rem; }
.a1m-auteur__bio { margin: 0; color: var(--gris); font-style: italic; }

/* ---- Chercheurs ------------------------------------------- */
.a1m-chercheurs > li { list-style: none; }
.a1m-chercheur {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 1px solid var(--filet);
}
.a1m-chercheur__photo { flex: 0 0 90px; margin: 0; }
.a1m-chercheur__photo img { width: 90px; height: 90px; object-fit: cover; border-radius: 50%; display: block; }
.a1m-chercheur__body { flex: 1 1 0; min-width: 0; }
.a1m-chercheur__body > * { margin-block-start: 0; }
.a1m-chercheur__body .wp-block-post-title { font-size: var(--wp--preset--font-size--large); font-weight: 800; margin-bottom: 0.25rem; }
.a1m-chercheur__body .wp-block-post-title a { text-decoration: none; }
.a1m-chercheur__body .wp-block-post-title a:hover { text-decoration: underline; }
.a1m-chercheur__bio { color: var(--gris); font-style: italic; margin: 0; }
.a1m-fiche-photo { margin: 0 0 1rem; }
.a1m-fiche-photo img { width: 150px; height: 150px; object-fit: cover; border-radius: 50%; }

/* ---- Pagination ------------------------------------------- */
.wp-block-query-pagination { margin-top: 2rem; font-weight: 600; }
.wp-block-query-pagination a { text-decoration: none; }
.wp-block-query-pagination a:hover { text-decoration: underline; }
.wp-block-query-pagination-numbers .current {
  background: var(--vert);
  color: var(--blanc);
  padding: 0.1em 0.5em;
  border-radius: 4px;
}

/* ---- Pied de page ----------------------------------------- */
.a1m-footer {
  margin-top: 3rem;
  padding: 2rem 0;
  border-top: 3px solid var(--vert);
  font-size: var(--wp--preset--font-size--small);
  color: var(--gris);
}
.a1m-footer address { font-style: normal; line-height: 1.6; }
.a1m-footer p { margin: 0; }
