/* ===== Blog (/blog/) =====
   Loaded after base/header/shared/footer. Built from the site's own design
   language so the blog reads as part of the same website:
     - hero:     the site's .cph-hero (shared.css), reused as-is on the blog home and listings
     - fonts:    Cairo (headings, buttons, sub-headings), Manrope (body)
     - buttons:  8px radius, orange-to-red gradient (same as .about-story__cta-btn--primary)
     - cards:    12px radius, thin #e6e6ec border, soft shadow, orange border on hover
   Class prefix: .blog-*
   Reading text follows the site's own long-form pages (legal): #424249 on white, 16px,
   headings in Cairo 600 (#171a1c). The marketing grey (#7a7a7a) is not used for long text. */

.blog {
  --blog-head: "Cairo", "Cairo Fallback", var(--font-heading);
  --blog-sub: "Cairo", "Cairo Fallback", var(--font-heading);
  --blog-body: "Manrope", "Manrope Fallback", var(--font-body);
  --blog-ink: #171a1c;
  --blog-text: #424249;
  --blog-muted: #6b6f76;
  --blog-line: #e6e6ec;
  --blog-soft: #f7f7fb;
  --blog-orange-tint: rgba(245, 126, 32, .09);
  --blog-link: #171a1c;            /* links: dark text, underlined (same as the site's legal pages) */
  --blog-grad: linear-gradient(135deg, var(--brand-orange), var(--accent));
  --blog-hero-grad: linear-gradient(120deg, #2c1240 0%, #171a2e 45%, #0c2f37 100%);
  background: #fff;
  color: var(--blog-text);
  font-family: var(--blog-body);
}

.blog a { color: inherit; }
.blog :focus-visible { outline: 3px solid var(--brand-orange); outline-offset: 3px; border-radius: 4px; }

/* ----- Hero (listing and home pages use the site's .cph-hero markup) ----- */
.blog-hero .cph-hero__inner { padding: 80px 0 72px; }
.blog-hero .cph-hero__desc { max-width: 640px; }

/* ----- Hero on a single post: the site's .cph-hero (centred, uppercase), title scaled for long headlines ----- */
.blog-hero--post .cph-hero__inner { padding: 72px 0 64px; }
.blog-post-hero__content { max-width: 980px !important; }
.blog-hero--post .blog-post-hero__title { font-size: clamp(28px, 3.4vw, 44px); line-height: 1.18; }
.blog-hero--post .blog-eyebrow { color: #ffb27a; }
@media (max-width: 560px) { .blog-hero--post .blog-post-hero__title { font-size: 28px; line-height: 34px; } }
.blog-byline {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, .78);
}
.blog-byline span + span::before { content: "\00b7"; margin-right: 18px; opacity: .6; }
.blog-byline span:first-child { flex-basis: 100%; text-align: center; }
.blog-byline span:nth-child(2)::before { content: none; margin: 0; }

.blog-eyebrow {
  margin: 0 0 14px;
  font-family: var(--blog-head);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand-orange);
}

/* ----- Breadcrumbs (on white, above the content) ----- */
.blog-crumbs { margin: 0 0 28px; font-size: 13px; }
.blog-crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; list-style: none; margin: 0; padding: 0; }
.blog-crumbs li + li::before { content: "/"; margin: 0 9px; opacity: .45; }
.blog-crumbs a { color: var(--blog-muted); text-decoration: none; }
.blog-crumbs a:hover { color: var(--brand-orange); text-decoration: underline; }
.blog-crumbs [aria-current] { color: var(--blog-ink); font-weight: 600; }

/* ----- Sections ----- */
.blog-section { padding: 56px 0 96px; }
.blog-h2 {
  margin: 64px 0 24px;
  font-family: var(--blog-sub);
  font-weight: 600;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.2;
  color: var(--blog-ink);
}
.blog-empty {
  margin: 24px 0;
  padding: 40px 24px;
  text-align: center;
  background: var(--blog-soft);
  border: 1px solid var(--blog-line);
  border-radius: 12px;
  color: var(--blog-muted);
}

