/* DemandStream Digital: blog (home.php, single.php, archive.php, search.php, 404.php; helpers in inc/blog.php).
   Loads after home-dark.css + glowup.css, only on the blog views. Same system as the service and trade pages:
   navy-grain hero under the transparent header, light gray content ground (#EEF1F5) with white rounded cards and soft
   shadows, Archivo Expanded headings, Manrope text, red gradient buttons, the red-bar kicker. Class prefix: db-. */

/* ---- Light ground tokens (same set as .tr-jobs / .tr-how in trade.css) ---- */
.db-list, .db-body {
  --hd-bg: #EEF1F5; --hd-bg-2: #F7F9FB; --hd-card: #FFFFFF; --hd-navy: #E1E6ED; --hd-line: #D3DAE3;
  --hd-white: #15171B; --hd-text: #3A3E45; --hd-muted: #5F646C; --hd-red-text: #B3222B;
  --lx-hair: rgba(21, 23, 27, 0.12); --lx-hair-strong: rgba(21, 23, 27, 0.24); --lx-surface: rgba(21, 23, 27, 0.03);
  --lx-ink: #15171B; --lx-ink-2: #2C3036; --lx-ink-3: #3A3E45;
  background: var(--hd-bg); color: var(--hd-text);
}
.db-list .hd-btn:not(.hd-btn--outline), .db-body .hd-btn:not(.hd-btn--outline) { --hd-white: #FFFFFF; --hd-red-text: #FFFFFF; }
.ds-blog .hd-title .hd-accent { color: var(--hd-red-text); }

/* ---- Hero: navy grain, one column ---- */
.db-hero { position: relative; padding: 186px 0 92px; background-color: #06111D; background-image: url(tex/bg-navy-grain.webp); background-size: cover; background-position: center; color: var(--hd-text); }
.db-hero__inner { max-width: 1300px; }
.db-hero__title { max-width: 900px; font-size: 52px; line-height: 1.1; }
.db-hero__title--post { max-width: 960px; font-size: 46px; line-height: 1.14; }
.db-hero__lead { max-width: 700px; margin-top: 22px; font-size: 18.5px; line-height: 1.7; color: var(--lx-ink-3); }
.db-hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.db-hero__actions .hd-btn { min-width: 220px; justify-content: center; }
.db-hero__actions .hd-btn--outline { color: #FFFFFF !important; }
.db-hero--post { padding-bottom: 176px; }

.db-crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 26px; padding: 0; list-style: none; font-size: 14.5px; color: var(--hd-muted); }
.db-crumbs li + li::before { content: "/"; margin-right: 6px; opacity: 0.6; }
.db-crumbs a { color: var(--hd-muted); transition: color 0.2s ease; }
.db-crumbs a:hover, .db-crumbs a:focus-visible { color: #FFFFFF; }
.db-hero__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }

.db-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 0; margin-top: 30px; font-size: 15px; color: #B9C4CF; }
.db-byline > span { display: inline-flex; align-items: center; }
.db-byline > span + span::before { content: ""; width: 4px; height: 4px; margin: 0 14px; border-radius: 50%; background: currentColor; opacity: 0.55; }
.db-byline > .db-byline__photo + span::before { display: none; }
.db-byline__photo img { width: 44px; height: 44px; margin-right: 12px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; }
.db-byline__name { color: #FFFFFF; font-weight: 600; }

/* ---- Tags ---- */
.db-tag { position: relative; z-index: 2; display: inline-block; padding: 5px 11px; border-radius: 999px; background: #E9EDF2; color: #2C3036; font-size: 13px; font-weight: 600; line-height: 1.3; transition: background 0.2s ease, color 0.2s ease; }
.db-tag:hover, .db-tag:focus-visible { background: #15171B; color: #FFFFFF; }
.db-tag--dark { background: rgba(255, 255, 255, 0.09); color: #FFFFFF; }
.db-tag--dark:hover, .db-tag--dark:focus-visible { background: var(--hd-red); }

/* ---- Index and archives: filter, search, card grid ---- */
.db-list { padding: 64px 0 120px; }
.db-filter { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 28px; margin-bottom: 40px; }
.db-filter__nav { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.db-filter__label { color: var(--hd-muted); font-size: 15px; font-weight: 600; }
.db-filter__nav ul { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.db-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 999px; background: #FFFFFF; color: #15171B; font-size: 15px; font-weight: 600; box-shadow: 0 1px 2px rgba(21, 23, 27, 0.06), 0 4px 12px rgba(21, 23, 27, 0.05); transition: background 0.2s ease, color 0.2s ease; }
.db-pill__n { color: var(--hd-muted); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.db-pill:hover, .db-pill:focus-visible { background: #E1E6ED; }
.db-pill.is-active { background: #0B1E33; color: #FFFFFF; }
.db-pill.is-active .db-pill__n { color: #B9C4CF; }

.db-search { display: flex; gap: 8px; width: 100%; max-width: 380px; }
.db-search input[type="search"] { flex: 1; min-width: 0; height: 46px; padding: 0 16px; border: 1px solid #D3DAE3; border-radius: 4px; background: #FFFFFF; color: #15171B; font: 500 15.5px/1 var(--hd-font); }
.db-search input[type="search"]::placeholder { color: #7A8089; }
.db-search button { height: 46px; padding: 0 18px; border: 0; border-radius: 4px; background-image: linear-gradient(180deg, #D0333B 0%, #B3232B 100%); color: #FFFFFF; font: 600 15px/1 var(--hd-font); cursor: pointer; }
.db-search button:hover, .db-search button:focus-visible { background-image: linear-gradient(180deg, #DA3D45 0%, #BF272F 100%); }

.db-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.db-card { position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: 4px; background: #FFFFFF; box-shadow: 0 1px 2px rgba(21, 23, 27, 0.06), 0 12px 30px rgba(21, 23, 27, 0.08); }
.db-card__media { aspect-ratio: 16 / 9; overflow: hidden; background: #E1E6ED; }
.db-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1); }
.db-card:hover .db-card__media img { transform: scale(1.03); }
.db-card__body { display: flex; flex: 1; flex-direction: column; padding: 24px 26px 24px; }
.db-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.db-card__title { margin: 0; color: #15171B; font-size: 20px; font-weight: 600; line-height: 1.32; letter-spacing: -0.005em; }
.db-card__link { color: inherit; }
.db-card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.db-card:hover .db-card__link, .db-card__link:focus-visible { color: #B3222B; }
.db-card__excerpt { display: -webkit-box; margin: 12px 0 0; overflow: hidden; color: #3A3E45; font-size: 15.5px; line-height: 1.65; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.db-card__meta { display: flex; flex-wrap: wrap; gap: 8px; margin: auto 0 0; padding-top: 18px; color: #5F646C; font-size: 14px; }

/* The newest post spans two columns beside one regular card, so eight posts fill three even rows. */
.db-card--lead { grid-column: span 2; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); }
.db-card--lead .db-card__media { aspect-ratio: auto; min-height: 100%; }
.db-card--lead .db-card__body { justify-content: center; padding: 40px 40px; }
.db-card--lead .db-card__title { font-size: 28px; line-height: 1.2; font-weight: 500; letter-spacing: -0.012em; }
.db-card--lead .db-card__excerpt { margin-top: 16px; font-size: 17px; -webkit-line-clamp: 5; }
.db-card--lead .db-card__meta { margin-top: 24px; padding-top: 0; }

.db-empty { padding: 48px; border-radius: 4px; background: #FFFFFF; color: #3A3E45; font-size: 17px; text-align: center; }
.db-empty a { color: #B3222B; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.db-pages ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 48px 0 0; padding: 0; list-style: none; }
.db-pages .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 14px; border-radius: 4px; background: #FFFFFF; color: #15171B; font-weight: 600; }
.db-pages .page-numbers.current { background: #0B1E33; color: #FFFFFF; }
.db-pages a.page-numbers:hover, .db-pages a.page-numbers:focus-visible { background: #E1E6ED; }

/* ---- Single post: the article card overlaps the hero, sidebar beside it ---- */
.db-body { padding: 0 0 104px; }
.db-body__grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: start; }
.db-article { position: relative; z-index: 1; min-width: 0; margin-top: -120px; overflow: hidden; border-radius: 4px; background: #FFFFFF; box-shadow: 0 1px 2px rgba(21, 23, 27, 0.06), 0 16px 40px rgba(21, 23, 27, 0.10); }
.db-feature { margin: 0; background: #E1E6ED; }
.db-feature img { width: 100%; height: auto; }

.db-prose { padding: 56px 68px 56px; color: #3A3E45; font-size: 18px; line-height: 1.78; }
.db-prose > * { max-width: 70ch; }
.db-prose > * + * { margin-top: 1.15em; }
.db-prose p, .db-prose li { font-weight: 450; }
.db-prose h2, .db-prose h3, .db-prose h4 { color: #15171B; font-family: var(--ds-head); font-stretch: 115%; font-variation-settings: "wdth" 115; text-wrap: balance; }
.db-prose h2 { margin-top: 1.9em; font-size: 29px; font-weight: 500; line-height: 1.22; letter-spacing: -0.012em; }
.db-prose h3 { margin-top: 1.6em; font-size: 21.5px; font-weight: 600; line-height: 1.3; }
.db-prose h4 { margin-top: 1.4em; font-size: 18px; font-weight: 600; }
.db-prose > :first-child { margin-top: 0; }
.db-prose :is(h2, h3, h4) + * { margin-top: 0.6em; }
.db-prose a { color: #B3222B; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.db-prose a:hover, .db-prose a:focus-visible { color: #8E1A21; text-decoration-thickness: 2px; }
.db-prose strong { color: #15171B; font-weight: 700; }
.db-prose ul, .db-prose ol { padding: 0; list-style: none; }
.db-prose li { position: relative; padding-left: 30px; }
.db-prose li + li { margin-top: 0.55em; }
.db-prose ul > li::before { content: ""; position: absolute; left: 4px; top: 0.86em; width: 12px; height: 2px; border-radius: 1px; background: var(--hd-red); }
.db-prose ol { counter-reset: db-ol; }
.db-prose ol > li { counter-increment: db-ol; }
.db-prose ol > li::before { content: counter(db-ol) "."; position: absolute; left: 0; top: 0; color: #B3222B; font-family: var(--ds-head); font-weight: 600; font-variant-numeric: tabular-nums; }
.db-prose blockquote { padding: 4px 0 4px 24px; border-left: 3px solid var(--hd-red); color: #15171B; font-size: 20px; line-height: 1.6; }
.db-prose figure { margin: 2em 0; max-width: none; }
.db-prose img { width: 100%; height: auto; border-radius: 4px; }
.db-prose figcaption { margin-top: 10px; color: #5F646C; font-size: 14.5px; }
.db-prose pre { overflow-x: auto; max-width: 100%; padding: 22px 24px; border-radius: 4px; background: #0B1E33; color: #DCE3EA; font: 14.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2; }
.db-prose pre code { font: inherit; color: inherit; background: none; padding: 0; }
.db-prose :not(pre) > code { padding: 0.12em 0.4em; border-radius: 3px; background: #EEF1F5; color: #15171B; font: 0.88em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.db-prose table { width: 100%; max-width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.5; }
.db-prose th, .db-prose td { padding: 12px 14px; border-bottom: 1px solid #D3DAE3; text-align: left; vertical-align: top; }
.db-prose th { background: #F4F6F9; color: #15171B; font-weight: 700; }
.db-prose hr { height: 1px; margin: 2.4em 0; border: 0; background: rgba(21, 23, 27, 0.12); }

/* Author */
.db-author { display: flex; gap: 22px; align-items: flex-start; margin: 0 68px; padding: 36px 0 52px; border-top: 1px solid rgba(21, 23, 27, 0.12); }
.db-author__photo { flex: none; }
.db-author__photo img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; }
.db-author__name { margin: 0; color: #15171B; font-family: var(--ds-head); font-stretch: 115%; font-variation-settings: "wdth" 115; font-size: 19px; font-weight: 600; line-height: 1.3; }
.db-author__role { margin: 4px 0 0; color: #5F646C; font-size: 15px; }
.db-author__bio { margin: 12px 0 0; color: #3A3E45; font-size: 16px; line-height: 1.7; }
.db-author__link { display: inline-block; margin-top: 12px; color: #B3222B; font-size: 15.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Sidebar */
.db-aside { position: sticky; top: 112px; display: grid; gap: 36px; padding-top: 48px; }
.db-cta { padding: 32px 28px 28px; border-radius: 4px; background-color: #0B1E33; background-image: url(tex/bg-navy-grain.webp); background-size: cover; color: #CFD8E1; box-shadow: 0 2px 4px rgba(6, 17, 29, 0.18), 0 16px 36px rgba(6, 17, 29, 0.22); }
.db-cta__title { margin: 0; color: #FFFFFF; font-family: var(--ds-head); font-stretch: 115%; font-variation-settings: "wdth" 115; font-size: 21px; font-weight: 500; line-height: 1.25; }
.db-cta__text { margin: 12px 0 22px; font-size: 15.5px; line-height: 1.65; color: #CFD8E1; }
.db-cta .db-cta__btn { display: flex; width: 100%; justify-content: center; padding: 0 16px; text-align: center; color: #FFFFFF; }
.db-cta__phone { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 18px 0 0; color: #8A9AA9; font-size: 14.5px; }
.db-cta__phone a { display: inline-flex; align-items: center; gap: 8px; color: #FFFFFF; font-weight: 600; }
.db-cta__phone a:hover, .db-cta__phone a:focus-visible { color: #FF6B72; }
.db-side__title { margin: 0 0 12px; color: #15171B; font-family: var(--ds-head); font-stretch: 115%; font-variation-settings: "wdth" 115; font-size: 17px; font-weight: 600; }
.db-side ul { margin: 0; padding: 0; list-style: none; }
.db-side li { display: flex; flex-direction: column; gap: 3px; padding: 13px 0; border-top: 1px solid rgba(21, 23, 27, 0.12); }
.db-side__cats li { flex-direction: row; justify-content: space-between; align-items: baseline; }
.db-side a { color: #15171B; font-size: 15.5px; font-weight: 600; line-height: 1.45; transition: color 0.2s ease; }
.db-side a:hover, .db-side a:focus-visible { color: #B3222B; }
.db-side span { color: #5F646C; font-size: 13.5px; }

/* Related posts */
.db-related { padding: 96px 0 112px; background: #F7F9FB; box-shadow: inset 0 1px 0 rgba(21, 23, 27, 0.08); }
.db-related__title { margin: 0 0 40px; }

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .db-body__grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .db-aside { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 36px; padding-top: 48px; }
  .db-aside .db-cta { grid-column: 1 / -1; }
  .db-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .db-card--lead { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .db-card--lead .db-card__media { min-height: 320px; }
  .db-card--lead .db-card__body { padding: 36px 36px; }
  .db-card--lead .db-card__title { font-size: 26px; }
  .db-hero__title { font-size: 44px; }
  .db-hero__title--post { font-size: 40px; }
}
@media (max-width: 760px) {
  .db-hero { padding: 132px 0 60px; }
  .db-hero--post { padding-bottom: 104px; }
  .db-hero__title { font-size: 33px; }
  .db-hero__title--post { font-size: 29px; line-height: 1.2; }
  .db-hero__lead { margin-top: 16px; font-size: 16.5px; }
  .db-crumbs ol { margin-bottom: 18px; font-size: 13.5px; }
  .db-byline { margin-top: 22px; font-size: 14px; }
  .db-byline__name { flex: 1 0 calc(100% - 56px); }
  .db-byline__name + span::before { display: none; }
  .db-byline > span:not(.db-byline__photo):not(.db-byline__name):first-child::before { display: none; }
  .db-hero__actions .hd-btn { width: 100%; min-width: 0; }
  .db-list { padding: 40px 0 80px; }
  .db-filter { margin-bottom: 28px; }
  .db-search { max-width: none; }
  .db-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .db-card--lead { grid-column: auto; grid-template-columns: minmax(0, 1fr); }
  .db-card--lead .db-card__media { min-height: 0; aspect-ratio: 16 / 9; }
  .db-card--lead .db-card__body { padding: 24px 22px; }
  .db-card--lead .db-card__title { font-size: 23px; }
  .db-card--lead .db-card__excerpt { font-size: 15.5px; }
  .db-card__body { padding: 22px 22px; }
  .db-article { margin-top: -64px; margin-left: -4px; margin-right: -4px; }
  .db-prose { padding: 30px 22px 36px; font-size: 17px; line-height: 1.72; }
  .db-prose h2 { font-size: 24px; }
  .db-prose h3 { font-size: 19.5px; }
  .db-prose pre { padding: 18px 16px; font-size: 13px; }
  .db-prose table { display: block; overflow-x: auto; }
  .db-author { flex-direction: column; gap: 16px; margin: 0 22px; padding: 28px 0 36px; }
  .db-author__photo img { width: 72px; height: 72px; }
  .db-aside { grid-template-columns: minmax(0, 1fr); padding-top: 40px; }
  .db-body { padding-bottom: 72px; }
  .db-related { padding: 64px 0 80px; }
  .db-related__title { margin-bottom: 28px; }
}
