/*
 * Les deux familles du site d'origine : un Didone italique pour les titres (Wix
 * servait « didot-w01-italic »), une géométrique fine pour le texte
 * (« futura-lt-w01-light » et « avenir-lt »). Bodoni Moda et Jost sont les équivalents
 * libres les plus proches ; voir le README.
 */
:root {
    --wine: #ad333c;
    --wine-nav: #c43640;
    --wine-deep: #8c2830;
    --cream: #fff8e9;
    --cream-soft: #fffbf3;
    --placeholder: #de9196;
    --paper: #ffffff;

    --serif: 'Bodoni Moda', 'Didot', 'Playfair Display', Georgia, serif;
    --sans: 'Jost', 'Futura', 'Century Gothic', 'Avenir Next', sans-serif;

    --gutter: clamp(1.25rem, 4vw, 3rem);
    --strip: 980px;
    --gallery-gap: 10px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    background: var(--paper);
    color: var(--wine);
    font-family: var(--sans);
    font-weight: 300;
    font-size: 1.125rem;
    line-height: 1.75;
    overflow-wrap: break-word;
}

img {
    max-width: 100%;
    height: auto;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--wine-deep);
    outline-offset: 3px;
}

/* Le contenu du site d'origine tient dans une colonne de 980 px. */
.wrap {
    width: min(var(--strip), 100% - 2 * var(--gutter));
    margin-inline: auto;
}

/* Titres : le Didone italique, en dégradé continu pour rester lisible de 320 à 1920 px. */
.display {
    margin: 0;
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0.005em;
    text-align: center;
}

.display--brand {
    /* 90 px sur le site d'origine ; 86 px ici, parce que Bodoni Moda est un peu plus
       large que le Didot de Wix et que le titre doit tenir sur une seule ligne. */
    font-size: clamp(2.25rem, 5.95vw, 5.375rem);
    line-height: 1.35;
}

.display--hero {
    font-size: clamp(1.875rem, 6.1vw, 5.5rem); /* 88 px à 1440 */
}

.display--page {
    font-size: clamp(1.75rem, 3.47vw, 3.125rem); /* 50 px à 1440 */
}

.display--article {
    font-size: clamp(1.25rem, 1.95vw, 1.75rem); /* 28 px à 1440 */
    line-height: 1.375;
}

.tagline {
    margin: 0;
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(1rem, 1.53vw, 1.375rem); /* 22 px à 1440 */
    line-height: 1.41;
    text-align: center;
}

.lede {
    margin: 0;
    font-size: clamp(1rem, 1.39vw, 1.25rem); /* 20 px à 1440 */
    line-height: 1.67;
    text-align: center;
}

/* Les bandes de couleur du site : crème pour l'accueil et le pied de page, blanc cassé
   pour la galerie et les pages intérieures. */
.band-cream {
    background: var(--cream);
}

.band-soft {
    background: var(--cream-soft);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 10;
    padding: 0.75rem 1.25rem;
    background: var(--wine);
    color: var(--paper);
    font-weight: 500;
}

.skip-link:focus {
    top: 1rem;
}

/* ---------------------------------------------------------------- en-tête */

.site-header {
    background: var(--paper);
    padding-bottom: clamp(1.5rem, 3.05vw, 2.75rem);
}

.site-header .wrap {
    position: relative;
}

.site-nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0;
    padding: clamp(1.25rem, 4.7vw, 4.25rem) 0 0;
    list-style: none;
}

.site-nav a {
    display: block;
    padding: 0 clamp(0.45rem, 1.1vw, 0.95rem);
    font-size: clamp(0.9375rem, 1.46vw, 1.3125rem); /* 21 px à 1440 */
    font-weight: 600;
    line-height: clamp(2.5rem, 4.2vw, 3.75rem);
    color: var(--wine-nav);
    transition: color 150ms ease;
}

.site-nav a:hover,
.site-nav a.is-active {
    color: var(--wine-deep);
}

.brand-mark {
    display: block;
    width: clamp(8.5rem, 18.9vw, 17rem);
    margin: clamp(1.5rem, 4.3vw, 3.875rem) auto 0;
}

