/* ============================================================
   SPLDT Theme – Custom CSS
   Design system: Precision Pulse

   Charge APRES assets/css/tailwind.css (voir spldt_enqueue_assets).
   ============================================================ */

/* ── Material Symbols baseline ───────────────────────────── */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
    line-height: 1;
    display: inline-block;
}

/* ── Menus deroulants ─────────────────────────────────────
   Le walker emet desormais un <ul class="spldt-submenu"> correctement
   imbrique. Sans ces regles il resterait affiche en permanence.        */
.spldt-submenu--desktop {
    visibility: hidden;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
.spldt-has-children:hover > .spldt-submenu--desktop,
.spldt-has-children:focus-within > .spldt-submenu--desktop {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}
.spldt-has-children:hover > a > .spldt-caret,
.spldt-has-children:focus-within > a > .spldt-caret {
    transform: rotate(180deg);
}
.spldt-caret {
    transition: transform 0.15s ease;
}

@media (prefers-reduced-motion: reduce) {
    .spldt-submenu--desktop,
    .spldt-caret {
        transition: none;
    }
}

/* Le sous-menu mobile reste toujours deplie (pas de survol au doigt). */
.spldt-submenu--mobile {
    display: block;
}

/* ── Menu de pied de page (walker par defaut) ────────────── */
.spldt-footer-menu a {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #dbeafe; /* blue-100 : 5.90:1 sur #0033ff */
    transition: color 0.2s;
}
.spldt-footer-menu a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* ── Prose overrides (the_content) ───────────────────────── */
.prose h2, .prose h3, .prose h4 {
    font-family: 'Lexend', ui-sans-serif, system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #1f2937;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.25rem; }
.prose p  { margin-bottom: 1.25rem; }
.prose ul, .prose ol { margin: 0 0 1.25rem 1.5rem; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 0.375rem; }
.prose a {
    color: #0033ff;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.prose a:hover {
    color: #c41f5c; /* 5.43:1 sur fond clair */
}
.prose img {
    border-radius: 0.5rem;
    height: auto;
}
.prose blockquote {
    border-left: 4px solid #0033ff;
    padding-left: 1rem;
    font-style: italic;
    margin: 1.5rem 0;
}
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.25rem;
}
.prose th, .prose td {
    padding: 0.5rem 0.75rem;
    text-align: left;
}
.prose thead th { background: #f3f4f6; }
/* No-Line rule: pas de trait de section dans le contenu. */
.prose hr {
    border: none;
    margin: 2.5rem 0;
}

/* Les extraits passent par the_excerpt(), qui les enveloppe dans un <p>. */
.spldt-excerpt p {
    margin: 0;
}

/* ── Debordement horizontal ──────────────────────────────── */
.prose pre,
.prose table {
    overflow-x: auto;
    display: block;
    max-width: 100%;
}

/* ── Pagination ───────────────────────────────────────────── */
.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    height: 2.75rem;
    padding: 0 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #4b5563;
    transition: background-color 0.2s, color 0.2s;
    text-decoration: none;
}
.page-numbers:hover,
.page-numbers.current {
    background-color: #0033ff;
    color: #ffffff;
}
.page-numbers.dots {
    background: none;
    color: #6b7280;
    cursor: default;
    min-width: auto;
}

/* ── Commentaires ─────────────────────────────────────────── */
.comment-list .children {
    list-style: none;
    margin: 1.5rem 0 0 1.5rem;
    padding-left: 1rem;
    border-left: 2px solid #e5e7eb;
}
.comment-list .comment-body {
    padding-bottom: 1.5rem;
}
.comment-list .comment-author img {
    border-radius: 9999px;
    vertical-align: middle;
    margin-right: 0.5rem;
}
.comment-list .comment-author .fn {
    font-weight: 700;
    font-style: normal;
    color: #1f2937;
}
.comment-list .comment-meta {
    font-size: 0.75rem;
    color: #4b5563;
    margin-bottom: 0.5rem;
}
.comment-list .comment-meta a { color: #4b5563; }
.comment-list .bypostauthor > .comment-body .fn::after {
    content: '★';
    color: #c41f5c;
    margin-left: 0.25rem;
}

.comment-form label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #4b5563;
    margin-bottom: 0.25rem;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-bottom: 2px solid #d1d5db;
    border-radius: 0.25rem;
    padding: 0.75rem 1rem;
    width: 100%;
    font-family: 'Lexend', ui-sans-serif, system-ui, sans-serif;
    font-size: 0.9rem;
    color: #1f2937;
    transition: border-color 0.2s;
}
.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-bottom-color: #c41f5c; /* Pulse Input rule */
}
.comment-form .submit {
    background-color: #0033ff;
    color: #ffffff;
    font-family: 'Lexend', ui-sans-serif, system-ui, sans-serif;
    font-weight: 700;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s;
}
.comment-form .submit:hover {
    background-color: #4b63ff;
}

