/* Tutorials of the knowledge base on the site generator (guides/partials/tutorial-step): the capture in a browser
   window, its numbered marks, the cursor, clicks, typing and drags played by public/js/guide-tutorial.js, then the
   gestures told in words and the notes. Without the script, the capture and its marks stay still. */

.gt-intro {
    background: #f8fbff;
    border: 1px solid #dbe7ff;
    border-radius: var(--radius);
    display: grid;
    gap: 18px 28px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    padding: 18px 20px;
}

.gt-intro h2 {
    font-size: 1rem;
    margin: 0 0 8px;
}

.gt-intro ul {
    gap: 6px;
}

.gt-intro p {
    color: var(--body);
    line-height: 1.6;
    margin: 0;
}

.gt-intro-result {
    border-left: 3px solid var(--green, #20b486);
    padding-left: 16px;
}

.gt-path {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.gt-path-label {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* The capture, in a browser window as wide as the capture itself at most. */
.gt-scene {
    display: grid;
    gap: 10px;
    margin: 0;
    max-width: min(100%, calc(var(--gt-width, 1280px) + 2px));
    width: 100%;
}

.gt-window {
    background: #ffffff;
    border: 1px solid var(--line-strong, #d6dde8);
    border-radius: 12px;
    box-shadow: 0 18px 46px rgba(24, 39, 75, 0.12);
    overflow: hidden;
}

.gt-window-bar {
    align-items: center;
    background: #eef2f8;
    border-bottom: 1px solid var(--line-strong, #d6dde8);
    display: flex;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
}

.gt-window-bar span {
    background: #c9d2e0;
    border-radius: 50%;
    height: 9px;
    width: 9px;
}

.gt-window-bar strong {
    background: #ffffff;
    border-radius: 6px;
    color: var(--body);
    flex: 0 1 220px;
    font-size: 0.72rem;
    font-weight: 700;
    margin-left: 10px;
    overflow: hidden;
    padding: 2px 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gt-stage {
    background: #f6f8fb;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.gt-shot {
    display: block;
    height: 100%;
    inset: 0;
    max-width: none;
    position: absolute;
    width: 100%;
}

.gt-after {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.gt-stage.is-after .gt-after {
    opacity: 1;
}

/* The marks: a frame around each element a gesture points at, and its number. */
.gt-marks {
    inset: 0;
    pointer-events: none;
    position: absolute;
}

.gt-mark {
    border: 2px solid rgba(20, 92, 255, 0.7);
    border-radius: 7px;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.55);
    position: absolute;
    transition: opacity 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.gt-mark b {
    align-items: center;
    background: var(--blue, #145cff);
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(16, 34, 63, 0.3);
    color: #ffffff;
    display: flex;
    font-size: 0.72rem;
    font-weight: 850;
    height: 22px;
    justify-content: center;
    left: -11px;
    line-height: 1;
    position: absolute;
    top: -11px;
    width: 22px;
}

.gt-mark.is-edge-x b {
    left: 3px;
}

.gt-mark.is-edge-y b {
    top: 3px;
}

.gt-stage:not(.is-after) .gt-mark[data-gt-image="after"],
.gt-stage.is-after .gt-mark[data-gt-image="before"] {
    display: none;
}

/* While playing, only the mark of the gesture being played shows. */
.gt-scene.is-playing .gt-mark {
    opacity: 0;
}

.gt-scene.is-playing .gt-mark.is-active {
    animation: gt-pulse 1.4s ease-out infinite;
    border-color: var(--blue, #145cff);
    opacity: 1;
}

@keyframes gt-pulse {
    0% { box-shadow: 0 0 0 0 rgba(20, 92, 255, 0.45); }
    100% { box-shadow: 0 0 0 12px rgba(20, 92, 255, 0); }
}

/* The cursor, the click, the typing, the dragged element and the gesture told next to the cursor. */
.gt-cursor {
    height: 26px;
    left: 88%;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 92%;
    transition: left 0.9s cubic-bezier(0.45, 0.05, 0.25, 1), top 0.9s cubic-bezier(0.45, 0.05, 0.25, 1), opacity 0.3s ease;
    width: 26px;
    z-index: 6;
}

.gt-cursor.is-instant {
    transition: none;
}

.gt-scene.is-playing .gt-cursor {
    opacity: 1;
}

.gt-cursor svg {
    display: block;
    filter: drop-shadow(0 2px 3px rgba(16, 34, 63, 0.35));
    transform: translate(-4px, -3px);
    transform-origin: 4px 3px;
    transition: transform 0.15s ease;
}

.gt-cursor svg path {
    fill: #10223f;
    stroke: #ffffff;
    stroke-linejoin: round;
    stroke-width: 1.6;
}

.gt-cursor.is-pressed svg {
    transform: translate(-4px, -3px) scale(0.82);
}

.gt-cursor em {
    background: #f79009;
    border-radius: 999px;
    color: #ffffff;
    display: none;
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 850;
    left: 22px;
    padding: 2px 8px;
    position: absolute;
    top: 18px;
    white-space: nowrap;
}

.gt-cursor.has-label em {
    display: block;
}

.gt-ripple {
    border: 3px solid var(--blue, #145cff);
    border-radius: 50%;
    height: 44px;
    margin: -22px 0 0 -22px;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    width: 44px;
    z-index: 5;
}

.gt-ripple.is-right {
    border-color: #f79009;
}

.gt-ripple.is-on {
    animation: gt-ripple 0.6s ease-out;
}

@keyframes gt-ripple {
    from { opacity: 0.9; transform: scale(0.3); }
    to { opacity: 0; transform: scale(1.5); }
}

.gt-typing {
    align-items: center;
    background: #ffffff;
    border: 2px solid var(--blue, #145cff);
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(16, 34, 63, 0.2);
    color: #10223f;
    display: none;
    font-size: clamp(0.72rem, 1.6vw, 0.92rem);
    font-weight: 650;
    max-width: 92%;
    min-height: 26px;
    overflow: hidden;
    padding: 3px 8px;
    position: absolute;
    white-space: nowrap;
    z-index: 4;
}

.gt-typing.is-on {
    display: flex;
}

.gt-typing::after {
    animation: gt-caret 0.9s steps(1) infinite;
    background: var(--blue, #145cff);
    content: "";
    height: 1.1em;
    margin-left: 2px;
    width: 2px;
}

@keyframes gt-caret {
    50% { opacity: 0; }
}

.gt-ghost {
    background: rgba(20, 92, 255, 0.1);
    border: 2px dashed var(--blue, #145cff);
    border-radius: 7px;
    display: none;
    pointer-events: none;
    position: absolute;
    transition: left 0.9s cubic-bezier(0.45, 0.05, 0.25, 1), top 0.9s cubic-bezier(0.45, 0.05, 0.25, 1), opacity 0.3s ease;
    z-index: 4;
}

.gt-ghost.is-on {
    display: block;
}

.gt-bubble {
    background: #10223f;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(16, 34, 63, 0.28);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.4;
    max-width: min(280px, 60%);
    opacity: 0;
    padding: 8px 11px;
    pointer-events: none;
    position: absolute;
    transition: opacity 0.25s ease;
    width: max-content;
    z-index: 7;
}

.gt-bubble.is-on {
    opacity: 1;
}

.gt-bubble b {
    color: #9cc0ff;
    margin-right: 4px;
}

/* Below the capture: what it is, and the buttons that play it, show the result or open it at full size. */
.gt-caption {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.8rem;
    gap: 8px 14px;
    justify-content: space-between;
    line-height: 1.45;
}

.gt-controls {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gt-controls[hidden] {
    display: none;
}

.gt-control {
    background: #ffffff;
    border: 1px solid #cfdcf5;
    border-radius: 999px;
    color: var(--blue, #145cff);
    cursor: pointer;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 5px 12px;
}

.gt-control:hover {
    border-color: var(--blue, #145cff);
}

.gt-control[aria-pressed="true"] {
    background: var(--blue, #145cff);
    border-color: var(--blue, #145cff);
    color: #ffffff;
}

.gt-control:focus-visible {
    outline: 3px solid rgba(20, 92, 255, 0.4);
    outline-offset: 2px;
}

/* The gestures told in words, numbered like the marks; the one being played is lit. */
.gt-gestures-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 16px 10px;
}

.gt-gestures-card h4 {
    font-size: 0.92rem;
    margin: 0 0 8px;
}

.guide-article .gt-gestures {
    display: grid;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.guide-article .gt-gestures li {
    align-items: baseline;
    border-radius: 8px;
    display: grid;
    gap: 4px 10px;
    grid-template-columns: 24px 76px minmax(0, 1fr);
    padding: 7px 8px;
    transition: background-color 0.25s ease;
}

.guide-article .gt-gestures li.is-active {
    background: #eef4ff;
}

.gt-num {
    align-items: center;
    align-self: start;
    background: var(--blue, #145cff);
    border-radius: 50%;
    color: #ffffff;
    display: flex;
    font-size: 0.72rem;
    font-weight: 850;
    height: 22px;
    justify-content: center;
    margin-top: 1px;
    width: 22px;
}

.gt-do {
    align-self: start;
    justify-self: start;
    background: #eef4ff;
    border-radius: 999px;
    color: var(--blue, #145cff);
    font-size: 0.7rem;
    font-weight: 850;
    margin-top: 3px;
    padding: 2px 8px;
    white-space: nowrap;
}

.gt-do.is-type { background: #ecfdf3; color: #067647; }
.gt-do.is-drag { background: #f4f0ff; color: #5b3cc4; }
.gt-do.is-point { background: #f2f4f7; color: #475467; }
.gt-do.is-right { background: #fff6ed; color: #b54708; }

.gt-say {
    color: var(--ink);
    line-height: 1.55;
}

/* Tip, mistake to avoid, checks. */
.gt-notes {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.gt-note {
    border: 1px solid;
    border-radius: var(--radius);
    padding: 13px 15px;
}

.gt-note h4 {
    font-size: 0.85rem;
    margin: 0 0 6px;
}

.gt-note p,
.guide-article .gt-note li {
    font-size: 0.9rem;
    line-height: 1.55;
    margin: 0;
}

.guide-article .gt-note ul {
    gap: 4px;
    padding-left: 18px;
}

.gt-note.is-tip { background: #f5f8ff; border-color: #d4e2ff; }
.gt-note.is-tip h4 { color: var(--blue, #145cff); }
.gt-note.is-avoid { background: #fffaf2; border-color: #f6d9a8; }
.gt-note.is-avoid h4 { color: #b54708; }
.gt-note.is-check { background: #f3fbf6; border-color: #bfe8cf; }
.gt-note.is-check h4 { color: #067647; }

/* The tutorial before and after this one. */
.gt-series {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 12px;
    padding-top: 20px;
}

.gt-series p {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    margin: 0;
}

.gt-series-links {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.gt-series-link {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--heading);
    display: grid;
    font-weight: 800;
    gap: 4px;
    line-height: 1.35;
    padding: 14px 16px;
    text-decoration: none;
}

.gt-series-link span {
    color: var(--blue, #145cff);
    font-size: 0.75rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.gt-series-link.is-next {
    grid-column: -2;
    text-align: right;
}

.gt-series-link:hover {
    border-color: var(--blue, #145cff);
}

/* « Agrandir »: the capture at full size. */
.gt-zoom {
    background: #ffffff;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 28px 70px rgba(16, 34, 63, 0.4);
    max-height: 94vh;
    max-width: min(96vw, 1600px);
    padding: 0;
}

.gt-zoom::backdrop {
    background: rgba(10, 20, 40, 0.72);
}

.gt-zoom form {
    display: flex;
    justify-content: flex-end;
    margin: 0;
    padding: 8px;
    position: sticky;
    top: 0;
}

.gt-zoom-close {
    background: #10223f;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 800;
    padding: 6px 14px;
}

.gt-zoom img {
    display: block;
    height: auto;
    max-width: 100%;
    padding: 0 8px 8px;
}

@media (max-width: 760px) {
    .gt-bubble {
        display: none;
    }

    .gt-window-bar {
        height: 24px;
    }

    .guide-article .gt-gestures li {
        grid-template-columns: 24px minmax(0, 1fr);
    }

    .gt-do {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gt-cursor,
    .gt-ghost,
    .gt-after,
    .gt-mark {
        transition: none;
    }

    .gt-scene.is-playing .gt-mark.is-active,
    .gt-typing::after {
        animation: none;
    }
}
