/* French Karé – Habillage : la page « Notre histoire » (gabarits/histoire.php). Chargée après fk.css, sur cette page seulement.
   Idée : le récit est un carnet. Chaque date est une entrée ; la photo (ou le film de la leçon) reste en face du texte
   pendant qu'on lit l'entrée, comme une page de gauche collée en face de la page écrite. La barre des dates suit la lecture.

   « :not(#fk-h) » ne vise rien (aucun élément ne porte cet identifiant) : il donne à chaque règle le poids d'un identifiant,
   pour passer devant les règles générales des pages intérieures de fk.css et celles du thème (titres, paragraphes, images). */

/* ===== Le thème rend la largeur ; son bandeau de titre s'efface (le gabarit porte son propre h1) ===== */
body.fk-on.fk-page-histoire .page-entry-header{display:none !important}
body.fk-on.fk-page-histoire.page #content > .container,
body.fk-on.fk-page-histoire.page #content > article > .container,
body.fk-on.fk-page-histoire.page #content #primary,
body.fk-on.fk-page-histoire.page #content #main,
body.fk-on.fk-page-histoire.page #content #main > article,
body.fk-on.fk-page-histoire.page #content .entry-content{width:100%;max-width:none;margin:0;padding:0;float:none}
body.fk-on.fk-page-histoire.page #content.site-content{padding-top:0;padding-bottom:0}

