/* ============================================================
   Sophie Royer · Graphiste indépendante en Nord-Aveyron
   Feuille de style du site (dossier assets/css, à côté de index.html)

   Pour changer une couleur, une police, un arrondi ou une ombre,
   modifiez les variables du premier bloc « :root » ci-dessous :
   elles s'appliquent ensuite à tout le site.

   Sommaire
     1. Variables (couleurs, polices, arrondis, ombres) et mode sombre
     2. Réglages généraux et mise en page
     3. Volet bordeaux
     4. Galerie
     5. Prestations, déroulé d'une prestation
     6. Ils m'ont fait confiance (logos clients)
        Pied de page (contact)
     7. Fiche projet (et rubrique « Du même projet »)
     8. Angles arrondis, ombrages
     9. Tablette et mobile
   ============================================================ */

/* ============================================================
   Variables : couleurs, polices, arrondis, ombres
   ============================================================ */
:root {
  --bg: #FFFFFF;  /* fond de la page */
  --ink: #231517;  /* texte courant et fond du pied de page */
  --muted: #6F5E60;  /* texte secondaire */
  --line: #E6DADA;  /* filets et bordures */
  --tint: #F5EEEE;  /* fond gris rosé (fiche projet, visuels en attente) */
  --bordeaux: #874043;  /* volet de gauche */
  --on-bordeaux: #FFFFFF;  /* texte sur le bordeaux */
  --on-bordeaux-soft: #F0D9DA;  /* texte secondaire sur le bordeaux */
  --accent: #874043;  /* liens, numéros et titres colorés */
  --foot-muted: #CDBDBF;  /* pied de page : texte secondaire */
  --foot-line: #4D3A3C;  /* pied de page : filet */
  --foot-accent: #EBB1B4;  /* pied de page : liens et bouton */
  --foot-btn-text: #231517;  /* pied de page : texte du bouton « M’écrire » */
  --foot-field: rgba(255, 255, 255, .08);  /* pied de page : fond des champs du formulaire */
  --foot-ok: #A8D5B5;  /* formulaire : message envoyé */
  --foot-error: #F4B4A8;  /* formulaire : erreur */
  --shade: rgba(35, 21, 23, .30);  /* couleur des ombres */
  --shadow: 0 1px 2px rgba(35, 21, 23, .10), 0 12px 26px -12px rgba(35, 21, 23, .32);  /* ombre des visuels */
  --shadow-up: 0 2px 4px rgba(35, 21, 23, .12), 0 24px 44px -16px rgba(35, 21, 23, .44);  /* ombre des visuels au survol */
  --display: "Gloock", "Playfair Display", Georgia, "Times New Roman", serif;  /* police des titres */
  --body: "Hanken Grotesk", "Helvetica Neue", Arial, system-ui, sans-serif;  /* police du texte */
  --gutter: clamp(16px, 3.4vw, 48px);  /* marge latérale de la page */
  --radius: 12px;  /* arrondi des images */
  --radius-sm: 7px;  /* arrondi des vignettes */
}

/* ============================================================
   Mode sombre : suit le réglage du visiteur. Supprimez ce bloc pour garder le site clair partout.
   ============================================================ */

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171011;
    --ink: #F3E9E9;
    --muted: #BBA6A7;
    --line: #3A2A2C;
    --tint: #241A1B;
    --bordeaux: #874043;
    --on-bordeaux: #FFFFFF;
    --on-bordeaux-soft: #F0D9DA;
    --accent: #DE9A9D;
    --foot-muted: #6F5E60;
    --foot-line: #D9C9C9;
    --foot-accent: #874043;
    --foot-btn-text: #FFFFFF;
    --foot-field: rgba(35, 21, 23, .05);
    --foot-ok: #2F6B45;
    --foot-error: #A23B2C;
    --shade: rgba(0, 0, 0, .70);
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 12px 26px -12px rgba(0, 0, 0, .85);
    --shadow-up: 0 2px 4px rgba(0, 0, 0, .55), 0 24px 44px -16px rgba(0, 0, 0, .9);
    color-scheme: dark;
  }
}