.brand-mark img {
    display: block;
    width: 100%;
    height: auto;
}

.brand-line {
    margin: 0;
    color: var(--wine);
}

.brand-line a {
    transition: color 150ms ease;
}

.brand-line a:hover {
    color: var(--wine-deep);
}

.tagline {
    margin-top: clamp(0.4rem, 1.18vw, 1.0625rem);
    color: var(--wine);
}

.header-social {
    position: absolute;
    /* Les quatre pastilles du site s'arrêtent à 59 px du bord de la colonne de
       980 px, et non au bord : c'est la mesure relevée sur le site d'origine. */
    right: 3.6875rem;
    bottom: 0;
}

/* ------------------------------------------------------- pastilles sociales */

.social {
    display: flex;
    flex-wrap: wrap;
    gap: calc(var(--icon-size, 20px) * 0.5);
    margin: 0;
    padding: 0;
    list-style: none;
}

.social a {
    display: grid;
    place-items: center;
    width: var(--icon-size, 20px);
    height: var(--icon-size, 20px);
    color: var(--wine);
    border-radius: 2px;
    transition: color 150ms ease;
}

.social a:hover {
    color: var(--wine-deep);
}

.social svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
    overflow: visible;
}

/* ---------------------------------------------------------------- accueil */

.hero {
    padding: clamp(1rem, 2.5vw, 2.25rem) 0 clamp(1.25rem, 2.8vw, 2.5rem);
}

.hero-photo {
    display: block;
    width: min(971px, 100%);
    height: auto;
    margin-inline: auto;
}

.gamme {
    padding: clamp(0.6rem, 1vw, 0.875rem) var(--gutter) clamp(1.5rem, 2.9vw, 2.625rem);
    color: var(--wine);
}

/* ---------------------------------------------------------------- galerie */

.gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--gallery-gap);
    margin: 0;
    padding: 0;
    list-style: none;
}

.tile {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    padding: 0;
    border: 0;
    background: var(--placeholder);
    cursor: zoom-in;
    overflow: hidden;
}

.tile img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 400ms ease;
}

.tile:hover img {
    transform: scale(1.04);
}

/* ------------------------------------------------------------ fiche d'un pot */

/* Pas de défilement de la page derrière une fiche ouverte. */
body:has(dialog[open]) {
    overflow: hidden;
}

.fiche {
    width: min(960px, 100% - 2 * clamp(0.75rem, 3vw, 2.5rem));
    max-width: none;
    max-height: min(88dvh, 780px);
    padding: 0;
    border: 0;
    background: transparent;
    overflow: visible;
    color: var(--wine);
}

.fiche::backdrop {
    background: rgb(60 24 28 / 72%);
}

.fiche-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 5fr);
    gap: clamp(1rem, 2.5vw, 2.25rem);
    max-height: inherit;
    overflow: auto;
    padding: clamp(1.25rem, 3vw, 2.5rem);
    background: var(--paper);
    box-shadow: 0 24px 60px rgb(60 24 28 / 35%);
}

.fiche-figure {
    display: grid;
    place-items: center;
    background: var(--cream);
}

.fiche-figure img {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(60dvh, 560px);
    object-fit: contain;
}

.fiche-body {
    align-self: center;
}

.fiche-body h2 {
    margin: 0 0 1rem;
    text-align: left;
}

.fiche-body .line {
    margin: 0 0 0.85rem;
    font-size: clamp(0.9375rem, 1.1vw, 1.0625rem);
    line-height: 1.65;
}

.fiche .counter {
    margin: 1.25rem 0 0;
    /* Pas d'opacité ici : à 0,7 le rouge du compteur tombe sous le rapport de
       contraste minimal pour du texte de 14 px. */
    color: var(--wine-deep);
    font-size: 0.875rem;
    letter-spacing: 0.08em;
}

.control {
    position: absolute;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid var(--wine);
    border-radius: 50%;
    background: var(--paper);
    color: var(--wine);
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
}

