/*
 * Kontakts - Petit film animé de la home (« Une semaine de votre fiche Google, sans vous »), 11/10/2026.
 * Script : /assets/js/kt-film.js (ligne de temps GSAP 3.12.5). Vue : app/Views/landing/_film_semaine.php.
 *
 * La scène est dessinée en pixels de tournage puis mise à l'échelle de son cadre (--kf-scale) :
 *   large    1280 × 720  (ordinateur, tablette)
 *   vertical  720 × 1180 (max-width: 640px ; le téléphone de la scène est agrandi, son bas sort du cadre)
 * Les dimensions internes du téléphone sont en em : une seule taille de police change d'un format à
 * l'autre. L'état par défaut (sans script) est l'image de fin : résumé du lundi et légende finale.
 * Couleurs lisibles par un daltonien : bleu = publié, jaune foncé = en attente, états écrits en clair.
 */

.kf-band {
    --kf-ink: #16163a;
    --kf-muted: #4f5470;
    --kf-soft: #6b7088;
    --kf-line: #e4e5f1;
    --kf-paper: #ffffff;
    --kf-brand: #4648d4;
    --kf-brand-ink: #3335a8;
    --kf-brand-tint: #eeeefe;
    --kf-ok: #0057d9;
    --kf-ok-tint: #e7effd;
    --kf-warn-ink: #7a5400;
    --kf-warn-tint: #fff3d1;
    --kf-star: #f2a900;
    background: #f5f5fc;
    border-top: 1px solid var(--kf-line);
    border-bottom: 1px solid var(--kf-line);
    padding: clamp(52px, 7vw, 88px) 0;
    color: var(--kf-ink);
}
.kf-wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.kf-head { max-width: 46rem; margin: 0 0 clamp(22px, 3vw, 34px); }
.kf-head h2 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-weight: 800;
    font-size: clamp(1.7rem, 3.4vw, 2.6rem);
    line-height: 1.12;
    letter-spacing: -0.025em;
    margin: 0 0 12px;
    text-wrap: balance;
    color: var(--kf-ink);
}
.kf-head p { margin: 0; font-size: 1.05rem; line-height: 1.6; color: var(--kf-muted); max-width: 62ch; }

/* ─── Cadre du film ─── */
.kf-frame {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid var(--kf-line);
    background: #f1f1fb;
    box-shadow: 0 34px 70px -38px rgba(22, 22, 58, .38), 0 2px 6px rgba(22, 22, 58, .05);
    aspect-ratio: 1280 / 720;
}
.kf-scene {
    position: absolute;
    left: 0;
    top: 0;
    width: 1280px;
    height: 720px;
    transform: scale(var(--kf-scale, .8));
    transform-origin: 0 0;
    font-family: 'Inter', -apple-system, sans-serif;
    color: var(--kf-ink);
    overflow: hidden;
}
.kf-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(900px 520px at 78% 30%, rgba(70, 72, 212, .10), transparent 70%),
        radial-gradient(700px 500px at 10% 100%, rgba(242, 169, 0, .07), transparent 70%),
        linear-gradient(160deg, #f8f8fe 0%, #eeeffc 100%);
}

/* ─── Légendes ─── */
.kf-caps { position: absolute; left: 84px; top: 96px; width: 560px; height: 470px; }
/* Chaque légende est centrée verticalement dans sa zone, quelle que soit sa longueur */
.kf-cap { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; opacity: 0; }
.kf-cap--end { opacity: 1; }
.kf-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--kf-paper);
    color: var(--kf-brand-ink);
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 8px 20px -12px rgba(22, 22, 58, .35);
}
.kf-chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--kf-brand); }
.kf-cap h3 {
    margin: 24px 0 18px;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-weight: 800;
    font-size: 54px;
    line-height: 1.06;
    letter-spacing: -0.03em;
    color: var(--kf-ink);
}
.kf-cap h3 { word-spacing: .08em; }
.kf-cap h3 .w { display: inline-block; }
.kf-cap p { margin: 0; font-size: 21px; line-height: 1.5; color: var(--kf-muted); max-width: 480px; }
.kf-cap--intro h3 { font-size: 66px; margin-top: 30px; }
.kf-cap--end h3 { font-size: 62px; }