/* ============================================================
   Réglages généraux
   ============================================================ */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
dl,
dd {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

[hidden] {
  display: none!important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.nb {
  white-space: nowrap;
}

.label {
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* ============================================================
   Mise en page générale : volet à gauche, contenu à droite
   ============================================================ */

.layout {
  display: grid;
  grid-template-columns: clamp(290px, 27vw, 380px) minmax(0, 1fr);
  align-items: start;
}

/* ============================================================
   Volet bordeaux
   ============================================================ */

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  background: var(--bordeaux);
  color: var(--on-bordeaux);
  padding: clamp(1.5rem, 3vw, 2.6rem);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  overflow-y: auto;
}

.side :focus-visible {
  outline-color: var(--on-bordeaux);
}

.side h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.4rem, 3.6vw, 3.3rem);
  line-height: .98;
  letter-spacing: -.01em;
}

.side h1 .role {
  display: block;
  font-family: var(--body);
  line-height: 1.5;
  margin-top: .9rem;
  color: var(--on-bordeaux-soft);
}

.side .intro {
  color: var(--on-bordeaux-soft);
  font-size: 1rem;
  max-width: 34ch;
}

.cats {
  display: grid;
  gap: .1rem;
  margin-top: auto;
}

.cats .label {
  color: var(--on-bordeaux-soft);
  padding-bottom: .6rem;
}

.cat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: .5rem 0;
  border-top: 1px solid rgba(255, 255, 255, .28);
  font-family: var(--display);
  font-size: 1.45rem;
  line-height: 1.2;
  color: var(--on-bordeaux-soft);
  transition: color .15s, padding-left .2s;
}

.cat:hover {
  color: var(--on-bordeaux);
}

.cat[aria-pressed="true"] {
  color: var(--on-bordeaux);
  padding-left: 1.1rem;
  position: relative;
}

.cat[aria-pressed="true"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--on-bordeaux);
  transform: translateY(-50%);
}

.side nav {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem 1.1rem;
  font-size: .95rem;
  margin-top: 1.1rem;
}

.side nav a {
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, .45);
  padding-bottom: .1rem;
}

.side nav a:hover {
  border-bottom-color: var(--on-bordeaux);
}

/* ============================================================
   Galerie
   ============================================================ */

.main {
  padding: clamp(1.5rem, 3vw, 2.6rem) var(--gutter) 0;
  min-width: 0;
}

.head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .4rem 1.5rem;
  padding-bottom: 1.4rem;
}

.head h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  line-height: 1.1;
}

.head p {
  color: var(--muted);
  font-size: .95rem;
}

.notice {
  background: var(--tint);
  border-left: 3px solid var(--accent);
  padding: .8rem 1rem;
  margin-bottom: 1.5rem;
  font-size: .92rem;
  color: var(--ink);
}

.gallery {
  columns: 3 250px;
  column-gap: clamp(1rem, 2vw, 1.75rem);
}

.card {
  display: block;
  width: 100%;
  break-inside: avoid;
  padding-bottom: clamp(1.4rem, 2.4vw, 2.1rem);
}

.frame {
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--tint);
  min-height: 130px;
}

.frame img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}

.card:hover .frame img {
  transform: scale(1.045);
}

.plus {
  position: absolute;
  right: .7rem;
  top: .7rem;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  background: var(--bordeaux);
  color: var(--on-bordeaux);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  line-height: 1;
  opacity: 0;
  transform: scale(.8);
  transition: opacity .2s, transform .2s;
}

.card:hover .plus,
.card:focus-visible .plus {
  opacity: 1;
  transform: none;
}

.ph {
  display: none;
}

.noimg .frame {
  aspect-ratio: var(--r, 4/3);
  min-height: 0;
}

.noimg .frame img {
  display: none;
}

.noimg .ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: .3rem;
  padding: 1.1rem;
  color: var(--accent);
}

.noimg .ph b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.1;
}

