/* ==========================================================================
   Single post — ported from Prestige Blog Post.dc.html.

   The reference kept layout inline on elements; it lives here as classes so it
   can be re-laid-out at breakpoints. Values come from prestige-tokens.css.

   NOTHING IN HERE STYLES .pr-prose. The post body is editor-authored and is
   styled by TAG in prestige-components.css, which is the single source of
   truth for it. The only .pr-prose selectors below constrain the WIDTH of two
   furniture regions (the sidebar card, the CTA card) — they set no typography.
   ========================================================================== */

/* --- Banner -------------------------------------------------------------- */

/* The header renders above <main>, so the banner pulls up under it and pads
   itself back down by the measured header height. Never hardcoded — site.js
   publishes --pr-header-height and the header compacts on scroll. */
[data-s="banner"] {
  /* The header is fixed and out of flow, so only the padding is needed to
     start the content below it — no negative margin to cancel. */
  padding-top: var(--pr-header-height, 0px);
  /* No min-height here: the interior heroes are one shared block, so the
     height comes from .pr-banner. The reference page carried its own taller
     value inline (690px vs 600px), which made this hero 74px taller than
     Contact, Gallery and Blog for no reason a reader could see. */
  /* 0.66 flat wash over the photo — above the 0.62 floor, and the reference's
     own value. White banner copy measures well clear of 4.5:1 against the
     project photography at this wash. */
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.66), rgba(0, 0, 0, 0.66)),
    var(--pr-banner-image);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* Gap comes from .pr-banner__inner (14px), like every other interior hero.
   The reference page's own 16px was a one-off that made this hero's crumb-to-
   title spacing differ from the rest. */

/* The post title is sentence case and long, so it drops below the shared
   --display-xl and keeps its own casing. */
[data-s="title"] {
  max-width: 1180px;
  font-size: clamp(34px, 4.2vw, 80px);
  line-height: 1.04;
  text-transform: none;
  text-wrap: pretty;
}

[data-s="meta"] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
}

/* On the dark banner the shared .pr-meta drops to --surface (4.39:1 at 15px,
   which fails AA), so post meta is --paper here. */
[data-s="metaitem"] { color: var(--paper); }

/* --- Body + sidebar ------------------------------------------------------ */

[data-s="bodysection"] {
  padding-top: clamp(48px, 4.6vw, 90px);
  padding-right: var(--gutter-page);
  padding-bottom: clamp(56px, 5.2vw, 100px);
  padding-left: var(--gutter-page);
}

[data-s="body"] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  gap: clamp(30px, 3.4vw, 66px);
  align-items: start;
}

[data-s="body"] > .pr-prose { min-width: 0; }

/* --- Article furniture (outside .pr-prose) ------------------------------- */

[data-s="aside"] {
  position: sticky;
  /* Clears the fixed header. Uses the COMPACT height, because by the time the
     sidebar sticks the header has already shrunk — offsetting by the resting
     height would leave a large gap. Falls back to the resting height, then to
     a sane constant, so this is right before JS runs too. */
  top: calc(
    var(--pr-header-height-compact, var(--pr-header-height, 96px))
    + clamp(20px, 2vw, 36px)
  );
  border-left: 1px solid rgba(0, 0, 0, 0.12);
  padding-left: clamp(22px, 2.2vw, 40px);
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 2.4vw, 40px);
}