/* ----- Guides / Articles entry cards on the home page ----- */
.blog-paths { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.blog-path {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 32px;
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--blog-line);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .04);
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.blog-path:hover { border-color: var(--brand-orange); box-shadow: 0 16px 34px rgba(50, 61, 65, .1); transform: translateY(-3px); }
.blog-path__eyebrow { font-family: var(--blog-head); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-orange); }
.blog-path__title { font-family: var(--blog-sub); font-weight: 600; font-size: 30px; line-height: 1.15; color: var(--blog-ink); }
.blog-path__desc { color: var(--blog-muted); line-height: 1.65; }
.blog-path__go { margin-top: 8px; font-family: var(--blog-head); font-weight: 700; font-size: 14px; color: var(--blog-ink); }

/* ----- Post cards ----- */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.blog-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--blog-line);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .04);
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.blog-card:hover { border-color: var(--brand-orange); box-shadow: 0 16px 34px rgba(50, 61, 65, .1); transform: translateY(-3px); }
.blog-card__top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.blog-card__cat { font-size: 13px; color: var(--blog-muted); }
.blog-card__title { margin: 0 0 10px; font-family: var(--blog-sub); font-weight: 600; font-size: 22px; line-height: 1.3; color: var(--blog-ink); }
.blog-card__title a { text-decoration: none; }
/* The whole card is clickable through the title link. */
.blog-card__title a::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.blog-card__desc { margin: 0 0 18px; color: var(--blog-muted); line-height: 1.65; font-size: 15px; }
.blog-card__meta { margin: auto 0 0; font-size: 13px; color: var(--blog-muted); }