.noimg .ph small {
  font-size: .78rem;
  color: var(--muted);
}

.cap {
  display: block;
  padding-top: .7rem;
}

.cap .t {
  display: block;
  font-family: var(--display);
  font-size: 1.12rem;
  line-height: 1.25;
}

.cap .c {
  display: block;
  color: var(--muted);
  font-size: .9rem;
  margin-top: .15rem;
}

.empty {
  padding: 3rem 0 4rem;
  color: var(--muted);
  max-width: none;  /* le texte tient sur une ligne */
}

.empty b {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--ink);
  margin-bottom: .4rem;
}

/* ============================================================
   Prestations, contact
   ============================================================ */

.block {
  border-top: 1px solid var(--line);
  margin-top: clamp(2rem, 4vw, 3.5rem);
  padding-block: clamp(2.2rem, 5vw, 4rem);
}

.block > h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  line-height: 1.05;
  text-wrap: balance;
  margin-bottom: clamp(1.5rem, 3vw, 2.4rem);
  max-width: 24ch;
}

.prestations {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 2rem clamp(1.5rem, 3vw, 3rem);
}

.prestations h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.35rem;
  color: var(--accent);
  padding-bottom: .6rem;
  margin-bottom: .7rem;
  border-bottom: 1px solid var(--line);
}

.prestations p {
  color: var(--muted);
  margin-bottom: .7rem;
}

.prestations li {
  padding-block: .22rem;
}

.lede {
  max-width: 62ch;
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: clamp(1.8rem, 3vw, 2.6rem);
}

/* ============================================================
   Déroulé d’une prestation
   ============================================================ */

.steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.2rem clamp(1.5rem, 3vw, 3rem);
}

.steps li {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .2rem 1.1rem;
  align-content: start;
}

.steps .n {
  grid-row: 1 / span 2;
  font-family: var(--display);
  font-size: 2.6rem;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: lining-nums;
}

.steps h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.35rem;
  line-height: 1.2;
  padding-top: .35rem;
}

.steps p {
  grid-column: 2;
  margin-top: .4rem;
}

.steps p + p {
  margin-top: .7rem;
}

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

.contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 1.6rem clamp(1.5rem, 3vw, 3rem);
}

.contact dt {
  color: var(--muted);
  margin-bottom: .35rem;
}

.contact dd {
  font-size: 1.08rem;
  overflow-wrap: anywhere;
}

.contact a {
  text-decoration-color: var(--accent);
  text-underline-offset: .25em;
}


/* ============================================================
   Prestations mises en avant : bandeau teinté et cartes
   ============================================================ */

#prestations {
  border-top: 0;
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  background: var(--tint);
}

#prestations + .block {
  border-top: 0;
}

#prestations .lede {
  color: var(--ink);
}

.prestations {
  gap: clamp(1rem, 2vw, 1.6rem);
}

.prestations > div {
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.5rem 1.3rem;
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s;
}

.prestations > div:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-up);
}

.prestations h3 {
  font-size: clamp(1.35rem, 1.9vw, 1.6rem);
  line-height: 1.15;
}

.prestations ul {
  margin-top: auto;
}

.prestations li {
  position: relative;
  padding-left: 1.1rem;
}

.prestations li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .78em;
  width: .42rem;
  height: .42rem;
  border-radius: 50%;
  background: var(--bordeaux);
}

/* ============================================================
   Prestations et Déroulé : titres et textes d'introduction sur toute la largeur
   ============================================================ */

#prestations > h2,
#deroule > h2 {
  max-width: none;
}

#prestations .lede,
#deroule .lede {
  max-width: none;
}

/* ============================================================
   Écrans d'ordinateur peu hauts : le volet se resserre
   pour que le bouton « Me contacter » reste visible
   ============================================================ */

@media (min-width: 881px) and (max-height: 800px) {
  .side {
    gap: 1.1rem;
    padding-block: 1.3rem;
  }

  .side h1 {
    font-size: clamp(2rem, 3vw, 2.5rem);
  }

  .side .intro {
    font-size: .9rem;
    line-height: 1.5;
  }

  .cat {
    font-size: 1.2rem;
    padding: .32rem 0;
  }

  .cats .label {
    padding-bottom: .35rem;
  }
}

