/* =============================================================================
   Lilium Travel — editorial layer (North Guide + long-form magazine)
   Loaded only by /destinations/ and /mag/ shells, on top of base.css. Uses the
   base tokens (sand / gold / green / stone / ink, radii, spacing, motion) and
   existing components (.section-head, .panel, .faq, .dnav, .xgrid, cards);
   the classes below add only what long-form editorial pages need:
     .ed            reading grid: text column + wide + full-bleed breakouts
     .ehero         cinematic page hero with breadcrumb, eyebrow, H1, dek
     .ephoto        figure + caption + attribution (photo credit)
     .emap          inline SVG map with its text alternative
     .equick/.efacts/.einsight/.enote/.echeck  editorial blocks
     .etimeline / .echoose / .eplaces / .eregions  decision + route blocks
   Signature motif: a fine gold "journey line" (headings, timeline, routes).
   ============================================================================= */

:root {
  --ed-text: 44rem;      /* comfortable Persian reading measure (~70–80 chars) */
  --ed-wide: 68rem;      /* maps, photo pairs, tables, decision blocks */
  --ed-gutter: 1.25rem;
  --ed-gap: clamp(1.15rem, 2vw, 1.4rem);
  --ed-line: var(--gold-500);
}

/* ---------- reading grid ---------- */
.ed {
  display: grid;
  grid-template-columns:
    [full-start] minmax(var(--ed-gutter), 1fr)
    [wide-start] minmax(0, calc((var(--ed-wide) - var(--ed-text)) / 2))
    [text-start] min(var(--ed-text), calc(100% - 2 * var(--ed-gutter)))
    [text-end] minmax(0, calc((var(--ed-wide) - var(--ed-text)) / 2))
    [wide-end] minmax(var(--ed-gutter), 1fr) [full-end];
  padding-bottom: var(--space-section-sm);
}
.ed > * { grid-column: text; min-width: 0; }
.ed > .ed-wide { grid-column: wide; }
.ed > .ed-full { grid-column: full; }
.ed > * + * { margin-top: var(--ed-gap); }
.ed > .ed-wide, .ed > .ed-full, .ed > .equick, .ed > .emap--tall { margin-top: clamp(1.75rem, 4vw, 2.75rem); }
.ed > .ed-wide + *, .ed > .ed-full + * { margin-top: clamp(1.75rem, 4vw, 2.75rem); }
.ed--guide, .ed--article { padding-top: clamp(1.5rem, 4vw, 2.75rem); }

.ed p.ed-text, .ed .ed-list, .ed blockquote { font-size: 1.05rem; line-height: 2.1; color: var(--stone-800); }
.ed p.ed-text a, .ed .ed-list a, .equick a, .eplaces p a, .echoose a, .enote a, .esources a, .efaq a, .ephoto figcaption span a {
  color: var(--green-800); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
}
.ed .ed-list { padding-inline-start: 1.3rem; }
.ed ul.ed-list { list-style: disc; }
.ed ol.ed-list { list-style: persian; }
.ed .ed-list li + li { margin-top: 0.35rem; }
.ed .ed-list li::marker { color: var(--gold-600); }
.ed strong { font-weight: 800; color: var(--ink); }

/* headings carry the journey-line motif */
.ed-h2 {
  font-size: clamp(1.32rem, 1.05rem + 1.1vw, 1.75rem); font-weight: 800; line-height: 1.55; letter-spacing: -0.005em; color: var(--ink);
  margin-top: clamp(3rem, 7vw, 4.75rem) !important; scroll-margin-top: calc(var(--header-height) + 3.5rem);
}
.ed-h2::before { content: ""; display: block; width: 2.5rem; height: 2px; border-radius: 2px; background: var(--ed-line); margin-bottom: 1rem; }
.ed h3.ed-text { font-size: 1.12rem; font-weight: 800; margin-top: 2rem; }
.ed blockquote { border-inline-start: 2px solid var(--ed-line); padding-inline-start: 1.25rem; color: var(--stone-700); }

