/* OF4S Blog Skin — one shared stylesheet for all migrated blog posts.
 * Served as a public ir.attachment at /web/content/<id>/of4s-blog.css;
 * each migrated post's content links it and wraps itself in <div class="of4s-blog">.
 * EVERYTHING here is scoped under .of4s-blog (plus one :has() page-background
 * rule that only fires when a .of4s-blog wrapper is present) so unmigrated
 * posts and the shared blog chrome are unaffected.
 * Tokens: OF4S design system v1.0 (design_handoff_landing_page/design-system/tokens.css).
 */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..600;1,9..144,300..600&family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

/* Warm paper page background, only on pages that contain a migrated post. */
#wrapwrap:has(.of4s-blog) {
  background: #faf8f4;
}

.of4s-blog {
  /* ── tokens ── */
  --of4s-navy-800: #15273f;
  --of4s-brass-900: #6e4f1f;
  --of4s-brass-700: #8e6a30;
  --of4s-brass-400: #c9a474;
  --of4s-brass-300: #d9bd95;
  --of4s-brass-100: #f0e6d4;
  --of4s-paper-50: #faf8f4;
  --of4s-paper-100: #f3efe7;
  --of4s-paper-200: #e8e2d4;
  --of4s-stone-500: #7a7468;
  --of4s-stone-700: #3a362f;
  --of4s-stone-900: #1a1814;
  --of4s-font-display: 'Fraunces', 'Times New Roman', serif;
  --of4s-font-sans: 'Geist', -apple-system, system-ui, sans-serif;
  --of4s-font-mono: 'Geist Mono', 'SF Mono', Menlo, monospace;
  --of4s-radius-lg: 8px;
  --of4s-radius-xl: 14px;
  --of4s-radius-pill: 999px;
  --of4s-border-thin: 1px solid rgba(15, 29, 51, 0.1);
  /* Fixed-px measure (~68ch of 17px Geist) so headings, body, figures and
     rules all align on one column; ch would recompute per font size. */
  --of4s-measure: 720px;

  font-family: var(--of4s-font-sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--of4s-stone-900);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

.of4s-blog ::selection {
  background: var(--of4s-navy-800);
  color: var(--of4s-paper-50);
}

/* ── Reading measure: loose text blocks sit at ~68ch, centered.
      Text inside snippet grid columns is narrower than the measure,
      so these rules are a no-op there — layouts are preserved. ── */
.of4s-blog > p,
.of4s-blog > h2,
.of4s-blog > h3,
.of4s-blog > h4,
.of4s-blog > ul,
.of4s-blog > ol,
.of4s-blog > blockquote,
.of4s-blog > figure,
.of4s-blog .container > p,
.of4s-blog .container > h2,
.of4s-blog .container > h3,
.of4s-blog .container > h4,
.of4s-blog .container > ul,
.of4s-blog .container > ol,
.of4s-blog .container > blockquote,
.of4s-blog .container > figure {
  max-width: var(--of4s-measure);
  margin-left: auto;
  margin-right: auto;
}

/* ── Type ── */
.of4s-blog h2,
.of4s-blog h3,
.of4s-blog h4 {
  font-family: var(--of4s-font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  line-height: 1.2;
  color: var(--of4s-stone-900);
  text-wrap: pretty;
}

.of4s-blog h2 {
  font-size: clamp(26px, 3.2vw, 34px);
  margin-top: 2.2em;
  margin-bottom: 0.6em;
}

.of4s-blog h3 {
  font-size: clamp(21px, 2.4vw, 26px);
  margin-top: 1.8em;
  margin-bottom: 0.5em;
}

.of4s-blog h4 {
  font-size: 19px;
  font-weight: 600;
  margin-top: 1.6em;
  margin-bottom: 0.5em;
}

.of4s-blog h2 em,
.of4s-blog h3 em {
  font-style: italic;
  color: var(--of4s-brass-700);
}

.of4s-blog p {
  margin-bottom: 1.1em;
}

.of4s-blog .of4s-lede {
  font-size: 20px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--of4s-stone-700);
}

.of4s-blog a:not(.of4s-cta-btn) {
  color: var(--of4s-brass-900);
  text-decoration: underline;
  text-decoration-color: var(--of4s-brass-400);
  text-underline-offset: 3px;
  transition: text-decoration-color 150ms ease;
}

.of4s-blog a:not(.of4s-cta-btn):hover {
  text-decoration-color: var(--of4s-brass-900);
}

.of4s-blog a:focus-visible,
.of4s-blog button:focus-visible {
  outline: 2px solid var(--of4s-brass-700);
  outline-offset: 2px;
  border-radius: 2px;
}

.of4s-blog ul,
.of4s-blog ol {
  padding-left: 1.4em;
  margin-bottom: 1.1em;
}

.of4s-blog li {
  margin-bottom: 0.35em;
}

.of4s-blog li::marker {
  color: var(--of4s-brass-700);
}

.of4s-blog hr {
  border: 0;
  border-top: var(--of4s-border-thin);
  max-width: var(--of4s-measure);
  margin: 2.5em auto;
}

/* ── Eyebrow (mono-caps section kicker) ── */
.of4s-blog .of4s-eyebrow {
  font-family: var(--of4s-font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--of4s-brass-700);
  margin-bottom: 0.4em;
}

/* ── Images: rounded, hairline border, never wider than their block ── */
.of4s-blog img {
  max-width: 100%;
  height: auto;
  border-radius: var(--of4s-radius-lg);
  border: var(--of4s-border-thin);
}

.of4s-blog figure {
  margin: 2em auto;
}

.of4s-blog figcaption {
  font-family: var(--of4s-font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--of4s-stone-500);
  margin-top: 10px;
}

/* ── Gallery (2-up / 3-up image grid for new posts) ── */
.of4s-blog .of4s-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 2em 0;
}

