/* Listing detail. Every size, spacing and dark colour is read from the Paper file
   "Nexus · Landing mockup", artboard "Public — Listing detail · extended".
   Loaded after base.css and clinical.css: nav, footer, buttons, tags and both themes come from there.
   Colours are tokens only; the two values Paper uses that have no token yet are added below with a white-view pair. */

:root {
  --ld-slash: #6B6E73;
  --ld-check: #DDF1EC;
}
:root[data-theme="light"] {
  --ld-slash: #8E9094;
  --ld-check: var(--teal);
}

/* Paper: nav row is 40 + 44 + 24 = 108px tall and in the flow; here the nav is fixed, so the page starts below it */
.ld { display: block; padding-top: 108px; }
.ld-head, .ld-layout, .ld-band { width: 100%; max-width: 1440px; margin-inline: auto; padding-inline: var(--gutter); }

/* ───────── Page head ───────── */
.ld-head { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; padding-top: 48px; padding-bottom: 40px; }
.ld-top { align-self: stretch; display: flex; align-items: center; gap: 10px; min-height: 44px; }
.ld-back { flex-shrink: 0; display: flex; align-items: center; gap: 6px; height: 44px; font-size: 13px; line-height: 16px; font-weight: 500; color: var(--c-label); transition: color 150ms ease; }
.ld-back svg { flex-shrink: 0; transition: translate 200ms var(--ease-out); }
.ld-top-rule { flex-shrink: 0; width: 1px; height: 16px; background: var(--c-line-dash); }
.ld-crumbs { display: flex; align-items: center; gap: 10px; height: 44px; font-size: 13px; line-height: 16px; font-weight: 500; color: var(--c-label); }
.ld-crumbs a { display: flex; align-items: center; height: 44px; transition: color 150ms ease; }
.ld-crumbs .sep { font-weight: 400; color: var(--ld-slash); }
.ld-crumbs [aria-current] { color: var(--ink); }
.ld-actions { flex-shrink: 0; display: flex; align-items: center; gap: 18px; margin-left: auto; }
.ld-compare { display: flex; align-items: center; gap: 6px; height: 44px; font-size: 13px; line-height: 16px; font-weight: 500; color: var(--c-label); transition: color 150ms ease, scale 150ms ease-out; }
.ld-actions .save { transition: color 150ms ease, scale 150ms ease-out; }
.ld-actions .save:active, .ld-compare:active { scale: 0.97; }
@media (hover: hover) and (pointer: fine) {
  .ld-crumbs a:hover, .ld-back:hover, .ld-compare:hover, .ld-link:hover { color: var(--ink); }
  .ld-back:hover svg { translate: -3px 0; }
  .ld-link:hover svg { translate: 3px 0; }
  .ld-tab:hover { color: var(--ink); }
}
.ld-head h1 { font-size: 60px; line-height: 66px; font-weight: 300; letter-spacing: -0.03em; color: var(--ink); text-wrap: wrap; }
.ld-tagline { font-family: var(--serif); font-style: italic; font-size: 21px; line-height: 30px; color: var(--c-sub); }
.ld-chips { flex-wrap: wrap; padding-top: 6px; }
.ld-chip { background: var(--row-2); color: var(--chip-ink); }

/* ───────── Two columns ───────── */
.ld-layout { display: flex; align-items: flex-start; gap: 32px; padding-bottom: 96px; }
.ld-main { flex: 1 1 0%; min-width: 0; display: flex; flex-direction: column; gap: 32px; }
.ld-side { flex-shrink: 0; width: 400px; display: flex; flex-direction: column; gap: 20px; }

.ld-photo { position: relative; flex-shrink: 0; height: 520px; margin: 0; overflow: clip; border-radius: 12px; background: var(--row); }
.ld-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ld-photo .photo-chip { left: 16px; bottom: 16px; }

.ld-summary { display: flex; flex-direction: column; gap: 14px; }
.ld-summary p { max-width: 680px; font-size: 16px; line-height: 26px; color: var(--c-sub); }

