/* Editorial block layout for Travel News articles that have content blocks
   (and the /prototype/article preview). Builds on the tokens in landing.css
   (--ink, --muted, --ochre, --border, --font-display). */

.ap-article {
  --ap-text: 680px;   /* reading column */
  --ap-wide: 1100px;  /* hero + wide blocks */
  --ap-gutter: clamp(1rem, 5vw, 2rem);
  margin-top: 68px;   /* fixed Nav height */
  padding: clamp(3rem, 7vw, 5.5rem) var(--ap-gutter) clamp(4rem, 8vw, 7rem);
  color: var(--ink);
  overflow-wrap: break-word;
}
.ap-article img { display: block; max-width: 100%; height: auto; }

/* ── Header ── */
.ap-header { max-width: var(--ap-text); margin: 0 auto; text-align: left; }
.ap-eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ochre);
  margin-bottom: 0.9rem;
}
.ap-title {
  font-family: 'Noto Serif', Georgia, 'Times New Roman', serif;
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.9rem;
}
/* Sapo — the italic standfirst under the headline */
.ap-standfirst {
  font-family: 'Noto Serif', Georgia, 'Times New Roman', serif;
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 1rem;
}
.ap-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}
/* Share row (plain links — no third-party scripts) */
.ap-share {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: var(--ap-text);
  margin: 0.9rem auto 0;
  font-size: 0.8rem;
}
.ap-share-label { color: var(--muted); margin-right: 0.25rem; }
.ap-share a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
}
.ap-share a:hover { border-color: var(--ochre); color: var(--ochre); }
.ap-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }

/* ── Hero ── */
.ap-hero { max-width: var(--ap-wide); margin: clamp(2.5rem, 5vw, 4rem) auto 0; }
.ap-hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; }
.ap-caption {
  max-width: var(--ap-text);
  margin: 0 auto;
  padding: 0.65rem 0.9rem;
  background: var(--cream);
  font-size: 0.85rem;
  font-style: italic;
  line-height: 1.55;
  color: var(--muted);
  text-align: center;
}

/* ── Body: every block sits in the reading column unless it opts wider ── */
.ap-body { margin-top: clamp(3rem, 6vw, 4.5rem); }
.ap-block { max-width: var(--ap-text); margin: 0 auto 1.75rem; }
.ap-block--image-text,
.ap-block--gallery { max-width: 960px; margin-top: 3rem; margin-bottom: 3rem; }
.ap-block--related-article,
.ap-block--quote { margin-top: 2.75rem; margin-bottom: 2.75rem; }

.ap-paragraph {
  font-size: clamp(1.05rem, 1.6vw, 1.15rem);
  line-height: 1.75;
  margin: 0;
  white-space: pre-line; /* single line breaks inside a paragraph stay visible */
}
.ap-block--heading { margin-top: 3rem; margin-bottom: 1.25rem; }
.ap-heading {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0;
}
.ap-heading--h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.ap-heading--h3 { font-size: clamp(1.25rem, 2.4vw, 1.5rem); }

/* ── Image + Text ── */
.ap-image-text {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}
.ap-image-text--right .ap-image-text-media { order: 2; }
.ap-image-text-media { margin: 0; min-width: 0; }
.ap-image-text-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
/* Photo attribution (e.g. Wikimedia Commons CC licences) — small, quiet, visible */
.ap-credit {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--muted);
  opacity: 0.85;
}
.ap-image-text-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  font-weight: 500;
  line-height: 1.3;
  margin: 0 0 0.9rem;
}
.ap-image-text-body p { font-size: 1.02rem; line-height: 1.8; margin: 0 0 0.75rem; }
.ap-link-cta {
  /* min-height gives a 44px tap target; the underline stays text-tight. */
  display: inline-flex;
  align-items: center;
  gap: 0.35em; /* flex drops the text/arrow whitespace */
  min-height: 44px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ochre);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.ap-link-cta:hover { color: var(--rust); }

/* ── Related article card ── */
.ap-related {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 1.25rem;
  align-items: center;
  padding: 1rem;
  background: var(--sand);
  border-radius: 8px;
}
.ap-related-thumb { width: 120px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }
.ap-related-body { min-width: 0; }
.ap-related-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.ap-related-title {
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.4;
  color: var(--ink);
  text-decoration: none;
}
.ap-related-title:hover { color: var(--ochre); }
.ap-related-btn {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #fff;
  background: var(--ochre);
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
}
.ap-related-btn:hover { background: var(--rust); }