/* ============================================================
   Ils m'ont fait confiance (logos des clients)
   ============================================================ */

.refs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
  gap: clamp(.8rem, 1.6vw, 1.2rem);
}

.ref {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 104px;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: #FFFFFF;  /* fond blanc dans les deux modes, pour que les logos restent lisibles */
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .25s, box-shadow .25s;
}

.ref img {
  display: block;
  max-width: 85%;
  max-height: 60px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(1);
  opacity: .75;
  transition: filter .25s, opacity .25s;
}

.ref-nom {
  display: none;
  font-family: var(--display);
  font-size: 1.05rem;
  line-height: 1.2;
  text-align: center;
  color: #874043;
}

.ref.noimg img {
  display: none;
}

.ref.noimg .ref-nom {
  display: block;
}

a.ref[href]:hover,
a.ref[href]:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-up);
}

.ref:hover img {
  filter: none;
  opacity: 1;
}

/* ============================================================
   « Ils m'ont fait confiance » : même présentation que les prestations
   (bandeau teinté sur toute la largeur, cartes arrondies qui se soulèvent)
   ============================================================ */

#references {
  border-top: 0;
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  background: var(--tint);
}

#references > h2 {
  max-width: none;
}

#references + .foot {
  margin-top: 0;  /* le bandeau des logos rejoint directement le pied de page */
}

.refs {
  gap: clamp(1rem, 2vw, 1.6rem);
}

.ref {
  height: 116px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

a.ref[href]:hover,
a.ref[href]:focus-visible,
.ref:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-up);
}

.ref-nom {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
}

/* ============================================================
   Bouton « Contactez-moi » (volet) et style des boutons du pied de page (.btn-mail sert au bouton « Envoyer »)
   ============================================================ */

.cta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-top: 1.3rem;
  padding: .7rem 1.4rem;
  border-radius: 999px;
  background: #F3E9E9;  /* beige clair, celui du pied de page en mode sombre */
  color: var(--bordeaux);  /* texte en bordeaux */
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .45);
  transition: transform .2s, box-shadow .2s;
}

.side > .cta {
  align-self: flex-start;  /* le bouton garde sa largeur, juste au-dessus de « Portfolio » */
  margin-top: auto;
}

.side > .cta + .cats {
  margin-top: 0;
}

.cta::after {
  content: "→";
  transition: transform .2s;
}

.cta:hover,
.cta:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px -12px rgba(0, 0, 0, .55);
}

.cta:hover::after {
  transform: translateX(3px);
}

.contact-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .8rem 2rem;
  margin-bottom: 1.2rem;
}

.foot .contact-head h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.45rem, 2.3vw, 1.9rem);
  line-height: 1.05;
  margin: 0;
}

.btn-mail {
  display: inline-flex;
  align-items: center;
  padding: .75rem 1.5rem;
  border-radius: 999px;
  background: var(--foot-accent);
  color: var(--foot-btn-text);
  font-weight: 700;
  text-decoration: none;
  transition: transform .2s, filter .2s;
}

.btn-mail:hover,
.btn-mail:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

/* ============================================================
   Formulaire de contact (bandeau dans le pied de page)
   Nom et e-mail l'un sur l'autre à gauche, message à droite
   ============================================================ */

.contact-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr);
  grid-template-areas:
    "nom    msg"
    "email  msg"
    "status status"
    "note   send";
  align-items: start;
  gap: .9rem 1.2rem;
  padding: 1.2rem 1.3rem 1.1rem;
  margin-bottom: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--foot-field);
}

.f-field {
  display: grid;
  gap: .35rem;
  min-width: 0;
}

.f-field:nth-of-type(1) {
  grid-area: nom;
}

.f-field:nth-of-type(2) {
  grid-area: email;
}

.f-msg {
  grid-area: msg;
  grid-template-rows: auto 1fr;
  align-self: stretch;
}