.control:hover {
    background: var(--wine);
    color: var(--paper);
}

.control svg {
    width: 1.25rem;
    height: 1.25rem;
}

.fiche .close {
    top: 0.75rem;
    right: 0.75rem;
}

.fiche .prev,
.fiche .next {
    top: 50%;
    transform: translateY(-50%);
}

.fiche .prev {
    left: -1.375rem;
}

.fiche .next {
    right: -1.375rem;
}

/* ---------------------------------------------------------------- à propos */

.apropos {
    padding: clamp(2rem, 4.3vw, 4rem) 0 clamp(2rem, 3.9vw, 3.5rem);
}

.prose {
    max-width: 780px;
}

.prose .lede {
    margin-top: clamp(0.75rem, 2.36vw, 2.125rem);
}

.prose .paragraph {
    margin: 1.75rem 0 0;
    font-size: 1.125rem;
    line-height: 1.75;
    text-align: center;
    white-space: pre-line;
}

.banner {
    display: block;
    width: 100%;
    aspect-ratio: 1440 / 565;
    object-fit: cover;
    object-position: 39% 57%;
}

/* ------------------------------------------------------------- l'entreprise */

.entreprise .grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
}

.entreprise .photo {
    display: block;
    width: 100%;
    aspect-ratio: 720 / 635;
    object-fit: cover;
    object-position: 56% 44%;
}

.entreprise .details {
    max-width: 460px;
    margin: 0 auto;
    padding: clamp(1.5rem, 4vw, 4rem) clamp(1.25rem, 3vw, 2rem);
    text-align: left;
}

.entreprise .details h2 {
    margin: 0 0 1rem;
    text-align: left;
}

.entreprise .details p {
    margin: 0.4rem 0 0;
    font-size: 1.125rem;
    line-height: 1.75;
}

.link:hover {
    text-decoration: underline;
    text-underline-offset: 0.25em;
}

.carte {
    padding: 0;
}

.carte-frame {
    width: min(940px, 100% - 2 * var(--gutter));
    margin-inline: auto;
}

.carte-frame iframe {
    display: block;
    width: 100%;
    height: clamp(260px, 30vw, 425px);
    border: 0;
    filter: grayscale(0.15);
}

/* ---------------------------------------------------------------- articles */

.article {
    padding: clamp(2rem, 5.5vw, 5rem) 0;
}

/* Le premier article touche l'en-tête sur le site d'origine. */
.article:first-of-type {
    padding-top: 0;
}

.article-grid {
    display: grid;
    grid-template-columns: minmax(0, 460fr) minmax(0, 640fr);
    align-items: center;
    gap: clamp(1.5rem, 6.25vw, 5.625rem);
    /* La bande fait 1 280 px et son texte commence 90 px à l'intérieur. */
    width: min(1280px, 100% - 2 * var(--gutter));
    padding-inline-start: clamp(0rem, 6.25vw, 5.625rem);
    margin-inline: auto;
}

.article-text {
    text-align: left;
}

.article-text h2 {
    text-align: left;
}

.article .award {
    margin: 0.75rem 0 0;
    font-size: clamp(1rem, 1.39vw, 1.25rem);
    line-height: 1.67;
}

.article .paragraph {
    margin: 1.35rem 0 0;
    font-size: clamp(1rem, 1.39vw, 1.25rem);
    line-height: 1.65;
}

.article-photo {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: 50% 50%;
}

/* ---------------------------------------------------------------- contact */

.contact {
    padding: clamp(2rem, 4vw, 3.75rem) 0 clamp(2.5rem, 5vw, 4.5rem);
}

.contact form {
    width: min(940px, 100%);
    margin-inline: auto;
}

.field {
    margin-bottom: 0.85rem;
}

.field label {
    display: block;
    padding: 0 0 0.45rem;
    font-size: 0.9375rem;
    line-height: 1;
}

.field input,
.field textarea {
    display: block;
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--wine);
    border-radius: 0;
    background: transparent;
    color: var(--wine);
    font: inherit;
    font-size: 0.9375rem;
    line-height: 1.5;
    transition: background-color 150ms ease, box-shadow 150ms ease;
}

