/* ==========================================================================
   Blog listing + article design (static HTML/CSS for WordPress integration).
   Layered on top of ../../style.css, which is linked first on the blog pages
   and owns the shared header, footer and design tokens.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens

   These ramps started life as the Tailwind palette from the React source and
   did not match the rest of the site: a cooler navy for text and a violet-ish
   blue (#2563eb) for the accent, against index.html's #0d1526 ink and #0072f6
   blue. Every step below is now derived from the site palette in ../../style.css,
   which is linked ahead of this file on the blog pages, so `var()` references
   to it resolve here. Endpoints alias those variables directly; the in-between
   steps are interpolated so each ramp stays evenly spaced.

   Change a colour in ../../style.css :root and the blog follows.
   -------------------------------------------------------------------------- */
:root {
  /* Ink — body copy, headings and dark surfaces (was "navy") */
  --navy-50: var(--bg-soft); /* #f5f7fb */
  --navy-100: var(--line); /* #e6eaf1 */
  --navy-200: #ccd3e0;
  --navy-300: var(--muted-2); /* #8791a3 */
  --navy-400: var(--muted); /* #5c6779 */
  --navy-500: #465064;
  --navy-600: #2f3a4d;
  --navy-700: var(--ink-2); /* #1b2536 */
  --navy-800: #141d2e;
  --navy-900: var(--ink); /* #0d1526 */
  --navy-950: #070d1a;

  /* Brand blue — primary accent. 600 is the CTA blue used by .btn-strategy
     on index.html; 500 is the site's --blue, so the two-stop gradients in
     this file read as the same brand ramp. */
  --blue-50: var(--blue-soft); /* #e8f1ff */
  --blue-100: #d4e5ff;
  --blue-200: var(--sky-1); /* #bfdcff */
  --blue-300: #8fc0ff;
  --blue-400: #4b9bff;
  --blue-500: var(--blue); /* #1668ff */
  --blue-600: #0072f6;
  --blue-700: var(--blue-dark); /* #0b4ed1 */
  --blue-800: #0a3ea6;
  --blue-900: #0a3180;

  /* Glass / dark cards — same ink as .site-footer so dark panels match */
  --glass-900: var(--ink); /* #0d1526 */
  --glass-800: var(--ink-2); /* #1b2536 */

  --surface: var(--bg-soft); /* #f5f7fb */
  --logo: #0072f6;

  /* Nunito and JetBrains Mono are not among the families loaded in the
     document head, so both used to fall back to a system face mid-page.
     Track the site's own stacks instead. */
  --font-display: var(--heading-font);
  --font-sans: var(--body-font);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --header-h: 72px;
  /* Scoped name so it does not override the site-wide --container in style.css,
     which the shared .site-header / .site-footer / .container rely on. */
  --tw-container: 1280px;

  --shadow-card: 0 18px 40px -20px rgba(13, 21, 38, 0.25);
  --shadow-panel: 0 30px 70px -20px rgba(13, 21, 38, 0.55);
  --shadow-glass: 0 30px 80px -30px rgba(13, 21, 38, 0.55);
}

/* --------------------------------------------------------------------------
   2. Reset / base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

.tw-main {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--navy-900);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  background: var(--blue-200);
  color: var(--navy-900);
}

.tw-main img,
.tw-main svg {
  display: block;
  max-width: 100%;
}

.tw-main a {
  color: inherit;
  text-decoration: none;
}

.tw-main button,
.tw-main input,
.tw-main select {
  font: inherit;
  color: inherit;
}

/* Zero the UA/Bootstrap default margins inside the blog, but do it at zero
   specificity. Written as `.tw-main p` this is (0,1,1), which quietly outranks
   every single-class component rule in this file — `.tw-bloghero__lede`'s
   `margin: 20px auto 0` lost to it, so the lede rendered flush left under a
   centred heading instead of centred. :where() keeps the reset while letting
   any component class win. */
:where(.tw-main) :is(h1, h2, h3, h4, p, ul, figure) {
  margin: 0;
}

.tw-main ul {
  padding: 0;
  list-style: none;
}

.tw-container {
  width: 100%;
  max-width: var(--tw-container);
  margin-inline: auto;
  padding-inline: 16px;
}

.tw-icon {
  width: 16px;
  height: 16px;
  flex: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.tw-icon--filled {
  fill: currentColor;
  stroke: none;
}

.tw-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 640px) {
  .tw-container {
    padding-inline: 24px;
  }
}

@media (min-width: 1024px) {
  .tw-container {
    padding-inline: 32px;
  }
}

/* --------------------------------------------------------------------------
   3. Logo
   -------------------------------------------------------------------------- */
.tw-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tw-logo__mark {
  height: 28px;
  width: 18px; /* 36:56 aspect of the mark's viewBox */
  color: var(--logo);
  fill: none;
}

.tw-logo__word {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--logo);
}

.tw-footer .tw-logo__mark,
.tw-footer .tw-logo__word {
  color: #fff;
}

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */
.tw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding-inline: 20px;
  border: 0;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.tw-btn--primary {
  background: var(--blue-500);
  color: #fff;
  box-shadow: 0 1px 2px rgba(8, 21, 43, 0.08);
}

.tw-btn--primary:hover {
  background: var(--blue-600);
}

.tw-btn--ghost {
  background: transparent;
  color: var(--navy-800);
  font-weight: 500;
}

.tw-btn--ghost:hover {
  background: var(--surface);
  color: var(--blue-600);
}

.tw-btn--outline {
  background: #fff;
  color: var(--navy-900);
  border: 1px solid var(--navy-100);
  font-weight: 600;
}

.tw-btn--outline:hover {
  border-color: var(--blue-300);
  color: var(--blue-600);
}

.tw-btn--block {
  width: 100%;
}

.tw-btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   5. Header / navigation
   -------------------------------------------------------------------------- */
.tw-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0);
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
  border-bottom: 1px solid transparent;
}

.tw-header.is-active {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--navy-100);
}

.tw-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

/* Desktop nav */
.tw-nav {
  display: none;
  align-items: center;
  gap: 28px;
}

