/*
 * About › History (/about/history/): prologue ledger, export journey map,
 * chronicle by year. Navy ground, gold hairlines, brand red for actions.
 * Logical properties only; RTL (ar, he) mirrors through inline/start/end.
 */

/* ---------- Prologue ---------- */
.hx-prologue-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 80px); align-items: center; }
.hx-big-year { font-family: var(--f-display); font-weight: 600; font-size: clamp(120px, 17vw, 260px); line-height: .78; color: transparent; -webkit-text-stroke: 1.5px var(--gold); letter-spacing: -.02em; font-variant-numeric: tabular-nums; user-select: none; }
.hx-prologue-copy { display: grid; gap: var(--flow-gap-tight, 12px); }
.hx-prologue-copy .about-text { margin: 0; }
.hx-ledger { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: var(--space-4, 20px) 0 0; border-block-start: 1px solid rgba(212, 161, 46, .45); }
.hx-ledger > div { display: flex; flex-direction: column; justify-content: space-between; padding-block: 18px 4px; padding-inline-end: 12px; }
.hx-ledger > div + div { border-inline-start: 1px solid rgba(10, 26, 48, .1); padding-inline-start: 16px; }
.hx-ledger dt { font-size: 12px; letter-spacing: var(--tracking-label, .08em); text-transform: uppercase; color: #5b6b80; line-height: 1.35; }
.hx-ledger dd { margin: 6px 0 0; font-family: var(--f-display); font-size: clamp(30px, 3.2vw, 44px); font-weight: 600; line-height: 1; color: var(--navy-900); font-variant-numeric: tabular-nums; }

/* ---------- Shared section head ---------- */
.hx-head { display: grid; gap: 10px; max-inline-size: 760px; }
.hx-head .display { margin: 0; font-size: var(--fs-h2, 40px); }
.hx-head p { margin: 0; color: var(--mist); line-height: 1.65; }

/* ---------- Journey ---------- */
.hx-journey { position: relative; padding-block: clamp(56px, 8vw, 104px); background: radial-gradient(120% 80% at 80% 0%, #12294a 0%, var(--navy-950) 62%); color: var(--white); overflow: hidden; }
.hx-journey::before { content: ""; position: absolute; inset-inline: 0; inset-block-start: 0; block-size: 1px; background: linear-gradient(90deg, transparent, rgba(212, 161, 46, .7), transparent); }
.hx-journey .stack { gap: clamp(20px, 3vw, 32px); }

.hx-years { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-block-end: 2px; scroll-snap-type: x proximity; }
.hx-years::-webkit-scrollbar { display: none; }
.hx-chip { flex: 0 0 auto; scroll-snap-align: start; white-space: nowrap; border: 1px solid rgba(212, 161, 46, .45); background: transparent; color: var(--mist); font: 600 15px/1 var(--f-display); letter-spacing: .06em; padding: 10px 16px; border-radius: 999px; cursor: pointer; transition: background-color .2s, color .2s, border-color .2s; font-variant-numeric: tabular-nums; }
.hx-chip:hover { color: var(--white); border-color: var(--gold); }
.hx-chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--navy-950); }
.hx-chip:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }

