/*
 * Genio — "Sur mesure / Tailored" card animation, version 5.
 * Drops into a carousel card's .visual slot and draws straight onto the card,
 * in the card's own ink: one page, like the revision card's, holding the
 * dentist's template, which then becomes the note. templates.js places,
 * lifts, focuses and writes everything. Everything is sized in container
 * units (cqw).
 */

.gt {
  --gt-ink: currentColor;
  /* Text knocked out of the ink, in the card's paper colour. */
  --gt-paper: #f7f5ef;
  /* The app's own UI font, for the template and the note. */
  --gt-app-font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gt-mono-font: "DM Mono", ui-monospace, monospace;

  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  container-type: size;
  pointer-events: none;
  color: inherit;
}

.card-blue .gt {
  --gt-paper: #1747e8;
}

/* The page: comes into focus as the loop starts, and goes out of it at the end. */
.gt-page {
  position: absolute;
  inset: 0;
  display: block;
  transform-origin: 0 0;
  will-change: transform, opacity, filter;
}

/* Page heading, as on the revision card: an icon, the page's name, the date. */
.gt-head {
  position: absolute;
  top: 15cqw;
  right: 7.2cqw;
  left: 7.2cqw;
  display: flex;
  align-items: center;
  gap: 2.2cqw;
  font-family: var(--gt-mono-font);
  font-size: 3.4cqw;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.gt-head svg {
  flex: none;
  width: 5.2cqw;
  height: 5.2cqw;
  overflow: visible;
}

.gt-head svg * {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

/* "Mon modèle" and "Note clinique", stacked, so one can roll away and the
   other in. The padding keeps accents inside the clip. */
.gt-name {
  display: grid;
  overflow: hidden;
  margin-block: -0.35em;
  padding-block: 0.35em;
}

.gt-name > span {
  grid-area: 1 / 1;
  will-change: transform, opacity;
}

.gt-name-b {
  opacity: 0;
}

.gt-date {
  margin-left: auto;
  font-size: 2.6cqw;
  opacity: 0;
}

.gt-rule {
  position: absolute;
  top: 22.5cqw;
  right: 7.2cqw;
  left: 7.2cqw;
  display: block;
  height: max(1px, 0.25cqw);
  background: var(--gt-ink);
  opacity: 0.28;
}

/* ---------- The sections, one per row ---------- */

.gt-list {
  position: absolute;
  inset: 0;
  display: block;
  font-family: var(--gt-app-font);
  font-size: 4.6cqw;
  letter-spacing: -0.01em;
}

/* Placed, lifted and focused by templates.js. */
.gt-row {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  height: 1.4em;
  line-height: 1.4em;
  white-space: nowrap;
  transform-origin: 0 0;
  will-change: transform, filter, opacity;
}

/* The held row's plate, in the card's colour (set by templates.js), so it
   covers the rows it passes. Its box is set by templates.js too. */
.gt-plate {
  position: absolute;
  top: -0.3em;
  bottom: -0.3em;
  left: 0;
  display: block;
  opacity: 0;
}

/* The drag handle, under the heading's icon. */
.gt-grip {
  position: absolute;
  top: 50%;
  left: 0;
  display: block;
  width: 2.4cqw;
  height: 4cqw;
  margin-top: -2cqw;
}

.gt-grip svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.gt-title {
  position: absolute;
  top: 0;
  left: 0;
  font-weight: 600;
}

.gt-value {
  position: absolute;
  top: 0;
  left: 0;
  font-weight: 400;
  white-space: pre;
}

.gt-value .gt-c {
  opacity: 0;
}

/* Where Genio will write: a stroke the length of the words to come, on
   their x-height, in a lighter ink. */
.gt-bar {
  position: absolute;
  top: 0.79em;
  left: 0;
  display: block;
  height: 0.27em;
  margin-top: -0.135em;
  border-radius: 1em;
  background: var(--gt-ink);
  opacity: 0.28;
}

.gt-caret {
  position: absolute;
  top: 0.16em;
  left: 0;
  display: block;
  width: max(1px, 0.28cqw);
  height: 1.02em;
  background: var(--gt-ink);
  opacity: 0;
}

/* "+ Ajouter une section": an outlined pill, as on the one-click card. */
.gt-add {
  position: absolute;
  top: 0;
  left: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  height: 8cqw;
  padding: 0 4.4cqw;
  border: max(1px, 0.3cqw) solid var(--gt-ink);
  border-radius: 8cqw;
  font-family: var(--gt-mono-font);
  font-size: 2.8cqw;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  transform-origin: 0 0;
  will-change: transform, opacity, filter;
}

/* Cancel the trailing letter-space so the label sits optically centred. */
.gt-add-label {
  margin-right: -0.12em;
}

.gt-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.gt-ripple {
  fill: none;
  stroke: var(--gt-ink);
  opacity: 0;
}

/* ---------- Cursor: an arrow, a pointing hand, and a hand that grabs ---------- */

.gt-cursor {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  display: block;
  width: 5.4cqw;
  height: 5.4cqw;
  opacity: 0;
  filter: drop-shadow(0 0.25cqw 0.35cqw rgba(0, 0, 0, 0.28));
}

.gt-cursor svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.gt-arrow path {
  fill: #111;
  stroke: #fff;
  stroke-linejoin: round;
  stroke-width: 1.3;
}

.gt-hand path,
.gt-grab path {
  fill: #fff;
  stroke: #111;
  stroke-linejoin: round;
  stroke-width: 1.15;
}

.gt-hand .gt-hand-lines,
.gt-grab .gt-hand-lines {
  fill: none;
  stroke-linecap: round;
  stroke-width: 0.9;
}

.gt-hand,
.gt-grab,
.gt-cursor.is-hand .gt-arrow,
.gt-cursor.is-grab .gt-arrow {
  visibility: hidden;
}

.gt-cursor.is-hand .gt-hand,
.gt-cursor.is-grab .gt-grab {
  visibility: visible;
}
