/* =========================================================================
   Base / reset léger + primitives partagées
   ========================================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* L'attribut HTML `hidden` doit TOUJOURS l'emporter sur un `display` d'auteur
   (pattern Normalize.css). Sinon toute règle déclarant `display` sur un élément
   ré-affiche un élément marqué `hidden` par JS (Stimulus). Correction transverse :
   fiabilise `hidden` partout (liste SSR du quiz, .quizp__game, .quizp__result, etc.). */
[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: var(--brass);
    text-decoration: none;
    transition: color .15s ease;
}

a:hover {
    color: var(--gold);
}

/* Lien d'évitement clavier (WCAG 2.4.1) : hors écran par défaut, ramené en haut
   à gauche (à droite en RTL) dès qu'il reçoit le focus au clavier. */
.skip-link {
    position: absolute;
    inset-block-start: 8px;
    inset-inline-start: 8px;
    z-index: 100;
    padding: 10px 16px;
    border-radius: var(--r-md, 8px);
    background: var(--gold);
    color: var(--surface-dark);
    font-weight: 600;
    transform: translateY(-150%);
    opacity: 0;
    pointer-events: none;
}
.skip-link:focus {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    outline: 2px solid var(--surface-dark);
    outline-offset: 2px;
    color: var(--surface-dark);
}

h1, h2, h3, h4 {
    margin: 0;
}

/* Titres arabes : bascule sur Aref Ruqaa (les titres contiennent du texte arabe). */
[dir="rtl"] .section-title,
[dir="rtl"] .final__title,
[dir="rtl"] .browse__title,
[dir="rtl"] .hero__eyebrow {
    font-family: var(--font-title-ar);
}

/* --- Conteneur --- */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

/* --- Sections --- */
.section {
    padding-block: 56px;
}

.section--surface-1 { background: var(--surface-1); }
.section--surface-2 { background: var(--surface-2); }

/* --- Eyebrow + titres de section --- */
.eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .26em;
    text-transform: uppercase;
    color: var(--brass);
    margin-bottom: 8px;
}

.section-title {
    font-family: var(--font-title);
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--ink);
    font-size: clamp(22px, 4vw, 38px);
}

/* --- Badges stores (.btn-store) --- */
.store-badges {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 300px;
}

.btn-store {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 56px;
    padding-inline: 22px;
    background: #000;
    border: 1px solid var(--brass);
    border-radius: var(--r-md);
}

.btn-store:hover {
    border-color: var(--gold);
}

.btn-store__icon {
    flex: 0 0 auto;
}

.btn-store__label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
}

.btn-store__pre {
    font-size: 10px;
    color: var(--brass);
    letter-spacing: .04em;
}

.btn-store__name {
    font-size: 18px;
    font-weight: 600;
    color: var(--ink);
}

/* RTL : le texte des badges s'aligne à droite */
[dir="rtl"] .btn-store__label {
    align-items: flex-end;
}

/* --- Sélecteur de langue (.chip-lang) --- */
.chip-lang {
    display: inline-flex;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-pill);
    overflow: hidden;
}

.chip-lang__item {
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--brass);
}

.chip-lang__item:hover {
    color: var(--gold);
}

.chip-lang__item.is-active {
    background: var(--gold);
    color: var(--surface-dark);
    font-weight: 600;
}

.chip-lang__item.is-active:hover {
    color: var(--surface-dark);
}

/* --- Preuve sociale --- */
.social-proof {
    display: flex;
    align-items: center;
    gap: 8px;
}

.social-proof__stars {
    font-size: 14px;
    letter-spacing: 2px;
    color: var(--gold);
}

.social-proof__text {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-70);
}

/* Accessibilité : respecte les préférences de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}