/* ─── Réglette de la semaine ─── */
.kf-ruler { position: absolute; left: 84px; top: 598px; width: 520px; height: 50px; }
.kf-ruler-line { position: absolute; left: 0; right: 0; top: 8px; height: 4px; background: repeating-linear-gradient(90deg, #d9dbea 0, #d9dbea calc(12.5% - 4px), transparent calc(12.5% - 4px), transparent 12.5%); }
.kf-ruler-fill { position: absolute; left: 0; top: 8px; height: 4px; width: 100%; background: repeating-linear-gradient(90deg, var(--kf-brand) 0, var(--kf-brand) calc(12.5% - 4px), transparent calc(12.5% - 4px), transparent 12.5%); transform-origin: 0 50%; transform: scaleX(1); }
/* Chaque jour occupe un segment ; son nom est centré dessous */
.kf-tick { position: absolute; top: 24px; transform: translateX(-50%); }
.kf-tick span { font-size: 14px; font-weight: 700; color: var(--kf-soft); }
.kf-playhead {
    position: absolute;
    top: 1px;
    left: 100%;
    width: 18px;
    height: 18px;
    margin-left: -9px;
    border-radius: 50%;
    background: var(--kf-brand);
    box-shadow: 0 0 0 6px rgba(70, 72, 212, .18);
}

/* ─── Téléphone ─── */
.kf-phone {
    position: absolute;
    left: 760px;
    top: 26px;
    font-size: 16.5px;
    width: 23em;
    height: 44em;
    border-radius: 3.1em;
    background: var(--kf-ink);
    padding: .62em;
    box-shadow: 0 50px 80px -40px rgba(22, 22, 58, .55), 0 6px 16px rgba(22, 22, 58, .12);
    transform-origin: 50% 40%;
}
.kf-screen { position: relative; height: 100%; border-radius: 2.5em; background: var(--kf-paper); overflow: hidden; }
.kf-status { display: flex; justify-content: space-between; align-items: center; padding: .95em 1.6em .4em; font-size: .86em; font-weight: 700; }
.kf-clock { display: inline-block; min-width: 3.2em; font-variant-numeric: tabular-nums; }
.kf-status svg { width: 3.6em; height: .95em; fill: var(--kf-ink); color: var(--kf-ink); }
.kf-biz { display: grid; grid-template-columns: 2.7em minmax(0, 1fr); gap: .75em; align-items: center; padding: .7em 1.2em .8em; }
.kf-avatar { width: 2.7em; height: 2.7em; border-radius: .8em; display: grid; place-items: center; background: var(--kf-ink); color: #fff; font-weight: 800; font-size: .95em; }
.kf-biz b { display: block; font-size: 1.06em; line-height: 1.2; }
.kf-biz small { display: block; font-size: .8em; color: var(--kf-muted); margin-top: .15em; white-space: nowrap; }
.kf-biz small b { display: inline; font-size: 1em; color: var(--kf-ink); }
.kf-stars { display: inline-flex; gap: .06em; vertical-align: -.12em; }
.kf-stars svg { width: .95em; height: .95em; fill: var(--kf-star); }
.kf-stars svg.off { fill: #d9dbe7; }
.kf-kpis { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 1.2em; border: 1px solid var(--kf-line); border-radius: .9em; }
.kf-kpis div { padding: .55em .7em; border-right: 1px solid var(--kf-line); }
.kf-kpis div:last-child { border-right: 0; }
.kf-kpis b { display: inline-block; font-size: 1.12em; font-weight: 800; font-variant-numeric: tabular-nums; border-radius: .3em; padding: 0 .15em; margin: 0 -.15em; }
.kf-kpis span { display: block; font-size: .72em; color: var(--kf-soft); font-weight: 600; }
.kf-kpis b.is-flash { animation: kf-flash 1.2s ease-out; }
@keyframes kf-flash { 0% { background: rgba(70, 72, 212, .25); color: var(--kf-brand-ink); } 100% { background: transparent; } }

.kf-views { position: absolute; left: 0; right: 0; top: 11.6em; bottom: 0; }
.kf-view { position: absolute; left: 1.2em; right: 1.2em; top: .9em; display: grid; gap: .7em; opacity: 0; }
.kf-view--5 { opacity: 1; }

.kf-row { display: grid; grid-template-columns: 1.7em minmax(0, 1fr); gap: .7em; padding: .7em .8em; border: 1px solid var(--kf-line); border-radius: .8em; }
.kf-row b { display: block; font-size: .92em; }
.kf-row span { display: block; font-size: .8em; color: var(--kf-muted); line-height: 1.4; }
.kf-tick-ok { width: 1.7em; height: 1.7em; border-radius: 50%; display: grid; place-items: center; background: var(--kf-ok-tint); color: var(--kf-ok); }
.kf-tick-ok svg { width: .95em; height: .95em; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.kf-tick-ok--neutral { background: #eef0f6; color: var(--kf-muted); }
.kf-quote { margin: 0; padding: .75em .85em; border-radius: .8em; background: #f6f6fc; font-size: .84em; line-height: 1.5; }
.kf-strike { text-decoration: line-through; text-decoration-color: rgba(79, 84, 112, .6); margin-right: .35em; }
.kf-after { display: inline-block; color: var(--kf-ink); font-weight: 700; }

.kf-review { display: grid; grid-template-columns: 2.2em minmax(0, 1fr); gap: .7em; }
.kf-face { width: 2.2em; height: 2.2em; border-radius: 50%; display: grid; place-items: center; background: #e8e9f4; font-weight: 700; font-size: .9em; }
.kf-review-head { display: flex; flex-wrap: wrap; align-items: center; gap: .2em .5em; font-size: .86em; }
.kf-review-head small { color: var(--kf-soft); font-size: .9em; }
.kf-review p { margin: .25em 0 0; font-size: .86em; line-height: 1.45; }
.kf-reply { margin-left: 2.9em; padding: .7em .8em; border-radius: .8em; background: var(--kf-brand-tint); }
.kf-reply small { display: block; font-size: .72em; font-weight: 700; color: var(--kf-brand-ink); margin-bottom: .2em; }
.kf-reply p { margin: 0; font-size: .84em; line-height: 1.45; }
.kf-work { display: flex; align-items: center; gap: .5em; margin-left: 2.9em; font-size: .78em; color: var(--kf-muted); }
.kf-work i { width: .38em; height: .38em; border-radius: 50%; background: var(--kf-brand); display: inline-block; }

.kf-stamp {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: .45em;
    padding: .45em .8em;
    border-radius: 999px;
    font-size: .8em;
    font-weight: 700;
}
.kf-stamp svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.kf-stamp--ok { background: var(--kf-ok-tint); color: var(--kf-ok); }
.kf-stamp--wait { background: var(--kf-warn-tint); color: var(--kf-warn-ink); }
.kf-stamp--indent { margin-left: 2.9em; }

.kf-post { border: 1px solid var(--kf-line); border-radius: .9em; overflow: hidden; }
.kf-post-photo { position: relative; height: 10.5em; overflow: hidden; background: #ececf4; }
.kf-post-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform-origin: 60% 55%; }
.kf-post-body { padding: .75em .85em .85em; display: grid; gap: .5em; }
.kf-post-body small { font-size: .74em; color: var(--kf-soft); }
.kf-post-body p { margin: 0; font-size: .84em; line-height: 1.45; }
.kf-post-cta { justify-self: start; font-size: .76em; font-weight: 700; color: var(--kf-ok); border: 1px solid #b9cdf3; border-radius: 999px; padding: .35em .8em; }

.kf-notif {
    position: absolute;
    left: .6em;
    right: .6em;
    top: .55em;
    z-index: 3;
    display: grid;
    grid-template-columns: 2.1em minmax(0, 1fr);
    gap: .6em;
    padding: .7em .75em;
    border-radius: 1.1em;
    background: rgba(250, 250, 255, .97);
    box-shadow: 0 14px 30px -14px rgba(22, 22, 58, .45), 0 0 0 1px rgba(22, 22, 58, .06);
    opacity: 0;
    transform: translateY(-120%);
}
.kf-notif-icon { width: 2.1em; height: 2.1em; border-radius: .55em; background: var(--kf-brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .9em; }
.kf-notif small { display: flex; justify-content: space-between; font-size: .7em; color: var(--kf-soft); font-weight: 600; }
.kf-notif b { display: block; font-size: .8em; line-height: 1.35; }

.kf-mail { border: 1px solid var(--kf-line); border-radius: .9em; overflow: hidden; }
.kf-mail-head { padding: .6em .85em; background: #f6f6fc; border-bottom: 1px solid var(--kf-line); font-size: .74em; color: var(--kf-muted); }
.kf-mail-head b { display: block; color: var(--kf-ink); font-size: 1.12em; margin-top: .15em; }
.kf-mail-body { padding: .65em .85em .8em; display: grid; gap: .4em; font-size: .8em; line-height: 1.45; }
.kf-mail-body h4 { margin: .2em 0 0; font-size: .92em; color: var(--kf-ok); }
.kf-mail-body p { margin: 0; }
.kf-mail-line { display: grid; grid-template-columns: 6.6em minmax(0, 1fr); gap: .5em; }
.kf-mail-line b { font-variant-numeric: tabular-nums; }
.kf-mail-line span { color: var(--kf-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Texte qui s'écrit : la suite occupe déjà sa place, invisible */
.kf-rest { color: transparent; }
.kf-typing .kf-typed::after { content: ''; display: inline-block; width: 2px; height: 1em; margin: 0 1px -.15em; background: var(--kf-brand); }

/* ─── Barre de lecture ─── */
.kf-bar { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.kf-play {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 0;
    display: grid;
    place-items: center;
    background: var(--kf-ink);
    color: #fff;
    cursor: pointer;
}
.kf-play:hover { background: var(--kf-brand-ink); }
.kf-play:focus-visible { outline: 3px solid rgba(70, 72, 212, .45); outline-offset: 3px; }
.kf-play svg { width: 18px; height: 18px; fill: currentColor; }
.kf-play .kf-i-pause { display: none; }
.kf.is-playing .kf-play .kf-i-pause { display: block; }
.kf.is-playing .kf-play .kf-i-play { display: none; }
.kf-chapters { flex: 1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; list-style: none; margin: 0; padding: 0; }
.kf-chapters button {
    position: relative;
    width: 100%;
    display: grid;
    gap: 6px;
    padding: 6px 0 4px;
    border: 0;
    background: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
    color: var(--kf-soft);
}
.kf-chapters button:focus-visible { outline: 2px solid var(--kf-brand); outline-offset: 2px; border-radius: 6px; }
.kf-chapters .kf-track { display: block; height: 4px; border-radius: 4px; background: #dcdeee; overflow: hidden; }
.kf-chapters .kf-track i { display: block; height: 100%; width: 100%; background: var(--kf-brand); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
.kf-chapters .kf-ch-label { font-size: .78rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kf-chapters button[aria-current="true"] { color: var(--kf-brand-ink); }

.kf-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: clamp(22px, 3vw, 32px); }
.kf-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 24px;
    border-radius: 14px;
    background: var(--kf-brand);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    box-shadow: 0 12px 24px -12px rgba(70, 72, 212, .6);
    transition: transform .2s cubic-bezier(.16, 1, .3, 1), background-color .2s;
}
.kf-cta-btn:hover { background: var(--kf-brand-ink); transform: translateY(-1px); color: #fff; }
.kf-cta-btn:focus-visible { outline: 3px solid rgba(70, 72, 212, .45); outline-offset: 3px; }
.kf-cta-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.kf-cta-sub { font-size: .9rem; color: var(--kf-muted); }
.kf-note { margin: 10px 0 0; font-size: .82rem; color: var(--kf-soft); }

.kf-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ─── Format vertical (téléphone) : le script lit la largeur de la scène pour choisir sa ligne de temps ─── */
@media (max-width: 640px) {
    .kf-frame { aspect-ratio: 720 / 1180; border-radius: 20px; }
    .kf-scene { width: 720px; height: 1180px; }
    .kf-caps { left: 52px; top: 52px; width: 616px; height: 330px; }
    .kf-cap h3 { font-size: 48px; margin: 20px 0 14px; }
    .kf-cap--intro h3 { font-size: 54px; }
    .kf-cap--end h3 { font-size: 56px; }
    .kf-cap p { font-size: 25px; max-width: 600px; }
    .kf-chip { font-size: 22px; padding: 11px 18px; }
    .kf-ruler { left: 52px; top: 392px; width: 616px; }
    .kf-tick span { font-size: 17px; }
    .kf-phone { left: 92px; top: 470px; font-size: 22px; }
    /* Le bas du téléphone sort du cadre : ce qui ne tiendrait pas est retiré, pas rogné */
    .kf-hide-haut, .kf-post-body small { display: none; }
    .kf-post-photo { height: 8em; }
}

@media (max-width: 640px) {
    .kf-chapters .kf-ch-label { display: none; }
    .kf-chapters { gap: 4px; }
    .kf-cta-btn { width: 100%; justify-content: center; }
}