/* ── Gallery ── */
.ap-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.ap-gallery--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ap-gallery--1 { grid-template-columns: minmax(0, 1fr); }
.ap-gallery-item { margin: 0; min-width: 0; }
.ap-gallery-item img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; }
.ap-gallery-item figcaption { font-size: 0.8rem; color: var(--muted); margin-top: 0.5rem; }

/* ── Quote / highlight ── */
.ap-quote {
  margin: 0;
  padding: 0.25rem 0 0.25rem clamp(1.25rem, 3vw, 2rem);
  border-left: 3px solid var(--ochre);
}
.ap-quote p {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.5;
  margin: 0;
}

/* ── Reading progress (carried over from the old article page) — the "route"
   travelled through the article, a callback to the dashed-route icon ── */
.tnews-progress {
  position: fixed; top: 68px; left: 0; right: 0; height: 3px;
  background: var(--border);
  z-index: 490;
  pointer-events: none;
}
.tnews-progress-fill {
  position: relative; height: 100%; width: 0%;
  background: linear-gradient(to right, var(--ochre), var(--rust));
  transition: width 0.08s linear;
}
.tnews-progress-pin { display: none; } /* newspaper look: plain thin progress bar */

/* ── Back to journal (top) ── */
.ap-back {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  /* Full content width, so the link sits at the left edge of the wide column
     (auto margins on a fit-content box would centre it). */
  width: 100%;
  max-width: var(--ap-wide);
  min-height: 44px;
  margin: -1.5rem auto 1.5rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.ap-back:hover { color: var(--ink); }

/* ── Source line + more stories ── */
.ap-source {
  max-width: var(--ap-text);
  margin: 2rem auto 0;
  font-weight: 700;
  color: var(--ink);
  text-align: right;
}
.ap-morestories { max-width: var(--ap-wide); margin: clamp(2.5rem, 5vw, 3.5rem) auto 0; padding-top: 1.25rem; border-top: 3px double var(--ink); }
.ap-morestories-title { font-family: 'Noto Serif', Georgia, 'Times New Roman', serif; font-size: 1.3rem; margin: 0 0 1rem; }
.ap-morestories-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.ap-morestory { display: flex; flex-direction: column; gap: 0.35rem; color: var(--ink); text-decoration: none; }
.ap-morestory-thumb { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--cream); margin-bottom: 0.25rem; }
.ap-morestory-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ap-morestory:hover .ap-morestory-title { color: var(--ochre); }
.ap-morestory-title { font-family: 'Noto Serif', Georgia, 'Times New Roman', serif; font-weight: 700; line-height: 1.3; }
.ap-morestory-date { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* ── Back to list ── */
.ap-more {
  display: block;
  max-width: var(--ap-text);
  margin: clamp(3rem, 6vw, 4.5rem) auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ochre);
  text-decoration: none;
}
.ap-more:hover { color: var(--ink); }

/* ── Tablet ── */

  .ap-article { --ap-text: 640px; }