[data-s="asideblock"] {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

[data-s="asidehead"] {
  font-family: var(--font-cta);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Table of contents. Built from the post's own h2 ids by single.js. */
[data-s="toc"] {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

[data-s="toc"] a {
  font-size: var(--body);
  line-height: 26px;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  text-decoration-color: rgba(0, 0, 0, 0.25);
  text-wrap: pretty;
}
[data-s="toc"] a:hover { text-decoration-color: var(--ink); }

/* Share row. */
[data-s="sharerow"] {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

[data-s="sharebtn"] {
  display: flex;
  align-items: center;
  justify-content: center;
  /* 46px in the reference; raised to the 44px floor's nearest comfortable
     square and kept at 46 so the row matches the comp. */
  width: 46px;
  height: 46px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--surface);
  color: var(--ink);
  cursor: pointer;
}
[data-s="sharebtn"]:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
[data-s="sharebtn"] svg {
  width: 20px;
  height: 20px;
}

[data-s="copystatus"] {
  font-size: 14px;
  line-height: 22px;
  color: var(--muted);
}
/* Nothing to say yet — collapse the line so the block does not reserve space
   before the button is ever pressed. */
[data-s="copystatus"]:empty { display: none; }

/* Sidebar help card. Padding is the reference's, tighter than .pr-surface. */
[data-s="asidecard"] {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(22px, 2.2vw, 34px);
}

[data-s="asidecardtitle"] {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(22px, 1.7vw, 30px);
  line-height: 1.1;
  text-transform: uppercase;
}

/* Width only — typography inside stays the shared prose contract's. */
[data-s="asidecardbody"] { max-width: 100%; }

[data-s="asidecardcta"] { margin-top: 4px; }

/* --- Related posts ------------------------------------------------------- */

[data-s="relatedsection"] {
  padding-right: var(--gutter-page);
  padding-left: var(--gutter-page);
}

[data-s="relatedtitle"] { font-size: var(--display-md); }

[data-s="relatedgrid"] {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 2vw, 36px);
  margin-top: clamp(26px, 2.6vw, 46px);
}

/* Same shape as the blog archive card and the homepage news card — this is
   the same .pr-photocard, and it should not change height per page. */
/*
 * Same card, same reasoning as the blog archive (see pages/blog.css): the ratio
 * sets the height from the width, and min-height: auto lets a long title grow
 * the card rather than being clipped at the top.
 */
[data-s="relatedcard"] {
  aspect-ratio: 967 / 607;
  min-height: auto;
}

/* .pr-photocard__shot is an absolutely-positioned layer; the <img> inside it
   (there so WordPress emits srcset) needs an explicit height to fill it. */
[data-s="relatedshot"] img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

[data-s="relatedmeta"] {
  font-size: 14px;
  color: var(--surface);
}

[data-s="relatedcardtitle"] {
  font-family: var(--font-editorial);
  font-weight: 500;
  font-size: clamp(20px, 1.6vw, 30px);
  line-height: 1.16;
  color: var(--paper);
  text-wrap: pretty;
  /*
   * Three lines, then an ellipsis.
   *
   * The card holds a fixed 967/607 ratio, so a title long enough to overrun it
   * would have its TOP cut off by the card's overflow — the first line, mid
   * letter, with no sign anything was missing. Three lines is what the card has
   * room for at every width, and -webkit-line-clamp trails off cleanly instead.
   *
   * Earlier attempts let the card grow instead, which cost the rounded corners
   * and then the hover zoom containment; clamping the text keeps every visual
   * detail of the card intact.
   */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

/* --- Get in touch card (straddles the footer edge) ----------------------- */
/* Same card as the home page. site.js measures it and publishes
   --pr-cta-overhang; the margin-bottom below is only the pre-JS value. */

[data-s="ctawrap"] {
  position: relative;
  z-index: 5;
  margin-top: clamp(40px, 4.95vw, 95px);
  margin-bottom: clamp(-128px, -6.67vw, -52px);
  padding: 0 var(--gutter-page);
}

[data-s="cta-row"] {
  max-width: var(--content-max);
  margin-right: auto;
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(20px, 2.4vw, 44px);
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-cta);
  padding: clamp(28px, 3vw, 54px) clamp(24px, 2.6vw, 48px);
}

[data-s="ctacopy"] {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 420px;
  min-width: 0;
}
/* Measure only. */
[data-s="ctacopy"] .pr-prose { max-width: 620px; }

[data-s="ctatitle"] {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--display-md);
  line-height: 1.05;
  text-transform: uppercase;
}

[data-s="cta-row"] > .pr-cta { flex: 0 0 auto; }

/* ==========================================================================
   Breakpoints
   ========================================================================== */

@media (max-width: 1199px) {
  /* The sidebar drops under the article and stops being sticky — a rail that
     follows you is only useful beside the text. */
  [data-s="body"] { grid-template-columns: minmax(0, 1fr); }
  [data-s="aside"] {
    position: static;
    border-left: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    padding-left: 0;
    padding-top: clamp(28px, 3vw, 48px);
  }
  [data-s="relatedgrid"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/*
 * Two per row, same problem the blog grid has: 967/607 makes the card shorter
 * exactly where the title has least width, and long titles hit the 3-line
 * clamp. Measured clipped at 768, 800 and 900px. 3/2 buys back ~40px.
 *
 * Bounded below at 768 so it cannot reach the one-per-row range.
 */
@media (min-width: 768px) and (max-width: 1199px) {
  [data-s="relatedcard"] { aspect-ratio: 3 / 2; }
}

@media (max-width: 991px) {
  /* Standing rule: titles and copy centre at tablet and below. */
  [data-s="meta"] { justify-content: center; }
  [data-s="aside"] { text-align: center; }
  [data-s="asideblock"] { align-items: center; }
  [data-s="toc"] { align-items: center; }
  [data-s="sharerow"] { justify-content: center; }
  [data-s="asidecard"] { align-items: center; }
  [data-s="asidecardcta"] { text-align: center; }
  [data-s="cta-row"] {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  [data-s="cta-row"] > .pr-cta {
    max-width: 420px;
    text-align: center;
  }
  [data-s="ctacopy"] { flex: 0 1 auto; }
  [data-s="ctacopy"] .pr-prose { margin-right: auto; margin-left: auto; }
}

@media (max-width: 767px) {
  [data-s="relatedgrid"] { grid-template-columns: minmax(0, 1fr); }
  /*
   * One per row: the card fills the column, so a ratio scales its height with
   * the viewport — squat and clipping at 375px, overly tall near 767px. Fixed
   * height instead, width fills the row. Matches [data-b="card"] on the blog
   * index, which is the same component at the same breakpoint.
   */
  [data-s="relatedcard"] {
    aspect-ratio: auto;
    height: 320px;
  }
}
