/* Content site (mvpkit blog): layout on top of the brand's tokens.css. The --site-* colours default to MTO FinOps;
   a site overrides them with content.yaml `theme:` (a :root block after this stylesheet). */
:root { --site-header: linear-gradient(135deg, #00140f 0%, #00221a 45%, #005a43 100%); --site-dark: #00221a;
  --site-on-dark: #e6f4ee; --site-on-dark-muted: #bfe5d6; --site-line: #dfe7e3; --site-tint: #dff3ea; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 1.0625rem/1.7 var(--font-body); color: var(--color-text); background: var(--color-background); }
a { color: var(--color-accent); text-underline-offset: 3px; }
a:hover { color: var(--color-primary); }
img { max-width: 100%; height: auto; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 22px; }
.small { font-size: .875rem; }
.muted { color: var(--color-muted); }

.draft-banner { margin: 0; padding: 8px 22px; background: var(--color-highlight); color: #fff; font-weight: 700; text-align: center; }

.top { background: var(--site-header); color: #fff; }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-top: 16px; padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand .name { font: 400 1.25rem/1 var(--font-heading); letter-spacing: .01em; }
.brand .by { font-size: .8125rem; color: var(--site-on-dark-muted); }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.top nav a { color: var(--site-on-dark); text-decoration: none; font-weight: 600; font-size: .9375rem; }
.top nav a:hover, .top nav a[aria-current="page"] { color: #fff; text-decoration: underline; }

main.wrap { padding-top: 48px; padding-bottom: 72px; }
.page, .post, .blog { max-width: 740px; margin: 0 auto; }
.head { margin-bottom: 28px; }
.crumb { margin: 0 0 8px; font-weight: 600; font-size: .9375rem; }
h1, h2, h3 { font-family: var(--font-heading); font-weight: 400; line-height: 1.15; color: var(--color-text); }
h1 { font-size: clamp(2rem, 6vw, 3rem); margin: 0 0 14px; }
h2 { font-size: clamp(1.4rem, 3.6vw, 1.75rem); margin: 2.2em 0 .6em; }
h3 { font-size: 1.2rem; margin: 1.8em 0 .5em; }
.lede { font-size: 1.25rem; line-height: 1.55; color: var(--color-muted); margin: 0; }
.meta { color: var(--color-muted); font-size: .9375rem; margin: 0; }

.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose li { margin-bottom: .4em; }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--color-secondary); color: var(--color-muted); }
.prose code { font: .92em var(--font-mono); background: var(--color-surface); padding: 1px 5px; border-radius: 4px; }
.prose pre { background: var(--site-dark); color: var(--site-on-dark); padding: 18px 20px; border-radius: 10px; overflow-x: auto; font-size: .875rem; line-height: 1.55; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: .9375rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--site-line); }
.prose th { background: var(--color-surface); }
.prose .definition { background: var(--color-surface); border-radius: 12px; padding: 18px 22px; font-size: 1.125rem; margin: 0 0 1.6em; }
.prose .cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 1.4em 0; }
.prose .card { border: 1px solid var(--site-line); border-radius: 14px; padding: 20px 22px; }
.prose .card h3 { margin-top: 0; }
.prose .card p:last-child { margin-bottom: 0; }
.prose .pill { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; background: var(--site-tint); color: var(--color-accent); margin-bottom: 8px; }
.prose .pill.soon { background: #fdeae4; color: #a5321a; }

.cta { margin: 48px 0 0; padding: 28px; border-radius: 16px; background: var(--site-tint); }
.cta h2 { margin: 0 0 8px; font-size: 1.4rem; }
.cta p { margin: 0 0 16px; }
.btn { display: inline-block; padding: 13px 22px; border-radius: 999px; background: var(--color-primary); color: var(--color-on-primary);
  font-weight: 700; text-decoration: none; }
.btn:hover { background: var(--color-accent); color: var(--color-on-primary); }

.latest, .related { margin-top: 48px; }
.pillar-link { font-weight: 700; }

/* figures: the hero sits under the H1; every figure states its point in the caption too */
figure { margin: 0; }
.hero { margin: 0 0 32px; border-radius: 18px; overflow: hidden; background: var(--color-surface); }
.hero img, .prose figure img { display: block; width: 100%; height: auto; }
.prose figure { margin: 1.6em 0; border-radius: 14px; overflow: hidden; background: var(--color-surface); }
figcaption { padding: 10px 16px 12px; font-size: .9375rem; color: var(--color-muted); }

/* "In 30 seconds": the definition and the key points above the fold */
.prose .tldr { border-left: 4px solid var(--color-primary); background: var(--color-surface); border-radius: 0 12px 12px 0;
  padding: 16px 20px; margin: 0 0 1.6em; }
.prose .tldr > p:first-child { font-weight: 700; margin-bottom: .4em; }
.prose .tldr ul { margin: 0; }

/* detail for engineers stays in the HTML, folded */
.prose details { border: 1px solid var(--site-line); border-radius: 12px; padding: 12px 18px; margin: 1em 0; }
.prose details > summary { cursor: pointer; font-weight: 700; }
.prose details[open] > summary { margin-bottom: .6em; }

/* icon cards: one picture, one line */
.prose .cards.icons .card { text-align: left; }
.prose .card img { width: 56px; height: 56px; margin-bottom: 8px; }

.posts { list-style: none; padding: 0; margin: 0; }
.posts li { padding: 20px 0; border-bottom: 1px solid var(--site-line); }
.posts .t { font: 400 1.25rem/1.3 var(--font-heading); }
.posts a { text-decoration: none; color: var(--color-text); }
.posts a:hover .t { color: var(--color-accent); }
.posts time { display: block; color: var(--color-muted); font-size: .875rem; margin-top: 4px; }
.posts p { margin: 6px 0 0; }

.foot { border-top: 1px solid var(--site-line); padding: 28px 0 40px; color: var(--color-muted); }
.foot p { margin: 0 0 6px; }

/* figures in the body: inlined SVGs break out of the text column, wide on desktop, portrait variant on phones */
.prose .fig { margin: 2.2em 0; border-radius: 0; overflow: visible; background: none; }
.fig-art { width: min(1080px, calc(100vw - 40px)); margin-left: 50%; transform: translateX(-50%);
  background: #fff; border: 1px solid var(--site-line); border-radius: 18px; padding: 18px; }
.fig-tall { display: none; }
.fig-art svg { display: block; width: 100%; height: auto; }
.prose .fig-shot img { border: 1px solid var(--site-line); border-radius: 14px; }
.prose .fig figcaption { text-align: center; padding: 10px 0 0; }

/* large screens: type, column and figures grow with the window; figures stay within the window's height */
@media (min-width: 1100px) {
  body { font-size: clamp(1.0625rem, .55rem + .55vw, 1.375rem); }
  .page, .post, .blog { max-width: 46em; }
  .wrap { max-width: max(1080px, 52em); }
  h1 { font-size: clamp(3rem, 1.4rem + 1.9vw, 4.25rem); }
  .fig-art { width: min(1560px, calc(100vw - 96px), calc((100vh - 120px) * 1.6)); padding: 24px; }
}

/* phones: portrait figures, wrapped code, tables as stacked cards */
@media (max-width: 640px) {
  .fig-art { width: calc(100vw - 24px); padding: 8px; border-radius: 14px; }
  .fig-pair .fig-wide { display: none; }
  .fig-pair .fig-tall { display: block; }
  .prose pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .8rem; padding: 14px; }
  .prose table, .prose thead, .prose tbody, .prose tr, .prose th, .prose td { display: block; }
  .prose thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .prose tr { border: 1px solid var(--site-line); border-radius: 12px; padding: 6px 14px; margin: 0 0 12px; }
  .prose td { border: 0; padding: 6px 0; }
  .prose td[data-label]::before { content: attr(data-label); display: block; font-weight: 800; font-size: .78rem;
    letter-spacing: .05em; text-transform: uppercase; color: var(--color-accent); }
}

/* Nav menus and "On this page" dots (mvpkit blog). Appended to content.css only for sites that use a nav group or
   content.yaml `section_dots`, so the others build exactly as before. */

/* a nav group is a native <details>: a dropdown under its summary on wide screens, a panel under the bar on phones */
.top { position: relative; z-index: 20; }
.top nav { align-items: center; }
.menu { position: relative; }
.menu > summary { display: inline-flex; align-items: center; gap: 7px; list-style: none; cursor: pointer;
  color: var(--site-on-dark); font-weight: 600; font-size: .9375rem; border-radius: 4px; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: ""; width: 7px; height: 7px; margin-top: -4px; border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s ease, margin .15s ease; }
.menu[open] > summary::after { margin-top: 3px; transform: rotate(225deg); }
.menu > summary:hover, .menu[open] > summary { color: #fff; }
.menu-list { position: absolute; top: calc(100% + 12px); left: -14px; min-width: 230px; display: flex;
  flex-direction: column; gap: 2px; padding: 8px; border-radius: 12px; background: var(--site-dark);
  border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 14px 36px rgba(0, 0, 0, .3); }
.top nav .menu-list a { padding: 9px 12px; border-radius: 8px; white-space: nowrap; }
.top nav .menu-list a:hover { background: rgba(255, 255, 255, .1); text-decoration: none; }
.top nav a:focus-visible, .menu > summary:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.top nav .menu-list a:focus-visible { outline-offset: -2px; }

@media (max-width: 640px) {
  .menu { position: static; }
  .menu-list { top: 100%; left: 0; right: 0; min-width: 0; padding: 8px 14px 14px; border-radius: 0 0 14px 14px;
    border: 0; border-top: 1px solid rgba(255, 255, 255, .12); }
  .top nav .menu-list a { white-space: normal; padding: 11px 8px; }
}

/* "On this page": one dot per section on the right, the current one filled, its name on hover or focus */
.prose h2[id], .posts li[id] { scroll-margin-top: 20px; }
.dots { position: fixed; right: 18px; top: 50%; transform: translateY(-50%); z-index: 10; display: flex;
  flex-direction: column; }
.dots a { position: relative; display: flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  text-decoration: none; }
.dots a::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--color-primary);
  background: var(--color-background); transition: background-color .2s ease, transform .2s ease; }
.dots a[aria-current="true"]::before { background: var(--color-primary); }
.dots a:hover::before, .dots a:focus-visible::before { transform: scale(1.3); }
.dots a:focus-visible { outline: none; }
.dots a:focus-visible::before { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.dots span { position: absolute; right: calc(100% + 4px); top: 50%; transform: translateY(-50%);
  width: max-content; max-width: min(70vw, 340px); padding: 4px 11px; border-radius: 12px; text-align: right;
  background: var(--site-dark); color: var(--site-on-dark);
  font: 600 .8125em/1.35 var(--font-body); opacity: 0; pointer-events: none; transition: opacity .15s ease; }
.dots a:hover span, .dots a:focus-visible span { opacity: 1; }

/* below 1100 px figures and text reach the page's side padding: the rail shrinks into it, never over the text */
@media (max-width: 1099px) {
  .dots { right: 0; }
  .dots a { width: 16px; height: 22px; }
  .dots a::before { width: 8px; height: 8px; border-width: 1.5px; }
}

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) {
  .menu > summary::after, .dots a::before, .dots span { transition: none; }
}
@media print { .dots { display: none; } }