.tw-nav__link,
.tw-nav__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--navy-800);
  cursor: pointer;
  transition: color 0.2s ease;
}

.tw-nav__link:hover,
.tw-nav__trigger:hover,
.tw-nav__item.is-open .tw-nav__trigger {
  color: var(--blue-600);
}

.tw-nav__trigger .tw-icon {
  transition: transform 0.2s ease;
}

.tw-nav__item.is-open .tw-nav__trigger .tw-icon {
  transform: rotate(180deg);
}

.tw-nav__heart {
  color: var(--blue-500);
  fill: currentColor;
  stroke: none;
}

.tw-header__actions {
  display: none;
  align-items: center;
  gap: 8px;
}

.tw-header__burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--navy-800);
  cursor: pointer;
}

.tw-header__burger:hover {
  background: var(--surface);
}

.tw-header__burger .tw-icon {
  width: 20px;
  height: 20px;
}

.tw-header__burger .tw-icon--close,
.tw-header__burger.is-open .tw-icon--open {
  display: none;
}

.tw-header__burger.is-open .tw-icon--close {
  display: block;
}

@media (min-width: 1024px) {
  .tw-nav,
  .tw-header__actions {
    display: flex;
  }

  .tw-header__burger {
    display: none;
  }
}

/* --- Mega menu ----------------------------------------------------------- */
.tw-mega {
  position: absolute;
  left: 50%;
  top: 100%;
  z-index: 40;
  width: min(960px, calc(100vw - 2rem));
  transform: translateX(-50%);
  padding-top: 12px;
  display: none;
}

.tw-mega.is-open {
  display: block;
  animation: tw-fade-up 0.18s ease-out both;
}

.tw-mega__panel {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 18, 32, 0.85);
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}

.tw-mega__glow {
  position: absolute;
  border-radius: 9999px;
  pointer-events: none;
  filter: blur(64px);
}

.tw-mega__glow--a {
  top: -96px;
  left: -96px;
  height: 288px;
  width: 288px;
  background: rgba(59, 130, 246, 0.25);
}

.tw-mega__glow--b {
  bottom: -128px;
  right: 0;
  height: 288px;
  width: 320px;
  background: rgba(96, 165, 250, 0.15);
}

.tw-mega__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
}

.tw-mega__links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 24px;
}

.tw-mega__link {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  transition: background-color 0.2s ease;
}

.tw-mega__link:hover {
  background: rgba(255, 255, 255, 0.05);
}

.tw-mega__icon {
  display: flex;
  height: 36px;
  width: 36px;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  box-shadow: 0 4px 18px -4px rgba(59, 130, 246, 0.65);
  outline: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
}

.tw-mega__title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  border-bottom: 2px solid transparent;
  display: inline-block;
  padding-bottom: 2px;
  transition: border-color 0.2s ease;
}

.tw-mega__link:hover .tw-mega__title {
  border-bottom-color: var(--blue-400);
}

.tw-mega__desc {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.65);
}

.tw-mega__aside {
  position: relative;
  margin: 12px;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  padding: 28px;
  color: #fff;
}

.tw-mega__aside::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.15),
    transparent 55%,
    rgba(29, 78, 216, 0.2)
  );
  pointer-events: none;
}

.tw-mega__quote-mark {
  position: relative;
  width: 28px;
  height: 28px;
  color: var(--blue-300);
  fill: currentColor;
  stroke: none;
  transform: scaleX(-1);
}

.tw-mega__quote {
  position: relative;
  margin-top: 16px;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.95);
}

.tw-mega__author {
  position: relative;
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.tw-mega__avatar {
  height: 44px;
  width: 44px;
  border-radius: 9999px;
  object-fit: cover;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
  background: var(--navy-600);
}

.tw-mega__author-name {
  font-weight: 600;
}

.tw-mega__author-title {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.tw-mega__strip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(90deg, var(--blue-600), var(--blue-500));
  padding: 16px 24px;
  color: #fff;
}

.tw-mega__strip-copy {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
}

.tw-mega__strip-copy strong {
  font-weight: 600;
}

.tw-mega__strip-copy span {
  color: rgba(255, 255, 255, 0.85);
}

.tw-mega__strip-cta {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  border-radius: 9999px;
  background: #fff;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--blue-700);
  transition: gap 0.2s ease;
}

.tw-mega__strip:hover .tw-mega__strip-cta {
  gap: 10px;
}

@media (min-width: 640px) {
  .tw-mega__links {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 768px) {
  .tw-mega__grid {
    grid-template-columns: 1.4fr 1fr;
  }
}

/* --- Mobile menu --------------------------------------------------------- */
.tw-mobile {
  display: none;
  border-top: 1px solid var(--navy-100);
  background: #fff;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
}

.tw-mobile.is-open {
  display: block;
}

@media (min-width: 1024px) {
  .tw-mobile.is-open {
    display: none;
  }
}

.tw-mobile__inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-block: 16px;
}

.tw-mobile__summary {
  display: flex;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--navy-900);
  list-style: none;
}

.tw-mobile__summary::-webkit-details-marker {
  display: none;
}

.tw-mobile__summary:hover {
  background: var(--surface);
}

details[open] .tw-mobile__summary .tw-icon {
  transform: rotate(180deg);
}

.tw-mobile__group {
  display: grid;
  gap: 4px;
  padding: 0 12px 8px;
}

.tw-mobile__link {
  display: flex;
  gap: 12px;
  border-radius: 6px;
  padding: 8px;
}

.tw-mobile__link:hover {
  background: var(--surface);
}

.tw-mobile__icon {
  display: flex;
  height: 32px;
  width: 32px;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--blue-50);
  color: var(--blue-600);
}

.tw-mobile__icon--navy {
  background: var(--navy-50);
  color: var(--navy-700);
}

.tw-mobile__icon--emerald {
  background: #ecfdf5;
  color: #047857;
}

.tw-mobile__title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy-900);
}

.tw-mobile__desc {
  display: block;
  font-size: 12px;
  color: var(--navy-400);
}

.tw-mobile__flat {
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--navy-900);
}

.tw-mobile__flat:hover {
  background: var(--surface);
}