.field textarea {
    min-height: 126px;
    resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
    color: color-mix(in srgb, var(--wine) 55%, transparent);
}

.field input:focus,
.field textarea:focus {
    outline: none;
    background: color-mix(in srgb, var(--cream) 70%, #fff);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--wine) 35%, transparent);
}

.field [aria-invalid='true'] {
    border-color: #b3261e;
    background: color-mix(in srgb, #b3261e 6%, transparent);
}

.error {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    color: #b3261e;
}

.send {
    display: block;
    min-width: 142px;
    margin: 1rem auto 0;
    padding: 0.85rem 1.5rem;
    border: 0;
    background: var(--wine);
    color: var(--paper);
    font: inherit;
    font-size: 0.9375rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background-color 150ms ease;
}

.send:hover {
    background: var(--wine-deep);
}

.static-contact {
    width: min(940px, 100%);
    margin-inline: auto;
}

.static-note {
    margin: 1rem auto 0;
    max-width: 640px;
    font-size: 0.9375rem;
    line-height: 1.6;
    text-align: center;
}

.thanks {
    max-width: 780px;
    margin-inline: auto;
    text-align: center;
}

.thanks-title {
    font-size: clamp(1.5rem, 2.43vw, 2.1875rem); /* 35 px à 1440 */
    text-align: center;
}

.thanks-text {
    margin: 1.25rem 0 0;
    font-size: 1.125rem;
    line-height: 1.75;
}

.again {
    display: inline-block;
    margin-top: 1.75rem;
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--wine);
    color: var(--wine);
    font-size: 0.9375rem;
    transition: background-color 150ms ease, color 150ms ease;
}

.again:hover {
    background: var(--wine);
    color: var(--paper);
}

/* ------------------------------------------------------------ pied de page */

.site-footer {
    padding: clamp(2rem, 3.82vw, 3.4375rem) 0 clamp(2.5rem, 9vw, 8rem);
    color: var(--wine);
}

.footer-title {
    margin: 0;
    color: var(--wine);
}

.site-footer .contact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 0;
    margin-top: clamp(1.75rem, 4.17vw, 3.75rem);
}

.contact-link {
    text-align: center;
    font-size: 1.125rem;
    line-height: 1.75;
    transition: color 150ms ease;
}

.contact-link:hover {
    color: var(--wine-deep);
    text-decoration: underline;
    text-underline-offset: 0.25em;
}

.footer-social {
    display: flex;
    justify-content: center;
    margin-top: clamp(1.5rem, 3.13vw, 2.8125rem);
}

.legal {
    margin: clamp(2rem, 5.2vw, 4.6875rem) 0 0;
    font-size: 0.875rem;
    line-height: 1.79;
    text-align: center;
}

/* ------------------------------------------------------------ adaptations */

@media (max-width: 1000px) {
    .gallery {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .entreprise .grid {
        grid-template-columns: 1fr;
    }

    .entreprise .details {
        text-align: center;
    }

    .entreprise .details h2 {
        text-align: center;
    }

    .article-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .article-photo {
        order: -1;
        max-height: 60dvh;
    }

    .article-text h2 {
        text-align: center;
    }

    .fiche-card {
        grid-template-columns: 1fr;
    }

    .fiche-figure img {
        max-height: 34dvh;
    }

    .fiche-body h2 {
        text-align: center;
    }

    .fiche .prev,
    .fiche .next {
        top: auto;
        bottom: 0.75rem;
        transform: none;
    }

    .fiche .prev {
        left: 0.75rem;
    }

    .fiche .next {
        right: 0.75rem;
    }

    .fiche .counter {
        margin-bottom: 3rem;
        text-align: center;
    }
}

@media (max-width: 720px) {
    .header-social {
        position: static;
        display: flex;
        justify-content: center;
        margin-top: 1.25rem;
    }
}

@media (max-width: 640px) {
    .gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .site-footer .contact {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}
