/* =====================================================================
   Polygon Soup — feuille de style unique
   HTML écrit à la main, aucun outil de build.
   Repères de lecture :
     1. Variables (couleurs, tailles, espacements)
     2. Bases (reset léger, body, liens, images)
     3. En-tête / navigation
     4. Catalogue (la grille de la page d'accueil)
     5. Page d'un dessin
     6. Pied de page
     7. Adaptations mobile / tablette (tout en bas)
   ===================================================================== */

/* 1. VARIABLES ------------------------------------------------------- */
:root {
    --bg: #ffffff;          /* = fond blanc des mockups, pour qu'ils se fondent */
    --text: #111111;
    --muted: #777777;

    --largeur-page: 70rem;   /* largeur max du contenu */
    --gouttiere: 80%;        /* part de l'écran occupée par le contenu */

    --police: -apple-system, BlinkMacSystemFont, Arial, Helvetica, sans-serif;

    --espace-1: 0.5rem;
    --espace-2: 1rem;
    --espace-3: 2rem;
    --espace-4: 3rem;
    --espace-5: 4rem;
}

/* 2. BASES ----------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--police);
    font-size: 1.2rem;
    font-weight: 300;
    line-height: 1.6;
}

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

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

/* Conteneur centré, réutilisé sur toutes les pages */
.container {
    width: min(var(--gouttiere), var(--largeur-page));
    margin: 0 auto;
}

/* 3. EN-TÊTE --------------------------------------------------------- */
.site-header {
    display: flex;
    align-items: baseline;
    width: min(var(--gouttiere), var(--largeur-page));
    margin: var(--espace-2) auto var(--espace-5);
}

.logo {
    flex-grow: 1;          /* pousse la nav à droite */
    font-size: 1.3rem;
}

.site-nav a {
    margin-left: var(--espace-2);
}

.site-header a:hover {
    text-decoration: underline;
}

/* 4. CATALOGUE (page d'accueil) -------------------------------------- */
.catalogue {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr));
    gap: var(--espace-4) var(--espace-3);
}

.print a {
    display: block;
    text-align: center;
}

/* Vignette : conteneur pour superposer le bandeau SOLD */
.thumb {
    position: relative;
    display: block;
}

.thumb img {
    width: 100%;
    display: block;
}

/* Badge SOLD : rectangle arrondi noir translucide, centré sur la vignette */
.thumb .sold-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0.35em 1.1em;
    background: rgba(0, 0, 0, 0.55);
    color: #ffffff;
    font-size: 1rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    border-radius: 0.45em;
}

.print-title {
    display: block;
    margin-top: var(--espace-1);
}

.print-price {
    display: block;
    color: var(--muted);
}

.print a:hover .print-title {
    text-decoration: underline;
}

/* 5. PAGE D'UN DESSIN ------------------------------------------------ */
.product-title {
    margin: 0 0 var(--espace-4);
    font-size: 2rem;
    font-weight: normal;
    text-align: center;
}

.product-img {
    width: 100%;
    margin: 0 auto var(--espace-3);
}

/* Photos alignées sur le cadre du mockup */
.product-photo {
    width: 85.9%;
    margin-left: 8.1%;
}

.product-price {
    margin: var(--espace-3) 0 var(--espace-2);
    font-size: 1.5rem;
    text-align: center;
}

/* Bouton d'achat = simple lien mailto stylé en cadre */
.buy {
    display: block;
    width: max-content;
    margin: 0 auto var(--espace-5);
    padding: 0.7em 2.4em;
    border: 1px solid var(--text);
}

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

.product-text {
    max-width: 34rem;
    margin: 0 auto var(--espace-3);
    text-align: center;
}

.specs {
    list-style: none;
    max-width: 34rem;
    margin: 0 auto var(--espace-3);
    padding: 0;
    color: var(--muted);
    font-size: 1.05rem;
    text-align: center;
}

.specs li {
    margin: 0.2em 0;
}

/* Pièce vendue : prix remplacé par « Sold » en gris */
.sold {
    color: var(--muted);
}

/* 6. PIED DE PAGE ---------------------------------------------------- */
.site-footer {
    margin: var(--espace-5) auto var(--espace-4);
    text-align: center;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* Liens légaux en pied de page */
.legal-links {
    margin-top: var(--espace-2);
    font-size: 0.85rem;
}

.legal-links a {
    margin: 0 0.5em;
    color: var(--muted);
}

/* Pages légales : texte aligné à gauche, colonne étroite */
.legal {
    max-width: 40rem;
    margin: 0 auto;
    font-size: 1rem;
    line-height: 1.7;
}

/* Colonne unique about : texte + images partagent la même largeur */
.about-col {
    max-width: 45rem;
    margin: 0 auto;
}

.about-col h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin: 0 0 var(--espace-4);
}

.about-col p {
    margin: 0 0 var(--espace-3);
}

.about-col img {
    width: 100%;
    display: block;
    margin: var(--espace-3) 0 var(--espace-4);
}

/* 7. MOBILE / TABLETTE ---------------------------------------------- */
@media (max-width: 40em) {
    :root {
        --gouttiere: 90%;
    }

    body {
        font-size: 1.05rem;
    }

    .catalogue {
        grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
        gap: var(--espace-3) var(--espace-2);
    }

    .product-title {
        font-size: 1.6rem;
    }
}