/* ---------- hero ---------- */
.ehero { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: clamp(27rem, 74vh, 44rem); color: var(--white); background: var(--stone-900); overflow: hidden; isolation: isolate; }
.ehero__media, .ehero__media picture { position: absolute; inset: 0; z-index: -2; }
.ehero__media img { width: 100%; height: 100%; object-fit: cover; }
.ehero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(12,10,9,0.18) 0%, rgba(12,10,9,0.08) 35%, rgba(12,10,9,0.62) 72%, rgba(12,10,9,0.86) 100%); }
.ehero__inner { padding-block: 5rem clamp(2rem, 5vw, 3.5rem); max-width: var(--container); }
.ehero .breadcrumb { color: rgba(255,255,255,0.78); margin-block: 0 1.1rem; font-size: 0.78rem; }
.ehero .breadcrumb a:hover { color: var(--white); }
.ehero h1 { font-size: clamp(1.6rem, 1.05rem + 2.6vw, 3rem); font-weight: 800; line-height: 1.38; letter-spacing: -0.01em; max-width: 46rem; margin-top: 0.85rem; text-wrap: balance; }
.ehero__dek { margin-top: 1rem; max-width: 40rem; color: rgba(255,255,255,0.88); font-size: clamp(0.98rem, 0.9rem + 0.35vw, 1.12rem); line-height: 2; }
.ehero__credit { position: absolute; inset-inline-start: 0; bottom: 0.55rem; font-size: 0.66rem; color: rgba(255,255,255,0.62); text-align: end; }
.ehero__credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ehero--plain { min-height: 0; background: var(--sand-100); color: var(--ink); }
.ehero--plain::after { display: none; }
.ehero--plain .breadcrumb { color: var(--stone-500); }
.ehero--plain .ehero__dek { color: var(--stone-600); }
.ehero--article { min-height: clamp(24rem, 64vh, 38rem); }

/* fact bar under the hero (max 5 facts) */
.efactbar { background: var(--sand-100); border-bottom: 1px solid var(--sand-200); }
.efactstrip { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0.25rem 1.5rem; padding-block: 1rem; }
.efactstrip div { padding-block: 0.35rem; }
.efactstrip dt { font-size: 0.72rem; color: var(--stone-600); font-weight: 600; }
.efactstrip dd { font-size: 0.92rem; font-weight: 700; color: var(--ink); margin-top: 0.15rem; line-height: 1.7; }
.emeta { display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; align-items: center; padding-block: 1rem 0; font-size: 0.8rem; color: var(--stone-600); }
.emeta .link-arrow { font-size: 0.8rem; }
.emeta .link-arrow svg { width: 0.95rem; height: 0.95rem; }

/* section nav reuses .dnav */
.enav a { font-weight: 600; }