.blog-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--blog-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  background: #171a1c;
  color: #fff;
}
.blog-tag--guides { background: #171a1c; }
.blog-tag--articles { background: var(--blog-orange-tint); color: var(--blog-link); }
.blog-tag--draft { background: #fff; color: #8a1f1f; border: 1px solid #e3b4b4; }

/* ----- Topic chips ----- */
.blog-chips { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.blog-chips a {
  display: inline-block;
  padding: 9px 18px;
  border: 1px solid var(--blog-line);
  border-radius: 8px;
  text-decoration: none;
  font-family: var(--blog-head);
  font-weight: 600;
  font-size: 14px;
  color: var(--blog-ink);
  transition: background .15s, border-color .15s;
}
.blog-chips a:hover { background: var(--blog-orange-tint); border-color: var(--brand-orange); }

/* ----- Buttons: same as the site's .about-story__cta-btn ----- */
.blog-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid transparent;
  border-radius: 8px;
  padding: 13px 28px;
  font-family: var(--blog-head);
  font-size: 15px;
  font-weight: 700;
  line-height: 15px;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, background .15s, color .15s, border-color .15s;
}
.blog-btn--primary { background: var(--blog-grad); color: #fff !important; box-shadow: 0 8px 20px rgba(245, 126, 32, .32); }
.blog-btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(245, 126, 32, .4); }
.blog-btn--ghost { color: #171a1c; border-color: #171a1c; }
.blog-btn--ghost:hover { background: #171a1c; color: #fff; transform: translateY(-2px); box-shadow: 0 14px 28px rgba(0, 0, 0, .18); }

/* ----- Pagination ----- */
.blog-pager { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 48px; color: var(--blog-muted); }

/* ----- Bottom band: same dark gradient as the hero ----- */
.blog-band { background: var(--blog-hero-grad); color: #fff; padding: 56px 0; }
.blog-band__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px 40px; flex-wrap: wrap; }
.blog-band h2 { margin: 0 0 8px; font-family: var(--blog-sub); font-weight: 600; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.2; }
.blog-band p { margin: 0; color: rgba(255, 255, 255, .82); }

/* ----- Local preview banner (drafts) ----- */
.blog-preview {
  margin: 0 auto 28px;
  max-width: 1000px;
  padding: 12px 16px;
  background: #fff7e0;
  border: 1px solid #f0d58a;
  border-radius: 8px;
  font-size: 14px;
  color: #6b5200;
}

/* ----- Post layout: article + sticky table of contents (wide screens only) ----- */
.blog-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; max-width: 1000px; margin: 0 auto; }
.blog-toc { display: none; }
@media (min-width: 1024px) {
  .blog-layout { grid-template-columns: minmax(0, 720px) 240px; justify-content: space-between; }
  .blog-toc { display: block; position: sticky; top: 100px; align-self: start; }
}
.blog-toc {
  padding: 20px 22px;
  background: var(--blog-soft);
  border: 1px solid var(--blog-line);
  border-radius: 12px;
  font-size: 14px;
}
.blog-toc__title { margin: 0 0 12px; font-family: var(--blog-head); font-weight: 700; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--blog-muted); }
.blog-toc ol { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.blog-toc a { text-decoration: none; color: var(--blog-ink); line-height: 1.45; }
.blog-toc a:hover { color: var(--brand-orange); text-decoration: underline; }

/* ----- Answer-first summary box ----- */
.blog-summary {
  margin: 0 0 32px;
  padding: 22px 26px;
  background: var(--blog-orange-tint);
  border-left: 4px solid var(--brand-orange);
  border-radius: 0 12px 12px 0;
}
.blog-summary p { margin: 0; line-height: 1.7; font-size: 17px; color: var(--blog-ink); }
.blog-summary .blog-summary__label {
  margin-bottom: 6px;
  font-family: var(--blog-head);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand-orange);
}

/* ----- Article typography (rendered Markdown) ----- */
.blog-prose { font-size: 16px; line-height: 1.75; overflow-wrap: break-word; }
.blog-prose > :first-child { margin-top: 0; }
.blog-prose h2 { margin: 2.2em 0 .6em; font-family: var(--blog-sub); font-weight: 600; font-size: 32px; line-height: 1.2; color: var(--blog-ink); scroll-margin-top: 100px; }
.blog-prose h3 { margin: 1.8em 0 .5em; font-family: var(--blog-sub); font-weight: 600; font-size: 23px; line-height: 1.3; color: var(--blog-ink); scroll-margin-top: 100px; }
.blog-prose p { margin: 0 0 1.2em; }
.blog-prose ul, .blog-prose ol { margin: 0 0 1.3em; padding-left: 1.4em; }
.blog-prose li { margin-bottom: .45em; }
.blog-prose li > ul, .blog-prose li > ol { margin-top: .45em; margin-bottom: 0; }
.blog-prose a { color: var(--blog-link); text-decoration: underline; text-decoration-color: var(--brand-orange); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.blog-prose a:hover { text-decoration-color: var(--accent); }
.blog-prose strong { font-weight: 700; color: var(--blog-ink); }
.blog-prose img { max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--blog-line); margin: .4em 0 1.2em; }
.blog-prose blockquote { margin: 0 0 1.3em; padding: 4px 0 4px 20px; border-left: 4px solid var(--blog-line); color: var(--blog-muted); }
.blog-prose hr { border: 0; border-top: 1px solid var(--blog-line); margin: 2.4em 0; }
.blog-prose code {
  padding: 2px 6px;
  background: var(--blog-soft);
  border: 1px solid var(--blog-line);
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .86em;
}
.blog-prose pre {
  margin: 0 0 1.4em;
  padding: 16px 18px;
  overflow-x: auto;
  background: #171a1c;
  color: #f1f3f4;
  border-radius: 12px;
  line-height: 1.55;
  font-size: 15px;
}
.blog-prose pre code { padding: 0; background: none; border: 0; color: inherit; font-size: inherit; }
.blog-table { margin: 0 0 1.4em; overflow-x: auto; border: 1px solid var(--blog-line); border-radius: 12px; }
.blog-prose table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.5; }
.blog-prose th, .blog-prose td { padding: 12px 16px; border-bottom: 1px solid var(--blog-line); text-align: left; vertical-align: top; }
.blog-prose tr:last-child td { border-bottom: 0; }
.blog-prose th { background: var(--blog-soft); font-family: var(--blog-head); font-weight: 700; font-size: 14px; color: var(--blog-ink); }

/* ----- Post image under the answer box ----- */
.blog-figure { margin: 0 0 32px; }
.blog-figure img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--blog-line); }

