/* =========================================================
   POLICES
   ========================================================= */

@font-face {
    font-family: "Atavian";
    src: url("fonts/Atavian-REGULAR.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Flowmery";
    src: url("fonts/Flowmery-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}


/* =========================================================
   VARIABLES
   ========================================================= */

:root {
    --background: #f4f1eb;
    --surface: #ebe6dc;
    --text: #181716;
    --muted: #77716a;
    --accent: #8f1d25;
    --border: #c9c1b6;

    --content-width: 1200px;
}

[data-theme="dark"] {
    --background: #181615;
    --surface: #242220;
    --text: #f2ede4;
    --muted: #a89f93;
    --accent: #d1717a;
    --border: #3a3632;
}


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    overflow-x: hidden;
    background: var(--background);
    color: var(--text);

    font-family: "Atavian", Georgia, serif;

    line-height: 1.6;

    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out,
        border-color 0.3s ease-in-out;
}

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

a {
    color: inherit;
    text-decoration: none;
}

/* Fallback theme-switch transition for every element; selectors that
   already declare their own `transition` (interaction animations) list
   these same color properties explicitly so the theme switch keeps
   animating there too, since a later `transition` shorthand replaces
   this rule entirely rather than merging with it. */
*, *::before, *::after {
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out,
        border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out,
        fill 0.3s ease-in-out, stroke 0.3s ease-in-out;
}


/* =========================================================
   HEADER
   ========================================================= */

.site-header {
    border-bottom: 1px solid var(--border);
}

.header-inner {
    position: relative;

    width: min(var(--content-width), calc(100% - 48px));
    margin: auto;

    min-height: 80px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-title {
    font-family: "Atavian", Georgia, serif;

    font-size: 1.1rem;
    letter-spacing: 0.18em;
}


/* =========================================================
   NAVIGATION
   ========================================================= */

.site-nav {
    display: flex;
    align-items: center;
    gap: 32px;

    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-link {
    transition: color 0.2s ease-in-out, border-color 0.3s ease-in-out;
}

.nav-link:hover {
    color: var(--accent);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 0;
    margin: 0;

    background: none;
    border: none;

    color: inherit;
    font-family: inherit;
    font-size: inherit;
    letter-spacing: inherit;
    text-transform: inherit;

    cursor: pointer;

    transition: color 0.2s ease-in-out, border-color 0.3s ease-in-out;
}

.nav-dropdown-toggle:hover,
.nav-dropdown.open .nav-dropdown-toggle {
    color: var(--accent);
}

.nav-arrow {
    width: 10px;
    height: 7px;
    flex-shrink: 0;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;

    transition: transform 0.2s ease, stroke 0.3s ease-in-out;
}

.nav-dropdown.open .nav-arrow {
    transform: rotate(180deg);
}

/* Large hit area bridging the toggle and the visible panel so the
   pointer never leaves a hoverable element between the two. */
.nav-dropdown-panel {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);

    padding-top: 18px;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    z-index: 40;

    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.nav-dropdown-panel-inner {
    width: 240px;
    max-height: 320px;
    overflow-y: auto;

    padding: 12px;

    background: var(--background);
    border: 1px solid var(--border);
    box-shadow: 0 20px 40px rgba(24, 23, 22, 0.14);

    scrollbar-width: thin;
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 8px;
    border-radius: 4px;

    font-size: 0.8rem;
    letter-spacing: 0.02em;
    text-transform: none;

    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.nav-dropdown-item:hover {
    background: var(--surface);
    color: var(--accent);
}

.nav-dropdown-item-image {
    display: block;
    overflow: hidden;
    flex-shrink: 0;

    width: 40px;
    height: 40px;

    border-radius: 50%;
    background: var(--surface);
}

.nav-dropdown-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-dropdown-item-label {
    line-height: 1.3;
}

@media (hover: hover) and (pointer: fine) {

    .nav-dropdown:hover .nav-dropdown-panel,
    .nav-dropdown:focus-within .nav-dropdown-panel {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

.nav-dropdown.open .nav-dropdown-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


/* =========================================================
   CONTROLES DU HEADER (TOGGLE THEME + HAMBURGER)
   ========================================================= */

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.theme-toggle,
.settings-toggle {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;
    padding: 0;
    flex-shrink: 0;

    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;

    color: var(--text);
    cursor: pointer;

    transition: border-color 0.3s ease-in-out, color 0.3s ease-in-out,
        background-color 0.3s ease-in-out;
}

.theme-toggle:hover,
.settings-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.theme-icon {
    position: absolute;
    top: 50%;
    left: 50%;

    width: 18px;
    height: 18px;

    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;

    pointer-events: none;

    transition: opacity 0.35s ease-in-out, transform 0.35s ease-in-out,
        stroke 0.3s ease-in-out;
}

.theme-icon-sun {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

.theme-icon-moon {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-90deg) scale(0.5);
}

[data-theme="dark"] .theme-icon-sun {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(90deg) scale(0.5);
}

[data-theme="dark"] .theme-icon-moon {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
}


/* =========================================================
   HAMBURGER (MOBILE)
   ========================================================= */

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;

    width: 32px;
    height: 32px;
    padding: 0;
    flex-shrink: 0;

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

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;

    background: var(--text);

    transition: transform 0.25s ease, opacity 0.25s ease,
        background-color 0.3s ease-in-out;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/* =========================================================
   HERO
   ========================================================= */

.hero {
    width: min(var(--content-width), calc(100% - 48px));
    margin: 80px auto 120px;

    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);

    gap: 80px;

    align-items: center;
}

.hero-image {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--surface);
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-collage {
    position: relative;
    overflow: visible;
    background: none;
}

.hero-collage .collage-img {
    position: absolute;
    display: block;
    object-fit: cover;
}

.hero-collage .collage-img-back {
    inset: 0 14% 14% 0;
    width: 86%;
    height: 86%;
}

.hero-collage .collage-img-front {
    right: -6%;
    bottom: -8%;
    width: 55%;
    height: 55%;

    border: 6px solid var(--background);
    box-shadow: 0 24px 48px rgba(24, 23, 22, 0.18);
}

.hero-content {
    max-width: 520px;
}

.eyebrow {
    margin: 0 0 20px;

    color: var(--accent);

    font-size: 0.75rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

h1 {
    margin: 0;

    font-family: "Flowmery", Georgia, serif;
    font-weight: 400;

    font-size: clamp(4rem, 7vw, 7rem);
    line-height: 0.95;

    color: var(--text);
}

.description {
    margin: 36px 0 0;

    max-width: 500px;

    font-size: 1.05rem;
    color: var(--muted);
}

.description.motto {
    margin-top: 16px;

    font-style: italic;
}

.photo-credit {
    margin: 20px 0 0;

    color: var(--muted);

    font-size: 0.68rem;
    letter-spacing: 0.02em;
}

.photo-credit a {
    text-decoration: underline;
}

.btn {
    display: inline-block;
    margin-top: 40px;
    padding: 16px 34px;

    border: 1px solid var(--text);

    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;

    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out,
        border-color 0.3s ease-in-out;
}

.btn:hover {
    background: var(--text);
    color: var(--background);
}


/* =========================================================
   META
   ========================================================= */

.recipe-meta {
    margin-top: 48px;

    display: grid;
    grid-template-columns: 1fr 1fr;

    border-top: 1px solid var(--border);
}

.meta-item {
    padding: 20px 0;

    display: flex;
    flex-direction: column;

    border-bottom: 1px solid var(--border);
}

.meta-item:nth-child(odd) {
    margin-right: 25px;
}

.meta-item:nth-child(even) {
    margin-left: 25px;
}

.meta-label {
    margin-bottom: 5px;

    color: var(--muted);

    font-size: 0.7rem;
    letter-spacing: 0.16em;
}


/* =========================================================
   SECTIONS
   ========================================================= */

.section {
    width: min(var(--content-width), calc(100% - 48px));
    margin: 0 auto 140px;
}

.section-heading {
    display: flex;
    align-items: baseline;

    gap: 25px;

    margin-bottom: 60px;

    border-bottom: 1px solid var(--border);
}

.section-number {
    color: var(--accent);

    font-size: 0.75rem;
    letter-spacing: 0.15em;
}

h2 {
    margin: 0 0 18px;

    font-family: "Atavian", Georgia, serif;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 400;

    line-height: 1;
}


/* =========================================================
   INGREDIENTS
   ========================================================= */

.ingredients-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);

    gap: 60px 80px;
}

.ingredient-group {
    border-top: 2px solid var(--text);
}

.ingredient-group-title {
    margin: 20px 0 15px;

    font-size: 1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.ingredient {
    padding: 12px 0;

    display: flex;
    justify-content: space-between;
    gap: 20px;

    border-bottom: 1px solid var(--border);
}

.ingredient-name {
    color: var(--text);
}

.ingredient-quantity {
    color: var(--muted);
    white-space: nowrap;
}


/* =========================================================
   PREPARATION
   ========================================================= */

.steps-container {
    display: flex;
    flex-direction: column;
}

.step {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr);

    padding: 55px 0;

    border-bottom: 1px solid var(--border);
}

.step:first-child {
    border-top: 1px solid var(--border);
}

.step-number {
    color: var(--accent);

    font-size: 0.8rem;
    letter-spacing: 0.15em;
}

.step-content {
    max-width: 850px;
}

.step-title {
    margin: 0 0 30px;

    font-size: 1.6rem;
    font-weight: 400;

    letter-spacing: 0.04em;
}

.step-block {
    margin-bottom: 28px;
}

.step-block-title {
    margin-bottom: 12px;

    color: var(--accent);

    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.step-list {
    margin: 0;
    padding-left: 22px;
}

.step-list li {
    margin-bottom: 9px;
    padding-left: 5px;
}

.doneness,
.important,
.rescue,
.cooling {
    margin-top: 30px;
    padding: 20px 25px;

    background: var(--surface);

    border-left: 3px solid var(--accent);
}

.doneness::before {
    content: "CUISSON";
}

.important::before {
    content: "IMPORTANT";
}

.rescue::before {
    content: "SI NÉCESSAIRE";
}

.cooling::before {
    content: "REFROIDISSEMENT";
}

.doneness::before,
.important::before,
.rescue::before,
.cooling::before {
    display: block;

    margin-bottom: 10px;

    color: var(--accent);

    font-size: 0.7rem;
    letter-spacing: 0.15em;
}

.info-list {
    margin: 0;
    padding-left: 20px;
}

.info-list li {
    margin-bottom: 7px;
}


/* =========================================================
   FOOTER
   ========================================================= */

footer {
    padding: 50px 24px;

    border-top: 1px solid var(--border);

    text-align: center;
}

footer p {
    margin: 0;

    font-size: 0.75rem;
    letter-spacing: 0.2em;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 800px) {

    .header-inner {
        min-height: 70px;
    }

    .hamburger {
        display: flex;
    }

    .site-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 50;

        flex-direction: column;
        align-items: stretch;
        gap: 0;

        max-height: 0;
        overflow: hidden;

        background: var(--background);
        border-bottom: 1px solid var(--border);

        transition: max-height 0.3s ease, background-color 0.3s ease-in-out,
            border-color 0.3s ease-in-out;
    }

    .site-nav.open {
        max-height: 80vh;
        overflow-y: auto;
    }

    .nav-link {
        display: block;
        padding: 16px 24px;

        border-top: 1px solid var(--border);
    }

    .nav-dropdown-toggle {
        width: 100%;
        justify-content: space-between;
        padding: 16px 24px;

        border-top: 1px solid var(--border);
    }

    .nav-dropdown-panel {
        position: static;

        max-height: 0;
        overflow: hidden;

        padding-top: 0;
        transform: none;

        opacity: 1;
        visibility: visible;
        pointer-events: auto;

        transition: max-height 0.3s ease;
    }

    .nav-dropdown.open .nav-dropdown-panel {
        max-height: 320px;
    }

    .nav-dropdown-panel-inner {
        width: 100%;
        max-height: none;

        padding: 0 24px 16px;

        border: none;
        box-shadow: none;
    }

    .nav-arrow {
        transform: none;
    }

    .nav-dropdown.open .nav-arrow {
        transform: rotate(180deg);
    }

    .hero {
        grid-template-columns: 1fr;

        gap: 50px;

        margin-top: 40px;
        margin-bottom: 90px;
    }

    .hero-collage {
        overflow: hidden;
    }

    .hero-content {
        max-width: none;
    }

    h1 {
        font-size: clamp(3.5rem, 15vw, 6rem);
    }

    .section {
        margin-bottom: 90px;
    }

    .ingredients-container {
        grid-template-columns: 1fr;

        gap: 50px;
    }

    .step {
        grid-template-columns: 60px minmax(0, 1fr);

        padding: 40px 0;
    }

    .step-title {
        font-size: 1.3rem;
    }
}


@media (max-width: 500px) {

    .header-inner,
    .hero,
    .section {
        width: calc(100% - 32px);
    }

    .recipe-meta {
        grid-template-columns: 1fr;
    }

    .meta-item:nth-child(odd),
    .meta-item:nth-child(even) {
        margin-left: 0;
        margin-right: 0;
    }

    .ingredient {
        flex-direction: column;
        gap: 2px;
    }

    .ingredient-quantity {
        font-size: 0.9rem;
    }
}


/* =========================================================
   CATEGORIES
   ========================================================= */

.category-row {
    margin-bottom: 48px;
}

.category-row:last-child {
    margin-bottom: 0;
}

.category-row-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 24px;
}

.category-row-title {
    margin: 0;

    color: var(--muted);

    font-family: "Atavian", Georgia, serif;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.category-row-nav {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.category-row-nav[hidden] {
    display: none;
}

.category-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    border: 1px solid var(--border);
    border-radius: 50%;
    background: none;

    color: var(--text);
    font-family: inherit;
    font-size: 1.05rem;
    line-height: 1;

    cursor: pointer;
    transition: border-color 0.3s ease-in-out, color 0.3s ease-in-out;
}

.category-nav-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.category-nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.category-thumbs {
    display: flex;
    gap: 28px;

    width: 100%;

    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;

    padding-bottom: 4px;
    margin-bottom: -4px;

    scrollbar-width: none;
}

.category-thumbs::-webkit-scrollbar {
    display: none;
}

.category-thumb {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;

    width: 110px;

    color: inherit;
    text-decoration: none;
    text-align: center;

    scroll-snap-align: start;
}

.category-thumb-image {
    display: block;
    overflow: hidden;

    width: 96px;
    height: 96px;

    border-radius: 50%;
    background: var(--surface);
}

.category-thumb-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;

    transition: transform 0.3s ease;
}

.category-thumb:hover .category-thumb-image img {
    transform: scale(1.08);
}

.category-thumb-label {
    margin-top: 12px;

    font-size: 0.78rem;
    line-height: 1.3;
}


/* =========================================================
   PAGE D'ACCUEIL
   ========================================================= */

.recipes-home {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 48px;
}

.recipe-card {
    display: block;
    color: inherit;
    text-decoration: none;
}

.recipe-card-image {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--surface);
}

.recipe-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;

    transition: transform 0.4s ease;
}

.recipe-card:hover .recipe-card-image img {
    transform: scale(1.04);
}

.recipe-card-tag {
    display: block;
    margin: 22px 0 8px;

    color: var(--accent);

    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.recipe-card-title {
    margin: 0 0 10px;

    font-family: "Atavian", Georgia, serif;
    font-size: 1.5rem;
    font-weight: 400;
}

.recipe-card-description {
    margin: 0 0 20px;

    max-width: 40ch;

    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.recipe-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;

    padding-top: 16px;

    border-top: 1px solid var(--border);

    color: var(--muted);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}


@media (max-width: 700px) {

    .recipes-home {
        grid-template-columns: 1fr;
        gap: 50px;
    }
}


/* =========================================================
   FOOTER (CONTENU)
   ========================================================= */

.footer-title {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
}

.footer-tagline {
    margin: 10px 0 0;

    color: var(--muted);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
}


/* =========================================================
   PARAMETRES
   ========================================================= */

.settings-icon {
    width: 18px;
    height: 18px;

    fill: var(--background);
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;

    pointer-events: none;
}

.settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;

    background: rgba(24, 23, 22, 0.4);

    opacity: 0;

    transition: opacity 0.3s ease;
}

.settings-overlay.open {
    opacity: 1;
}

.settings-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 100;

    width: min(420px, 100%);
    padding: 28px 28px 40px;

    overflow-y: auto;
    overscroll-behavior: contain;

    background: var(--background);
    border-left: 1px solid var(--border);
    box-shadow: -20px 0 40px rgba(24, 23, 22, 0.14);

    transform: translateX(100%);

    transition: transform 0.3s ease, background-color 0.3s ease-in-out,
        border-color 0.3s ease-in-out;
}

.settings-panel.open {
    transform: translateX(0);
}

body.settings-open {
    overflow: hidden;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding-bottom: 16px;

    border-bottom: 1px solid var(--border);
}

.settings-title {
    margin: 0;

    font-size: 2rem;
}

.settings-close {
    width: 36px;
    height: 36px;
    padding: 0;

    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;

    color: var(--text);
    font-family: inherit;
    font-size: 1.3rem;
    line-height: 1;

    cursor: pointer;

    transition: border-color 0.3s ease-in-out, color 0.3s ease-in-out;
}

.settings-close:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.settings-intro {
    margin: 16px 0 8px;

    color: var(--muted);
    font-size: 0.9rem;
}

.settings-form {
    margin: 0;
}

.settings-field {
    margin: 22px 0 0;
    padding: 0 0 22px;

    border: none;
    border-bottom: 1px solid var(--border);
}

.settings-legend {
    padding: 0;
    margin-bottom: 12px;

    color: var(--accent);

    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.settings-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.settings-choice {
    position: relative;
    cursor: pointer;
}

.settings-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.settings-choice span {
    display: block;
    padding: 8px 14px;

    border: 1px solid var(--border);
    border-radius: 999px;

    font-size: 0.85rem;
    line-height: 1.3;

    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out,
        border-color 0.2s ease-in-out;
}

.settings-choice:hover span {
    border-color: var(--accent);
}

.settings-choice input:checked + span {
    background: var(--text);
    border-color: var(--text);
    color: var(--background);
}

.settings-choice input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.settings-custom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    margin-top: 14px;

    font-size: 0.85rem;
}

.settings-custom[hidden] {
    display: none;
}

.settings-custom-input {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.settings-custom-input input {
    width: 70px;
    padding: 6px 8px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;

    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
}

.settings-hint {
    margin: 12px 0 0;

    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.settings-reset {
    margin-top: 28px;
    padding: 12px 24px;

    background: none;
    border: 1px solid var(--text);

    color: var(--text);
    font-family: inherit;
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;

    cursor: pointer;

    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out,
        border-color 0.3s ease-in-out;
}

.settings-reset:hover {
    background: var(--text);
    color: var(--background);
}

.settings-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 18px;

    margin: -30px 0 40px;

    color: var(--muted);
    font-size: 0.85rem;
}

.settings-summary-link {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.settings-summary-note {
    flex-basis: 100%;
    margin: 0;
}

.ingredient-quantity.adjusted,
.settings-summary-note {
    color: var(--accent);
}

@media (max-width: 500px) {

    .settings-panel {
        padding: 20px 16px 32px;
    }

    .header-controls {
        gap: 8px;
    }
}


/* =========================================================
   MINUTEURS
   ========================================================= */

.timer {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 6px;
}

.timer-label {
    border-bottom: 1px dotted var(--accent);
}

.timer-toggle,
.timer-reset {
    padding: 1px 9px;

    color: var(--accent);
    background: transparent;

    border: 1px solid var(--accent);
    border-radius: 999px;

    font: inherit;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.5;
    white-space: nowrap;

    cursor: pointer;
}

.timer-reset {
    display: none;
    padding: 1px 7px;

    color: var(--muted);
    border-color: var(--border);
}

.timer[data-state="running"] .timer-toggle,
.timer-tray-item[data-state="running"] .timer-toggle {
    color: var(--background);
    background: var(--accent);
}

.timer[data-state="done"] .timer-toggle,
.timer-tray-item[data-state="done"] .timer-toggle {
    color: var(--background);
    background: var(--accent);

    animation: timer-ring 0.8s ease-in-out infinite alternate;
}

.timer:not([data-state="idle"]) .timer-reset {
    display: inline-block;
}

@keyframes timer-ring {
    from { opacity: 1; }
    to   { opacity: 0.45; }
}

.timer-tray {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 50;

    display: flex;
    flex-direction: column;
    gap: 8px;

    width: min(340px, calc(100vw - 32px));
    max-height: 50vh;
    overflow-y: auto;

    padding: 12px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);

    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}

.timer-tray-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.timer-tray-label {
    display: flex;
    flex: 1;
    flex-direction: column;

    min-width: 0;

    font-size: 0.8rem;
    line-height: 1.3;
}

.timer-tray-step {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timer-tray-duration {
    color: var(--muted);
    font-size: 0.75rem;
}

.timer-tray .timer-reset {
    display: inline-block;
}

@media (prefers-reduced-motion: reduce) {

    .timer[data-state="done"] .timer-toggle,
    .timer-tray-item[data-state="done"] .timer-toggle {
        animation: none;
    }
}
