@import url("navigation.css");
@import url("forms.css");
@import url("auth.css");
@import url("shops.css");
@import url("dark-mode.css");
@import url("favorites.css");
@import url("shop-detail.css");
@import url("scroll-tools.css");
@import url("search-history.css");

/* Variables */
:root {
    --black-strawberry: #33141a;
    --lobster-pink: #d45e5e;
    --light-sorbet: #f08080;
    --sweet-salmon: #f4978e;
    --light-coral: #ed6868;
    --soft-apricot: #ffdab9;
    --powder-blush: #f8ad9d;
    --peach-fuzz: #fbc4ab;
    --white: #ffffff;

    --foreground: #35272b;
    --background: #faf7f2;

    --color-text: var(--foreground);
    --color-background: var(--background);
    --color-surface: #ffffff;
    --color-border: #ded6d1;
    --color-header: #a83f4b;
    --color-header-text: #ffffff;
    --color-focus: #a83f4b;
    --color-input-background: #ffffff;
    --color-placeholder: #776970;
    --color-muted: #706269;

    --font-body: "Gotham";
    --font-display: "ABC Maxi Round";

    --space-3xs: 0.25rem;
    --space-2xs: 0.5rem;
    --space-xs: 1rem;
    --space-sm: 1.5rem;
    --space-md: 2rem;
    --space-lg: 3rem;
    --space-xl: 4rem;
    --space-2xl: 6rem;

    --content-width: 100rem;
    --page-gutter: clamp(1rem, 4vw, 3rem);
    --grid-gap: clamp(1rem, 2vw, 1.5rem);

    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-pill: 999px;

    --transition-fast: 180ms ease;
    --transition-theme: 300ms ease;

    --control-height: 3.5rem;
    --control-padding-inline: 1rem;
    --control-radius: var(--radius-sm);

    --button-text: var(--white);
    --button-background: var(--black-strawberry);
    --button-hover: #4a2028;

    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-h3: clamp(1.25rem, 2vw, 1.75rem);
    --text-h2: clamp(1.75rem, 3vw, 2.5rem);
    --text-h1: clamp(2rem, 5vw, 3.5rem);
}

/* Mode sombre */
body.darkmode {
    --foreground: #fff6ef;
    --background: #1f1114;

    --color-text: var(--foreground);
    --color-background: var(--background);
    --color-surface: rgba(248, 173, 157, 0.1);
    --color-border: rgba(255, 246, 239, 0.28);
    --color-header: var(--black-strawberry);
    --color-header-text: #fff6ef;
    --color-focus: var(--light-sorbet);
    --color-input-background: var(--black-strawberry);
    --color-placeholder: rgba(255, 246, 239, 0.68);
    --color-muted: rgba(255, 246, 239, 0.75);

    --button-text: var(--black-strawberry);
    --button-background: var(--foreground);
    --button-hover: var(--white);

    color-scheme: dark;
}

/* Polices */
@font-face {
    font-family: "ABC Maxi Round";
    src: url("../fonts/ABCMaxiRound-Light-Trial.otf") format("opentype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "ABC Maxi Round";
    src: url("../fonts/ABCMaxiRound-Regular-Trial.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "ABC Maxi Round";
    src: url("../fonts/ABCMaxiRound-Bold-Trial.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Gotham";
    src: url("../fonts/GothamLight.otf") format("opentype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Gotham";
    src: url("../fonts/GothamBold.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    color-scheme: light;
    scroll-behavior: smooth;
}

body {
    display: flex;
    flex-direction: column;
    min-width: 20rem;
    min-height: 100vh;
    margin: 0;

    color: var(--color-text);
    background: var(--color-background);

    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.6;
}

img,
svg {
    max-width: 100%;
}

[hidden] {
    display: none !important;
}

button,
input,
select,
textarea {
    color: inherit;
    font: inherit;
}

nav,
main,
footer {
    width: 100%;
    max-width: calc(
        var(--content-width) + var(--page-gutter) * 2
    );
    margin-inline: auto;
    padding-inline: var(--page-gutter);
}

main {
    flex: 1;
    padding-block: clamp(var(--space-sm), 4vw, var(--space-lg));
}

footer {
    padding-block: var(--space-md);
    text-align: center;
}

/* Titres */
h1,
h2,
h3 {
    margin-top: 0;
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.2;
}

h1 {
    margin-bottom: var(--space-sm);
    font-size: var(--text-h1);
    text-wrap: balance;
}

h2 {
    font-size: var(--text-h2);
}

h3 {
    font-size: var(--text-h3);
}

p {
    margin-top: 0;
}

@media (max-width: 38.75rem) {
    main h1 {
        text-align: center;
    }
}

/* Liens et clavier */
a {
    color: inherit;
    text-underline-offset: 0.2em;
}

:where(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