/* ----- End-of-post call to action ----- */
.blog-cta {
  margin: 56px 0 0;
  padding: 36px;
  background: var(--blog-hero-grad);
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 34px rgba(23, 26, 46, .22);
}
.blog-cta__title { margin: 0 0 8px; font-family: var(--blog-sub); font-weight: 600; font-size: 28px; line-height: 1.2; }
.blog-cta p { margin: 0 0 22px; color: rgba(255, 255, 255, .85); line-height: 1.65; }

/* ----- Small screens ----- */
@media (max-width: 720px) {
  .blog-hero .cph-hero__inner { padding: 40px var(--gutter) 48px; }
  .blog-post-hero { padding: 40px var(--gutter) 40px; }
  .blog-section { padding: 36px 0 64px; }
  .blog-paths { grid-template-columns: 1fr; }
  .blog-prose { font-size: 16px; }
  .blog-prose h2 { font-size: 26px; }
  .blog-prose h3 { font-size: 21px; }
  .blog-cta { padding: 26px 22px; }
  .blog-band__inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .blog-path, .blog-card, .blog-btn, .blog-chips a { transition: none; }
  .blog-path:hover, .blog-card:hover, .blog-btn--primary:hover, .blog-btn--ghost:hover { transform: none; }
}

/* Breadcrumbs on a post line up with the article column. */
.blog-layout-crumbs { max-width: 1000px; margin: 0 auto; }

/* Search box */
.blog-search { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; max-width: 640px; margin: 0 0 32px; }
.blog-search__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.blog-search__input { flex: 1 1 240px; min-width: 0; font: inherit; font-size: 16px; color: #171a1c; background: #fff; border: 1px solid #c9ccd1; border-radius: 8px; padding: 12px 16px; }
.blog-search__input:focus { outline: 2px solid var(--brand-orange, #f57e20); outline-offset: 1px; border-color: var(--brand-orange, #f57e20); }
.blog-search__btn { border: 0; cursor: pointer; align-self: stretch; }
.blog-search__count { margin: 0 0 20px; color: #424249; }

/* Search suggestions dropdown (js/blog-search.js) */
.blog-search__field { position: relative; flex: 1 1 240px; min-width: 0; }
.blog-search__field .blog-search__input { width: 100%; box-sizing: border-box; }
.blog-search__list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid #c9ccd1; border-radius: 12px; box-shadow: 0 14px 32px rgba(23, 26, 28, .16); max-height: 70vh; overflow-y: auto; }
.blog-search__list[hidden] { display: none; }
.blog-search__list li a { display: block; padding: 10px 12px; border-radius: 8px; color: #171a1c; text-decoration: none; }
.blog-search__list li.is-active a, .blog-search__list li a:hover { background: var(--blog-orange-tint, #fff3e8); }
.blog-search__title { display: block; font-family: var(--blog-head); font-weight: 600; font-size: 15px; line-height: 1.35; }
.blog-search__meta { display: block; margin-top: 2px; font-size: 13px; color: #6b6e75; }
.blog-search__all { font-family: var(--blog-head); font-weight: 600; font-size: 14px; color: #b55a12; }
.blog-search__none { padding: 10px 12px; font-size: 14px; color: #6b6e75; }
