/* Single article.

   Written entirely against the token layer, like kssk.css and kssk-content.css:
   no literal colour, type or spacing value belongs here. The few literal
   lengths are structural and match their precedents elsewhere in the theme:
   the 260px rail and its 104px sticky offset are the Terms rail's, and the
   0.04em tracking on uppercase labels is the placeholder label's.

   Loaded only on single posts (inc/article.php), after kssk-content.css, which
   carries the ArticleCard and PromoPair that close the page.

   Nothing here adds a shadow, and the only border is the orange hairline on
   the tip callout - the same hairline the AlertBanner's disclosure treatment
   already uses for the same job of setting one practical note apart. */

/* === Head ===
   Category, title, standfirst. Left-aligned at the gutter: the brand centres
   section headings and the confirmation seal and nothing else. */

.kssk-post__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-16);
  padding-top: var(--space-64);
  padding-bottom: var(--space-40);
}

.kssk-post__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
}

/* The Heading role, 48/54 at the canvas, stepping down with the display
   tokens in responsive.css. The measure is in em so it scales with the face:
   long titles break into two even lines instead of one line and an orphan. */
.kssk-post__title {
  max-width: 18em;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-8xl);
  line-height: var(--leading-54);
  color: var(--text-body);
}

/* The Subtitle role. Navy, not a brand colour: the reference this layout was
   approved against coloured its lead paragraph, and orange is never a text
   colour on white in this system. */
.kssk-post__standfirst {
  max-width: 68ch;
  margin: 0;
  font-family: var(--font-body);
  font-weight: var(--weight-medium);
  font-size: var(--text-xl);
  line-height: var(--leading-30);
  color: var(--text-body);
}

/* === Photograph ===
   Square corners, like the article card. 2:1 across the 1200px column keeps
   the first paragraph within reach of the fold; 16:9 below 1024, where 2:1
   would turn a portrait-ish crop into a letterbox. */

.kssk-post__media {
  padding-bottom: var(--space-64);
}

.kssk-post__image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  border-radius: var(--radius-none);
}

/* The labelled placeholder sets its ratio from its slot through a custom
   property; this rule sets aspect-ratio itself, so the page ratio wins. */
.kssk-post__media .kssk-placeholder {
  aspect-ratio: 2 / 1;
  border-radius: var(--radius-none);
}

/* === Layout ===
   The Terms rail's proportions, so the two long-form pages read as one
   system. .kssk-split already stacks below 1024 (tokens/responsive.css). */

.kssk-post__layout {
  --kssk-split-cols: 260px minmax(0, 1fr);
  padding-bottom: var(--space-104);
}

/* Stretched to the row so the inner block has somewhere to stick within.
   .kssk-split aligns its items to the start, which would leave the rail only
   as tall as its contents and the sticky offset with no room to act. */
.kssk-post__rail {
  align-self: stretch;
}

.kssk-post__rail-inner {
  position: sticky;
  top: 104px;
  display: flex;
  flex-direction: column;
  gap: var(--space-32);
  max-height: calc(100vh - 104px - var(--space-32));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: var(--space-8);
}

.kssk-post__main {
  min-width: 0;
}

/* === Meta ===
   Uppercase data labels over their values, the way PICK UP and RETURN label
   theirs. Uppercase here means "this is a label", never "this is important". */

.kssk-post-meta {
  margin: 0;
}

