/* ============================================================
   Spengler & Agans — surface texture + editorial furniture
   -----------------------------------------------------------
   Two jobs:
   1. Give the flat cream/navy bands some depth, without turning
      a law firm into a tech startup. Everything here is ambient:
      low-opacity, behind content, pointer-events:none.
   2. Supply the components that break up long text pages —
      pull quotes, callouts, drop caps, a sticky article TOC.

   Contrast rule for this file: nothing in here may sit between
   a reader and body text. Texture layers are decoration only and
   never carry, tint, or overlay type. Text colour is still owned
   by tokens.css and base.css.
   ============================================================ */

/* ------------------------------------------------------------
   1. Ambient section texture
   ------------------------------------------------------------ */

/* Sections need a stacking context so their ::before texture sits
   behind content but above the section background. */
.section,
.hero,
.cta-banner,
.map-band {
  position: relative;
  isolation: isolate;
}
.section > *,
.hero > *,
.cta-banner > *,
.map-band > * {
  position: relative;
  z-index: 1;
}

/* Paper ground.

   This is deliberately ONE viewport-fixed layer on <body> rather than a
   per-section pseudo-element. Section-level washes were tried first and every
   boundary between two cream blocks showed a faint horizontal seam where one
   gradient ended and the next began. A single fixed layer cannot seam, and it
   also means the light stays put while the page scrolls under it, which is
   what makes it read as a lit surface instead of a painted-on shape. */
body {
  background-image:
    radial-gradient(90% 60% at 82% 0%,
      color-mix(in srgb, #FFFFFF 55%, transparent) 0%,
      transparent 60%),
    radial-gradient(70% 55% at 0% 100%,
      color-mix(in srgb, var(--navy) 4%, transparent) 0%,
      transparent 60%);
  background-attachment: fixed, fixed;
  background-repeat: no-repeat, no-repeat;
}

/* Tinted bands get a faint ledger grid. It reads as paper ruling at a glance
   and disappears entirely at arm's length. These bands paint their own opaque
   background, so a boundary here is a deliberate change of surface, not a
   seam in a continuous one. */
.section-tint::before {
  content: '';
  position: absolute;
  inset: 0 calc(50% - 50vw);
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(color-mix(in srgb, var(--navy) 4.5%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--navy) 4.5%, transparent) 1px, transparent 1px);
  background-size: 64px 64px, 64px 64px;
}

/* Navy bands: fine diagonal hatching plus a cool light from the top
   right, so the block has a direction instead of being a solid slab. */
.section-navy::before,
.cta-banner::before,
.map-band::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    repeating-linear-gradient(
      -45deg,
      color-mix(in srgb, var(--sky) 4%, transparent) 0px,
      color-mix(in srgb, var(--sky) 4%, transparent) 1px,
      transparent 1px,
      transparent 9px),
    radial-gradient(80% 100% at 88% 0%,
      color-mix(in srgb, var(--sky) 11%, transparent) 0%,
      transparent 62%);
}

/* Monogram watermark. Set on any navy panel that has room for it —
   the CTA banner and the locations band. Clipped by overflow so it
   bleeds off the corner rather than floating in the middle. */
.cta-banner,
.section-navy .map-band-inner {
  overflow: hidden;
}
.cta-banner::after {
  content: 'S&A';
  position: absolute;
  right: -0.16em;
  bottom: -0.42em;
  z-index: 0;
  font-family: var(--font-display);
  font-size: clamp(9rem, 22vw, 20rem);
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.04em;
  color: color-mix(in srgb, var(--sky) 7%, transparent);
  pointer-events: none;
  user-select: none;
}

/* ------------------------------------------------------------
   2. Decorative rules
   ------------------------------------------------------------ */

/* A short brass rule. Sits under an eyebrow or above a section head. */
.rule-brass {
  display: block;
  width: 56px;
  height: 2px;
  border: 0;
  margin: 0 0 20px;
  background: linear-gradient(90deg, var(--brass) 0%, color-mix(in srgb, var(--brass) 20%, transparent) 100%);
}