.of4s-blog .of4s-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Blockquote ── */
.of4s-blog blockquote {
  font-family: var(--of4s-font-display);
  font-style: italic;
  font-size: 21px;
  line-height: 1.5;
  color: var(--of4s-stone-700);
  border-left: 3px solid var(--of4s-brass-400);
  padding: 4px 0 4px 24px;
  margin: 2em auto;
}

.of4s-blog blockquote p {
  margin-bottom: 0.4em;
}

/* ── End-of-post CTA block ── */
.of4s-blog .of4s-blog-cta {
  background: var(--of4s-stone-900);
  color: var(--of4s-paper-50);
  border-radius: var(--of4s-radius-xl);
  padding: clamp(40px, 6vw, 72px) clamp(24px, 5vw, 64px);
  text-align: center;
  margin: 3.5em 0 1em;
}

.of4s-blog .of4s-blog-cta .of4s-eyebrow {
  color: var(--of4s-brass-400);
}

.of4s-blog .of4s-blog-cta h2 {
  color: var(--of4s-paper-50);
  font-weight: 400;
  margin: 0.2em 0 0.5em;
  max-width: none;
}

.of4s-blog .of4s-blog-cta h2 em {
  color: var(--of4s-brass-300);
}

.of4s-blog .of4s-blog-cta p {
  color: var(--of4s-paper-200);
  max-width: 52ch;
  margin: 0 auto 1.6em;
}

.of4s-blog .of4s-cta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.of4s-blog .of4s-cta-btn {
  display: inline-block;
  background: var(--of4s-brass-400);
  color: var(--of4s-stone-900);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  padding: 14px 32px;
  border-radius: var(--of4s-radius-pill);
  transition: background 150ms ease, transform 150ms ease;
}

.of4s-blog .of4s-cta-btn:hover {
  background: var(--of4s-brass-300);
  transform: translateY(-1px);
}

.of4s-blog .of4s-cta-tel {
  font-family: var(--of4s-font-mono);
  font-size: 15px;
  color: var(--of4s-brass-300);
  text-decoration: underline;
  text-decoration-color: rgba(217, 189, 149, 0.4);
  text-underline-offset: 3px;
}

.of4s-blog .of4s-cta-tel:hover {
  text-decoration-color: var(--of4s-brass-300);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .of4s-blog {
    font-size: 16px;
  }

  .of4s-blog .of4s-lede {
    font-size: 18px;
  }

  .of4s-blog blockquote {
    font-size: 19px;
    padding-left: 18px;
  }
}