.hx-map { margin: 0; position: relative; border: 1px solid rgba(212, 161, 46, .22); border-radius: 4px; background: linear-gradient(180deg, rgba(16, 36, 63, .55), rgba(6, 17, 31, .2)); padding: clamp(8px, 2vw, 20px); }
.hx-map svg { display: block; inline-size: 100%; block-size: auto; }
.hx-land { fill: #1d3a5e; opacity: .85; }
.hx-arc { fill: none; stroke: var(--gold); stroke-width: 1.15; stroke-linecap: round; opacity: .9; stroke-dasharray: 1; stroke-dashoffset: 0; transition: opacity .3s, stroke-width .3s; }
.hx-dest .hx-dot { fill: var(--gold); stroke: var(--navy-950); stroke-width: 1; }
.hx-dest .hx-ring { fill: rgba(212, 161, 46, .06); stroke: var(--gold); stroke-width: .9; stroke-dasharray: 3 3; }
.hx-label { font-family: var(--f-display); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; fill: var(--white); paint-order: stroke; stroke: var(--navy-950); stroke-width: 3px; stroke-linejoin: round; }
.hx-dest { transition: opacity .3s; }
.hx-origin { fill: var(--red); stroke: var(--white); stroke-width: 1.5; }
.hx-origin-glow { animation: hx-pulse 2.8s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes hx-pulse { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }

/* One year chosen: other years step back. */
.hx-map[data-year]:not([data-year=""]) .hx-arc,
.hx-map[data-year]:not([data-year=""]) .hx-dest { opacity: .12; }
.hx-map[data-year]:not([data-year=""]) .hx-arc.is-on { opacity: 1; stroke-width: 1.8; }
.hx-map[data-year]:not([data-year=""]) .hx-dest.is-on { opacity: 1; }

/* Play the journey year by year once (history.js adds .is-ready, then .is-playing). */
.hx-map.is-ready .hx-arc { stroke-dashoffset: 1; }
.hx-map.is-ready .hx-dest { opacity: 0; }
.hx-map.is-playing .hx-arc { stroke-dashoffset: 0; transition: stroke-dashoffset 1.1s cubic-bezier(.6, 0, .2, 1) calc(var(--i, 0) * .45s), opacity .3s, stroke-width .3s; }
.hx-map.is-playing .hx-dest { opacity: 1; transition: opacity .5s ease calc(var(--i, 0) * .45s + .9s); }
@media (prefers-reduced-motion: reduce) {
  .hx-origin-glow { animation: none; }
  .hx-map.is-ready .hx-arc { stroke-dashoffset: 0; }
  .hx-map.is-ready .hx-dest { opacity: 1; }
}

.hx-map figcaption { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; margin-block-start: 12px; font-size: 13px; color: var(--mist-2); }
.hx-legend { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.hx-legend-origin { inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--white); }
.hx-legend-line { inline-size: 26px; block-size: 0; border-block-start: 1.5px solid var(--gold); }
.hx-note { margin-inline-start: auto; font-style: italic; }

.hx-dest-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 28px; }
.hx-dest-list li { display: grid; align-content: start; align-items: start; grid-template-columns: 58px minmax(0, 1fr); gap: 12px; padding-block: 14px; border-block-start: 1px solid rgba(212, 161, 46, .2); transition: opacity .3s; }
.hx-dest-list.is-filtered li:not(.is-on) { opacity: .35; }
.hx-dest-year { font-family: var(--f-display); font-size: 22px; font-weight: 600; line-height: 1.1; color: var(--gold); font-variant-numeric: tabular-nums; }
.hx-dest-places { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; align-content: flex-start; padding-block-start: 3px; }
.hx-dest-places a { display: inline-flex; align-items: center; gap: 8px; color: var(--white); text-decoration: none; font-size: 15px; line-height: 1.3; }
.hx-dest-places a:hover { color: var(--gold); }
.hx-flag { inline-size: auto; block-size: 15px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .18); flex: 0 0 auto; }
.hx-globe { inline-size: 15px; block-size: 15px; border-radius: 50%; border: 1.5px dashed var(--gold); flex: 0 0 auto; }

/* ---------- Chronicle ---------- */
.hx-chronicle { position: relative; padding-block: clamp(56px, 8vw, 112px); background: var(--navy-900); color: var(--white); }
.hx-chronicle > .wrap > .hx-head { margin-block-end: clamp(28px, 4vw, 48px); }
.hx-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(28px, 4vw, 48px); }

/* Year rail: one horizontal row pinned under the header, years on a gold line. */
.hx-rail { position: sticky; inset-block-start: var(--header-h, 76px); z-index: 5; margin-inline: calc(var(--gutter, 16px) * -1); padding: 12px var(--gutter, 16px); background: rgba(10, 26, 48, .94); backdrop-filter: blur(6px); border-block: 1px solid rgba(212, 161, 46, .25); }
.hx-rail ol { list-style: none; margin: 0; padding: 0; position: relative; display: flex; justify-content: space-between; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.hx-rail ol::-webkit-scrollbar { display: none; }
.hx-rail ol::before { content: ""; position: absolute; inset-inline: 0; inset-block-start: 50%; block-size: 1px; background: linear-gradient(90deg, transparent, rgba(212, 161, 46, .45) 6%, rgba(212, 161, 46, .45) 94%, transparent); pointer-events: none; }
.hx-rail li { position: relative; flex: 0 0 auto; }
.hx-rail a { display: inline-flex; align-items: center; padding: 8px 16px; background: var(--navy-900); border: 1px solid rgba(212, 161, 46, .35); border-radius: 999px; color: var(--mist); text-decoration: none; font: 600 17px/1 var(--f-display); letter-spacing: .06em; font-variant-numeric: tabular-nums; white-space: nowrap; transition: color .2s, background-color .2s, border-color .2s; }
.hx-rail a:hover { color: var(--white); border-color: var(--gold); }
.hx-rail a[aria-current="true"] { background: var(--gold); border-color: var(--gold); color: var(--navy-950); }
.hx-rail a:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }

.hx-chapters { display: grid; gap: clamp(48px, 7vw, 96px); }
.hx-year { scroll-margin-block-start: calc(var(--header-h, 76px) + 84px); }
.hx-year-num { margin: 0 0 clamp(16px, 2.4vw, 28px); font-family: var(--f-display); font-weight: 600; font-size: clamp(76px, 10vw, 150px); line-height: .8; color: transparent; -webkit-text-stroke: 1px var(--gold); letter-spacing: -.01em; font-variant-numeric: tabular-nums; display: flex; align-items: end; gap: 20px; }
.hx-year-num::after { content: ""; flex: 1 1 auto; block-size: 1px; margin-block-end: .12em; background: linear-gradient(90deg, rgba(212, 161, 46, .55), transparent); }
[dir="rtl"] .hx-year-num::after { background: linear-gradient(270deg, rgba(212, 161, 46, .55), transparent); }

.hx-items { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(18px, 2.4vw, 28px); }
.hx-item { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 0; background: linear-gradient(180deg, var(--navy-800), rgba(16, 36, 63, .55)); border: 1px solid rgba(212, 161, 46, .18); border-radius: 4px; overflow: hidden; transition: border-color .25s, transform .25s; }
.hx-item:hover { border-color: rgba(212, 161, 46, .55); }
.hx-item:nth-child(even) { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
.hx-item:nth-child(even) .hx-media { order: 2; }

.hx-media { position: relative; min-block-size: 240px; background: var(--navy-950); overflow: hidden; }
.hx-photo { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; transition: transform .8s ease; }
.hx-item:hover .hx-photo { transform: scale(1.04); }
.hx-plate { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; background: radial-gradient(80% 90% at 50% 45%, #13305a, var(--navy-950)); }
.hx-plate-land { fill: #1f3d63; }
.hx-plate-country { fill: rgba(212, 161, 46, .9); stroke: #f4d48a; stroke-width: .25; }
.hx-plate-dot { fill: var(--red); stroke: var(--white); stroke-width: .4; }
.hx-plate-pulse { fill: none; stroke: var(--gold); stroke-width: .5; animation: hx-pulse 2.6s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.hx-plate-ring { fill: rgba(212, 161, 46, .1); stroke: var(--gold); stroke-width: .6; stroke-dasharray: 2 2; }
.hx-plate-tag { position: absolute; inset-block-end: 14px; inset-inline-start: 14px; display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px; background: rgba(6, 17, 31, .78); border: 1px solid rgba(212, 161, 46, .35); border-radius: 2px; font: 600 15px/1 var(--f-display); letter-spacing: .06em; text-transform: var(--tt-card-title, uppercase); color: var(--white); backdrop-filter: blur(4px); white-space: nowrap; }
.hx-plate-tag .hx-flag { block-size: 18px; }
.hx-mark { position: absolute; inset: 0; display: grid; place-items: center; font: 600 clamp(64px, 8vw, 110px)/1 var(--f-display); color: transparent; -webkit-text-stroke: 1px rgba(212, 161, 46, .5); background: radial-gradient(70% 70% at 50% 50%, #13305a, var(--navy-950)); }
@media (prefers-reduced-motion: reduce) { .hx-plate-pulse { animation: none; } .hx-item:hover .hx-photo { transform: none; } }

.hx-certs { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; padding: 24px; background: radial-gradient(80% 80% at 50% 40%, #f4efe4, #d9d1c1); }
.hx-cert { display: block; inline-size: 44%; max-inline-size: 190px; box-shadow: 0 18px 36px rgba(6, 17, 31, .35); background: var(--white); transition: transform .35s ease; }
.hx-cert:first-child { transform: rotate(-4deg) translateX(10%); }
.hx-cert:last-child { transform: rotate(4deg) translateX(-10%); }
[dir="rtl"] .hx-cert:first-child { transform: rotate(4deg) translateX(-10%); }
[dir="rtl"] .hx-cert:last-child { transform: rotate(-4deg) translateX(10%); }
.hx-cert:only-child { inline-size: 56%; max-inline-size: 240px; transform: rotate(-2deg); }
.hx-cert:hover { transform: none; z-index: 1; }
.hx-cert img { display: block; inline-size: 100%; block-size: auto; }

.hx-body { display: grid; align-content: center; gap: 12px; padding: clamp(22px, 3vw, 36px); }
.hx-kind { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; letter-spacing: var(--tracking-label, .12em); text-transform: uppercase; color: var(--gold); }
.hx-kind::before { content: ""; inline-size: 22px; block-size: 1px; background: currentColor; }
.hx-kind i { inline-size: 4px; block-size: 4px; border-radius: 50%; background: var(--mist-2); }
.hx-kind bdi { color: var(--mist); }
.kind-certification .hx-kind { color: #e9c56f; }
.hx-body h4 { margin: 0; font-family: var(--f-card-title, var(--f-display)); font-size: clamp(22px, 2.2vw, 28px); font-weight: 600; letter-spacing: .02em; text-transform: var(--tt-card-title, uppercase); line-height: 1.08; color: var(--white); }
.hx-body p { margin: 0; color: var(--mist); line-height: 1.65; }

.hx-places, .hx-cert-chips { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hx-places a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid rgba(212, 161, 46, .35); border-radius: 999px; color: var(--white); text-decoration: none; font-size: 14px; white-space: nowrap; transition: border-color .2s, background-color .2s; }
.hx-places a:hover { border-color: var(--gold); background: rgba(212, 161, 46, .1); }
.hx-cert-chips li { padding: 7px 12px; border: 1px solid rgba(212, 161, 46, .45); border-radius: 2px; font-size: 13px; color: var(--mist); white-space: nowrap; }
.hx-cert-chips b { color: var(--white); font-weight: 600; }

.hx-link { justify-self: start; display: inline-flex; align-items: center; gap: 10px; margin-block-start: 4px; color: var(--white); text-decoration: none; font: 600 15px/1 var(--f-display); letter-spacing: .08em; text-transform: var(--tt-card-title, uppercase); padding-block: 8px; border-block-end: 1px solid var(--red); white-space: nowrap; transition: color .2s, gap .2s; }
.hx-link:hover { color: var(--gold); gap: 14px; }
.hx-arrow { inline-size: 16px; block-size: 1px; background: currentColor; position: relative; }
.hx-arrow::after { content: ""; position: absolute; inset-inline-end: 0; inset-block-start: -3px; inline-size: 7px; block-size: 7px; border-block-start: 1px solid currentColor; border-inline-end: 1px solid currentColor; transform: rotate(45deg); }
[dir="rtl"] .hx-arrow::after { transform: rotate(-45deg); }

.hx-motto { margin: 0; font-family: var(--f-display); font-size: clamp(22px, 2.6vw, 32px); font-weight: 500; letter-spacing: .04em; color: var(--gold); text-transform: var(--tt-card-title, uppercase); }

/* ---------- Tablet / phone ---------- */
@media (max-width: 1023px) {
  .hx-ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hx-ledger > div:nth-child(3) { border-inline-start: 0; padding-inline-start: 0; }
  .hx-rail a { font-size: 16px; padding: 8px 14px; }
}
@media (max-width: 899px) {
  .hx-prologue-grid { grid-template-columns: minmax(0, 1fr); }
  .hx-big-year { font-size: clamp(96px, 30vw, 150px); }
  .hx-item, .hx-item:nth-child(even) { grid-template-columns: minmax(0, 1fr); }
  .hx-item:nth-child(even) .hx-media { order: 0; }
  .hx-media { min-block-size: 0; aspect-ratio: 16 / 10; }
  .hx-note { margin-inline-start: 0; inline-size: 100%; }
  .hx-label { font-size: 15px; }
}
@media (max-width: 479px) {
  .hx-map { padding: 4px; margin-inline: calc(var(--gutter, 16px) * -1); border-inline: 0; border-radius: 0; }
  .hx-dest-list { grid-template-columns: minmax(0, 1fr); }
  .hx-ledger dd { font-size: 30px; }
}