.f-field .label {
  color: var(--muted);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  min-height: 46px;
  padding: .7rem .9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: .98rem;
  line-height: 1.4;
}

.contact-form textarea {
  height: 100%;
  min-height: 150px;  /* hauteur du champ de message */
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}

.contact-form textarea::placeholder {
  color: var(--muted);
  opacity: .8;
}

.f-send {
  grid-area: send;
  justify-self: end;
  border: 0;
  cursor: pointer;
  min-height: 46px;
  min-width: 10rem;
  justify-content: center;
}

.f-send:disabled {
  opacity: .6;
  cursor: wait;
}

.f-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
}

.f-status {
  grid-area: status;
  margin: 0;
  font-weight: 600;
}

.f-status:empty {
  display: none;
}

.f-status[data-kind="ok"] {
  color: var(--foot-ok);
}

.f-status[data-kind="error"] {
  color: var(--foot-error);
}

.f-note {
  grid-area: note;
  align-self: center;
  margin: 0;
  font-size: .82rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .contact-form {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "nom"
      "email"
      "msg"
      "send"
      "status"
      "note";
  }

  .f-send {
    justify-self: stretch;
  }
}

/* ============================================================
   Pied de page (contact)
   ============================================================ */

.foot {
  --muted: var(--foot-muted);
  --line: var(--foot-line);
  --accent: var(--foot-accent);
  background: var(--ink);
  color: var(--bg);
  margin-top: clamp(2rem, 4vw, 3.5rem);
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
}

.foot .block {
  border-top: 0;
  margin-top: 0;
  padding-block: clamp(1.3rem, 2.4vw, 1.9rem) 1.1rem;
}

.foot .block > h2 {
  font-size: clamp(1.45rem, 2.3vw, 1.9rem);
  margin-bottom: 1rem;
  max-width: none;
}

.foot .contact {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: .9rem clamp(1.2rem, 2.5vw, 2.4rem);
}

.foot .contact dt {
  margin-bottom: .2rem;
}

.foot .contact dd {
  font-size: .98rem;
  line-height: 1.45;
}


.foot footer {
  padding-block: .7rem .9rem;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem 1.4rem;
}

footer {
  border-top: 1px solid var(--line);
  padding-block: 1.2rem 2rem;
  color: var(--muted);
  font-size: .88rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .3rem 2rem;
}

/* ============================================================
   Fiche projet : visuel en grand à gauche ; à droite les infos et les vignettes des images du projet ; en bas la bande des autres projets
   ============================================================ */

dialog.sheet {
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border: 0;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
  background: var(--bg);
  color: var(--ink);
}

dialog.sheet:not([open]) {
  display: none;
}

.s-shell {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(260px, 24vw, 340px);
  grid-template-rows: minmax(0, 1fr) auto;
}

.s-stage {
  position: relative;
  overflow: hidden;
  background: var(--tint);
}

.s-media {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  padding: clamp(12px, 3vw, 44px);
}

.s-media img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius);
}

.s-ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: .5rem;
  padding: 10%;
  color: var(--accent);
}

.s-ph b {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.4rem, 3.6vw, 2.4rem);
  line-height: 1.1;
}

.s-ph small {
  color: var(--muted);
  max-width: 36ch;
}

.s-info {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  padding: clamp(1.1rem, 2.2vw, 1.9rem);
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  border-left: 1px solid var(--line);
  overflow-y: auto;
}

.s-info .x {
  align-self: flex-end;
}

.s-info .label {
  color: var(--muted);
}

.s-info h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.6rem, 2.5vw, 2.25rem);
  line-height: 1.08;
  margin-block: .5rem .45rem;
  text-wrap: balance;
}

.s-info .client {
  color: var(--muted);
}

.s-info .desc {
  margin-top: .9rem;
  font-size: .97rem;
}

.s-info .pics {
  font-variant-numeric: tabular-nums;
  margin-bottom: .7rem;
}

.s-nav {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: .8rem;
}

