/*
Theme Name: FeSpoRt
Theme URI: https://www.fesport.ma
Author: Dotma
Author URI: https://dotma.ma
Description: Thème autonome du site FeSpoRt.
Version: 1.0
Requires PHP: 8.0
Text Domain: fesport
*/

/* --- Base --- */
html { scroll-behavior: smooth; }
body { font-family: 'Montserrat', ui-sans-serif, system-ui, sans-serif; color: #080808; }
strong, b { font-weight: 600; }

/* --- Texte justifié --- */
.text-justified { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.text-justified a { text-decoration: underline; text-underline-offset: 3px; }
.text-justified a:hover { color: #0A5C2B; }

/* --- Arabe --- */
html[dir="rtl"] body { font-family: 'Cairo', ui-sans-serif, system-ui, sans-serif; }
html[dir="rtl"] .text-justified { hyphens: none; -webkit-hyphens: none; }

/* --- Écran de chargement --- */
.loader { transition: opacity .5s ease, visibility .5s ease; }
.loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

/* --- FAQ --- */
details.faq > summary { list-style: none; cursor: pointer; }
details.faq > summary::-webkit-details-marker { display: none; }
details.faq[open] .faq-chevron { transform: rotate(180deg); }

/* --- Diaporama du hero --- */
.hero-slide { opacity: 0; transition: opacity .9s ease; }
.hero-slide.is-active { opacity: 1; }
.hero-slide.is-active img { animation: hero-zoom 6s linear forwards; }
@keyframes hero-zoom { from { transform: scale(1); } to { transform: scale(1.06); } }

/* --- Barre rouge sous les H2 --- */
.h2-bar::after { content: ''; display: block; width: 40px; height: 4px; margin-top: 12px; border-radius: 2px; background: #C20711; }
.text-center .h2-bar::after { margin-inline: auto; }

/* --- Survol des blocs d'information --- */
.hover-card { transition: transform .2s ease-out, box-shadow .2s ease-out, border-color .2s ease-out; }
.hover-card:hover, .hover-card:focus-within { transform: translateY(-4px); border-color: #C20711; box-shadow: 0 12px 24px rgba(8,74,34,.12); }
.hover-card .icon-pill { transition: background-color .2s ease-out, color .2s ease-out; }
.hover-card:hover .icon-pill, .hover-card:focus-within .icon-pill { background-color: #C20711; color: #fff; }
.hover-tile { transition: box-shadow .2s ease-out; }
.hover-tile:hover, .hover-tile:focus-within { box-shadow: inset 0 0 0 2px #C20711; }
.hover-tile .tile-bar { transition: width .2s ease-out; }
.hover-tile:hover .tile-bar { width: 64px; }
.hover-zoom img { transition: transform .3s ease-out; }
.hover-card:hover .hover-zoom img { transform: scale(1.04); }

/* --- Logos des institutions --- */
.logo-tile img { filter: grayscale(1); opacity: .85; transition: filter .2s ease-out, opacity .2s ease-out; }
.logo-tile:hover img, .logo-tile:focus-within img { filter: grayscale(0); opacity: 1; }

/* --- Carrousel --- */
.carousel-track { scroll-snap-type: x mandatory; scrollbar-width: none; -ms-overflow-style: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track > * { scroll-snap-align: start; }
.carousel-progress { transition: width .25s ease-out; }
.carousel-btn:disabled { opacity: .4; cursor: default; }

/* --- Formulaires Contact Form 7 --- */
.wpcf7 form .wpcf7-form-control-wrap { display: block; }
.wpcf7 form p { margin: 0; }
.wpcf7-not-valid-tip { margin-top: 6px; font-size: 13px; color: #C20711; }
.wpcf7 form .wpcf7-response-output { margin: 0; border-radius: 8px; padding: 12px 16px; font-size: 14px; }
.wpcf7 form.sent .wpcf7-response-output { border-color: #084A22; background: rgba(8,74,34,.1); color: #084A22; }
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output { border-color: #C20711; color: #C20711; }
.wpcf7-spinner { display: none; }

/* --- Texte juridique --- */
.legal-content h2 { margin-top: 24px; font-size: 22px; line-height: 28px; font-weight: 800; color: #084A22; }
.legal-content p, .legal-content li { font-size: 16px; line-height: 26px; color: #080808; text-align: justify; hyphens: auto; }
.legal-content ul { list-style: disc; padding-left: 24px; display: flex; flex-direction: column; gap: 8px; }
.legal-content ol { list-style: decimal; padding-left: 24px; display: flex; flex-direction: column; gap: 8px; }
.legal-content a { color: #084A22; text-decoration: underline; text-underline-offset: 3px; }

/* --- Champs de formulaire --- */
.cf-field { width: 100%; height: 48px; border: 1px solid #E2E8E4; border-radius: 8px; background: #fff; padding: 0 16px; font-size: 14px; line-height: 22px; color: #080808; }
.cf-field:focus { border-color: #084A22; outline: 2px solid rgba(8,74,34,.3); outline-offset: 0; }
textarea.cf-field { height: 140px; padding: 14px 16px; resize: vertical; }
select.cf-field { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23084A22' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 44px; }
.cf-field.wpcf7-not-valid { border-color: #C20711; }
.cf-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; line-height: 20px; color: #080808; }
.cf-consent { font-size: 14px; line-height: 22px; color: #475569; }
.cf-consent a { color: #084A22; text-decoration: underline; text-underline-offset: 3px; }
.cf-consent .wpcf7-list-item { margin: 0; }
.cf-consent label { display: flex; align-items: flex-start; gap: 10px; }
.cf-consent input[type="checkbox"] { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; accent-color: #084A22; }
.cf-submit { display: inline-flex; height: 44px; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: #084A22; padding: 0 24px; font-size: 14px; font-weight: 600; color: #fff; cursor: pointer; transition: background .2s; }
.cf-submit:hover { background: #0A5C2B; }
.footer-newsletter .cf-consent { font-size: 13px; line-height: 20px; }
.cf-submit:focus-visible { outline: 2px solid #C20711; outline-offset: 2px; }

/* --- Accessibilité --- */
.skip-link { position: absolute; inset-inline-start: 8px; top: 8px; z-index: 100; transform: translateY(-300%); }
.skip-link:focus { transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-slide, .loader { transition: none; }
  .hero-slide.is-active img { animation: none; }
  .hover-card:hover, .hover-card:focus-within { transform: none; }
  .hover-zoom img, .hover-card:hover .hover-zoom img { transform: none; transition: none; }
  .hover-tile .tile-bar, .hover-tile:hover .tile-bar { width: 40px; transition: none; }
  .carousel-progress { transition: none; }
}

/* Barre rouge des titres : tracé à l'apparition (actif seulement si le JS d'animation tourne) */
.js-anim .h2-bar::after{transform:scaleX(0);transform-origin:left center;transition:transform .7s cubic-bezier(.22,1,.36,1) .25s}
.js-anim .text-center.h2-bar::after,.js-anim .text-center .h2-bar::after{transform-origin:center}
[dir="rtl"].js-anim .h2-bar::after,.js-anim [dir="rtl"] .h2-bar::after{transform-origin:right center}
.js-anim .h2-bar.is-drawn::after{transform:scaleX(1)}
body{overflow-x:clip}