/* ── Barre d'administration WordPress ─────────────────────
   Le core decale <html> de 32px (46px sous 782px) via
   wp_enqueue_admin_bar_bump_styles(), mais un element position:fixed se
   positionne par rapport au viewport et ignore cette marge : l'en-tete
   passait donc SOUS la barre d'admin, et la marge de <html> creait en plus
   une bande blanche de 32px entre l'en-tete et le contenu.

   --wp-admin--admin-bar--height est definie par le core sur <html> et suit
   deja le point de rupture 782px. Le repli 0px couvre les visiteurs
   deconnectes, pour qui la variable n'existe pas.                        */
.admin-bar #site-header {
    top: var(--wp-admin--admin-bar--height, 0px);
}

.admin-bar #mobile-menu,
.admin-bar #header-search {
    top: calc(5rem + var(--wp-admin--admin-bar--height, 0px));
}

.admin-bar #main {
    scroll-margin-top: calc(6rem + var(--wp-admin--admin-bar--height, 0px));
}

/* #wpadminbar monte a z-index 99999 : le lien d'evitement doit passer
   dessous, pas derriere. */
.admin-bar .skip-link:focus {
    top: var(--wp-admin--admin-bar--height, 0px);
}

/* Sous 600px la barre d'admin repasse en position:absolute et defile avec la
   page. Le decalage statique laisserait alors un vide en haut du viewport :
   main.js recalcule `top` au defilement dans ce cas precis. */

/* ── Panneaux deroulants de l'en-tete ────────────────────── */
#mobile-menu,
#header-search {
    transition: opacity 0.2s ease;
}
#mobile-menu.is-open,
#header-search.is-open {
    display: block;
}

@media (prefers-reduced-motion: reduce) {
    #mobile-menu,
    #header-search {
        transition: none;
    }
}

/* ── Hero "Kinetic Shift" ────────────────────────────────── */
.hero-title-kinetic {
    text-shadow: 0 2px 40px rgba(0, 0, 40, 0.45);
}

/* ── Logo ─────────────────────────────────────────────────── */
.custom-logo-link img {
    height: 3rem;
    width: auto;
    object-fit: contain;
}

/* ── Formulaire de recherche ─────────────────────────────── */
.search-form {
    display: flex;
    gap: 0.5rem;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 0.625rem 1rem;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    font-family: 'Lexend', ui-sans-serif, system-ui, sans-serif;
    font-size: 0.875rem;
    color: #1f2937;
}
.search-form .search-submit {
    background: #ffffff;
    color: #0033ff;
    border: none;
    padding: 0.625rem 1.5rem;
    border-radius: 0.75rem;
    font-family: 'Lexend', ui-sans-serif, system-ui, sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}
.search-form .search-submit:hover {
    background: #dbeafe;
}

/* ── Accessibilite ───────────────────────────────────────── */

/* Visible uniquement par les lecteurs d'ecran. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
    box-shadow: 0 0 0 6px #0033ff;
    border-radius: 2px;
}
/* Sur fond clair, l'anneau s'inverse pour rester visible. */
main :focus-visible,
.bg-surface-container :focus-visible,
footer .widget :focus-visible {
    outline: 3px solid #0033ff;
    box-shadow: 0 0 0 6px #ffffff;
}

/* ── Lien d'evitement ────────────────────────────────────── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: #0033ff;
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 0 0 0.5rem 0.5rem;
    font-weight: 700;
    z-index: 9999;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 0;
}

/* La cible du lien d'evitement ne doit pas passer sous l'en-tete fixe. */
#main {
    scroll-margin-top: 6rem;
}
#main:focus {
    outline: none;
}
