/* Module autonome ; polices fournies par le site, aucun chargement distant. */
.tb,
.tb-dialog {
  --tb-brume: #ddd8cd;
  --tb-fer: #2b2d2f;
  --tb-mout: #822941;
  --tb-vert: #3f4e34;
  --tb-chene: #c29b68;
  color: var(--tb-fer);
  font-family: Manrope, system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

.tb *,
.tb-dialog * { box-sizing: border-box; }
.tb [hidden] { display: none !important; }
.tb { padding: clamp(3rem, 7vw, 6rem) 1.5rem; background: var(--tb-brume); }
.tb__inner {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
  max-width: 82rem;
  margin-inline: auto;
}
.tb__portrait { width: 100%; max-width: 30rem; margin: 0 auto; }
.tb__portrait img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 48rem;
  object-fit: contain;
}
.tb__portrait figcaption { margin-top: .75rem; color: var(--tb-vert); font-size: .875rem; }
.tb__copy { min-width: 0; }
.tb__copy > * { margin: 0; }
.tb__copy > * + * { margin-top: 1.25rem; }
.tb__eyebrow { color: var(--tb-mout); font-size: .8125rem; letter-spacing: .09em; text-transform: uppercase; }
.tb h2,
.tb-dialog h2 { font-family: "Bricolage Grotesque", Manrope, system-ui, sans-serif; font-weight: 700; text-wrap: balance; }
.tb h2 { font-size: clamp(2rem, 4vw, 3.75rem); line-height: 1.1; letter-spacing: -.035em; }
.tb__intro { font-size: clamp(1.125rem, 1.6vw, 1.375rem); line-height: 1.5; }
.tb__note { padding-top: 1.25rem; border-top: 1px solid var(--tb-vert); color: var(--tb-vert); font-size: .9375rem; }
.tb__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  min-height: 3.25rem;
  padding: .75rem 1.25rem;
  border: 1px solid var(--tb-vert);
  border-radius: 2px;
  background: var(--tb-brume);
  color: var(--tb-fer);
  font: inherit;
  font-weight: 650;
  line-height: 1.4;
  cursor: pointer;
  text-align: center;
}
.tb__button--primary { border-color: var(--tb-mout); background: var(--tb-mout); color: var(--tb-brume); }
.tb__button:hover { text-decoration: underline; text-underline-offset: .2em; }
.tb :is(button, a, input):focus-visible { outline: 3px solid var(--tb-mout); outline-offset: 4px; }
.tb__button--primary:focus-visible { outline-color: var(--tb-fer); }
.tb a { color: inherit; text-underline-offset: .2em; }
.tb__fallback a { display: inline-block; padding-block: .5rem; }

.tb-dialog {
  width: min(58rem, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid var(--tb-vert);
  border-radius: 3px;
  background: var(--tb-brume);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.tb-dialog::backdrop { background: rgb(43 45 47 / .82); }
.tb-dialog__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.tb-dialog h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.25rem); line-height: 1.15; letter-spacing: -.025em; }
.tb-dialog__header form { flex: 0 0 auto; margin: 0; }
.tb-dialog__close { min-height: 2.75rem; padding: .5rem .75rem; }
.tb-dialog__description { margin: 1rem 0; color: var(--tb-vert); }
.tb-dialog__modes { display: flex; flex-wrap: wrap; gap: .5rem; margin-block: 1.25rem; }
.tb-dialog__modes .tb__button { flex: 1 1 10rem; font-size: .9375rem; }
.tb-dialog__modes [aria-pressed="true"] { color: var(--tb-brume); background: var(--tb-vert); text-decoration: underline; text-underline-offset: .2em; }
.tb-dialog__figure { margin: 0; }
.tb-dialog__stage {
  --tb-split: 50%;
  --tb-image-ratio: .6666667;
  position: relative;
  width: min(100%, calc(62vh * var(--tb-image-ratio)));
  width: min(100%, calc(62dvh * var(--tb-image-ratio)));
  aspect-ratio: var(--tb-image-ratio);
  margin-inline: auto;
  overflow: hidden;
  background: var(--tb-brume);
}
.tb-dialog__image { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.tb-dialog__original { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--tb-split)) 0 0); }
.tb-dialog__divider { position: absolute; inset-block: 0; left: var(--tb-split); width: 2px; transform: translateX(-1px); background: var(--tb-brume); box-shadow: 0 0 0 1px var(--tb-fer); pointer-events: none; }
.tb-dialog__stage:not([data-tb-mode="compare"]) .tb-dialog__divider { display: none; }
.tb-dialog__caption { margin-top: .75rem; font-size: .875rem; text-align: center; color: var(--tb-vert); }
.tb-dialog__range { margin-top: 1.25rem; }
.tb-dialog__range label { display: block; font-weight: 650; }
.tb-dialog__range input { display: block; width: 100%; min-height: 2.75rem; margin: .25rem 0; accent-color: var(--tb-mout); cursor: ew-resize; }
.tb-dialog__range p { margin: .25rem 0 0; font-size: .875rem; color: var(--tb-vert); }
.tb-dialog__error { padding: 1rem; border: 1px solid var(--tb-mout); color: var(--tb-mout); }

@media (max-width: 44rem) {
  .tb__inner { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .tb__portrait { max-width: 25rem; }
  .tb__copy > .tb__button { width: 100%; }
  .tb-dialog { width: calc(100% - 1rem); max-height: calc(100dvh - 1rem); padding: 1rem; }
  .tb-dialog__header { flex-wrap: wrap; }
  .tb-dialog__header form { margin-left: auto; }
  .tb-dialog__modes .tb__button { flex-basis: 8rem; }
}