@media (max-width: 600px) {
  .of4s-blog .of4s-blog-cta {
    text-align: left;
  }

  .of4s-blog .of4s-blog-cta p {
    margin-left: 0;
  }

  .of4s-blog .of4s-cta-actions {
    justify-content: flex-start;
  }

  .of4s-blog .of4s-cta-btn {
    width: 100%;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .of4s-blog * {
    transition: none !important;
  }
}

/* ── Rebuild vocabulary v2.1 (REBUILD-SPEC.md + post-20 spike, 2026-07-02) ──
   Spike verdicts: (a) the measure rule (max-width:720px on direct-child figures)
   clamped the 1160px wide moments — every breakout pattern now carries
   max-width:none; (b) true 100vw bleed renders clean in headless Chromium but an
   ancestor has overflow-x:auto, so classic-scrollbar browsers would grow a ~17px
   horizontal scroll — REJECTED in favor of a wrapper-escaping breakout at
   min(1160px, 96vw), centered on the viewport, immune to scrollbar width. */
.of4s-blog { --of4s-wide-max: 1160px; }

/* Shared breakout: escapes the wrapper/container up to 1160px or 96vw. */
.of4s-blog .of4s-wide, .of4s-blog .of4s-band, .of4s-blog .of4s-stats,
.of4s-blog .of4s-pair, .of4s-blog .of4s-blog-cta {
  --of4s-w: min(var(--of4s-wide-max), 96vw);
  width: var(--of4s-w);
  max-width: none;
  margin-left: calc(50% - var(--of4s-w) / 2);
  margin-right: calc(50% - var(--of4s-w) / 2);
}

/* Standfirst */
.of4s-blog .of4s-standfirst { max-width: var(--of4s-measure); margin: 0 auto 2em; }
.of4s-blog .of4s-standfirst .of4s-lede { margin-bottom: 0; }

/* Snapshot card */
.of4s-blog .of4s-snapshot { max-width: var(--of4s-measure); margin: 0 auto 2.5em;
  background: var(--of4s-paper-100); border: var(--of4s-border-thin);
  border-radius: var(--of4s-radius-xl); padding: 24px 28px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 28px; }
.of4s-blog .of4s-snapshot div { margin: 0; }
.of4s-blog .of4s-snapshot dt { font-family: var(--of4s-font-mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--of4s-brass-700); margin-bottom: 2px; }
.of4s-blog .of4s-snapshot dd { margin: 0; font-size: 15px; color: var(--of4s-stone-700); }

/* Section head */
.of4s-blog .of4s-sec { max-width: var(--of4s-measure); margin: 2.8em auto 1em; }
.of4s-blog .of4s-sec h2 { margin-top: 0; }
.of4s-blog .of4s-sec .of4s-eyebrow { margin-bottom: 0.5em; }

/* Wide moments */
.of4s-blog .of4s-wide { margin-top: 2.5em; margin-bottom: 2.5em; }
.of4s-blog .of4s-wide img { width: 100%; border-radius: var(--of4s-radius-lg); }
.of4s-blog .of4s-wide figcaption { max-width: var(--of4s-measure); margin: 10px auto 0; text-align: center; }

/* Pair */
.of4s-blog .of4s-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-top: 2.5em; margin-bottom: 2.5em; }
/* v2.3 (post-5): figure is a flex column and the img flexes instead of height:100%,
   so the figcaption keeps its own space inside the figure. The old height:100% made
   the img consume the full figure box and every pair caption overflowed it by ~30px —
   at mobile widths the next stacked figure painted over the caption. */
.of4s-blog .of4s-pair figure { margin: 0; display: flex; flex-direction: column; }
.of4s-blog .of4s-pair img { width: 100%; height: auto; flex: 1 1 auto; min-height: 0; object-fit: cover; }

/* Dark band */
.of4s-blog .of4s-band { background: var(--of4s-stone-900); color: var(--of4s-paper-50);
  border-radius: var(--of4s-radius-xl); padding: clamp(40px, 6vw, 72px) clamp(24px, 6vw, 80px);
  margin-top: 3em; margin-bottom: 3em; text-align: center; }
.of4s-blog .of4s-band .of4s-eyebrow { color: var(--of4s-brass-400); }
.of4s-blog .of4s-band blockquote { border-left: 0; padding: 0; margin: 0 auto 0.8em;
  color: var(--of4s-paper-50); font-size: clamp(22px, 3vw, 30px); max-width: 24ch; }
.of4s-blog .of4s-band .of4s-band-attr { font-family: var(--of4s-font-mono); font-size: 12px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--of4s-paper-200); margin: 0; }

/* Stats strip */
.of4s-blog .of4s-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 24px; margin-top: 2.5em; margin-bottom: 2.5em; padding: 28px 0;
  border-top: var(--of4s-border-thin); border-bottom: var(--of4s-border-thin); text-align: center; }
.of4s-blog .of4s-stats h3 { font-weight: 300; font-size: clamp(34px, 4vw, 48px); margin: 0 0 2px; }
.of4s-blog .of4s-stats p { font-family: var(--of4s-font-mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--of4s-stone-500); margin: 0; }

/* CTA keeps its base styling; the shared breakout above gives it the wide treatment. */
.of4s-blog .of4s-blog-cta { margin-top: 3.5em; margin-bottom: 1em; }

@media (max-width: 700px) {
  .of4s-blog .of4s-pair { grid-template-columns: 1fr; }
  .of4s-blog .of4s-snapshot { grid-template-columns: 1fr 1fr; }
}

/* ── v2.2 cover-layout fix (post-3 pilot, 2026-07-02) ──
   Odoo's blog "regular" layout caps #o_wblog_post_content at ~720px and leaves it
   LEFT-aligned inside a flex row, so the breakout patterns (which center on their
   containing block) landed at x=-145 instead of viewport center. Un-cap the column
   only when a rebuilt post is present; the wrapper then spans the centered container
   and all breakout math lands on the viewport center by construction. */
#o_wblog_post_content:has(.of4s-blog) { max-width: none; width: 100%; flex: 1 1 100%; }
