/* Page « Notre histoire » : cartes postales recto (photo) / verso (récit). */

.hi-hero { background: var(--yellow); border-bottom: 3px solid var(--ink); padding: clamp(40px, 7vw, 72px) clamp(20px, 5vw, 64px) clamp(32px, 5vw, 52px); }
.hi-hero-inner { max-width: 1240px; margin: 0 auto; }
.hi-eyebrow { font-family: var(--U); font-weight: 700; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.hi-title { font-family: var(--D); font-weight: 400; font-size: clamp(52px, 8vw, 112px); line-height: .9; margin-top: 8px; text-wrap: balance; }
.hi-intro { margin-top: 18px; max-width: 560px; font-size: 17px; line-height: 1.6; font-weight: 700; }

.hi-cartes { position: relative; overflow: hidden; background: #f3efe2; padding: clamp(36px, 6vw, 72px) clamp(16px, 5vw, 64px) clamp(48px, 7vw, 88px); }
.hi-cartes .flc-topo-fond { --topo-ligne: rgba(120,100,60,.16); --topo-ligne-m: rgba(120,100,60,.26); }
.hi-grid { position: relative; z-index: 1; list-style: none; margin: 0 auto; padding: 0; max-width: 1240px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: clamp(22px, 3vw, 34px); }
.hi-item { transform: rotate(var(--r, 0deg)); transition: transform .25s; }
.hi-item:hover { transform: rotate(0deg) translateY(-3px); }

/* Carte : sans JS, recto et verso l'un sous l'autre. */
.hi-pc { display: block; outline: none; }
.hi-flip { display: grid; gap: 10px; }
.hi-face { position: relative; border: 2.5px solid var(--ink); border-radius: 8px; box-shadow: 3px 3px 0 var(--ink); overflow: hidden; }
.hi-recto, .hi-verso { aspect-ratio: 4 / 3; }

.hi-js .hi-pc { cursor: pointer; perspective: 1000px; }
.hi-js .hi-flip { display: block; position: relative; aspect-ratio: 4 / 3; transition: transform .6s cubic-bezier(.3, 1.3, .5, 1); transform-style: preserve-3d; }
.hi-js .hi-face { position: absolute; inset: 0; aspect-ratio: auto; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.hi-js .hi-verso { transform: rotateY(180deg); }
.hi-js .hi-pc[aria-pressed="true"] .hi-flip { transform: rotateY(180deg); }
/* backface-visibility ne masque pas toujours les enfants positionnés (textes
   du recto vus en miroir à travers le verso) : on cache aussi la face tournée
   vers l'arrière, à mi-rotation. */
.hi-js .hi-face { transition: visibility 0s .12s; }
.hi-js .hi-verso, .hi-js .hi-pc[aria-pressed="true"] .hi-recto { visibility: hidden; }
.hi-js .hi-pc[aria-pressed="true"] .hi-verso { visibility: visible; }
.hi-pc:focus-visible .hi-face { outline: 3px solid var(--orange); outline-offset: 3px; }

/* Recto */
.hi-recto { background: var(--c); color: var(--fc, var(--ink)); padding: 14px 16px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.hi-c-blue   { --c: var(--blue); }
.hi-c-teal   { --c: var(--teal);   --fc: var(--cream); }
.hi-c-green  { --c: var(--green);  --fc: var(--cream); }
.hi-c-yellow { --c: var(--yellow); }
.hi-c-orange { --c: var(--orange); --fc: var(--cream); }
.hi-c-queens { --c: #B8406F;       --fc: var(--cream); }
.hi-c-ink    { --c: var(--ink);    --fc: var(--yellow); }
.hi-mt { position: absolute; right: -8px; bottom: -6px; width: 58%; opacity: .25; pointer-events: none; }
.hi-hello { position: relative; z-index: 1; align-self: flex-start; max-width: calc(100% - 40px); font-family: var(--U); font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.hi-bas { position: relative; z-index: 1; display: grid; gap: 4px; }
.hi-y { font-family: var(--D); font-size: clamp(42px, 5vw, 58px); line-height: .85; }
.hi-t { font-weight: 900; font-size: 16px; line-height: 1.25; }
.hi-tourner { position: absolute; z-index: 1; right: 12px; top: 10px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--cream); color: var(--ink); border: 2px solid var(--ink); font-weight: 900; font-size: 15px; }
html:not(.hi-js) .hi-tourner { display: none; }

/* Recto avec photo : la photo remplit la carte, les textes passent en clair. */
.hi-recto.has-photo { --fc: var(--cream); background: var(--ink); }
.hi-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hi-recto.has-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(28,43,26,.1) 0%, rgba(28,43,26,0) 38%, rgba(28,43,26,.78) 100%); }
.hi-recto.has-photo .hi-hello { z-index: 2; background: var(--cream); color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 10px; letter-spacing: .08em; }
.hi-recto.has-photo .hi-bas { z-index: 2; text-shadow: 0 2px 10px rgba(0,0,0,.45); }
.hi-recto.has-photo .hi-tourner { z-index: 2; }
.hi-recto.has-photo::before { content: ""; position: absolute; z-index: 2; left: 16px; bottom: 0; width: 64px; height: 6px; background: var(--c, var(--yellow)); border: 2px solid var(--ink); border-bottom: 0; border-radius: 4px 4px 0 0; }

/* Verso */
.hi-verso { background: #fffdf7; color: var(--ink); padding: 14px 16px; display: grid; grid-template-rows: 1fr auto; gap: 10px; }
.hi-timbre { width: 58px; height: 68px; border: 2px dashed var(--ink); background: var(--yellow); display: grid; place-items: center; text-align: center; font-family: var(--D); font-size: 15px; line-height: .95; transform: rotate(3deg); }
.hi-texte { overflow: auto; min-height: 0; }
.hi-texte p { font-family: var(--U); font-weight: 600; font-size: 14px; line-height: 1.5; margin: 0; }
/* Timbre flottant : le récit l'entoure puis reprend toute la largeur dessous. */
.hi-texte .hi-timbre { float: right; margin: 0 2px 6px 12px; }
.hi-texte.hi-long p { font-size: 12.5px; line-height: 1.42; }
.hi-tags { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.hi-tag { border: 2px solid var(--ink); border-radius: 999px; padding: 0 10px; font-size: 12px; font-weight: 900; line-height: 1.7; background: var(--cream); }
.hi-tag--gravel { background: var(--yellow); }
.hi-tag--vtt { background: var(--green); color: var(--cream); }
.hi-tag--route { background: var(--teal); color: var(--cream); }
.hi-tag--rouge { background: var(--orange); color: var(--cream); }
.hi-tag--bleu { background: var(--blue); }
.hi-tag--queens { background: #B8406F; color: var(--cream); }
.hi-adresse { display: grid; gap: 8px; }
.hi-adresse span { border-bottom: 1.5px solid #c9bfa8; font-size: 11.5px; font-weight: 800; color: #6a6350; }

.hi-cta { position: relative; z-index: 1; margin: clamp(32px, 5vw, 56px) 0 0; text-align: center; }
.hi-cta .nav-cta { display: inline-block; font-size: 16px; padding: 14px 32px; text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
	.hi-js .hi-flip, .hi-js .hi-face, .hi-item { transition: none; }
}