/* ── Mobile ── */
@media (max-width: 720px){
  .ap-image-text { grid-template-columns: minmax(0, 1fr); }
  .ap-image-text--right .ap-image-text-media { order: 0; }
  .ap-gallery, .ap-gallery--2 { grid-template-columns: minmax(0, 1fr); }
  .ap-gallery-item img { aspect-ratio: 4 / 3; }
  .ap-related { grid-template-columns: 88px minmax(0, 1fr); }
  .ap-related-thumb { width: 88px; }
  .ap-related-btn { grid-column: 1 / -1; justify-self: start; }
  .ap-hero img { aspect-ratio: 4 / 3; border-radius: 0; }
  .ap-morestories-grid { grid-template-columns: minmax(0, 1fr); }
  .ap-morestory { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .ap-morestory-thumb { width: 112px; flex-shrink: 0; margin: 0 0.9rem 0 0; }
  .ap-morestory-title { flex: 1 1 0; min-width: 0; }
  .ap-morestory-date { flex-basis: 100%; }
}

/* ── Rich (Word-style) text ── */
.ap-rich { white-space: normal; }
.ap-rich p, .ap-rich div { margin: 0 0 1em; }
.ap-rich > :last-child { margin-bottom: 0; }
.ap-rich ul, .ap-rich ol { margin: 0 0 1em; padding-left: 1.4em; }
.ap-quote .ap-rich p { margin: 0; }

/* ── Standalone image block ── */
.ap-block--image { max-width: var(--ap-wide); margin-top: 2.5rem; margin-bottom: 2.5rem; }
.ap-figure { margin: 0 auto; }
.ap-figure img { width: 100%; border-radius: 4px; }
.ap-figure--small { max-width: 420px; }
.ap-figure--wide { max-width: 960px; }
.ap-figure--full { max-width: var(--ap-wide); }
.ap-figure figcaption { margin-top: 0; padding: 0.6rem 0.9rem; background: var(--cream); font-size: 0.85rem; font-style: italic; line-height: 1.5; color: var(--muted); text-align: center; }

/* Mobile field-guide: long-form reading */
.ap-article {
  --ap-gutter: var(--m-gutter);
  margin-top: 60px;
  padding: 28px var(--ap-gutter) 56px;
  background: var(--m-paper);
}
.tnews-progress { top: 60px; background: var(--m-line); }
.tnews-progress-fill { background: var(--m-departure); }
.ap-back {
  min-height: 44px;
  margin: 0 auto 18px;
  color: var(--m-ocean-deep);
  font-weight: 800;
}
.ap-eyebrow {
  color: var(--m-departure);
  font-family: var(--m-mono);
  font-size: 10px;
}
.ap-title {
  font-size: clamp(32px, 9vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.035em;
}
.ap-standfirst { font-size: 17px; line-height: 1.55; }
.ap-meta { font-family: var(--m-mono); font-size: 10px; }
.ap-share {
  margin: 12px calc(var(--m-gutter) * -1) 0;
  padding: 0 var(--m-gutter) 3px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ap-share a { flex: 0 0 auto; min-height: 42px; }
.ap-hero {
  margin: 24px calc(var(--m-gutter) * -1) 0;
}
.ap-hero img { aspect-ratio: 4 / 3; border-radius: 0; }
.ap-caption { padding: 10px var(--m-gutter); text-align: left; }
.ap-body { margin-top: 32px; }
.ap-block { margin-bottom: 22px; }
.ap-paragraph,
.ap-rich { font-size: 17px; line-height: 1.75; }
.ap-block--heading { margin-top: 34px; }
.ap-heading {
  color: var(--m-ink);
  font-family: Inter, Arial, sans-serif;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.ap-heading--h2 { font-size: 27px; }
.ap-heading--h3 { font-size: 22px; }
.ap-image-text { display: block; }
.ap-image-text-media {
  margin: 0 calc(var(--m-gutter) * -1) 18px;
}
.ap-image-text-media img { border-radius: 0; }
.ap-related {
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  background: var(--m-mist);
  border: 1px solid var(--m-line);
  border-radius: 16px;
}
.ap-related-thumb { width: 84px; border-radius: 10px; }
.ap-related-btn {
  grid-column: 1 / -1;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--m-departure);
  border-radius: 12px;
}
.ap-gallery,
.ap-gallery--2 {
  display: flex;
  gap: 10px;
  margin: 0 calc(var(--m-gutter) * -1);
  padding: 0 var(--m-gutter) 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.ap-gallery-item {
  flex: 0 0 min(82vw, 330px);
  scroll-snap-align: start;
}
.ap-gallery-item img { aspect-ratio: 4 / 3; border-radius: var(--m-radius); }
.ap-quote {
  padding: 18px 18px 18px 20px;
  background: var(--m-mist);
  border-left-color: var(--m-departure);
  border-radius: 0 16px 16px 0;
}
.ap-quote p { font-size: 22px; line-height: 1.45; }
.ap-morestories-grid { gap: 14px; }
.ap-morestory {
  min-height: 108px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--m-line);
}
.ap-morestory-thumb { width: 104px; border-radius: 10px; }
.ap-more { min-height: 48px; color: var(--m-ocean-deep); }
.ap-block--image { margin-right: calc(var(--m-gutter) * -1); margin-left: calc(var(--m-gutter) * -1); }
.ap-figure img { border-radius: 0; }
