/**
 * BienHabillé - CSS Reset
 * 
 * Reset moderne basé sur les meilleures pratiques
 * Normalise les styles entre navigateurs
 * 
 * @package BienHabille
 * @since 1.0.0
 */

/* ========================================================================== */
/* BOX SIZING */
/* ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* ========================================================================== */
/* RESET MARGINS & PADDINGS */
/* ========================================================================== */

html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}

/* ========================================================================== */
/* HTML5 DISPLAY RESET */
/* ========================================================================== */

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section {
    display: block;
}

/* ========================================================================== */
/* DOCUMENT */
/* ========================================================================== */

html {
    /* Empêcher les ajustements de taille de police sur iOS */
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    
    /* Scroll fluide */
    scroll-behavior: smooth;
    
    /* Améliorer le rendu des polices */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    /* Hauteur minimale */
    min-height: 100%;
}

body {
    min-height: 100vh;
    line-height: 1.5;
    text-rendering: optimizeSpeed;
}

/* ========================================================================== */
/* TYPOGRAPHIE */
/* ========================================================================== */

/* Titres - reset complet, styles définis dans typography.css */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-size: inherit;
    font-weight: inherit;
}

/* Liens */
a {
    color: inherit;
    text-decoration: inherit;
    background-color: transparent;
}

a:focus {
    outline: none;
}

/* Texte en gras et italique */
b,
strong {
    font-weight: 600;
}

i,
em {
    font-style: italic;
}

/* Code et pré-formaté */
code,
kbd,
samp,
pre {
    font-family: var(--bh-font-mono, monospace);
    font-size: 1em;
}

pre {
    overflow: auto;
}

small {
    font-size: 80%;
}

/* Indices et exposants */
sub,
sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

sub {
    bottom: -0.25em;
}

sup {
    top: -0.5em;
}

/* ========================================================================== */
/* LISTES */
/* ========================================================================== */

ol,
ul {
    list-style: none;
}

/* ========================================================================== */
/* MÉDIAS */
/* ========================================================================== */

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

img {
    border-style: none;
}

/* SVG inline */
svg:not([fill]) {
    fill: currentColor;
}

/* Éviter le débordement sur les anciens navigateurs */
audio,
video {
    display: inline-block;
}

audio:not([controls]) {
    display: none;
    height: 0;
}

/* ========================================================================== */
/* FORMULAIRES */
/* ========================================================================== */

button,
input,
optgroup,
select,
textarea {
    font-family: inherit;
    font-size: 100%;
    line-height: 1.15;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
}

/* Boutons */
button,
[type="button"],
[type="reset"],
[type="submit"] {
    -webkit-appearance: button;
    appearance: button;
    cursor: pointer;
}

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
    border-style: none;
    padding: 0;
}

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
    outline: 1px dotted ButtonText;
}

button:disabled,
[type="button"]:disabled,
[type="reset"]:disabled,
[type="submit"]:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Inputs */
input {
    overflow: visible;
}

input::placeholder,
textarea::placeholder {
    color: var(--bh-text-tertiary, #9ca3af);
    opacity: 1;
}

/* Textarea */
textarea {
    overflow: auto;
    resize: vertical;
}

/* Select */
select {
    text-transform: none;
}

/* Fieldset & Legend */
fieldset {
    padding: 0;
    margin: 0;
    border: 0;
    min-width: 0;
}

legend {
    box-sizing: border-box;
    color: inherit;
    display: table;
    max-width: 100%;
    padding: 0;
    white-space: normal;
}

/* Checkbox & Radio */
[type="checkbox"],
[type="radio"] {
    box-sizing: border-box;
    padding: 0;
}

/* Number spinner */
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
    height: auto;
}

/* Search */
[type="search"] {
    -webkit-appearance: textfield;
    appearance: textfield;
    outline-offset: -2px;
}

[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
}

/* File upload */
::-webkit-file-upload-button {
    -webkit-appearance: button;
    font: inherit;
}

/* ========================================================================== */
/* TABLEAUX */
/* ========================================================================== */

table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
}

th {
    text-align: left;
    font-weight: 600;
}

/* ========================================================================== */
/* ÉLÉMENTS INTERACTIFS */
/* ========================================================================== */

/* Curseur pointer pour les éléments cliquables */
[role="button"],
button,
a,
label[for],
select,
summary {
    cursor: pointer;
}

/* Supprimer le délai de tap sur mobile */
a,
button,
input,
select,
textarea,
[tabindex] {
    -webkit-tap-highlight-color: transparent;
}

/* Details & Summary */
details {
    display: block;
}

summary {
    display: list-item;
}

/* Hidden */
[hidden] {
    display: none !important;
}

/* ========================================================================== */
/* ACCESSIBILITÉ */
/* ========================================================================== */

/* Focus visible amélioré */
:focus-visible {
    outline: 2px solid var(--bh-color-primary, #1d2327);
    outline-offset: 2px;
}

/* Réduire les animations pour les utilisateurs qui préfèrent */
@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;
    }
}

/* Skip link (pour l'accessibilité) */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--bh-color-primary, #1d2327);
    color: white;
    padding: 0.5rem 1rem;
    z-index: 9999;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
}

/* ========================================================================== */
/* SÉLECTION DE TEXTE */
/* ========================================================================== */

::selection {
    background-color: var(--bh-color-primary, #1d2327);
    color: white;
}

::-moz-selection {
    background-color: var(--bh-color-primary, #1d2327);
    color: white;
}

/* ========================================================================== */
/* SCROLLBAR PERSONNALISÉE (optionnel) */
/* ========================================================================== */

/* Webkit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bh-gray-100, #f3f4f6);
}

::-webkit-scrollbar-thumb {
    background: var(--bh-gray-300, #d1d5db);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bh-gray-400, #9ca3af);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--bh-gray-300, #d1d5db) var(--bh-gray-100, #f3f4f6);
}