.tw-mobile__actions {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   6. Blog hero
   -------------------------------------------------------------------------- */
.tw-main {
  position: relative;
  padding-top: var(--header-h);
}

.tw-hero {
  position: relative;
  overflow: hidden;
  padding-block: 48px 80px;
}

.tw-hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tw-hero__grid-lines {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(14, 31, 61, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 31, 61, 0.06) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(
    ellipse 60% 50% at 30% 30%,
    #000 40%,
    transparent 80%
  );
  mask-image: radial-gradient(
    ellipse 60% 50% at 30% 30%,
    #000 40%,
    transparent 80%
  );
}

.tw-hero__blob {
  position: absolute;
  top: -160px;
  left: 33%;
  height: 520px;
  width: 900px;
  transform: translateX(-50%);
  border-radius: 9999px;
  background: rgba(219, 234, 254, 0.6);
  filter: blur(64px);
}

.tw-hero__body {
  position: relative;
}

.tw-breadcrumb {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--navy-400);
}

.tw-breadcrumb a:hover {
  color: var(--blue-600);
}

.tw-breadcrumb .tw-icon {
  width: 14px;
  height: 14px;
}

.tw-breadcrumb__current {
  color: var(--navy-700);
}

.tw-hero__layout {
  display: grid;
  gap: 48px;
}

.tw-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tw-eyebrow__badge {
  display: inline-flex;
  height: 36px;
  width: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #ecfdf5;
  color: #047857;
}

.tw-eyebrow__text {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--navy-500);
}

.tw-hero__title {
  margin-top: 20px;
  max-width: 48rem;
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--navy-900);
}

.tw-hero__lede {
  margin-top: 24px;
  max-width: 42rem;
  font-size: 18px;
  line-height: 1.7;
  color: var(--navy-500);
}

/* --- Filter bar ---------------------------------------------------------- */
.tw-filters {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tw-search {
  position: relative;
  width: 100%;
}

.tw-search .tw-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--navy-400);
  pointer-events: none;
}

.tw-input {
  height: 40px;
  width: 100%;
  border: 1px solid var(--navy-200);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px 0 36px;
  font-size: 14px;
  color: var(--navy-900);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.tw-input::placeholder {
  color: var(--navy-300);
}

.tw-input:focus,
.tw-select:focus {
  outline: none;
  border-color: var(--blue-400);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.tw-filters__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tw-select {
  height: 40px;
  border: 1px solid var(--navy-200);
  border-radius: 8px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235C6E8C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding: 0 34px 0 12px;
  font-size: 14px;
  color: var(--navy-900);
  appearance: none;
  cursor: pointer;
}

.tw-select--category {
  width: 170px;
}

.tw-select--sort {
  width: 130px;
}

/* --- Hero glass card ----------------------------------------------------- */
.tw-glass-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 18, 32, 0.95);
  padding: 32px;
  color: #fff;
  box-shadow: var(--shadow-glass);
}

.tw-glass-card__glow--a,
.tw-glass-card__glow--b {
  position: absolute;
  border-radius: 9999px;
  pointer-events: none;
}

.tw-glass-card__glow--a {
  bottom: -40px;
  right: -40px;
  height: 240px;
  width: 240px;
  background: rgba(59, 130, 246, 0.35);
  filter: blur(40px);
}

.tw-glass-card__glow--b {
  top: -48px;
  left: -48px;
  height: 176px;
  width: 176px;
  background: rgba(96, 165, 250, 0.2);
  filter: blur(64px);
}

.tw-glass-card__spark {
  position: relative;
  width: 28px;
  height: 28px;
  color: var(--blue-300);
}

.tw-glass-card__title {
  position: relative;
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.35;
}

.tw-glass-card__text {
  position: relative;
  margin-top: 12px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
}

.tw-glass-card__list {
  position: relative;
  margin-top: 24px;
  display: grid;
  gap: 12px;
}

.tw-glass-card__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.tw-glass-card__check {
  margin-top: 2px;
  display: grid;
  height: 20px;
  width: 20px;
  flex: none;
  place-items: center;
  border-radius: 9999px;
  background: var(--blue-500);
  color: #fff;
}

.tw-glass-card__check .tw-icon {
  width: 12px;
  height: 12px;
}

.tw-glass-card__item-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.tw-glass-card__item-desc {
  display: block;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

@media (min-width: 768px) {
  .tw-hero {
    padding-block: 64px 112px;
  }

  .tw-hero__title {
    font-size: 56px;
  }

  .tw-hero__lede {
    font-size: 20px;
  }

  .tw-filters {
    flex-direction: row;
    align-items: center;
  }

  .tw-search {
    max-width: 320px;
  }
}

@media (min-width: 1024px) {
  .tw-hero__layout {
    grid-template-columns: 7fr 5fr;
    align-items: center;
  }

  .tw-hero__title {
    font-size: 60px;
  }
}

/* --------------------------------------------------------------------------
   7. Post list
   -------------------------------------------------------------------------- */
.tw-list {
  position: relative;
  background: var(--surface);
  padding-block: 64px;
}

.tw-active-filters {
  margin-bottom: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tw-active-filters__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy-400);
}

.tw-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 9999px;
  border: 1px solid var(--navy-200);
  background: #fff;
  padding: 4px 12px;
  font-size: 14px;
  color: var(--navy-700);
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.tw-chip:hover {
  border-color: var(--blue-500);
  background: var(--blue-500);
  color: #fff;
}

.tw-chip .tw-icon {
  width: 12px;
  height: 12px;
}

.tw-link-btn {
  border: 0;
  background: none;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--blue-600);
  cursor: pointer;
}

.tw-link-btn:hover {
  text-decoration: underline;
}

.tw-result-count {
  margin-left: 4px;
  font-size: 14px;
  color: var(--navy-400);
}

.tw-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .tw-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .tw-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tw-list {
    padding-block: 80px;
  }
}

/* --- Post card ----------------------------------------------------------- */
.tw-card {
  display: flex;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--navy-100);
  background: #fff;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.tw-card:hover {
  transform: translateY(-2px);
  border-color: var(--blue-200);
  box-shadow: var(--shadow-card);
}

.tw-card__media {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-900));
}