/* ===== Jetons de la page ===== */
body.fk-on .fk-p-histoire:not(#fk-h){
  --fk-h-haut:var(--fk-entete-h);
  --fk-h-fil-h:52px;
  --fk-h-vue:calc(100svh - var(--fk-h-haut) - var(--fk-h-fil-h));
  --fk-h-xl:clamp(60px,7.4vw,128px);
  --fk-h-l:clamp(40px,4.6vw,78px);
  --fk-h-pad:clamp(32px,5.6vw,96px);
  position:relative;
  max-width:none;margin:0;padding:0;
  font-family:var(--fk-texte);font-size:var(--t-corps);line-height:1.65;color:var(--fk-encre);background:var(--fk-papier);
  timeline-scope:--fk-h-a,--fk-h-b,--fk-h-c,--fk-h-d;
}
body.fk-on.fk-page-histoire.admin-bar .fk-p-histoire{--fk-h-haut:calc(var(--fk-entete-h) + 32px)}
body.fk-on .fk-p-histoire:not(#fk-h) *{box-sizing:border-box}
body.fk-on .fk-p-histoire:not(#fk-h) :is(h1,h2,p,figure,figcaption){margin:0;padding:0;list-style:none;letter-spacing:0;text-shadow:none;text-align:left;color:inherit}
body.fk-on .fk-p-histoire:not(#fk-h) :is(h1,h2){font-family:var(--fk-titre);font-weight:400;text-transform:uppercase;line-height:.92;letter-spacing:-.005em}
body.fk-on .fk-p-histoire:not(#fk-h) p{font-size:var(--t-corps);line-height:1.65;max-width:36em}
body.fk-on .fk-p-histoire:not(#fk-h) img{display:block;max-width:100%;height:auto;border-radius:0}
body.fk-on .fk-p-histoire:not(#fk-h) figcaption{font-size:var(--t-petit);line-height:1.4;color:var(--fk-doux)}
body.fk-on .fk-p-histoire:not(#fk-h) :focus-visible{outline:3px solid currentColor;outline-offset:3px;border-radius:4px}

/* ===== La barre des dates : les quatre entrées du carnet, celle qu'on lit en jaune ===== */
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-fil{
  position:sticky;top:var(--fk-h-haut);z-index:30;
  display:flex;height:var(--fk-h-fil-h);padding:0 var(--fk-marge) 0 calc(var(--fk-marge) - 16px);background:var(--fk-encre);color:#fff;
}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-fil a{
  display:flex;align-items:center;gap:10px;height:100%;padding:0 16px;
  color:#fff;font:400 var(--t-corps)/1 var(--fk-texte);text-decoration:none;white-space:nowrap;
  transition:background-color .25s,color .25s;
}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-fil__an{font-weight:600;font-variant-numeric:tabular-nums}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-fil a:hover .fk-h-fil__nom{text-decoration:underline 2px;text-underline-offset:5px}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-fil a:focus-visible{outline-offset:-4px}

/* Chaque chapitre donne son nom à une ligne de temps ; le lien de la barre s'allume tant que le chapitre passe au milieu de l'écran. */
body.fk-on .fk-p-histoire:not(#fk-h) #fk-h-2019{view-timeline-name:--fk-h-a}
body.fk-on .fk-p-histoire:not(#fk-h) #fk-h-2024{view-timeline-name:--fk-h-b}
body.fk-on .fk-p-histoire:not(#fk-h) #fk-h-2025{view-timeline-name:--fk-h-c}
body.fk-on .fk-p-histoire:not(#fk-h) #fk-h-2026{view-timeline-name:--fk-h-d}
@keyframes fk-h-actif{from,to{background-color:var(--fk-jaune);color:var(--fk-encre)}}
@supports (animation-timeline:view()){
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-fil a{
    animation-name:fk-h-actif;animation-timing-function:linear;animation-fill-mode:none;
    animation-range:cover 50vh cover calc(100% - 50vh);
  }
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-fil a:nth-child(1){animation-timeline:--fk-h-a}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-fil a:nth-child(2){animation-timeline:--fk-h-b}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-fil a:nth-child(3){animation-timeline:--fk-h-c}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-fil a:nth-child(4){animation-timeline:--fk-h-d}
}

/* ===== Un chapitre : la scène d'un côté, l'entrée du carnet de l'autre ===== */
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-chapitre{
  display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start;
  scroll-margin-top:calc(var(--fk-h-fil-h) - 16px);
}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-scene{
  position:sticky;top:calc(var(--fk-h-haut) + var(--fk-h-fil-h));
  display:flex;flex-direction:column;height:var(--fk-h-vue);min-height:520px;overflow:hidden;
}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-scene img{flex:1 1 0;min-height:0;width:100%;height:100%;max-width:none;object-fit:cover}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-scene figcaption{flex:none;padding:12px var(--fk-marge) 14px}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-texte{padding:var(--fk-h-pad) var(--fk-marge) clamp(96px,11vw,176px) var(--fk-h-pad)}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-texte p + p{margin-top:1.1em}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-titre{margin-bottom:clamp(28px,3vw,44px)}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-date{display:block;font-size:var(--fk-h-l);line-height:.92;white-space:nowrap}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-lieu{display:block;margin-top:.3em;font-size:var(--t-sous);line-height:1}

/* 2019 : la photo de l'assiette à gauche ; le titre de la page, puis la première entrée. */
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-tokyo .fk-h-scene img{object-position:50% 58%}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-grand{font-size:var(--fk-h-xl);line-height:.88;margin-left:-.03em}
body.fk-on .fk-p-histoire:not(#fk-h) p.fk-h-chapeau{margin-top:clamp(24px,2.4vw,36px);max-width:22em;font-size:var(--t-sous);line-height:1.22;font-weight:500}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-tokyo .fk-h-titre{margin-top:clamp(120px,15vw,240px)}

/* 2024 : le champ jaune, le film de la leçon à droite, debout comme il a été filmé. */
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-jinsuke{background:var(--fk-jaune)}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-jinsuke .fk-h-texte{padding-left:var(--fk-marge);padding-right:var(--fk-h-pad)}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-film{display:grid;align-content:center;justify-content:center;padding:clamp(24px,3vw,44px) var(--fk-marge)}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-film video{
  display:block;height:calc(var(--fk-h-vue) - 2 * clamp(24px,3vw,44px) - 44px);min-height:400px;width:auto;max-width:100%;aspect-ratio:9/16;
  object-fit:cover;background:var(--fk-encre);
}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-film figcaption{width:0;min-width:100%;padding:12px 0 0;color:var(--fk-encre)}

/* 2025 : la photo à gauche, puis la phrase qui ferme le chapitre, sur toute la largeur. */
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-chartres .fk-h-scene img{object-position:50% 30%}
body.fk-on .fk-p-histoire:not(#fk-h) p.fk-h-ne{
  grid-column:1 / -1;max-width:none;padding:clamp(72px,9vw,150px) var(--fk-marge);background:var(--fk-jaune);
  font:400 calc(var(--fk-dispo) * .098)/.88 var(--fk-titre);text-transform:uppercase;letter-spacing:-.01em;white-space:nowrap;
}
body.fk-on .fk-p-histoire:not(#fk-h) :is(p.fk-h-ne,p.fk-h-devise) span{display:block;transform-origin:left center}

/* 2026 : le texte, puis l'enseigne sous le texte ; Giovanni et Thibaud devant la vitrine, en grand, en face. */
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-paris .fk-h-texte{grid-column:1;grid-row:1;padding-left:var(--fk-marge);padding-right:var(--fk-h-pad);padding-bottom:0}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-photos{display:contents}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-photos figcaption{margin-top:10px}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-photos__chefs{grid-column:2;grid-row:1 / span 2;padding:var(--fk-h-pad) var(--fk-marge) 0 0}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-photos__chefs img{width:100%;aspect-ratio:4/5;object-fit:cover;object-position:50% 62%}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-photos__enseigne{grid-column:1;grid-row:2;align-self:end;width:min(52%,380px);margin:clamp(48px,5vw,80px) 0 0 var(--fk-marge)}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-photos__enseigne img{width:100%;aspect-ratio:1/1;object-fit:cover}

/* La fin de la lettre : la salle un soir de service, la devise, la signature. */
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-fin{
  grid-column:1 / -1;grid-row:3;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  margin-top:clamp(96px,11vw,176px);background:var(--fk-encre);color:#fff;
}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-fin__salle{position:relative;overflow:hidden;display:flex;flex-direction:column;min-height:min(86svh,820px)}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-fin__salle img{flex:1 1 0;min-height:0;width:100%;height:100%;max-width:none;object-fit:cover;object-position:40% 50%}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-fin__salle figcaption{position:relative;z-index:1;flex:none;padding:12px var(--fk-marge) 14px;background:var(--fk-encre);color:#d9d4cb}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-fin__mot{display:flex;flex-direction:column;justify-content:center;padding:var(--fk-h-pad) var(--fk-marge) var(--fk-h-pad) var(--fk-h-pad)}
body.fk-on .fk-p-histoire:not(#fk-h) p.fk-h-devise{max-width:none;color:var(--fk-jaune);font:400 var(--fk-h-xl)/.88 var(--fk-titre);text-transform:uppercase;letter-spacing:-.01em}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-fin__mot p:not(.fk-h-devise):not(.fk-h-signature){margin-top:clamp(28px,3vw,44px);max-width:20em;font-size:var(--t-sous);line-height:1.22;font-weight:500}
body.fk-on .fk-p-histoire:not(#fk-h) p.fk-h-signature{margin-top:clamp(28px,3vw,40px);font-size:var(--t-corps);line-height:1.45}
body.fk-on .fk-p-histoire:not(#fk-h) p.fk-h-signature strong{display:block;font-weight:600}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-actions{display:flex;flex-wrap:wrap;align-items:center;gap:14px 26px;margin-top:clamp(32px,3.4vw,48px)}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-actions .fk-bouton{color:var(--fk-encre)}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-actions .fk-bouton:hover{background:#fff;color:var(--fk-encre)}
body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-actions .fk-lien{color:#fff;font-size:var(--t-corps)}

/* ===== Téléphone et tablette : la scène en tête de chaque chapitre, puis l'entrée ===== */
@media (max-width:900px){
  body.fk-on .fk-p-histoire:not(#fk-h){--fk-h-fil-h:46px;--fk-h-xl:calc(var(--fk-dispo) * .2);--fk-h-l:clamp(36px,10vw,64px)}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-fil{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));padding:0}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-fil a{justify-content:center;width:100%;padding:0 6px}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-fil__nom{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-chapitre{grid-template-columns:minmax(0,1fr)}
  /* Ordre de lecture : le titre du chapitre, sa photo, puis le texte (et, en tête de page, le titre de la page avant la photo). */
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-texte{display:contents}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-texte > *{margin-left:var(--fk-marge);margin-right:var(--fk-marge)}
  body.fk-on .fk-p-histoire:not(#fk-h) :is(.fk-h-grand,p.fk-h-chapeau){order:1}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-titre{order:2;margin-top:44px;margin-bottom:0}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-scene{order:3;position:static;height:auto;min-height:0;margin-top:24px}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-texte > p:not(.fk-h-chapeau){order:4}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-titre + p{margin-top:28px}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-texte > p:last-child{margin-bottom:72px}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-photos figure{order:5}
  body.fk-on .fk-p-histoire:not(#fk-h) p.fk-h-ne{order:6}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-fin{order:7}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-grand{margin-top:36px}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-tokyo .fk-h-scene{order:2;margin-top:32px}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-tokyo .fk-h-titre{order:3;margin-top:80px}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-scene img{flex:none;height:auto;aspect-ratio:1/1}
  body.fk-on .fk-p-histoire:not(#fk-h) p.fk-h-chapeau{font-size:24px}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-lieu{font-size:26px}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-film{justify-content:start;padding:0 var(--fk-marge)}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-film video{height:auto;min-height:0;width:min(66vw,320px)}
  body.fk-on .fk-p-histoire:not(#fk-h) p.fk-h-ne{padding:64px var(--fk-marge);font-size:calc(var(--fk-dispo) * .19);line-height:.98;white-space:normal}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-photos__chefs{grid-column:1;grid-row:auto;width:min(100%,620px);padding:0 var(--fk-marge)}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-photos__enseigne{grid-column:1;grid-row:auto;align-self:start;justify-self:end;width:62%;margin:28px var(--fk-marge) 0 0}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-fin{grid-row:auto;grid-template-columns:minmax(0,1fr);margin-top:104px}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-tokyo .fk-h-scene img{aspect-ratio:5/4}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-fin__salle{order:2;min-height:0}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-fin__salle img{flex:none;height:auto;aspect-ratio:4/3}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-fin__mot{padding:48px var(--fk-marge) 64px}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-fin__mot p:not(.fk-h-devise):not(.fk-h-signature){font-size:24px}
}

/* ===== Mouvement : la photo d'ouverture se pose, les deux phrases du récit prennent leur taille en arrivant ===== */
@media (prefers-reduced-motion:no-preference){
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-tokyo .fk-h-scene img{animation:fk-h-pose 14s var(--fk-ease) both}
  @keyframes fk-h-pose{from{transform:scale(1.07)}to{transform:scale(1)}}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-film video{transition:transform .6s var(--fk-ease)}
  body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-film:hover video{transform:scale(1.015)}
  @supports (animation-timeline:view()){
    body.fk-on .fk-p-histoire:not(#fk-h) :is(p.fk-h-ne,p.fk-h-devise) span{animation:fk-h-taille linear both;animation-timeline:view();animation-range:entry 0% cover 45%}
    @keyframes fk-h-taille{from{transform:scale(.92)}to{transform:scale(1)}}
    body.fk-on .fk-p-histoire:not(#fk-h) .fk-h-fin__salle img{animation:fk-h-glisse linear both;animation-timeline:view();animation-range:cover 0% cover 100%}
    @keyframes fk-h-glisse{from{transform:scale(1.08) translateY(-2%)}to{transform:scale(1.08) translateY(2%)}}
  }
}