.kssk-post-meta--rail {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.kssk-post-meta__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.kssk-post-meta__label,
.kssk-post-toc__title {
  margin: 0;
  font-family: var(--font-body);
  font-weight: var(--weight-bold);
  font-size: var(--text-xs);
  line-height: var(--leading-18);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.kssk-post-meta__value {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: var(--leading-22);
  color: var(--text-body);
}

.kssk-post-meta--inline {
  display: none;
  flex-wrap: wrap;
  gap: var(--space-8);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: var(--leading-22);
  color: var(--text-secondary);
}

/* === Sections ===
   Each link is its own 44px target: the minimum holds at every breakpoint,
   the rail included. */

.kssk-post-toc__title {
  margin-bottom: var(--space-4);
}

.kssk-post-toc__list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kssk-post-toc__link {
  display: block;
  padding-block: 11px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: var(--leading-22);
  color: var(--text-secondary);
  text-decoration: none;
}

/* Dark orange rather than KSSK Orange: the brand orange on white is under 3:1,
   and a hover state is still text someone is reading. */
.kssk-post-toc__link:hover,
.kssk-post-toc__link:focus-visible {
  color: var(--orange-700);
  text-decoration: underline;
}

/* The phone and tablet form: closed until asked for, on the input recess
   fill, with the browser's own disclosure marker. */
.kssk-post__toc-disclosure {
  display: none;
}

.kssk-post-toc--disclosure {
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.kssk-post-toc__summary {
  padding: 11px var(--space-16);
  font-family: var(--font-body);
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  line-height: var(--leading-22);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
  cursor: pointer;
}

.kssk-post-toc--disclosure .kssk-post-toc__list {
  padding: 0 var(--space-16) var(--space-8);
}

/* === Body ===
   .kssk-prose (kssk.css) sets the measure and the paragraph, heading and list
   rhythm shared with the legal pages. What follows is only what an article
   adds to it. */

.kssk-post__body h2,
.kssk-post__body h3 {
  /* Clears the sticky header when a section link jumps here. */
  scroll-margin-top: 104px;
}

.kssk-post__body a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.kssk-post__body a:hover {
  color: var(--orange-700);
}

.kssk-post__body strong,
.kssk-post__body b {
  font-weight: var(--weight-bold);
}

/* --- Pull quote ---
   The testimonial card's idiom - cream ground, orange quote glyph, square
   corners - so a quote in an article reads as the same kind of thing as a
   review on the homepage. For real, attributable words only.

   Every bare blockquote takes it, so a quote made in any editor gets the
   treatment without a class. Border, margin and padding are reset explicitly:
   scoping only overrides the properties a rule declares, and the block
   library's quote styles declare some of their own. */

.kssk-post__body blockquote {
  position: relative;
  margin: var(--space-40) 0;
  padding: calc(var(--space-32) + 29px + var(--space-16)) var(--space-32) var(--space-32);
  border: 0;
  border-radius: var(--radius-none);
  background: var(--surface-cream);
  color: var(--text-body);
}

.kssk-post__body blockquote::before {
  content: "";
  position: absolute;
  top: var(--space-32);
  left: var(--space-32);
  width: 30px;
  height: 29px;
  background-color: var(--kssk-orange);
  -webkit-mask: url("../img/icons/quote.svg") no-repeat center / contain;
  mask: url("../img/icons/quote.svg") no-repeat center / contain;
}

.kssk-post__body blockquote p {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-4xl);
  line-height: var(--leading-37);
  color: var(--text-body);
}

.kssk-post__body blockquote p + p {
  margin-top: var(--space-16);
}

.kssk-post__body blockquote cite {
  display: block;
  margin-top: var(--space-16);
  font-family: var(--font-body);
  font-style: normal;
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  line-height: var(--leading-22);
  color: var(--text-primary);
}

/* The block editor's Pullquote wraps its quote in a figure. */
.kssk-post__body .wp-block-pullquote {
  margin: var(--space-40) 0;
  padding: 0;
  border: 0;
  text-align: left;
}

.kssk-post__body .wp-block-pullquote blockquote {
  margin: 0;
}

/* --- Tip ---
   One practical, KSSK-specific note, set apart on the AlertBanner's
   disclosure treatment: white, a 1px orange hairline, 4px radius, the tag
   glyph leading. Body-size type, because unlike a form notice this is part of
   the reading. */

.kssk-post__body .kssk-tip,
.kssk-post__body .is-style-kssk-tip {
  position: relative;
  margin: var(--space-32) 0;
  padding: var(--space-16) var(--space-21) var(--space-16) calc(var(--space-21) + 16px + var(--space-12));
  border: var(--border-hairline) solid var(--border-brand);
  border-radius: var(--radius-sm);
  background: var(--surface-page);
}

.kssk-post__body .kssk-tip::before,
.kssk-post__body .is-style-kssk-tip::before {
  content: "";
  position: absolute;
  top: calc(var(--space-16) + 4px);
  left: var(--space-21);
  width: 16px;
  height: 16px;
  background-color: var(--kssk-orange);
  -webkit-mask: url("../img/icons/tag.svg") no-repeat center / contain;
  mask: url("../img/icons/tag.svg") no-repeat center / contain;
}

.kssk-post__body .kssk-tip p,
.kssk-post__body .is-style-kssk-tip p {
  margin: 0;
}

.kssk-post__body .kssk-tip p + p,
.kssk-post__body .is-style-kssk-tip p + p {
  margin-top: var(--space-8);
}

.kssk-post__body .kssk-tip__title {
  font-weight: var(--weight-bold);
  color: var(--text-primary);
}

/* --- Figure ---
   Square corners and a one-line functional caption under the photograph,
   never laid over it. */

.kssk-post__body figure,
.kssk-post__body .wp-block-image {
  margin: var(--space-40) 0;
}

.kssk-post__body figure img,
.kssk-post__body .wp-block-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-none);
}

.kssk-post__body figcaption,
.kssk-post__body .wp-element-caption {
  margin: var(--space-8) 0 0;
  font-family: var(--font-body);
  font-size: var(--text-note);
  line-height: var(--leading-18);
  color: var(--text-secondary);
  text-align: left;
}

/* --- Checklist ---
   The design system's own check glyph in orange, hung in the gutter so every
   item starts on the same line. Masked rather than inlined, because the list
   is editor content and cannot carry markup for each tick. */

.kssk-post__body .kssk-checklist,
.kssk-post__body .is-style-kssk-checklist {
  padding-left: 0;
  list-style: none;
}

.kssk-post__body .kssk-checklist li,
.kssk-post__body .is-style-kssk-checklist li {
  position: relative;
  padding-left: var(--space-32);
}

.kssk-post__body .kssk-checklist li::before,
.kssk-post__body .is-style-kssk-checklist li::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 0;
  width: 18px;
  height: 12px;
  background-color: var(--kssk-orange);
  -webkit-mask: url("../img/icons/check.svg") no-repeat center / contain;
  mask: url("../img/icons/check.svg") no-repeat center / contain;
}

/* === Below 1024 ===
   The rail goes; the meta line under the standfirst and the closed section
   list above the body stand in for it. */

@media (max-width: 1023px) {
  .kssk-post__head {
    padding-top: var(--space-40);
    padding-bottom: var(--space-32);
  }

  .kssk-post__image,
  .kssk-post__media .kssk-placeholder {
    aspect-ratio: 16 / 9;
  }

  .kssk-post__media {
    padding-bottom: var(--space-40);
  }

  .kssk-post__rail {
    display: none;
  }

  .kssk-post-meta--inline {
    display: flex;
  }

  .kssk-post__toc-disclosure {
    display: block;
    margin-bottom: var(--space-32);
  }
}

@media (max-width: 767px) {
  .kssk-post__body blockquote {
    padding: calc(var(--space-24) + 29px + var(--space-12)) var(--space-24) var(--space-24);
  }

  .kssk-post__body blockquote::before {
    top: var(--space-24);
    left: var(--space-24);
  }
}