.tw-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Placeholder cover — swap for the_post_thumbnail() in WordPress */
.tw-card__cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
}

.tw-card__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    120% 90% at 20% 10%,
    rgba(255, 255, 255, 0.22),
    transparent 60%
  );
}

.tw-card__cover .tw-icon {
  position: relative;
  width: 56px;
  height: 56px;
  color: rgba(255, 255, 255, 0.85);
  stroke-width: 1.4;
}

.tw-card__cover--dispatch {
  background-color: var(--blue-700);
}
.tw-card__cover--product {
  background-color: #047857;
}
.tw-card__cover--compliance {
  background-color: #b45309;
}
.tw-card__cover--finance {
  background-color: #6d28d9;
}
.tw-card__cover--analytics {
  background-color: #0369a1;
}
.tw-card__cover--operations {
  background-color: #be123c;
}

.tw-card__flag {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 9999px;
  background: var(--blue-500);
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 1px 2px rgba(8, 21, 43, 0.15);
}

.tw-card__flag .tw-icon {
  width: 12px;
  height: 12px;
}

.tw-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 24px;
}

.tw-card__meta {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.tw-tag {
  display: inline-block;
  border-radius: 9999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
}

.tw-tag--dispatch {
  background: var(--blue-50);
  color: var(--blue-700);
}
.tw-tag--product {
  background: #ecfdf5;
  color: #047857;
}
.tw-tag--compliance {
  background: #fffbeb;
  color: #b45309;
}
.tw-tag--finance {
  background: #f5f3ff;
  color: #6d28d9;
}
.tw-tag--analytics {
  background: #f0f9ff;
  color: #0369a1;
}
.tw-tag--operations {
  background: #fff1f2;
  color: #be123c;
}

.tw-card__readtime {
  font-size: 12px;
  color: var(--navy-400);
}

.tw-card__title {
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--navy-900);
  transition: color 0.2s ease;
}

.tw-card:hover .tw-card__title {
  color: var(--blue-600);
}

.tw-card__excerpt {
  margin-bottom: 24px;
  flex: 1;
  font-size: 14px;
  line-height: 1.7;
  color: var(--navy-500);
}

.tw-card__tags {
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tw-card__tags span {
  border-radius: 6px;
  background: var(--surface);
  padding: 2px 8px;
  font-size: 12px;
  color: var(--navy-600);
}

.tw-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--navy-100);
  padding-top: 16px;
}

.tw-card__date {
  font-size: 12px;
  color: var(--navy-400);
}

.tw-card__more {
  font-size: 14px;
  font-weight: 600;
  color: var(--blue-600);
}

.tw-card:hover .tw-card__more {
  color: var(--blue-700);
}

/* --- Empty state --------------------------------------------------------- */
.tw-empty {
  border-radius: 24px;
  border: 1px dashed var(--navy-200);
  background: #fff;
  padding: 48px;
  text-align: center;
  font-size: 14px;
  color: var(--navy-500);
}

/* --- Pagination ---------------------------------------------------------- */
.tw-pagination {
  margin-top: 56px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.tw-page,
.tw-page__gap {
  display: inline-flex;
  height: 46px;
  min-width: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--navy-100);
  background: #fff;
  padding-inline: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--navy-800);
  box-shadow: 0 2px 8px -2px rgba(15, 30, 70, 0.08);
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.tw-page:hover {
  border-color: var(--blue-200);
  color: var(--blue-600);
  box-shadow: 0 6px 16px -6px rgba(37, 99, 235, 0.35);
}

.tw-page.is-active,
.tw-page.is-active:hover {
  border-color: var(--blue-700);
  background: var(--blue-700);
  color: #fff;
  box-shadow: 0 8px 18px -8px rgba(29, 78, 216, 0.65);
}

/* Prev / Next carry a word rather than a digit, so they run wider. */
.tw-page--nav {
  padding-inline: 22px;
}

.tw-page:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.tw-page__gap {
  color: var(--navy-400);
  cursor: default;
  user-select: none;
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   8. Footer
   -------------------------------------------------------------------------- */
.tw-footer {
  position: relative;
  border-top: 1px solid var(--navy-100);
  background: var(--navy-900);
  color: #fff;
}

.tw-footer__inner {
  padding-block: 64px;
}

.tw-footer__grid {
  display: grid;
  gap: 40px;
}

.tw-footer__blurb {
  margin-top: 16px;
  max-width: 24rem;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.7);
}

.tw-footer__status {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.tw-footer__dot {
  height: 6px;
  width: 6px;
  border-radius: 9999px;
  background: #34d399;
  animation: tw-glow-pulse 4s ease-in-out infinite;
}

.tw-footer__status span:last-child {
  font-family: var(--font-mono);
}

.tw-footer__cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.tw-footer__col-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.tw-footer__links {
  margin-top: 16px;
  display: grid;
  gap: 10px;
  font-size: 14px;
}

.tw-footer__links a {
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.2s ease;
}

.tw-footer__links a:hover {
  color: var(--blue-300);
}

.tw-footer__bottom {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 32px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.tw-footer__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.tw-footer__badges span {
  font-family: var(--font-mono);
}

@media (min-width: 768px) {
  .tw-footer__cols {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tw-footer__bottom {
    flex-direction: row;
    align-items: center;
  }
}

@media (min-width: 1024px) {
  .tw-footer__grid {
    grid-template-columns: 4fr 8fr;
  }
}

/* --------------------------------------------------------------------------
   9. Animations
   -------------------------------------------------------------------------- */
@keyframes tw-fade-up {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes tw-glow-pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

@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;
  }
}

/* ==========================================================================
   10. Blog detail page (single post)
   Mirrors BlogPostPage.tsx + BlogSidebar.tsx + TableOfContents.tsx
   ========================================================================== */

/* The detail page sits on the surface grey, not white. */
body.tw-page--post {
  background: var(--surface);
}

.tw-crumbbar {
  border-bottom: 1px solid var(--navy-100);
  background: #fff;
}

.tw-crumbbar__inner {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 1180px;
  margin-inline: auto;
  padding: 12px 24px;
  font-size: 13px;
  color: var(--navy-400);
}

.tw-crumbbar__inner a:hover {
  color: var(--blue-600);
}

.tw-crumbbar__inner .tw-icon {
  width: 14px;
  height: 14px;
  flex: none;
}

.tw-crumbbar__current {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: var(--navy-700);
}

/* --- Layout: article + sticky rail --------------------------------------- */
.tw-post-layout {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 36px;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 24px;
}

.tw-post-main {
  width: 100%;
  min-width: 0;
  flex: 1;
}

@media (min-width: 1024px) {
  .tw-post-layout {
    flex-direction: row;
  }

  /* Scoped to the layout so these win over the base .tw-rail block below. */
  .tw-post-layout > .tw-rail {
    position: sticky;
    top: 96px;
    width: 340px;
    flex: none;
    align-self: flex-start;
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .tw-post-layout > .tw-rail::-webkit-scrollbar {
    display: none;
  }
}

/* --- Cover --------------------------------------------------------------- */
.tw-post__cover {
  position: relative;
  margin-top: 28px;
  height: 240px;
  width: 100%;
  overflow: hidden;
  border-radius: 16px;
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.14),
      rgba(255, 255, 255, 0) 55%
    ),
    linear-gradient(160deg, var(--blue-700), var(--navy-900));
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  display: grid;
  place-items: center;
}

.tw-post__cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tw-post__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
}

