/* ─────────────────────────────────────────────────────────────────────────
   Atlas AI — design tokens (launch pass)

   Shared CSS custom properties for every code component. Imported once per
   component so each bundle is self-contained in Webflow. Values mirror the
   `:root` blocks in the reference build (atlas-website/site/css/_shared.css
   and _system.css) — keep them in sync, and keep the Site Settings head block
   (site-settings/head.html) in sync with this file. Do not add new colors to
   the palette (see CLAUDE.md § "Things NOT to do").

   ───────────────────────────────────────────────────────────────────────── */
:host,
:host {
  /* Paper (backgrounds) */
  --paper:      #F4EFE5;
  --paper-alt:  #EBE4D4;
  --paper-deep: #DDD3BC;
  --paper-86:   rgba(245, 239, 229, 0.86);
  --paper-74:   rgba(245, 239, 229, 0.74);
  --paper-55:   rgba(245, 239, 229, 0.55);
  --paper-22:   rgba(245, 239, 229, 0.22);
  --paper-10:   rgba(245, 239, 229, 0.10);

  /* Ink (text) */
  --ink:    #1A1612;
  --ink-85: rgba(26, 22, 18, 0.86);
  --ink-70: rgba(26, 22, 18, 0.72);
  --ink-64: rgba(26, 22, 18, 0.64); /* small text: 5.1:1 on paper, 4.6:1 on paper-deep */
  --ink-55: rgba(26, 22, 18, 0.55); /* form-field borders: 3.5:1 */
  --ink-50: rgba(26, 22, 18, 0.5);
  --ink-30: rgba(26, 22, 18, 0.3);
  --ink-20: rgba(26, 22, 18, 0.18);
  --ink-14: rgba(26, 22, 18, 0.14);
  --ink-08: rgba(26, 22, 18, 0.08);

  /* Ochre (accent) */
  --ochre:       #8C6A3D;
  --ochre-text:  #73572F; /* ochre text under 24px: 5.9:1 on paper */
  --ochre-light: #D9B98A;
  --ochre-soft:  rgba(140, 106, 61, 0.14);
  --gold:        #B89968;

  /* Status */
  --error: #7A2E1E; /* form errors only */

  /* Type */
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --sans:  "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Layout */
  --wrap-max:        1312px;
  --wrap-wide-max:   1440px;
  --wrap-narrow-max: 920px;
  --pad-x:           64px;
  --header-h:        76px; /* the sticky Nav; anchors scroll clear of it */
}

@media (max-width: 991px) {
  :host,
  :host {
    --pad-x: 24px;
    --header-h: 64px;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   Accessibility base (MIGRATION-PLAN.md §1.4)

   Imported with the tokens by each component. Document styles don't cross
   shadow roots, so every component carries its own copy of these rules.
   Ported from the reference build's _system.css §2 and its mobile pass.
   ───────────────────────────────────────────────────────────────────────── */

:focus-visible {
  outline: 2px solid var(--wf-focus, var(--ochre));
  outline-offset: 3px;
}

/* Visually hidden, still read by screen readers. */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 991px) {
  .wf-tap {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-block: calc(-1 * var(--wf-tap-pull, 11px));
  }

  .wf-tap-box {
    min-height: 44px;
  }
}

/* Reduced motion: everything lands in its final state at once. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* PostCard. Image ports the blog's `.post` (page-blog.css:14-31); Text ports the homepage's `.perspective-card`
   (_shared.css, with _system.css's ink-64 and ochre-text). It renders in its own shadow root, so the reference's page
   base the card relied on is set here: the body font, zero margins, text-wrap on headings and paragraphs.

   Every selector has two classes, so the page base rules a local render also sees (`.atlas-page p { margin: 0 }`)
   never outrank these.

   Sizes come in as custom properties, which inherit through the shadow boundary. The blog index's Featured list
   sets them on its items (shared/postList.slotted.ts); Size sets them on the card itself, which wins:
     --atlas-post-ratio         image aspect ratio          16 / 10
     --atlas-post-title-size    title size                  22px
     --atlas-post-title-leading title line height           1.28
     --atlas-post-sum-size      summary size                15px
     --atlas-post-sum-lines     summary lines before "…"    3 */

:host {
  display: block;
  height: 100%;
}

.wf-post {
  box-sizing: border-box;
  height: 100%;
  font: 400 16px/1.55 var(--sans);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wf-post *,
.wf-post *::before,
.wf-post *::after {
  box-sizing: border-box;
}

.wf-post .wf-post-title {
  margin: 0;
  text-wrap: balance;
}

.wf-post p {
  margin: 0;
  text-wrap: pretty;
}

/* ─── Image ───────────────────────────────────────────────────── */
.wf-post--big {
  --atlas-post-title-size: clamp(28px, 2.8vw, 36px);
  --atlas-post-title-leading: 1.15;
  --atlas-post-sum-size: 17px;
  --atlas-post-sum-lines: 4;
}

.wf-post--small {
  --atlas-post-ratio: 16 / 9;
}

.wf-post .wf-post-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.wf-post .wf-post-img {
  aspect-ratio: var(--atlas-post-ratio, 16 / 10);
  background: var(--paper-deep);
  overflow: hidden;
  margin-bottom: 18px;
}

.wf-post .wf-post-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) sepia(0.35) contrast(0.95) brightness(1.03);
  mix-blend-mode: multiply;
  transition: transform 0.5s ease;
}

.wf-post .wf-post-link:hover .wf-post-img img {
  transform: scale(1.03);
}

.wf-post .wf-post-k {
  margin: 0 0 8px;
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ochre-text);
}

.wf-post--image .wf-post-title {
  font: 400 var(--atlas-post-title-size, 22px) / var(--atlas-post-title-leading, 1.28) var(--serif);
  color: var(--ink);
}

.wf-post .wf-post-link:hover .wf-post-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.wf-post .wf-post-sum {
  margin: 10px 0 0;
  font-size: var(--atlas-post-sum-size, 15px);
  line-height: 1.55;
  color: var(--ink-70);
  display: -webkit-box;
  -webkit-line-clamp: var(--atlas-post-sum-lines, 3);
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wf-post--image .wf-post-by {
  display: block;
  margin: 12px 0 0;
  font-size: 13.5px;
  color: var(--ink-64);
}

/* ─── Text ────────────────────────────────────────────────────── */
.wf-post--text {
  background: var(--paper);
  padding: 32px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wf-post .wf-post-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 1.8px;
  color: var(--ink-64);
  text-transform: uppercase;
}

.wf-post .wf-post-head:empty {
  display: none;
}

.wf-post .wf-post-kicker {
  color: var(--ochre-text);
}

.wf-post--text .wf-post-title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.3px;
}

.wf-post .wf-post-excerpt {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-70);
}

.wf-post .wf-post-foot {
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

/* Text cards fill their grid cell, so the foot sits at the bottom and "Read →" lines up across a row.
   The padding keeps the 4px it had over the excerpt in the tallest card. */
.wf-post--text .wf-post-foot {
  margin-top: auto;
  padding-top: 4px;
}

.wf-post--text .wf-post-by {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-64);
}

.wf-post .wf-post-read {
  font-size: 12.5px;
  color: var(--ink);
  text-decoration: none;
}

.wf-post .wf-post-read span {
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
}

/* Phones: a comfortable tap target on "Read →" (_system.css conversion pass) */
@media (max-width: 991px) {
  .wf-post .wf-post-read {
    display: inline-block;
    padding-block: 11px;
    margin-block: -11px;
  }
}