/* ---------- photography ---------- */
.ephoto { margin: 0; }
.ephoto picture, .ephoto > img, .ephoto img { display: block; }
.ephoto img { width: 100%; height: auto; border-radius: var(--radius); background: var(--sand-200); }
.ephoto--wide img { aspect-ratio: 16 / 9; object-fit: cover; }
.ephoto--full img { border-radius: 0; aspect-ratio: 21 / 9; object-fit: cover; max-height: 78vh; }
.ephoto figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; margin-top: 0.7rem; font-size: 0.82rem; line-height: 1.85; color: var(--stone-600); }
.ephoto--full figcaption { max-width: var(--ed-wide); margin-inline: auto; padding-inline: var(--ed-gutter); }
.photo-credit { font-size: 0.7rem; color: var(--stone-600); white-space: normal; }
.photo-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ephoto--inset { justify-self: start; width: min(24rem, 100%); }
.ephoto--inset img { aspect-ratio: 4 / 5; object-fit: cover; }
.ephoto-pair { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.ephoto-pair img { aspect-ratio: 4 / 3; object-fit: cover; }
@media (min-width: 680px) { .ephoto-pair { grid-template-columns: 1.15fr 0.85fr; } .ephoto-pair figure:nth-child(2) { margin-top: 2.5rem; } }
.egallery { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .egallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.egallery__btn { display: block; width: 100%; padding: 0; border-radius: var(--radius); overflow: hidden; }
.egallery__btn img { aspect-ratio: 1; object-fit: cover; transition: transform var(--transition-slow); }
.egallery__btn:hover img { transform: scale(1.025); }

/* ---------- maps ---------- */
.emap { margin: 0; }
.emap__frame { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: #dfe8e6; border: 1px solid var(--sand-200); }
.emap__frame svg, .emap__frame img { width: 100%; height: 100%; display: block; }
.emap figcaption { display: grid; gap: 0.35rem; margin-top: 0.85rem; max-width: var(--ed-text); }
.emap figcaption b { font-size: 0.9rem; font-weight: 800; color: var(--ink); }
.emap figcaption span { font-size: 0.86rem; line-height: 1.95; color: var(--stone-600); }
.emap figcaption small { font-size: 0.68rem; color: var(--stone-600); }
.emap .emap-svg .credit { display: none; } /* credit is in the caption */
.emap-svg .pin circle { transition: transform var(--transition); transform-box: fill-box; transform-origin: center; }
.emap-svg .pin:hover circle { transform: scale(1.25); }
/* route draw: only once the map has loaded, and never with reduced motion */
@media (prefers-reduced-motion: no-preference) {
  .emap.is-loaded .route { stroke-dashoffset: 0; }
  .emap.is-loaded .route:not(.route--soft):not(.route--day3) { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ed-route 1.6s 0.2s cubic-bezier(0.45, 0, 0.2, 1) forwards; }
  .emap.is-loaded .pin { animation: ed-fade 0.6s 0.1s both; }
}
@keyframes ed-route { to { stroke-dashoffset: 0; } }
@keyframes ed-fade { from { opacity: 0; } to { opacity: 1; } }
/* mobile composition: larger type, fewer labels, touch-size pins */
@media (max-width: 640px) {
  .emap__frame { border-radius: var(--radius); margin-inline: calc(var(--ed-gutter) * -0.5); }
  .emap .emap-svg .minor, .emap .emap-svg .range-label { display: none; }
  .emap .emap-svg text { stroke-width: 9px; }
  .emap .emap-svg .pin__label { font-size: 40px; }
  .emap .emap-svg .pin--major .pin__label { font-size: 46px; }
  .emap .emap-svg .pin__note { font-size: 32px; }
  .emap .emap-svg .sea-label { font-size: 46px; }
  .emap .emap-svg .prov-label { font-size: 58px; }
  .emap .emap-svg .zone-label { font-size: 40px; }
  .emap .emap-svg .legend { display: none; } /* the caption carries the same day-by-day text */
  .emap .emap-svg .pin circle { r: 12px; }
  .emap .emap-svg .pin--major circle { r: 16px; }
  .emap .emap-svg .pin--step circle { r: 22px; }
  .emap .emap-svg .pin__step { font-size: 26px; }
  .emap .emap-svg .route { stroke-width: 7px; }
}

/* ---------- editorial blocks ---------- */
.equick { position: relative; padding: 1.35rem 1.5rem 1.4rem; border-radius: var(--radius); background: var(--white); border: 1px solid var(--sand-200); }
.equick::before { content: ""; position: absolute; inset-block: 1.3rem; inset-inline-start: 0; width: 2px; background: var(--ed-line); border-radius: 2px; }
.equick__label { display: block; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.03em; color: var(--gold-600); margin-bottom: 0.6rem; }
.equick p { font-size: 0.98rem; line-height: 2; color: var(--stone-800); }
.equick p + p { margin-top: 0.35rem; }

.efacts { display: grid; gap: 0; grid-template-columns: 1fr; border-top: 1px solid var(--sand-300); }
.efacts div { display: grid; grid-template-columns: minmax(7rem, 0.4fr) 1fr; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--sand-200); }
.efacts dt { font-weight: 800; font-size: 0.9rem; color: var(--ink); }
.efacts dd { font-size: 0.94rem; color: var(--stone-700); line-height: 1.9; }

.einsight { font-size: clamp(1.18rem, 1rem + 0.9vw, 1.55rem); font-weight: 700; line-height: 1.85; color: var(--green-900); text-wrap: balance; padding-block: 0.5rem; max-width: 52rem; }
.einsight::before { content: ""; display: block; width: 3.5rem; height: 2px; background: var(--ed-line); margin-bottom: 1rem; }

.enote { padding: 1rem 1.2rem; border-radius: var(--radius-sm); background: var(--green-50); border: 1px solid #cfe7d6; }
.enote p { font-size: 0.9rem; line-height: 1.95; color: var(--green-950); }

.echeck { display: grid; gap: 0.65rem; }
.echeck li { display: flex; gap: 0.65rem; align-items: flex-start; font-size: 0.98rem; line-height: 1.95; color: var(--stone-800); }
.echeck li svg { width: 1.05rem; height: 1.05rem; margin-top: 0.42rem; flex-shrink: 0; color: var(--green-700); }

/* timeline: the journey line made literal */
.etimeline { list-style: none; position: relative; display: grid; gap: 0; padding-inline-start: 0; }
.etimeline__step { position: relative; display: grid; grid-template-columns: 6.5rem 1fr; gap: 1.25rem; padding-block: 1.1rem; }
.etimeline__step + .etimeline__step { border-top: 1px dashed var(--sand-300); }
.etimeline__day { font-size: 0.8rem; font-weight: 800; color: var(--gold-600); padding-top: 0.25rem; position: relative; }
.etimeline__step h3 { font-size: 1.05rem; font-weight: 800; color: var(--ink); }
.etimeline__step p { font-size: 0.95rem; line-height: 1.95; color: var(--stone-700); margin-top: 0.3rem; }
.etimeline__extra { color: var(--stone-600) !important; font-size: 0.86rem !important; }
@media (min-width: 760px) {
  .etimeline::before { content: ""; position: absolute; inset-block: 1.6rem; inset-inline-start: 6.95rem; width: 2px; background: linear-gradient(var(--ed-line), var(--sand-300)); border-radius: 2px; }
  .etimeline__step { grid-template-columns: 6.5rem 1fr; gap: 2rem; }
  .etimeline__step + .etimeline__step { border-top: 0; }
  .etimeline__step::before { content: ""; position: absolute; inset-inline-start: 6.62rem; top: 1.55rem; width: 0.8rem; height: 0.8rem; border-radius: 50%; background: var(--sand-50); border: 2px solid var(--gold-500); }
}
@media (max-width: 520px) { .etimeline__step { grid-template-columns: 1fr; gap: 0.25rem; } }

/* decision support */
.echoose { display: grid; gap: 1px; grid-template-columns: 1fr; background: var(--sand-200); border: 1px solid var(--sand-200); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 720px) { .echoose { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.echoose__item { background: var(--white); padding: 1.2rem 1.3rem 1.25rem; }
@media (min-width: 720px) { .echoose__item:last-child:nth-child(odd) { grid-column: 1 / -1; } }
.echoose__item h3 { font-size: 0.98rem; font-weight: 800; color: var(--ink); }
.echoose__item p { font-size: 0.9rem; line-height: 1.95; color: var(--stone-700); margin-top: 0.35rem; }
.echoose__link { margin-top: 0.6rem !important; font-weight: 700; }

/* place rows (destination clusters; linked only when a guide exists) */
.eplaces__title { font-size: 0.82rem; font-weight: 800; letter-spacing: 0.03em; color: var(--gold-600); margin-bottom: 0.4rem; }
.eplaces ul { display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--sand-300); }
@media (min-width: 760px) { .eplaces ul { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.5rem; } }
.eplaces li { padding: 0.95rem 0; border-bottom: 1px solid var(--sand-200); }
.eplaces__name { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.eplaces__name > span, .eplaces__name > a { font-weight: 800; font-size: 1rem; color: var(--ink); }
.eplaces li.is-linked .eplaces__name > a { color: var(--green-800); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.eplaces__name small { font-size: 0.72rem; color: var(--stone-600); font-weight: 600; white-space: nowrap; }
.eplaces li p { font-size: 0.9rem; line-height: 1.9; color: var(--stone-700); margin-top: 0.2rem; }

/* full-bleed sand band that nests its own reading grid */
.eband { background: var(--sand-100); padding-block: clamp(1.25rem, 4vw, 2.5rem) clamp(2.5rem, 6vw, 4rem); margin-top: clamp(3rem, 7vw, 4.75rem) !important; }
.eband > .ed { padding-bottom: 0; }

/* region / child guide cards: one lead + quieter rows */
.eregions { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 860px) { .eregions { grid-template-columns: 1.35fr 1fr; grid-auto-rows: auto; } .eregion--lead { grid-row: span 2; } }
.eregion { position: relative; display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; align-items: center; padding: 0.75rem; background: var(--white); border: 1px solid var(--sand-200); border-radius: var(--radius); transition: border-color var(--transition); }
.eregion:hover { border-color: var(--sand-300); }
.eregion__media { border-radius: calc(var(--radius) - 0.35rem); overflow: hidden; aspect-ratio: 1; background: var(--sand-200); }
.eregion__media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--transition-slow); }
.eregion:hover .eregion__media img { transform: scale(1.04); }
.eregion__body small { font-size: 0.72rem; color: var(--gold-600); font-weight: 700; }
.eregion__body h3 { font-size: 1.05rem; font-weight: 800; color: var(--ink); margin-top: 0.15rem; }
.eregion__body p { font-size: 0.86rem; line-height: 1.85; color: var(--stone-600); margin-top: 0.25rem; }
.eregion__body .link-arrow { margin-top: 0.4rem; font-size: 0.8rem; }
.eregion:hover .link-arrow svg { transform: translateX(-3px); }
.eregion--lead { grid-template-columns: 1fr; align-content: start; padding: 0.75rem 0.75rem 1.25rem; }
.eregion--lead .eregion__media { aspect-ratio: 16 / 10; }
.eregion--lead .eregion__body { padding-inline: 0.5rem; }
.eregion--lead .eregion__body h3 { font-size: 1.3rem; }

.eexperiences { padding-top: 0.5rem; }
.eexperiences .section-head { margin-bottom: 1.25rem; }

/* tables: columns on desktop, labelled cards on phones */
.ed-table { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--sand-200); background: var(--white); }
.ed-table table { width: 100%; border-collapse: collapse; font-size: 0.9rem; line-height: 1.85; }
.ed-table th, .ed-table td { padding: 0.85rem 1rem; text-align: start; vertical-align: top; border-bottom: 1px solid var(--sand-200); }
.ed-table thead th { background: var(--sand-100); font-weight: 800; color: var(--ink); font-size: 0.86rem; }
.ed-table tbody th { font-weight: 800; color: var(--ink); background: var(--sand-50); white-space: nowrap; }
.ed-table tbody tr:last-child > * { border-bottom: 0; }
@media (max-width: 640px) {
  .ed-table { border: 0; background: transparent; overflow: visible; }
  .ed-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ed-table table, .ed-table tbody, .ed-table tr, .ed-table th, .ed-table td { display: block; }
  .ed-table tr { background: var(--white); border: 1px solid var(--sand-200); border-radius: var(--radius); margin-bottom: 0.75rem; overflow: hidden; }
  .ed-table tbody th { background: var(--sand-100); white-space: normal; }
  .ed-table td { display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.75rem; }
  .ed-table td::before { content: attr(data-label); font-size: 0.76rem; font-weight: 800; color: var(--gold-600); }
}

/* FAQ + sources: quieter than the body */
.efaq { margin-top: clamp(3rem, 7vw, 4.5rem) !important; }
.efaq .faq summary { font-size: 0.95rem; }
.efaq .faq p { font-size: 0.92rem; line-height: 1.95; color: var(--stone-700); padding-bottom: 1rem; }
.esources { margin-top: clamp(2.5rem, 6vw, 3.5rem) !important; padding-top: 1.5rem; border-top: 1px solid var(--sand-300); font-size: 0.85rem; color: var(--stone-600); }
.esources h2 { font-size: 0.95rem; font-weight: 800; color: var(--ink); }
.esources__dates { margin-top: 0.4rem; font-size: 0.8rem; }
.esources__list { margin-top: 0.85rem; padding-inline-start: 1.2rem; list-style: persian; display: grid; gap: 0.35rem; line-height: 1.8; }
.esources__list span { color: var(--stone-600); }
.esources__note { margin-top: 0.85rem; font-size: 0.8rem; line-height: 1.9; }
.esources__credits { margin-top: 0.85rem; }
.esources__credits summary { cursor: pointer; font-weight: 700; font-size: 0.8rem; color: var(--stone-700); }
.esources__credits ul { margin-top: 0.6rem; display: grid; gap: 0.4rem; font-size: 0.74rem; line-height: 1.8; }
.esources__credits a { text-decoration: underline; text-underline-offset: 2px; }

/* reveal: content is always visible; motion is opt-in and restrained */
.reveal.reveal-armed { opacity: 0; transform: translateY(14px); transition: opacity var(--transition-slow), transform var(--transition-slow); }
.reveal.reveal-armed.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal.reveal-armed { opacity: 1; transform: none; transition: none; }
  .eregion__media img, .egallery__btn img { transition: none; }
}

/* parents article: calmer, roomier */
.eguide--article .ed--article { --ed-gap: clamp(1.25rem, 2.2vw, 1.55rem); }

/* polish: content-sized grids for one or two related experiences, and a
   single child guide as one horizontal card (no empty half-row) */
@media (min-width: 760px) {
  .eexperiences .xgrid[data-n="1"] { grid-template-columns: minmax(0, 24rem); }
  .eexperiences .xgrid[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 24rem)); }
  .eregions--single { grid-template-columns: 1fr; }
  .eregions--single .eregion--lead { grid-row: auto; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; gap: 1.5rem; padding: 0.75rem; }
  .eregions--single .eregion--lead .eregion__media { aspect-ratio: 16 / 10; }
}