.tw-post__cover .tw-icon {
  position: relative;
  width: 72px;
  height: 72px;
  color: rgba(255, 255, 255, 0.85);
  stroke-width: 1.3;
}

@media (min-width: 768px) {
  .tw-post__cover {
    height: 360px;
  }
}

/* --- Article header ------------------------------------------------------ */
.tw-article {
  padding-block: 28px 48px;
}

.tw-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  border: 1px solid var(--navy-200);
  border-radius: 9999px;
  background: #fff;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--navy-500);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}

.tw-back:hover {
  border-color: var(--blue-400);
  color: var(--blue-600);
}

.tw-back .tw-icon {
  width: 14px;
  height: 14px;
}

.tw-post__cat {
  margin-bottom: 14px;
}

.tw-post__title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--navy-900);
}

.tw-post__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin: 20px 0 24px;
  border-bottom: 1px solid var(--navy-100);
  padding-bottom: 24px;
}

.tw-post__author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tw-post__avatar {
  display: grid;
  height: 32px;
  width: 32px;
  place-items: center;
  border-radius: 9999px;
  background: var(--blue-500);
  color: #fff;
}

.tw-post__avatar .tw-icon {
  width: 14px;
  height: 14px;
}

.tw-post__author-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy-800);
}

.tw-post__stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--navy-400);
}

.tw-post__stat .tw-icon {
  width: 14px;
  height: 14px;
}

.tw-post__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
}

.tw-post__tags > .tw-icon {
  width: 14px;
  height: 14px;
  color: var(--navy-400);
}

.tw-post__tag {
  border-radius: 9999px;
  background: var(--blue-50);
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--blue-600);
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.tw-post__tag:hover {
  background: var(--blue-500);
  color: #fff;
}

@media (min-width: 640px) {
  .tw-post__title {
    font-size: 36px;
  }
}

/* --- Table of contents --------------------------------------------------- */
.tw-toc {
  margin-bottom: 40px;
  border: 1px solid var(--blue-100);
  border-radius: 16px;
  background: rgba(239, 246, 255, 0.5);
  padding: 20px;
}

.tw-toc__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tw-toc__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--navy-900);
}

.tw-toc__label .tw-icon {
  width: 18px;
  height: 18px;
  color: var(--blue-500);
}

.tw-toc__toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: none;
  padding: 0;
  font-size: 14px;
  color: var(--navy-400);
  cursor: pointer;
  transition: color 0.2s ease;
}

.tw-toc__toggle:hover {
  color: var(--blue-600);
}

.tw-toc.is-collapsed .tw-toc__list {
  display: none;
}

.tw-toc.is-collapsed .tw-toc__toggle .tw-icon {
  transform: rotate(180deg);
}

.tw-toc__toggle .tw-icon {
  transition: transform 0.2s ease;
}

.tw-toc__list {
  margin-top: 16px;
  display: grid;
  gap: 8px;
  font-size: 14px;
}

.tw-toc__list a {
  color: var(--navy-700);
  font-weight: 600;
  transition: color 0.2s ease;
}

.tw-toc__list a:hover {
  color: var(--blue-600);
}

.tw-toc__list li.is-sub {
  padding-left: 20px;
}

.tw-toc__list li.is-sub a {
  font-weight: 400;
  color: var(--navy-500);
}

@media (min-width: 640px) {
  .tw-toc {
    padding: 24px;
  }
}

/* --- Rendered post body (ported from blog-content.css) ------------------- */
.blog-content {
  font-family: var(--font-sans);
  color: #1d1d1f;
  line-height: 1.8;
  font-size: 17px;
  margin-bottom: 40px;
}

.blog-content h1 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--navy-900);
  margin: 32px 0 16px;
}

.blog-content h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--navy-900);
  margin: 28px 0 14px;
  scroll-margin-top: 90px;
}

.blog-content h3 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  color: var(--navy-900);
  margin: 22px 0 12px;
  scroll-margin-top: 90px;
}

.blog-content p {
  margin: 0 0 18px;
}

.blog-content ul,
.blog-content ol {
  margin: 0 0 18px 1.4em;
  padding-left: 1em;
  list-style-position: outside;
}

.blog-content ul {
  list-style-type: disc;
}

.blog-content ol {
  list-style-type: decimal;
}

.blog-content ul ul {
  list-style-type: circle;
}

.blog-content li {
  margin: 6px 0;
}

.blog-content a {
  color: var(--blue-600);
  font-weight: 600;
  text-decoration: underline;
}

.blog-content img,
.blog-content video {
  max-width: 100%;
  border-radius: 12px;
  margin: 24px 0;
}

.blog-content iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 12px;
  margin: 24px 0;
}

.blog-content blockquote {
  border-left: 4px solid var(--blue-500);
  padding: 4px 18px;
  color: var(--navy-500);
  margin: 18px 0;
  background: var(--blue-50);
}

