/* ============================================================
   ARTAWEB -- Base Styles
   Reset, Custom Properties, Typography, @font-face
   ============================================================ */

/* ----------------------------------------------------------
   Fonts
   Toutes les polices du site sont servies par Google Fonts, via la balise
   <link> générée par renderGoogleFontsLink() (includes/functions.php) d'après
   la Charte graphique. Pas de @font-face ici : les anciennes déclarations
   pointaient vers /fonts/*.woff2, un dossier qui n'a jamais existé (404).
   ---------------------------------------------------------- */

/* ----------------------------------------------------------
   Custom Properties (Light Theme)
   ---------------------------------------------------------- */
:root {
    /* Colors */
    --color-bg:        #FAF7F2;
    --color-text:      #1A1A1A;
    --color-accent:    #8B6914;
    --color-secondary: #2C4A6E;
    --color-surface:   #F0EBE0;
    --color-border:    #D4C9B8;
    --color-muted:     #6B6358;

    /* Typography */
    --font-heading: 'Jost', 'Futura', 'Trebuchet MS', sans-serif;
    --font-body:    'Source Serif 4', 'Georgia', 'Times New Roman', serif;

    /* Font sizes (fluid) */
    --text-xs:   clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-sm:   clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
    --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
    --text-lg:   clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
    --text-xl:   clamp(1.375rem, 1.1rem + 1.2vw, 2rem);
    --text-2xl:  clamp(1.75rem, 1.3rem + 2vw, 3rem);
    --text-3xl:  clamp(2.25rem, 1.5rem + 3.5vw, 4.5rem);

    /* Spacing */
    --space-xs:  0.25rem;
    --space-sm:  0.5rem;
    --space-md:  1rem;
    --space-lg:  2rem;
    --space-xl:  4rem;
    --space-2xl: 8rem;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;

    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(26, 26, 26, 0.08);
    --shadow-md: 0 4px 12px rgba(26, 26, 26, 0.1);
    --shadow-lg: 0 8px 32px rgba(26, 26, 26, 0.12);
}

/* ----------------------------------------------------------
   Dark Theme
   ---------------------------------------------------------- */
[data-theme="dark"] {
    --color-bg:        #1A1710;
    --color-text:      #F0EBE0;
    --color-accent:    #C9A84C;
    --color-secondary: #5B8CC2;
    --color-surface:   #2A2520;
    --color-border:    #3D352A;
    --color-muted:     #9B9184;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ----------------------------------------------------------
   Reset
   ---------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-base), color var(--transition-base);
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--color-link, var(--color-accent));
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

a:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

ul,
ol {
    list-style: none;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: none;
}

/* ----------------------------------------------------------
   Typography
   ---------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--color-heading, var(--color-text));
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-base); font-weight: 600; }
h6 { font-size: var(--text-sm); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }

p {
    margin-bottom: var(--space-md);
}

p:last-child {
    margin-bottom: 0;
}

strong {
    font-weight: 700;
}

em {
    font-style: italic;
}

/* <small> — la « petite mention » : conditions, précisions, notes de bas de
   bloc. Elle était réglée sur --text-sm, dont le clamp PLAFONNE à 1rem : sur
   grand écran elle rendait donc exactement à la taille du texte courant, ce qui
   vide la balise de son sens. Une taille RELATIVE (em) reste proportionnelle au
   contexte — dans un paragraphe comme dans un titre — et la couleur atténuée
   dit à l'œil que c'est une mention, pas le propos. */
small {
    font-size: 0.85em;
    color: var(--color-muted);
}

/* ----------------------------------------------------------
   Selection
   ---------------------------------------------------------- */
::selection {
    background-color: var(--color-accent);
    color: var(--color-bg);
}

/* ----------------------------------------------------------
   Reduced Motion
   ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ----------------------------------------------------------
   Screen Reader Only
   ---------------------------------------------------------- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Lien d'évitement : caché mais RÉVÉLÉ au focus clavier (accessibilité). */
.sr-only.skip-link:focus,
.skip-link:focus-visible {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1000;
    width: auto;
    height: auto;
    margin: 0;
    padding: 10px 16px;
    clip: auto;
    overflow: visible;
    background: var(--color-accent); /* toujours émis par la Charte (renderDesignCss) */
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
}

/* ============================================================
   Visibilité responsive des contenus (#4)
   Classes posées par l'admin (œil) sur sections / lignes / blocs.
   Téléphone ≤ 767px · Tablette 768–1023px · Ordinateur ≥ 1024px.
   ============================================================ */
.mp-hide-all { display: none !important; }
@media (max-width: 767px) {
    .mp-hide-phone,
    .mp-hide-phone-tablet { display: none !important; }
}
@media (min-width: 768px) and (max-width: 1023px) {
    .mp-hide-phone-tablet { display: none !important; }
}
