/* Composants communs aux pages de la maquette. */

/* ---------- Eyebrow : « ___ LIBELLÉ » ---------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-size: var(--fs-btn);
  text-transform: uppercase;
  letter-spacing: 0;
  line-height: 1.2;
}
.eyebrow::before {
  content: "";
  width: 1.7em;
  border-top: 1px solid currentColor;
  flex: none;
}

/* ---------- Titres ---------- */
.title-xl, .title-lg, .title-md {
  font-family: var(--font-serif);
  font-weight: var(--weight-light);
  text-wrap: balance;
}
.title-xl { font-size: clamp(1.75rem, 4.2vw, var(--fs-title-xl)); line-height: var(--lh-title); }
.title-lg { font-size: clamp(1.5rem, 3.4vw, var(--fs-title-lg)); line-height: var(--lh-tight); }
.title-md { font-size: var(--fs-title-card); line-height: 1.15; }
/* Avis et citations : Fraunces Light Italic */
.title-quote { font-family: var(--font-serif); font-style: italic; font-weight: var(--weight-light); font-size: var(--fs-quote); line-height: var(--lh-quote); }

.lead { font-size: var(--fs-lead); line-height: var(--lh-lead); }
.is-accent { color: var(--color-accent); }

/* ---------- En-tête de page : eyebrow + titre à gauche, chapô à droite, filet dessous ---------- */
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--head-aside, 22.0625rem));   /* chapô : colonne de 353 px (x = 799 px) */
  column-gap: var(--space-7);
  row-gap: var(--space-4);
  align-items: center;
  padding-bottom: 2.5rem; /* 40 px entre la dernière ligne du titre et le filet (maquette : 38 à 43 px) */
  border-bottom: var(--border-hair) solid var(--color-accent);   /* filet brun (maquette) */
}
.section-head__main { display: grid; gap: 1.125rem; }
.section-head__aside { justify-self: stretch; font-size: var(--fs-body); line-height: var(--lh-body); }
/* Variantes conservées (même mesure : le chapô est en texte courant sur toutes les pages) */
.section-head--body, .section-head--lead { --head-aside: 22.0625rem; }
.page-header { padding-top: 3.6875rem; } /* 59 px sous l'en-tête du site (maquette) */

/* ---------- Séparateur ---------- */
.rule { border: 0; border-top: var(--border-hair) solid var(--color-accent); margin: 0; }
.rule--on-dark { border-top-color: var(--color-rule-on-dark); }

/* ---------- Boutons « pilule » : « > LIBELLÉ » ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--btn-height);
  min-width: var(--btn-min-width);
  padding: 0.35rem 0.9375rem;
  border: var(--border-hair) solid var(--color-accent);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-weight: var(--weight-regular);
  font-size: var(--fs-btn);
  line-height: 1.2;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.btn::before { content: "> "; white-space: pre; }
@media (min-width: 60.0625rem) { .btn { white-space: nowrap; } }   /* libellés sur une ligne sur ordinateur */
.btn--plain::before { content: none; }            /* sans chevron (filtres) */
.btn:hover { background: var(--color-accent); border-color: var(--color-accent); color: var(--dgd-white); }

/* Sur fond brun ou vert : contour blanc */
.btn--light { border-color: var(--dgd-white); color: var(--dgd-white); }
.btn--light:hover { background: var(--dgd-white); border-color: var(--dgd-white); color: var(--dgd-black); }

/* Pilule pleine noire : filtre actif, « Tous les projets » */
.btn--solid { background: var(--dgd-black); border-color: var(--dgd-black); color: var(--dgd-white); }
.btn--solid:hover { background: var(--color-accent); border-color: var(--color-accent); }

.btn--sm { min-width: 0; min-height: 2.25rem; }   /* filtres : 36 px de haut */

/* ---------- Bouton rond « » » ---------- */
.btn-round {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--btn-round); height: var(--btn-round); flex: none;
  border: var(--border-hair) solid var(--dgd-white); border-radius: var(--radius-round);
  color: var(--dgd-white);
  transition: background-color 160ms ease, color 160ms ease;
}
.btn-round::before {
  content: "";
  width: 1.125rem; height: 1.125rem;
  background: currentColor;
  -webkit-mask: url("../icons/chevrons-right-8a819cf819d75d365f2efdb66ad343a4.svg") center / contain no-repeat;
          mask: url("../icons/chevrons-right-8a819cf819d75d365f2efdb66ad343a4.svg") center / contain no-repeat;
}
a:hover > .btn-round, .btn-round:hover, .project-card:hover .btn-round { background: var(--dgd-white); color: var(--color-accent); }