.blog-content pre {
  background: #0d1117;
  color: #e6edf3;
  padding: 18px;
  border-radius: 12px;
  overflow: auto;
  margin: 18px 0;
}

.blog-content code {
  font-family: var(--font-mono);
  font-size: 14px;
}

.blog-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
}

.blog-content th,
.blog-content td {
  border: 1px solid #ddd;
  padding: 8px 12px;
  text-align: left;
}

.blog-content .tw-table-scroll {
  overflow-x: auto;
}

/* --- Share strip --------------------------------------------------------- */
.tw-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--navy-100);
  border-radius: 16px;
  background: #fff;
  padding: 20px 24px;
}

.tw-share__label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy-700);
}

.tw-share__label .tw-icon {
  width: 18px;
  height: 18px;
  color: var(--navy-400);
}

.tw-share__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 9999px;
  background: var(--navy-900);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.tw-share__btn:hover {
  background: var(--navy-800);
}

.tw-share__btn.is-copied {
  background: #059669;
}

.tw-share__btn .tw-icon {
  width: 14px;
  height: 14px;
}

.tw-share__btn .tw-share__done,
.tw-share__btn.is-copied .tw-share__idle {
  display: none;
}

.tw-share__btn.is-copied .tw-share__done {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tw-share__idle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* --- Sidebar rail -------------------------------------------------------- */
.tw-rail {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-block: 28px 48px;
}

.tw-rail__card {
  border: 1px solid var(--navy-100);
  border-radius: 16px;
  background: #fff;
  padding: 20px;
  box-shadow: 0 6px 18px rgba(20, 40, 90, 0.04);
}

.tw-rail__title {
  margin-bottom: 14px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--navy-900);
}

.tw-rail__search {
  position: relative;
  display: flex;
  align-items: center;
}

.tw-rail__search > .tw-icon {
  position: absolute;
  left: 12px;
  color: var(--navy-400);
  pointer-events: none;
}

.tw-rail__search input {
  height: 40px;
  width: 100%;
  border: 1px solid var(--navy-200);
  border-radius: 8px;
  background: #fff;
  padding: 0 64px 0 36px;
  font-size: 14px;
  color: var(--navy-900);
  outline: none;
}

.tw-rail__search input:focus {
  border-color: var(--blue-400);
}

.tw-rail__go {
  position: absolute;
  right: 6px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: var(--blue-500);
  padding-inline: 12px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
}

.tw-rail__go:hover {
  background: var(--blue-600);
}

.tw-rail__toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--navy-900);
}

.tw-rail__toggle .tw-icon {
  width: 18px;
  height: 18px;
  color: var(--navy-400);
  transition: transform 0.2s ease;
}

.tw-rail__card.is-collapsed .tw-rail__list {
  display: none;
}

.tw-rail__card.is-collapsed .tw-rail__toggle .tw-icon {
  transform: rotate(180deg);
}

.tw-rail__list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tw-rail__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.tw-rail__thumb {
  display: grid;
  height: 48px;
  width: 48px;
  flex: none;
  place-items: center;
  border-radius: 8px;
  background: var(--blue-500);
  background-size: cover;
  background-position: center;
  color: rgba(255, 255, 255, 0.9);
}

.tw-rail__thumb .tw-icon {
  width: 20px;
  height: 20px;
}

.tw-rail__thumb--product {
  background: #047857;
}
.tw-rail__thumb--compliance {
  background: #b45309;
}
.tw-rail__thumb--finance {
  background: #6d28d9;
}
.tw-rail__thumb--analytics {
  background: #0369a1;
}
.tw-rail__thumb--operations {
  background: #be123c;
}

.tw-rail__item-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  color: var(--navy-800);
  transition: color 0.2s ease;
}

.tw-rail__item:hover .tw-rail__item-title {
  color: var(--blue-600);
}

.tw-rail__item-date {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--navy-400);
}

.tw-rail__text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--navy-500);
}

.tw-rail__cta {
  margin-top: 16px;
  display: inline-flex;
  height: 40px;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  background: var(--blue-500);
  padding-inline: 16px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  transition: background-color 0.2s ease;
}

.tw-rail__cta:hover {
  background: var(--blue-600);
}

/* ==========================================================================
   11. Blog listing — centered hero + category pills + featured + grid
   (the layout used by index.html)
   ========================================================================== */

body.tw-page--blog {
  background: var(--surface);
}

/* --- Centered hero ------------------------------------------------------- */
.tw-bloghero {
  position: relative;
  overflow: hidden;
  padding-block: 72px 40px;
  text-align: center;
}

.tw-bloghero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tw-bloghero__bg::before {
  content: "";
  position: absolute;
  top: -220px;
  left: 50%;
  height: 420px;
  width: 900px;
  transform: translateX(-50%);
  border-radius: 9999px;
  background: rgba(147, 197, 253, 0.35);
  filter: blur(90px);
}

.tw-bloghero__inner {
  position: relative;
}

.tw-bloghero__badge {
  display: inline-block;
  border-radius: 9999px;
  background: #e6ecfd;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-600);
}

.tw-bloghero__title {
  margin-top: 24px;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #1f2937;
}

.tw-bloghero__title em {
  font-style: normal;
  color: var(--blue-600);
}

.tw-bloghero__lede {
  margin: 20px auto 0;
  max-width: 620px;
  font-size: 18px;
  line-height: 1.65;
  color: var(--navy-400);
}

@media (min-width: 768px) {
  .tw-bloghero {
    padding-block: 96px 48px;
  }

  .tw-bloghero__title {
    font-size: 56px;
  }
}

@media (min-width: 1024px) {
  .tw-bloghero__title {
    font-size: 64px;
  }
}

/* --- Category pills ------------------------------------------------------ */
.tw-cats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 36px;
}

.tw-cat {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--navy-100);
  border-radius: 9999px;
  background: #fff;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 500;
  color: var(--navy-800);
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.tw-cat:hover {
  border-color: var(--blue-300);
  color: var(--blue-600);
  box-shadow: 0 4px 14px -6px rgba(37, 99, 235, 0.4);
}

