/* Greyquill blog — shared style system.
   Scope: dc/blogs/ only. One stylesheet so the whole blog reads as one voice.
   Self-contained: fonts self-hosted, no CDNs, nothing external.
   Colors + type match greyquill.io (blue #0B4F88, ink #0A1628, Sora + Inter).
   Index layout follows a Deloitte-style card grid with IBM Carbon structure
   (sharp corners, category chips, grid). Article header follows a McKinsey-style
   pattern: category eyebrow, title, date/time + share, divider (no visible byline). */

@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Sora"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("fonts/sora-latin.woff2") format("woff2");
}

/* ---- theme tokens ---- */
:root {                     /* light (default) — brand blue, high-contrast */
  --bg:        #ffffff;
  --surface:   #f2f7fc;
  --mist:      #eaf4fc;     /* light blue wash (callouts, quotes) */
  --ink:       #0a1628;     /* near-black navy — text AND headings */
  --ink-soft:  #4a5a70;
  --brand:     #0b4f88;     /* Greyquill brand blue (matches the logo) */
  --brand-lit: #1a6bb5;     /* hover / decorative */
  --border:    #e2e8ef;
  --maxw:      44rem;       /* article reading column */
  --maxw-wide: 68rem;       /* index / header */
}
:root[data-theme="dark"] {  /* near-black; brighter blue so it pops on black */
  --bg: #0c0c0c; --surface: #15181d; --mist: #12161c;
  --ink: #eef2f7; --ink-soft: #9aa7b6;
  --brand: #4d9be8; --brand-lit: #6fb0ef; --border: #262b33;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0c0c0c; --surface: #15181d; --mist: #12161c;
    --ink: #eef2f7; --ink-soft: #9aa7b6;
    --brand: #4d9be8; --brand-lit: #6fb0ef; --border: #262b33;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 18px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; font-feature-settings: "ss01", "cv11", "kern";
}
h1, h2, h3, .wordmark, .card__title { font-family: "Sora", "Inter", -apple-system, sans-serif; }

/* ---- site chrome (spans wide on all screens) ---- */
.site-bar { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--border); }
.site-bar__inner {
  max-width: var(--maxw-wide); margin: 0 auto; padding: 1rem 1.5rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.site-bar__brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-logo { display: inline-flex; align-items: center; }
.brand-logo img { height: 1.55rem; width: auto; display: block; }
/* dark mode: the navy wordmark would vanish on dark, so render it light */
:root[data-theme="dark"] .brand-logo img { filter: brightness(0) invert(1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .brand-logo img { filter: brightness(0) invert(1); }
}
.site-bar__tag { color: var(--ink-soft); font-size: 0.82rem; }

.theme-toggle {
  margin-left: auto; display: inline-flex; align-items: center; justify-content: center;
  width: 2.1rem; height: 2.1rem; padding: 0; border: 1px solid var(--border);
  border-radius: 999px; background: var(--bg); color: var(--brand); cursor: pointer; line-height: 0;
}
.theme-toggle:hover { border-color: var(--brand-lit); color: var(--brand-lit); }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; }
/* show the icon of the mode you'll switch TO: moon in light, sun in dark */
.theme-toggle .i-sun { display: none; }
.theme-toggle .i-moon { display: inline; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .i-moon { display: none; }
  :root:not([data-theme]) .theme-toggle .i-sun { display: inline; }
}

/* ---- shared bits ---- */
.eyebrow {
  display: block; text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--brand-lit); margin: 0 0 1rem;
}

/* ================= ARTICLE ================= */
.post { max-width: var(--maxw); margin: 0 auto; padding: 2.75rem 1.25rem 1rem; }
.post__back {
  display: inline-block; margin-bottom: 1.5rem;
  font-size: 0.85rem; color: var(--brand); text-decoration: none;
}
.post__back::before { content: "\2190\00a0"; }   /* left arrow + space */
.post__back:hover { color: var(--brand-lit); }
.post__ps {
  margin-top: 2.25rem; padding-top: 1.3rem; border-top: 1px solid var(--border);
  color: var(--ink-soft); font-size: 0.95rem; line-height: 1.6;
}
.post__title {
  color: var(--ink); font-size: clamp(1.9rem, 4.2vw, 2.6rem);
  line-height: 1.12; letter-spacing: -0.02em; font-weight: 700; margin: 0 0 0.7rem;
}
.post__deck {
  color: var(--ink-soft); font-size: 1.06rem; line-height: 1.55;
  font-weight: 600; font-style: italic; margin: 0 0 1.6rem;
}

/* header meta row: date/time on the left, share on the right, divider under */
.post__headmeta {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 0.75rem 1rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--border); margin-bottom: 2.4rem;
}
.post__datetime { color: var(--ink-soft); font-size: 0.9rem; }