.s-nav span {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: .92rem;
  min-width: 4.2em;
  text-align: center;
}

.rb {
  width: 2.7rem;
  height: 2.7rem;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  line-height: 1;
  text-align: center;
}

.rb:hover:not(:disabled) {
  border-color: var(--ink);
}

.rb:disabled {
  opacity: .35;
  cursor: default;
}

.s-strip {
  grid-column: 1 / -1;
  display: flex;
  gap: .6rem;
  padding: .7rem clamp(.8rem, 2vw, 1.4rem);
  overflow-x: auto;
  border-top: 1px solid var(--line);
  scrollbar-width: thin;
}

.s-thumb {
  flex: none;
  height: 66px;
  min-width: 48px;
  background: var(--tint);
  opacity: .5;
  overflow: hidden;
  transition: opacity .15s;
}

.s-thumb img {
  display: block;
  height: 100%;
  width: auto;
  max-width: 150px;
  object-fit: cover;
}

.s-thumb.noimg {
  width: 92px;
  display: grid;
  place-items: center;
  padding: .3rem;
  font-size: .64rem;
  line-height: 1.15;
  text-align: center;
  color: var(--muted);
}

.s-pix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
}

.p-thumb {
  display: block;
  aspect-ratio: 1;
  background: var(--tint);
  overflow: hidden;
  opacity: .55;
  transition: opacity .15s;
}

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