.tw-cat.is-active {
  border-color: var(--blue-800);
  background: var(--blue-800);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(30, 64, 175, 0.6);
}

/* --- Featured post ------------------------------------------------------- */
.tw-featured {
  padding-block: 32px 8px;
}

.tw-featured__card {
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 20px 45px -30px rgba(15, 30, 70, 0.35);
}

.tw-featured__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(150deg, var(--blue-600), var(--navy-900));
}

/* Thumbnails are letterboxed, never cropped — blog banners carry text that a
   cover-crop would cut off. The tinted backdrop fills the leftover band. */
.tw-featured__media:has(img),
.tw-pcard__media:has(img) {
  background: var(--navy-100);
}

.tw-featured__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tw-featured__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px;
}

.tw-featured__label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-600);
}

.tw-featured__title {
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--navy-900);
  transition: color 0.2s ease;
}

.tw-featured__card:hover .tw-featured__title {
  color: var(--blue-600);
}

.tw-featured__excerpt {
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--navy-400);
}

@media (min-width: 900px) {
  .tw-featured__card {
    grid-template-columns: 1fr 1fr;
  }

  .tw-featured__media {
    aspect-ratio: auto;
    height: 100%;
    min-height: 380px;
  }

  .tw-featured__body {
    padding: 48px;
  }

  .tw-featured__title {
    font-size: 34px;
  }
}

/* --- Shared card bits ---------------------------------------------------- */
.tw-badge {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

/* Gradient stand-in for a missing featured image */
.tw-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 32px 32px;
}

.tw-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    120% 90% at 20% 10%,
    rgba(255, 255, 255, 0.2),
    transparent 60%
  );
}

.tw-cover .tw-icon {
  position: relative;
  width: 60px;
  height: 60px;
  color: rgba(255, 255, 255, 0.85);
  stroke-width: 1.4;
}

.tw-cover--dispatch {
  background-color: var(--blue-700);
}
.tw-cover--product {
  background-color: #047857;
}
.tw-cover--compliance {
  background-color: #b45309;
}
.tw-cover--finance {
  background-color: #6d28d9;
}
.tw-cover--analytics {
  background-color: #0369a1;
}
.tw-cover--operations {
  background-color: #be123c;
}

.tw-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--navy-400);
}

.tw-meta__dot {
  height: 4px;
  width: 4px;
  border-radius: 9999px;
  background: var(--navy-300);
}

.tw-readlink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--blue-600);
  transition: gap 0.2s ease;
}

.tw-readlink .tw-icon {
  width: 16px;
  height: 16px;
}

.tw-featured__card:hover .tw-readlink,
.tw-pcard:hover .tw-readlink {
  gap: 12px;
}

/* --- Post grid ----------------------------------------------------------- */
.tw-posts {
  padding-block: 32px 80px;
}

.tw-posts__grid {
  display: grid;
  gap: 28px;
  grid-template-columns: 1fr;
}

.tw-pcard {
  display: flex;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 34px -26px rgba(15, 30, 70, 0.4);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.tw-pcard:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 50px -28px rgba(15, 30, 70, 0.5);
}

.tw-pcard__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(150deg, var(--blue-600), var(--navy-900));
}

.tw-pcard__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tw-pcard__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 24px;
}

.tw-pcard__title {
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.32;
  color: var(--navy-900);
  transition: color 0.2s ease;
}

.tw-pcard:hover .tw-pcard__title {
  color: var(--blue-600);
}

.tw-pcard__excerpt {
  margin-top: 12px;
  flex: 1;
  font-size: 15px;
  line-height: 1.7;
  color: var(--navy-400);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tw-pcard__foot {
  margin-top: 24px;
}

@media (min-width: 640px) {
  .tw-posts__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .tw-posts__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* --- Empty state --------------------------------------------------------- */
.tw-posts__empty {
  border-radius: 20px;
  border: 1px dashed var(--navy-200);
  background: #fff;
  padding: 56px 24px;
  text-align: center;
  font-size: 15px;
  color: var(--navy-500);
}

/* ==========================================================================
   12. Blog listing — "Categories" rail + row list + sticky promo rail
   ========================================================================== */

/* --- Section heading ----------------------------------------------------- */
.tw-section {
  padding-block: 40px 0;
}

.tw-section__title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--navy-900);
}

@media (min-width: 768px) {
  .tw-section__title {
    font-size: 36px;
  }
}

/* --- Horizontally scrolling category rail -------------------------------- */
.tw-catrail {
  position: relative;
  margin-top: 24px;
}

.tw-catrail__track {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--navy-200) transparent;
}

.tw-catrail__track::-webkit-scrollbar {
  height: 6px;
}

.tw-catrail__track::-webkit-scrollbar-thumb {
  background: var(--navy-200);
  border-radius: 9999px;
}

.tw-catrail__track::-webkit-scrollbar-track {
  background: transparent;
}

/* Fade the right edge so it reads as "there is more to scroll". */
.tw-catrail::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 10px;
  width: 56px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(245, 247, 251, 0), var(--surface));
}

.tw-catpill {
  flex: none;
  scroll-snap-align: start;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--blue-200);
  border-radius: 9999px;
  background: #fff;
  padding: 11px 24px;
  font-size: 15px;
  font-weight: 500;
  color: var(--navy-800);
  white-space: nowrap;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.tw-catpill:hover {
  border-color: var(--blue-400);
  background: var(--blue-50);
  color: var(--blue-700);
}

.tw-catpill.is-active {
  border-color: var(--blue-500);
  background: var(--blue-50);
  color: var(--blue-700);
  font-weight: 600;
}

/* --- Two-column body ----------------------------------------------------- */
.tw-listing {
  padding-block: 36px 80px;
}

.tw-listing__layout {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 40px;
}

.tw-listing__main {
  width: 100%;
  min-width: 0;
  flex: 1;
}

@media (min-width: 1024px) {
  .tw-listing__layout {
    flex-direction: row;
  }

  .tw-listing__layout > .tw-promo-rail {
    position: sticky;
    top: 96px;
    width: 340px;
    flex: none;
    align-self: flex-start;
  }
}