.share { display: inline-flex; align-items: center; gap: 0.45rem; }
.share__label { font-size: 0.8rem; color: var(--ink-soft); }
.share__btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border: 1px solid var(--border); border-radius: 2px; /* Carbon-sharp */
  color: var(--brand); background: var(--bg); cursor: pointer; text-decoration: none; position: relative;
}
.share__btn:hover { border-color: var(--brand); color: var(--brand-lit); }
.share__btn svg { width: 1rem; height: 1rem; }
.share__btn--copied::after {
  content: "Copied"; position: absolute; top: -1.7rem; left: 50%; transform: translateX(-50%);
  background: var(--brand); color: #fff; font-size: 0.68rem; padding: 0.15rem 0.4rem; border-radius: 2px; white-space: nowrap;
}

/* header / cover image (optional, sits under the header, above the body) */
.post__cover { margin: 0 0 2.25rem; }
.post__cover img {
  width: 100%; height: auto; display: block; border-radius: 4px;
  border: 1px solid var(--border); aspect-ratio: 21 / 9; object-fit: cover;
}
.post__cover figcaption { color: var(--ink-soft); font-size: 0.85rem; margin-top: 0.5rem; }
/* full-bleed variant: spans wider than the reading column */
.post__cover--bleed { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.post__cover--bleed img { border-radius: 0; border-left: 0; border-right: 0; max-width: 100vw; }

.post__body > * { margin-top: 0; }
.post__body h2 { color: var(--ink); font-size: 1.5rem; letter-spacing: -0.01em; margin: 2.6rem 0 0.8rem; }
.post__body h3 { color: var(--ink); font-size: 1.2rem; margin: 2rem 0 0.6rem; }
.post__body p { margin: 0 0 1.2rem; }
.post__body a { color: var(--brand); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--brand) 40%, transparent); }
.post__body a:hover { color: var(--brand-lit); border-bottom-color: var(--brand-lit); }
.post__body ul, .post__body ol { margin: 0 0 1.2rem; padding-left: 1.4rem; }
.post__body li { margin: 0.35rem 0; }
.post__body blockquote {
  margin: 1.8rem 0; padding: 0.4rem 0 0.4rem 1.25rem; border-left: 3px solid var(--brand-lit);
  color: var(--ink); font-size: 1.28rem; line-height: 1.45; font-style: normal;
}
.callout { background: var(--mist); border: 1px solid var(--border); border-left: 3px solid var(--brand-lit); border-radius: 4px; padding: 1.1rem 1.3rem; margin: 2rem 0; }
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }
.callout__label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand); margin-bottom: 0.5rem; }
figure { margin: 2rem 0; }
figure img, .post__body img { max-width: 100%; height: auto; border-radius: 4px; border: 1px solid var(--border); display: block; }
figcaption { color: var(--ink-soft); font-size: 0.85rem; margin-top: 0.5rem; }
/* white panel for images with transparency/dark text, so they read in dark mode too */
.post__body figure.panel { background: #ffffff; border: 1px solid var(--border); border-radius: 4px; padding: 1.1rem; }
.post__body figure.panel img { border: 0; border-radius: 0; margin: 0 auto; }
pre, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
code { background: var(--surface); padding: 0.1em 0.35em; border-radius: 2px; }
pre { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 1rem 1.1rem; overflow-x: auto; line-height: 1.5; }
pre code { background: none; padding: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
table { width: 100%; border-collapse: collapse; margin: 1.6rem 0; font-size: 0.95rem; display: block; overflow-x: auto; }
th, td { border: 1px solid var(--border); padding: 0.55rem 0.8rem; text-align: left; }
th { background: var(--surface); color: var(--ink); }

/* ---- components: code block (with language label + copy) ---- */
.code { margin: 2rem 0; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.code__bar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border-bottom: 1px solid var(--border); padding: 0.4rem 0.75rem;
}
.code__lang { color: var(--ink-soft); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.code__copy {
  border: 1px solid var(--border); background: var(--bg); color: var(--brand);
  font-size: 0.72rem; padding: 0.15rem 0.55rem; border-radius: 2px; cursor: pointer;
}
.code__copy:hover { border-color: var(--brand); color: var(--brand-lit); }
.code__copy--copied { color: var(--brand-lit); border-color: var(--brand-lit); }
.code pre { margin: 0; border: 0; border-radius: 0; }

/* ---- components: YouTube embed (click-to-load facade) ---- */
.video {
  position: relative; aspect-ratio: 16 / 9; margin: 2rem 0; overflow: hidden;
  border: 1px solid var(--border); border-radius: 4px; background: var(--surface);
  background-size: cover; background-position: center;
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.video__play {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand); border: 0; cursor: pointer; color: #fff; transition: background .15s ease;
}
.video[style*="background-image"] .video__play { background: rgba(10,22,40,0.35); }
.video__play:hover { background: var(--brand-lit); }
.video[style*="background-image"] .video__play:hover { background: rgba(10,22,40,0.15); }
.video__play svg { width: 4rem; height: 4rem; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3)); }

/* ---- component: quote with attribution ---- */
.quote { margin: 2.25rem 0; padding: 1.4rem 1.5rem; background: var(--mist); border-left: 3px solid var(--brand-lit); border-radius: 4px; }
.quote p { font-size: 1.25rem; line-height: 1.5; color: var(--ink); margin: 0 0 0.8rem; }
.quote__by { display: block; font-style: normal; font-size: 0.9rem; color: var(--ink-soft); }
.quote__by::before { content: "— "; }

/* ---- component: end-of-post CTA card ---- */
.cta { margin: 3rem 0 1rem; padding: 1.75rem 1.9rem; border: 1px solid var(--border); border-top: 3px solid var(--brand); border-radius: 4px; background: var(--surface); }
.cta__lead { font-family: "Sora", "Inter", sans-serif; font-size: 1.25rem; line-height: 1.35; color: var(--brand); margin: 0 0 0.5rem; }
.cta__body { color: var(--ink); margin: 0 0 1rem; }
.cta__link { display: inline-block; font-weight: 600; color: var(--brand); text-decoration: none; border-bottom: 1px solid var(--brand-lit); }
.cta__link:hover { color: var(--brand-lit); }

/* ---- component: references / sources ---- */
sup.ref { font-size: 0.7em; line-height: 0; }
sup.ref a { color: var(--brand); text-decoration: none; border: 0; }
.references { margin: 3rem 0 1rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.references__title { font-size: 1.1rem; color: var(--ink); margin: 0 0 0.75rem; }
.references__list { color: var(--ink-soft); font-size: 0.9rem; padding-left: 1.3rem; margin: 0; }
.references__list li { margin: 0.4rem 0; }
.references__list a { color: var(--brand); }

/* ================= INDEX (Deloitte grid + IBM structure) ================= */
.blog-index { max-width: var(--maxw-wide); margin: 0 auto; padding: 2.75rem 1.5rem 1rem; }
.blog-hero { padding-bottom: 2rem; margin-bottom: 2.25rem; border-bottom: 1px solid var(--border); }
.blog-hero h1 { color: var(--ink); font-size: clamp(2rem, 5vw, 3rem); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 0.7rem; }
.blog-hero p { color: var(--ink-soft); font-size: 1.06rem; line-height: 1.55; font-weight: 600; font-style: italic; margin: 0; max-width: 40rem; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 1.5rem; }
.card {
  display: flex; flex-direction: column; border: 1px solid var(--border); background: var(--bg);
  text-decoration: none; color: inherit; border-radius: 2px; /* Carbon-sharp */
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(11,79,136,0.10); }
.card__media { aspect-ratio: 16 / 9; background: var(--surface); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; border: 0; border-radius: 0; }
.card__body { padding: 1rem 1.1rem 1.25rem; display: flex; flex-direction: column; gap: 0.55rem; flex: 1; }
.card__cat {
  align-self: flex-start;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--brand-lit); background: var(--mist);
  padding: 0.2rem 0.5rem; border-radius: 2px;
}
.card__title { font-size: 1.15rem; line-height: 1.28; color: var(--ink); margin: 0; }
.card:hover .card__title { color: var(--brand-lit); }
.card__meta { margin-top: auto; color: var(--ink-soft); font-size: 0.82rem; }

/* featured post: full-width, media beside body on wide screens */
.card--featured { grid-column: 1 / -1; }
@media (min-width: 46rem) {
  .card--featured { flex-direction: row; }
  .card--featured .card__media { width: 56%; aspect-ratio: 16 / 10; }
  .card--featured .card__body { width: 44%; justify-content: center; padding: 1.75rem 1.9rem; gap: 0.75rem; }
  .card--featured .card__title { font-size: 1.7rem; line-height: 1.2; }
}

/* ---- footer ---- */
.post-footer {
  max-width: var(--maxw-wide); margin: 3rem auto 0; padding: 1.75rem 1.5rem 3rem;
  border-top: 1px solid var(--border); color: var(--ink-soft); font-size: 0.92rem;
}
.post-footer strong { color: var(--brand); }
.post-footer a { color: var(--brand); text-decoration: none; }
.post-footer a:hover { text-decoration: underline; }

a:focus-visible, .theme-toggle:focus-visible, .share__btn:focus-visible, .card:focus-visible {
  outline: 2px solid var(--brand-lit); outline-offset: 2px; border-radius: 2px;
}

@media (max-width: 480px) {
  body { font-size: 17px; }
  .post, .blog-index { padding-top: 2rem; }
  .site-bar__tag { display: none; }
}