.p-thumb.noimg {
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.p-thumb:hover,
.p-thumb[aria-current="true"] {
  opacity: 1;
}

.p-thumb[aria-current="true"] {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.s-thumb:hover,
.s-thumb[aria-current="true"] {
  opacity: 1;
}

.s-thumb[aria-current="true"] {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================================
   Fiche projet : rubrique « Du même projet »
   (autres pièces d'un même projet global)
   ============================================================ */

.s-info .group {
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
}

.s-info .gname {
  font-family: var(--display);
  font-size: 1.15rem;
  line-height: 1.25;
  margin: .35rem 0 .8rem;
}

.s-info .group .p-thumb {
  opacity: .85;
}

.s-info .group .p-thumb.noimg {
  font-size: .72rem;
  padding: .2rem;
}

/* ============================================================
   Angles arrondis
   ============================================================ */

.frame {
  border-radius: var(--radius);
}

.p-thumb,
.s-thumb {
  border-radius: var(--radius-sm);
}

/* ============================================================
   Ombrages
   ============================================================ */

.side {
  z-index: 1;
  box-shadow: 0 0 30px -4px var(--shade);
}

.gallery {
  padding-top: 4px;
}

.frame {
  box-shadow: var(--shadow);
  transition: box-shadow .3s;
}

.card:hover .frame {
  box-shadow: var(--shadow-up);
}

.s-media img {
  filter: drop-shadow(0 14px 22px var(--shade));
}

.p-thumb,
.s-thumb {
  box-shadow: var(--shadow);
}

.foot {
  position: relative;
  box-shadow: 0 -14px 30px -18px var(--shade);
}

/* ============================================================
   Tablette et mobile (880 px de large et moins)
   ============================================================ */

@media (max-width:880px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .side {
    position: static;
    height: auto;
    gap: 1.4rem;
    padding: 1.6rem var(--gutter) 1.4rem;
  }

  .cats {
    margin-top: 0;
  }

  .cat {
    font-size: 1.25rem;
  }

  .gallery {
    columns: 2 150px;
  }

  .s-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto auto;
  }

  .s-info {
    grid-column: 1;
    grid-row: 2;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: .9rem var(--gutter);
    gap: .8rem;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    overflow: visible;
  }

  .s-info .x {
    position: absolute;
    top: .6rem;
    right: .6rem;
  }

  .s-info .what {
    flex: 1 1 100%;
  }

  .s-info h2 {
    margin-block: .25rem .2rem;
    font-size: 1.45rem;
  }

  .s-nav {
    margin-top: 0;
  }

  .s-strip {
    grid-row: 3;
  }

  .s-thumb {
    height: 54px;
  }

  .s-info .more {
    flex: 1 1 100%;
  }

  .s-pix {
    grid-template-columns: repeat(auto-fill, minmax(52px, 64px));
  }
}

/* ============================================================
   Visiteurs ayant désactivé les animations
   ============================================================ */

@media (prefers-reduced-motion:reduce) {
  * {
    transition: none!important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ============================================================
   Ajustements responsive (contrôle à 15 tailles d'écran)
   ============================================================ */

/* Prestations : 3 cartes côte à côte seulement s'il y a la place ;
   sinon une carte par ligne, avec la liste à droite du texte */
@media (max-width: 1279px) {
  .prestations {
    grid-template-columns: minmax(0, 1fr);
  }

  .prestations > div {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    column-gap: clamp(1.2rem, 3vw, 2.5rem);
    align-items: start;
  }

  .prestations > div > h3,
  .prestations > div > p {
    grid-column: 1;
  }

  .prestations > div > ul {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-top: 0;
  }
}

@media (max-width: 600px) {
  .prestations > div {
    display: flex;
    flex-direction: column;
  }
}

/* Écrans tactiles : liens assez hauts pour le doigt (44 px environ) */
@media (pointer: coarse) {
  .side nav a,
  .foot-links a,
  .contact dd a {
    display: inline-block;
    padding-block: .55rem;
  }

  .side nav {
    row-gap: 0;
  }
}

/* Fiche projet sur téléphone tenu verticalement :
   les informations défilent pour laisser au visuel au moins la moitié de l'écran */
@media (max-width: 880px) and (orientation: portrait) {
  .s-info {
    max-height: 40vh;
    overflow-y: auto;
  }
}

/* Fiche projet sur téléphone tenu horizontalement : visuel à gauche, informations à droite */
@media (max-width: 1000px) and (orientation: landscape) and (max-height: 520px) {
  .s-shell {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 40%);
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .s-info {
    grid-column: 2;
    grid-row: 1;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    border-top: 0;
    border-left: 1px solid var(--line);
    padding: .8rem 1rem;
    gap: .6rem;
    overflow-y: auto;
    max-height: none;
  }

  .s-info .x {
    position: static;
    align-self: flex-end;
  }

  .s-info h2 {
    font-size: 1.25rem;
  }

  .s-strip {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-block: .45rem;
  }

  .s-thumb {
    height: 44px;
  }
}


/* ============================================================
   Projets écrits dans le HTML : avant que le script ne construise la galerie,
   seule la première image de chaque projet est visible
   ============================================================ */

.gallery .projet img ~ img,
.gallery .projet .description {
  display: none;
}

.gallery .projet img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.ensembles {
  display: none;
}


/* ============================================================
   Petites vignettes sur la page d'accueil
   (projets à plusieurs images : aperçu des visuels supplémentaires)
   ============================================================ */

.mini {
  position: absolute;
  left: .65rem;
  bottom: .65rem;
  display: flex;
  gap: .35rem;
}

.mini-t {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 7px;
  overflow: hidden;
  border: 2px solid #FFFFFF;
  background: #FFFFFF;
  box-shadow: 0 4px 10px -4px rgba(35, 21, 23, .55);
  transition: transform .2s;
}

.mini-t img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mini-t:hover {
  transform: translateY(-3px);
}

.mini-more {
  background: var(--bordeaux);
  border-color: var(--bordeaux);
  color: #FFFFFF;
  font-size: .82rem;
  font-weight: 700;
}

.noimg .mini {
  display: none;
}

@media (max-width: 600px) {
  .mini-t {
    width: 36px;
    height: 36px;
  }
}


/* ============================================================
   Galerie : colonnes construites par le script, pour respecter
   l'ordre des projets de gauche à droite (voir site.js)
   ============================================================ */

.gallery.cols {
  columns: auto;
  display: flex;
  align-items: flex-start;
  gap: clamp(1rem, 2vw, 1.75rem);
}

.gcol {
  flex: 1 1 0;
  min-width: 0;
}