/* Bouton rond « + » (prestations : en savoir plus) */
.btn-round--plus::before {
  -webkit-mask: url("../icons/plus-352bdb3668220441ac9a258fec2e9801.svg") center / 1.125rem 1.125rem no-repeat;
          mask: url("../icons/plus-352bdb3668220441ac9a258fec2e9801.svg") center / 1.125rem 1.125rem no-repeat;
}
/* ---------- Bandeau d'appel à l'action (brun) ---------- */
.cta-band {
  background: var(--color-bg-accent);
  color: var(--color-text-on-dark);
}
.cta-band__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-5); flex-wrap: wrap;
  min-height: 6.9375rem;       /* 111 px */
  padding-block: var(--space-5);
}
.cta-band__title { flex: 1 1 20rem; font-family: var(--font-serif); font-weight: var(--weight-light); font-size: clamp(1.625rem, 3.8vw, var(--fs-title-xl)); line-height: var(--lh-title); }

/* ---------- Vignette projet : image, bandeau brun translucide, bouton rond ---------- */
.project-card { position: relative; overflow: hidden; background: var(--color-bg-soft); }
.project-card__media { aspect-ratio: var(--ar, 4 / 3); }
.project-card__media img { width: 100%; height: 100%; object-fit: cover; }
.project-card__caption {
  position: absolute; left: 0; right: 0; bottom: 0.75rem;     /* bandeau pleine largeur, à 12 px du bas (maquette) */
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  min-height: 3rem;            /* 48 px */
  padding: 0.375rem 0.75rem 0.375rem 0.5rem;     /* petites vignettes : texte à 8 px du bord, bouton à 12 px */
  background: var(--gradient-caption);
  color: var(--color-text-on-dark);
}
.project-card--lg .project-card__caption { padding-left: 0.875rem; }       /* grandes vignettes : texte à 14 px du bord */
/* Toute la vignette est cliquable via le lien du bouton rond (pas de lien englobant : le texte reste éditable) */
.project-card .btn-round::after { content: ""; position: absolute; inset: 0; }
.project-card--edit:not(.project-card--studio-nav) .btn-round::after { display: none; }
.project-card--edit:not(.project-card--studio-nav) .btn-round { pointer-events: none; }
/* Réalisations (Studio) : image + bandeau dans un bloc pour que le bandeau ne chevauche pas le menu « Catégorie (filtres) » sous la vignette. */
.project-card__visual { position: relative; width: 100%; }
.project-card--fill.project-card--with-filter-group .project-card__visual { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.project-card--fill.project-card--with-filter-group .project-card__visual .project-card__media { flex: 1; min-height: 0; }
.project-card__go { display: inline-flex; flex: none; position: relative; }
.project-card--fill { height: 100%; }
.project-card--fill .project-card__media { height: 100%; aspect-ratio: auto; }
.project-card__category { font-size: var(--fs-caption); text-transform: uppercase; letter-spacing: 0; line-height: 1.3; }
.project-card__category::before { content: ""; display: inline-block; width: 1.9em; border-top: 1px solid currentColor; vertical-align: middle; margin-right: 0.4em; }
.project-card__title { font-family: var(--font-serif); font-weight: var(--weight-light); font-size: var(--fs-title-card); line-height: 1.15; }

/* ---------- Mosaïque de l'accueil : 1 grande vignette + 2 petites empilées ---------- */
.mosaic-home {
  display: grid;
  grid-template-columns: 715fr 365fr;    /* 715 px / 365 px (maquette) */
  grid-template-rows: minmax(0, 240fr) minmax(0, 452fr);   /* vignettes de droite : 240 px et 452 px */
  column-gap: var(--grid-gap);
  row-gap: var(--grid-gap-row);
}
.mosaic-home > :first-child { grid-row: 1 / span 2; --ar: 2 / 1; }
.mosaic-home > :first-child .project-card__media { height: auto; aspect-ratio: 2 / 1; }   /* la hauteur de la mosaïque vient de ce ratio, pas de l image */
.mosaic-home > :not(:first-child) { height: 100%; }
.mosaic-home > :not(:first-child) .project-card__media { height: 100%; aspect-ratio: auto; }
.mosaic-home .project-card__media { position: relative; }
.mosaic-home .project-card__media img, .mosaic-home .project-card__media picture { position: absolute; inset: 0; }   /* l image ne dicte plus la hauteur des lignes */

/* Accueil — deux projets coup de cœur : paysage + portrait sur une même ligne.
   La colonne de droite doit rester assez étroite : sinon (ex. 38 % de large pour ~28 rem de haut)
   la zone est plus large que haute → l’image « portrait » paraît en paysage avec object-fit: cover. */
.mosaic-home--duo {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.44fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
}
/* Annule .mosaic-home > :first-child { grid-row: 1 / span 2 } (mosaïque 3 vignettes), sinon p1 s’étire sur 2 lignes et p2 reste seul en haut → bords bas non alignés */
.mosaic-home--duo > :first-child {
  grid-row: 1;
}
.mosaic-home--duo > :last-child {
  grid-row: 1;
}
.mosaic-home--duo > * { min-height: clamp(28rem, 38vw, 38rem); height: 100%; }
.mosaic-home--duo > :first-child { --ar: 2 / 1; }
.mosaic-home--duo > :last-child { --ar: 3 / 4; }
.mosaic-home--duo > :first-child .project-card__media,
.mosaic-home--duo > :last-child .project-card__media {
  height: 100%;
  aspect-ratio: auto;
}
.mosaic-home--duo .project-card { height: 100%; }

@media (max-width: 60rem) {
  .section-head { grid-template-columns: 1fr; }
  .section-head__aside { justify-self: start; max-width: 36rem; }
  .cta-band__inner { flex-direction: column; align-items: flex-start; }
  .cta-band__title { flex: none; }   /* en colonne, le flex-basis de 20 rem deviendrait une hauteur */
  /* Zone tactile d'environ 44 px sans changer l'aspect des boutons */
  .btn { position: relative; }
  .btn::after { content: ""; position: absolute; inset: -0.4rem 0; }
  .btn--sm::after { inset: -0.25rem 0; }
  .mosaic-home { grid-template-columns: 1fr; grid-template-rows: none; row-gap: var(--grid-gap); }
  .mosaic-home > :first-child { grid-row: auto; }
  .mosaic-home > :first-child .project-card__media { aspect-ratio: 3 / 2; height: auto; }
  .mosaic-home > :not(:first-child) { height: auto; }
  .mosaic-home > :not(:first-child) .project-card__media { aspect-ratio: 16 / 9; height: auto; }
  .mosaic-home--duo {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }
  .mosaic-home--duo > * { min-height: 0; height: auto; }
  .mosaic-home--duo > :first-child .project-card__media { aspect-ratio: 3 / 2; height: auto; }
  .mosaic-home--duo > :last-child .project-card__media { aspect-ratio: 3 / 2; height: auto; }
  .mosaic-home--duo .project-card { height: auto; }
}

/* Tablette paysage (60rem < largeur ≤ 80rem) : conserver le duo desktop (paysage + portrait, mêmes bords bas). */
@media (max-width: 80rem) and (min-width: 60.0625rem) {
  .mosaic-home--duo > * {
    min-height: clamp(16rem, 32vw, 34rem);
  }
}

/* Cadrage choisi dans le Studio (point à garder au centre + zoom) : variables posées sur le cadre de l'image (ImageFocus) */
[data-focus] { overflow: hidden; }
[data-focus] img { object-fit: cover; object-position: var(--fx, 50%) var(--fy, 50%); transform: scale(var(--fz, 1)); transform-origin: var(--fx, 50%) var(--fy, 50%); }

/* Mode « image entière » : rien n'est coupé. Cadres de la mise en page imposés (vignettes, hero, bande photos) : l'image est
   contenue dans le cadre ; portraits et visuels autonomes : le cadre prend la proportion de l'image. */
[data-focus][data-fit] img { object-fit: contain; object-position: 50% 50%; transform: none; }
/* Le portrait de l'accueil garde le cadre de la maquette (285 × 192) même en « image entière » : sinon la bande de l'agence grandit. */
.pres-histoire__portrait[data-fit],
.carte-cadeau__media[data-fit] { aspect-ratio: auto; height: auto; }
.pres-histoire__portrait[data-fit] > img,
.carte-cadeau__media[data-fit] > img { height: auto; }

/* Lien texte discret (maillage interne) : même macro que les boutons, sans pilule ni chevron. */
.btn--link { border: 0; padding: 0; background: none; border-radius: 0; text-decoration: underline; text-underline-offset: 0.25em; text-decoration-thickness: 1px; }
.btn--link::before { content: none; }
.btn--link:hover { color: var(--color-accent); background: none; }

/* Blocs CMS (constructeur — accueil, présentation, prestations, contact) */
.cms-page-blocks { margin-bottom: var(--space-lg, 1.5rem); }
.cms-section__inner { margin-inline: auto; }
.cms-section__label { margin-bottom: 0.75rem; }
.cms-section__children > * + * { margin-top: var(--space-md, 1rem); }
.cms-block--align-start { text-align: start; }
.cms-block--align-center { text-align: center; }
.cms-block--align-center .btn { margin-inline: auto; }
.cms-block--align-end { text-align: end; }
.cms-block--align-end .btn { margin-inline: 0 0; margin-left: auto; }
.cms-block--align-justify { text-align: justify; text-justify: inter-word; }
.cms-block-image { margin: 0; }
.cms-block-image img { display: block; width: 100%; height: auto; }

/* Apparence PageContent (jetons whitelistés → classes u-pc-*) */
/* Masquage ciblé des ornements décoratifs (préfixe >, filet eyebrow, trait catégorie) — ne masque pas le texte ni l’action. */
.u-pc-ornament-hide.eyebrow::before,
.u-pc-ornament-hide.btn::before,
.u-pc-ornament-hide.project-card__category::before { content: none; }

/* Guillemets décoratifs (jeton quote_marks — hors contenu éditorial, jamais dans le HTML) */
blockquote.u-pc-quotes-french::before,
blockquote.u-pc-quotes-typographic::before,
blockquote.u-pc-quotes-french::after,
blockquote.u-pc-quotes-typographic::after,
blockquote.u-pc-quotes-french > :first-child::before,
blockquote.u-pc-quotes-typographic > :first-child::before,
blockquote.u-pc-quotes-french > :last-child::after,
blockquote.u-pc-quotes-typographic > :last-child::after {
  display: inline;
  font: inherit;
  color: inherit;
  vertical-align: baseline;
  white-space: nowrap;
}
blockquote.u-pc-quotes-french::before { content: "«\00a0"; }
blockquote.u-pc-quotes-french::after { content: "\00a0»"; }
blockquote.u-pc-quotes-typographic::before { content: "\201C\00a0"; }
blockquote.u-pc-quotes-typographic::after { content: "\00a0\201D"; }
/* Richtext : les paragraphes sont en bloc — guillemets sur le premier / dernier enfant */
blockquote.u-pc-quotes-french:has(> :not(br))::before,
blockquote.u-pc-quotes-french:has(> :not(br))::after,
blockquote.u-pc-quotes-typographic:has(> :not(br))::before,
blockquote.u-pc-quotes-typographic:has(> :not(br))::after {
  content: none;
}
blockquote.u-pc-quotes-french:has(> :not(br)) > :first-child::before { content: "«\00a0"; }
blockquote.u-pc-quotes-french:has(> :not(br)) > :last-child::after { content: "\00a0»"; }
blockquote.u-pc-quotes-typographic:has(> :not(br)) > :first-child::before { content: "\201C\00a0"; }
blockquote.u-pc-quotes-typographic:has(> :not(br)) > :last-child::after { content: "\00a0\201D"; }

/* Citations inline (span.cite — jeton data-cite-style dans le HTML) */
span.cite[data-cite-style="french"]:not(.cite--no-decor)::before,
span.cite[data-cite-style="french"]:not(.cite--no-decor)::after,
span.cite[data-cite-style="typographic"]:not(.cite--no-decor)::before,
span.cite[data-cite-style="typographic"]:not(.cite--no-decor)::after,
span.cite[data-cite-style="straight"]:not(.cite--no-decor)::before,
span.cite[data-cite-style="straight"]:not(.cite--no-decor)::after {
  display: inline;
  font: inherit;
  color: inherit;
  vertical-align: baseline;
  white-space: nowrap;
}
span.cite[data-cite-style="french"]:not(.cite--no-decor)::before { content: "«\00a0"; }
span.cite[data-cite-style="french"]:not(.cite--no-decor)::after { content: "\00a0»"; }
span.cite[data-cite-style="typographic"]:not(.cite--no-decor)::before { content: "\201C\00a0"; }
span.cite[data-cite-style="typographic"]:not(.cite--no-decor)::after { content: "\00a0\201D"; }
span.cite[data-cite-style="straight"]:not(.cite--no-decor)::before { content: "\"\00a0"; }
span.cite[data-cite-style="straight"]:not(.cite--no-decor)::after { content: "\00a0\""; }
span.cite[data-cite-style="none"]::before,
span.cite[data-cite-style="none"]::after { content: none; }

.u-pc-text-default { color: var(--color-text); }
.u-pc-text-muted { color: rgba(0, 0, 0, 0.58); }
.u-pc-text-inverse { color: var(--color-text-on-dark); }
.u-pc-text-accent { color: var(--color-accent); }

.u-pc-bg-transparent { background: transparent; }
.u-pc-bg-default { background: var(--color-bg-soft); }
.u-pc-bg-subtle { background: var(--dgd-cream-light); }
.u-pc-bg-inverse { background: var(--color-bg-footer); color: var(--color-text-on-dark); }
.u-pc-bg-accent { background: var(--color-bg-accent); color: var(--color-text-on-dark); }

.u-pc-fs-body { font-size: var(--fs-body); line-height: var(--lh-body); }
.u-pc-fs-small { font-size: var(--fs-caption); line-height: var(--lh-body); }
.u-pc-fs-lead { font-size: var(--fs-lead); line-height: var(--lh-lead); }
.u-pc-fs-title-sm { font-size: var(--fs-btn); line-height: var(--lh-title); font-weight: var(--weight-semibold); }
.u-pc-fs-title-md { font-size: var(--fs-title-card); line-height: var(--lh-title); }
.u-pc-fs-title-lg { font-size: var(--fs-title-xl); line-height: var(--lh-tight); }

.u-pc-ff-body { font-family: var(--font-sans); }
.u-pc-ff-display { font-family: var(--font-serif); }
.u-pc-ff-alt { font-family: var(--font-minion); }

.u-pc-fw-normal { font-weight: var(--weight-regular); }
.u-pc-fw-medium { font-weight: var(--weight-semibold); }
.u-pc-fw-bold { font-weight: var(--weight-bold); }

.u-pc-align-start { text-align: start; }
.u-pc-align-center { text-align: center; }
.u-pc-align-end { text-align: end; }
.u-pc-align-justify { text-align: justify; text-justify: inter-word; }

.u-pc-spacing-none { margin-block: 0; }
.u-pc-spacing-sm { margin-block: var(--space-2); }
.u-pc-spacing-md { margin-block: var(--space-4); }
.u-pc-spacing-lg { margin-block: var(--space-6); }

.u-pc-max-narrow { max-width: 36rem; margin-inline: auto; }
.u-pc-max-default { max-width: 48rem; margin-inline: auto; }
.u-pc-max-wide { max-width: 64rem; margin-inline: auto; }

.u-pc-border-none { border: none; box-shadow: none; }
.u-pc-border-subtle { border: var(--border-hair) solid var(--color-rule); }
.u-pc-border-strong { border: 2px solid var(--color-accent); }

.u-pc-radius-none { border-radius: var(--radius-none); }
.u-pc-radius-sm { border-radius: 6px; }
.u-pc-radius-md { border-radius: 12px; }

.u-pc-padding-none { padding: 0; }
.u-pc-padding-sm { padding: var(--space-2); }
.u-pc-padding-md { padding: var(--space-4); }
.u-pc-padding-lg { padding: var(--space-6); }

/* Formatage intra-texte Studio (classes whitelist rt-*) */
.rt-font-sans { font-family: var(--font-sans); }
.rt-font-serif { font-family: var(--font-serif); }
.rt-font-footer { font-family: var(--font-footer); }
.rt-font-minion { font-family: var(--font-minion); }

.rt-size-xs { font-size: 0.75rem; }
.rt-size-sm { font-size: 0.875rem; }
.rt-size-md { font-size: 1rem; }
.rt-size-lg { font-size: 1.125rem; }
.rt-size-xl { font-size: 1.25rem; }

.rt-color-ink { color: var(--color-ink, #1c1c1a); }
.rt-color-accent { color: var(--color-accent); }
.rt-color-muted { color: var(--color-muted, #6b6a63); }
.rt-color-inverse { color: #fff; }

.rt-align-left { text-align: left; }
.rt-align-center { text-align: center; }
.rt-align-right { text-align: right; }
.rt-align-justify { text-align: justify; text-justify: inter-word; }

.prose ul, .prose ol, .offre-modal__text ul, .offre-modal__text ol,
.project-detail__body ul, .project-detail__body ol {
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}