.ld-facts-wrap { display: flex; flex-direction: column; gap: 10px; }
.ld-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.ld-fact { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: 8px; background: var(--row); }
.ld-fact dt { font-size: 12px; line-height: 16px; color: var(--c-sub); }
.ld-fact dd { margin: 0; font-size: 16px; line-height: 22px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.ld-fact dd.is-quiet { color: var(--c-label); }
.ld-note { max-width: 680px; font-size: 13px; line-height: 20px; color: var(--c-dim); }
.ld-summary p.ld-note { font-size: 13px; line-height: 20px; color: var(--c-dim); }
.ld-note-pad { padding-top: 6px; }

/* ───────── Section tabs: the underline style of the portal stage tracker ───────── */
.ld-tabs { position: sticky; top: 68px; z-index: 5; flex-shrink: 0; display: flex; gap: 32px; border-bottom: 1px solid var(--c-line); background: var(--page); }
.ld-tab { position: relative; flex-shrink: 0; display: flex; flex-direction: column; justify-content: center; height: 44px; font-size: 14px; line-height: 18px; font-weight: 500; color: var(--c-sub); transition: color 150ms ease; }
/* The bold label is always measured, so a tab does not change width when it becomes active */
.ld-tab::before { content: attr(data-label); height: 0; overflow: hidden; visibility: hidden; font-weight: 700; }
.ld-tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 2px; background: var(--ink); transform: scaleX(0); transition: transform 220ms var(--ease-out); }
.ld-tab[aria-current="true"] { font-weight: 700; color: var(--ink); }
.ld-tab[aria-current="true"]::after { transform: none; }
/* Nav bar 68 + tabs 45; the later sections bring their own 32px of top padding */
.ld-main section[id] { scroll-margin-top: 137px; }
.ld-main .ld-sec { scroll-margin-top: 113px; }