/* --- Post rows ----------------------------------------------------------- */
.tw-rows {
  display: grid;
  gap: 40px;
}

.tw-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: center;
}

.tw-row__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(150deg, var(--blue-600), var(--navy-900));
}

.tw-row__media:has(img) {
  background: var(--navy-100);
}

.tw-row__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.35s ease;
}

.tw-row:hover .tw-row__media img {
  transform: scale(1.03);
}

.tw-row__title {
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--navy-900);
  transition: color 0.2s ease;
}

.tw-row:hover .tw-row__title {
  color: var(--blue-600);
}

.tw-row__excerpt {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--navy-400);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tw-row__more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--blue-600);
  transition: gap 0.2s ease;
}

.tw-row__more .tw-icon {
  width: 16px;
  height: 16px;
}

.tw-row:hover .tw-row__more {
  gap: 12px;
}

@media (min-width: 700px) {
  .tw-row {
    grid-template-columns: 340px 1fr;
    gap: 28px;
  }

  .tw-row__title {
    margin-top: 0;
    font-size: 23px;
  }
}

/* --- Promo rail ---------------------------------------------------------- */
.tw-promo-rail {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tw-promo__photo {
  overflow: hidden;
  border-radius: 16px;
  background: var(--navy-100);
}

.tw-promo__photo img {
  width: 100%;
  height: auto;
}

.tw-promo {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: var(--glass-900);
  padding: 28px;
  color: #fff;
}

.tw-promo::before {
  content: "";
  position: absolute;
  bottom: -60px;
  right: -60px;
  height: 200px;
  width: 200px;
  border-radius: 9999px;
  background: rgba(59, 130, 246, 0.35);
  filter: blur(50px);
  pointer-events: none;
}

.tw-promo__title {
  position: relative;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.tw-promo__title em {
  font-style: normal;
  color: var(--blue-400);
}

.tw-promo__text {
  position: relative;
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.75);
}

.tw-promo__cta {
  position: relative;
  margin-top: 20px;
  display: inline-flex;
  height: 44px;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  background: var(--blue-500);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  transition: background-color 0.2s ease;
}

.tw-promo__cta:hover {
  background: var(--blue-600);
}

.tw-promo__list {
  position: relative;
  margin-top: 20px;
  display: grid;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 18px;
}

.tw-promo__item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.tw-promo__item .tw-icon {
  width: 14px;
  height: 14px;
  color: var(--blue-400);
}

/* ==========================================================================
   13. Blog detail — three columns: TOC rail | article | recent + categories
   ========================================================================== */

.tw-posthead {
  padding-block: 40px 28px;
}

.tw-posthead__title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--navy-900);
}

.tw-posthead__meta {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  font-size: 14px;
  color: var(--navy-600);
}

.tw-posthead__meta > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.tw-posthead__meta .tw-icon {
  width: 15px;
  height: 15px;
  color: var(--navy-400);
}

.tw-posthead__meta .tw-icon--filled {
  color: var(--blue-500);
}

@media (min-width: 768px) {
  .tw-posthead {
    padding-block: 56px 32px;
  }

  .tw-posthead__title {
    font-size: 42px;
  }
}

/* --- The three-column shell ---------------------------------------------- */
.tw-post3 {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
  grid-template-areas:
    "toc"
    "content"
    "side";
  padding-bottom: 72px;
}

.tw-post3__toc {
  grid-area: toc;
}

.tw-post3__content {
  grid-area: content;
  min-width: 0;
}

.tw-post3__side {
  grid-area: side;
}

@media (min-width: 900px) {
  .tw-post3 {
    grid-template-columns: 1fr 300px;
    grid-template-areas:
      "toc  toc"
      "content side";
  }
}

@media (min-width: 1200px) {
  .tw-post3 {
    grid-template-columns: 280px 1fr 300px;
    grid-template-areas: "toc content side";
  }

  .tw-post3__toc,
  .tw-post3__side {
    position: sticky;
    top: 96px;
    align-self: start;
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .tw-post3__toc::-webkit-scrollbar,
  .tw-post3__side::-webkit-scrollbar {
    display: none;
  }
}

/* --- Shared rail card ---------------------------------------------------- */
.tw-card-panel {
  border: 1px solid var(--navy-100);
  border-radius: 12px;
  background: #fff;
  padding: 20px;
  box-shadow: 0 6px 18px rgba(20, 40, 90, 0.04);
}

.tw-card-panel + .tw-card-panel {
  margin-top: 24px;
}

.tw-card-panel__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--navy-900);
}

/* --- Table of contents rail ---------------------------------------------- */
.tw-toc2__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--blue-600);
}

.tw-toc2__list {
  margin-top: 12px;
  display: grid;
  gap: 2px;
}

.tw-toc2__list a {
  display: block;
  border-left: 3px solid transparent;
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--navy-800);
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.tw-toc2__list a:hover {
  background: var(--blue-50);
  color: var(--blue-700);
}

.tw-toc2__list li.is-sub a {
  padding-left: 26px;
  font-size: 14px;
  color: var(--navy-500);
}

.tw-toc2__list a.is-current {
  border-left-color: var(--blue-500);
  background: var(--blue-50);
  color: var(--blue-700);
  font-weight: 600;
}

/* --- Article column ------------------------------------------------------ */
.tw-article2 {
  min-width: 0;
}

.tw-article2__cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: var(--navy-100);
  margin-bottom: 28px;
}

.tw-article2__cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* --- Recent posts -------------------------------------------------------- */
.tw-recent {
  margin-top: 16px;
  display: grid;
  gap: 14px;
}

.tw-recent a {
  font-size: 15px;
  line-height: 1.5;
  color: var(--navy-500);
  transition: color 0.2s ease;
}

.tw-recent a:hover {
  color: var(--blue-600);
}

/* --- Category tag cloud -------------------------------------------------- */
.tw-tagcloud {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tw-tagcloud a {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--navy-100);
  border-radius: 9999px;
  background: #fff;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-800);
  box-shadow: 0 2px 6px -2px rgba(15, 30, 70, 0.1);
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.tw-tagcloud a:hover {
  border-color: var(--blue-400);
  background: var(--blue-50);
  color: var(--blue-700);
}