/* Centred divider with a diamond, for breaking a long article into acts. */
.divider-mark {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 56px 0;
  color: color-mix(in srgb, var(--brass) 55%, transparent);
}
.divider-mark::before,
.divider-mark::after {
  content: '';
  flex: 1;
  height: 1px;
  background: currentColor;
}
.divider-mark span {
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  background: var(--brass);
  flex: none;
}

/* ------------------------------------------------------------
   3. Editorial furniture for long text
   ------------------------------------------------------------ */

/* Pull quote. Lifts a line out of the body copy and gives the eye a
   rest point. Display serif, brass rule, never full width. */
.pullquote {
  margin: 44px 0;
  padding: 4px 0 4px 28px;
  border-left: 3px solid var(--brass);
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 1.1vw + 1rem, 1.7rem);
  line-height: 1.4;
  color: var(--navy);
}
.pullquote cite {
  display: block;
  margin-top: 12px;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--charcoal-soft);
}
/* On a wide screen a pull quote may hang into the margin of a .prose
   column, which is what makes it read as editorial rather than as a
   blockquote. Only where there is margin to hang into. */
@media (min-width: 1100px) {
  .prose .pullquote--hang {
    margin-left: -110px;
    padding-right: 24px;
  }
}

/* Callout / key takeaway. A bordered aside for the one thing a reader
   should leave with. */
.callout {
  margin: 40px 0;
  padding: 26px 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brass);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.callout-title {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy-mid);
  margin-bottom: 10px;
}
.callout p:last-child,
.callout ul:last-child { margin-bottom: 0; }

/* Drop cap. Applied per-element, never automatically, so a paragraph
   that starts with a quote mark or a number is never mangled. */
.dropcap::first-letter {
  float: left;
  font-family: var(--font-display);
  font-size: 3.6em;
  line-height: 0.82;
  font-weight: 500;
  color: var(--navy);
  margin: 0.06em 0.10em 0 0;
}

/* ------------------------------------------------------------
   4. Article layout — body column plus sticky contents rail
   ------------------------------------------------------------
   The blog template used a single centred .prose column, which left a
   wide empty margin on desktop. The rail fills it with something the
   reader can use instead of decoration. */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 68ch) 240px;
  gap: 64px;
  justify-content: center;
  align-items: start;
}
.article-layout > .prose { margin-inline: 0; max-width: none; }

.article-rail {
  position: sticky;
  top: 112px;
  font-size: 0.9rem;
  border-left: 1px solid var(--line);
  padding-left: 22px;
}
.article-rail-title {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy-mid);
  margin-bottom: 14px;
}
.article-rail ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.article-rail a {
  /* --charcoal-soft is 5.5:1 on cream; the active/hover state goes to
     full navy so the contrast only ever increases. */
  color: var(--charcoal-soft);
  line-height: 1.35;
  display: block;
}
.article-rail a:hover,
.article-rail a.is-current {
  color: var(--navy);
  text-decoration: none;
}
.article-rail a.is-current { font-weight: 600; }

/* Below the grid breakpoint the rail is redundant with the article
   itself and costs a screen of scrolling, so it goes away. */
@media (max-width: 1080px) {
  .article-layout { grid-template-columns: minmax(0, 68ch); justify-content: center; }
  .article-rail { display: none; }
}

/* ------------------------------------------------------------
   5. Trust strip — credentials under a hero
   ------------------------------------------------------------ */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px 32px;
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.trust-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--charcoal-soft);
}
@media (max-width: 860px) { .trust-strip { grid-template-columns: repeat(2, 1fr); } }
.trust-item strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--navy);
  line-height: 1;
}

/* ------------------------------------------------------------
   6. Figure accents
   ------------------------------------------------------------ */
/* A brass corner bracket behind a photo, offset so it peeks out of two
   edges. Purely decorative, sits under the image. */
.figure--framed { position: relative; }
.figure--framed::before {
  content: '';
  position: absolute;
  left: -14px;
  bottom: -14px;
  width: 46%;
  height: 52%;
  border-left: 2px solid color-mix(in srgb, var(--brass) 60%, transparent);
  border-bottom: 2px solid color-mix(in srgb, var(--brass) 60%, transparent);
  border-bottom-left-radius: var(--radius);
  z-index: -1;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .article-rail { position: static; }
}