/* ───────── Sections of the main column ───────── */
.ld-sec { display: flex; flex-direction: column; gap: 20px; padding-top: 32px; }
.ld-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ld-sec-head .chip { flex-shrink: 0; }
.ld-sec-intro { display: flex; flex-direction: column; gap: 14px; }
.ld-sec-intro p { max-width: 680px; font-size: 16px; line-height: 26px; color: var(--c-sub); }
.ld-rows-main .ld-row { background: var(--row); }
.ld-row dt, .ld-row dd { display: flex; align-items: center; }
.ld-row dt { gap: 10px; min-width: 0; }
.ld-row dd { flex-shrink: 0; gap: 8px; }
.ld-row svg { flex-shrink: 0; color: var(--c-label); }
.ld-notes { display: flex; flex-direction: column; gap: 8px; }
.ld-caveat { max-width: 680px; font-size: 14px; line-height: 22px; color: var(--c-sub); }
.ld-link { position: relative; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; line-height: 18px; font-weight: 500; color: var(--c-label); transition: color 150ms ease, scale 150ms ease-out; }
.ld-link::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); }
.ld-link span { text-decoration: underline 1px; text-underline-position: from-font; }
.ld-link svg { flex-shrink: 0; transition: translate 200ms var(--ease-out); }
.ld-link:active { scale: 0.97; }
.ld-terms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.ld-about { display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px; border-radius: 8px; background: var(--row); }
.ld-about .chip { flex-shrink: 0; }
.ld-about-body { flex: 1 1 0%; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ld-about-body p { font-size: 15px; line-height: 22px; color: var(--c-sub); }

/* ───────── Side cards ───────── */
.ld-card { display: flex; flex-direction: column; gap: 20px; padding: 28px; border-radius: 12px; background: var(--panel); border: 1px solid var(--c-line); }
.ld-card-top { display: flex; align-items: center; gap: 10px; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.1em; color: var(--ink); }
.ld-card-top svg { flex-shrink: 0; }
.ld-price { display: flex; flex-direction: column; gap: 6px; }
.ld-price span { font-size: 13px; line-height: 16px; color: var(--c-sub); }
.ld-price b { font-size: 38px; line-height: 46px; font-weight: 300; letter-spacing: -0.02em; color: var(--ink); }
.ld-rows { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.ld-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-shrink: 0; height: 48px; padding-inline: 16px; border-radius: 8px; background: var(--row-2); font-size: 14px; line-height: 20px; }
.ld-row dt { color: var(--chip-ink); }
.ld-row dd { margin: 0; font-weight: 500; color: var(--c-sub); }
.ld-register, .ld-btn-48 { min-height: 48px; padding: 0 20px; font-size: 15px; line-height: 20px; }
.ld-card-note { font-size: 13px; line-height: 20px; color: var(--c-sub); }

.ld-group, .ld-list { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.ld-group .chip { align-self: flex-start; }
.ld-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; line-height: 20px; color: var(--chip-ink); }
.ld-list svg { flex-shrink: 0; }
.ld-list .is-check { color: var(--ld-check); }
.ld-list .is-lock { color: var(--c-label); }
.ld-rule { flex-shrink: 0; height: 1px; background: var(--c-line); }

/* ───────── Full-width blocks under the two columns ───────── */
.ld-band { display: flex; flex-direction: column; gap: 40px; padding-bottom: 96px; }
.ld-next { display: flex; align-items: flex-start; justify-content: space-between; gap: 64px; padding: 40px; border-radius: 12px; background: var(--panel); border: 1px solid var(--c-line); }
.ld-next-copy { flex: 1 1 0%; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.ld-next-text { max-width: 480px; font-size: 16px; line-height: 26px; color: var(--c-sub); }
.ld-next-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-top: 6px; }
.ld-advance { flex-shrink: 0; width: 480px; display: flex; flex-direction: column; gap: 16px; }
.ld-steps { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ld-steps li { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; border-radius: 8px; background: var(--row-2); }
.ld-steps i { flex-shrink: 0; width: 20px; font-style: normal; font-size: 12px; line-height: 20px; font-weight: 600; color: var(--c-sub); font-variant-numeric: tabular-nums; }
.ld-steps div { flex: 1 1 0%; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 20px; }
.ld-steps b { font-weight: 500; color: var(--ink); }
.ld-steps span { color: var(--c-sub); }
.ld-band-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.ld-band-head .btn { flex-shrink: 0; }
.ld-band-title { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.ld-band-text { font-size: 16px; line-height: 26px; color: var(--c-sub); }
/* Guide cards reuse the Resources card; Paper gives the paragraph no minimum height here */
.ld-guides .calc { justify-content: space-between; }

/* The price column stays in view while the longer main column scrolls (not drawn in Paper) */
@media (min-width: 1200px) and (min-height: 900px) {
  .ld-side { position: sticky; top: 92px; }
}

/* ───────── Below the 1440 artboard's range (not drawn in Paper): one column ───────── */
@media (max-width: 1199px) {
  .ld-head h1 { font-size: 48px; line-height: 54px; }
  .ld-layout { flex-direction: column; align-items: stretch; }
  .ld-side { width: auto; }
  .ld-photo { height: auto; aspect-ratio: 816 / 520; }
  .ld-next { flex-direction: column; align-items: stretch; gap: 32px; }
  .ld-advance { width: auto; }
  .ld-related .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ld-guides .calcs { flex-direction: column; }
}
@media (max-width: 700px) {
  .ld { padding-top: 68px; }
  .ld-head { padding-top: 24px; padding-bottom: 28px; gap: 14px; }
  .ld-top { flex-wrap: wrap; row-gap: 0; }
  .ld-top-rule { display: none; }
  .ld-back { width: 100%; }
  .ld-crumbs { flex-wrap: wrap; height: auto; min-height: 44px; row-gap: 0; }
  .ld-actions { width: 100%; margin-left: 0; }
  .ld-head h1 { font-size: 34px; line-height: 40px; letter-spacing: -0.02em; }
  .ld-tagline { font-size: 18px; line-height: 26px; }
  .ld-layout { gap: 24px; padding-bottom: 64px; }
  .ld-main { gap: 24px; }
  .ld-photo { aspect-ratio: 4 / 3; }
  .ld-photo .photo-chip { left: 12px; right: 12px; bottom: 12px; }
  .ld-tabs { gap: 24px; overflow-x: auto; scrollbar-width: none; }
  .ld-tabs::-webkit-scrollbar { display: none; }
  .ld-sec { padding-top: 16px; }
  .ld-sec-head { flex-direction: column; align-items: flex-start; }
  .ld-facts, .ld-terms { grid-template-columns: minmax(0, 1fr); }
  .ld-rows-main .ld-row { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; height: auto; min-height: 48px; padding-block: 12px; }
  .ld-about { flex-direction: column; }
  .ld-card { padding: 20px; }
  .ld-price b { font-size: 30px; line-height: 38px; }
  .ld-band { gap: 28px; padding-bottom: 64px; }
  .ld-next { padding: 24px 20px; }
  .ld-next-actions { align-self: stretch; flex-direction: column; align-items: stretch; }
  .ld-band-head { flex-direction: column; align-items: flex-start; gap: 20px; }
  .ld-related .cards { grid-template-columns: minmax(0, 1fr); }
}

/* The price card sits in the main column, under the practice facts and above Finance.
   On wide screens it spreads into two halves: the price and the button, then the locked figures. */
@media (min-width: 1200px) {
  .ld-card-wide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 40px; row-gap: 16px; align-items: start; }
  .ld-card-wide > * { grid-column: 1; }
  .ld-card-wide > .ld-rows { grid-column: 2; grid-row: 1 / span 4; align-self: center; }
  .ld-card-wide > .ld-register { justify-self: start; }
}
