/* DIABEETS white healthtech editorial system.
   Loaded after the legacy theme to modernize every generated page. */
:root {
  --dark-navy: #ffffff;
  --dark-charcoal: #f6f9fc;
  --surface-elevation: #ffffff;
  --surface-2: #f1f7fb;
  --surface-3: #e7f0f7;
  --bg-card: #ffffff;
  --white: #0b1720;
  --accent-blue: #0b74d1;
  --accent-blue-dim: rgba(11, 116, 209, 0.1);
  --accent-blue-glow: rgba(11, 116, 209, 0.18);
  --accent-red: #c2413d;
  --accent-red-dim: rgba(194, 65, 61, 0.1);
  --accent-green: #087f6b;
  --accent-purple: #4257c7;
  --accent-amber: #b7791f;
  --text-primary: #0b1720;
  --text-secondary: #405466;
  --text-muted: #6d8191;
  --slate-gray: #667789;
  --border-light: #dce7ef;
  --border-medium: #c9d8e3;
  --border-accent: rgba(11, 116, 209, 0.32);
  --gradient-hero: linear-gradient(180deg, #ffffff 0%, #eef7fb 100%);
  --gradient-card: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
  --gradient-brand: linear-gradient(135deg, #087f6b 0%, #0b74d1 100%);
  --gradient-warm: linear-gradient(135deg, #c2413d 0%, #b7791f 100%);
  --gradient-green: linear-gradient(135deg, #087f6b 0%, #0b74d1 100%);
  --gradient-text: linear-gradient(135deg, #0b1720 0%, #0b74d1 100%);
  --shadow-sm: 0 1px 2px rgba(11, 23, 32, 0.06);
  --shadow-md: 0 12px 32px rgba(31, 52, 69, 0.1);
  --shadow-lg: 0 24px 70px rgba(31, 52, 69, 0.14);
  --shadow-glow-blue: 0 16px 45px rgba(11, 116, 209, 0.12);
  --shadow-glow-red: 0 16px 45px rgba(194, 65, 61, 0.1);
  --section-gap: 96px;
  --card-radius: 8px;
  --btn-radius: 8px;
  --font-main: "Outfit", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", Georgia, serif;
}

html { background: #ffffff; }
body {
  font-family: var(--font-main);
  background:
    linear-gradient(180deg, rgba(232, 245, 250, 0.72) 0, rgba(255,255,255,0) 340px),
    #ffffff;
  color: var(--text-primary);
}

h1, h2, h3 {
  color: var(--text-primary);
  letter-spacing: 0;
  text-wrap: balance;
}

h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.02;
}

h2 { font-weight: 700; }
a { color: var(--accent-blue); }
a:hover { color: var(--accent-green); }

#db-progress-bar {
  background: var(--gradient-brand) !important;
  box-shadow: none !important;
}

.db-nav {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 1px 0 rgba(11, 23, 32, 0.03);
}
.db-nav.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 30px rgba(31, 52, 69, 0.08);
}
.db-nav-inner { height: 76px; }
.db-logo {
  color: var(--text-primary);
  gap: 12px;
}
.db-logo:hover {
  color: var(--accent-blue);
  transform: none;
}
.db-logo-icon {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}
.db-logo svg circle { stroke: rgba(11, 116, 209, 0.24); }
.db-logo svg path[stroke],
.db-heartbeat-path { stroke: var(--accent-blue) !important; }
.db-heartbeat-logo,
.db-heartbeat-path,
.db-heartbeat-pulse {
  animation: none !important;
  filter: none !important;
}
.db-logo-text,
.db-logo span {
  font-weight: 800;
  letter-spacing: 0.02em;
}
.db-nav-links { gap: 4px; }
.db-nav-links a {
  color: var(--text-secondary);
  border-radius: 8px;
  font-weight: 600;
}
.db-nav-links a:hover,
.db-nav-links a.db-active {
  color: var(--accent-blue);
  background: var(--accent-blue-dim);
}
.db-nav-cta,
.btn-primary,
.db-btn-primary {
  background: var(--accent-green) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 24px rgba(8, 127, 107, 0.18) !important;
  border-radius: var(--btn-radius) !important;
}
.db-nav-cta:hover,
.btn-primary:hover,
.db-btn-primary:hover {
  background: #066b5b !important;
  transform: translateY(-1px);
}
.db-hamburger span { background: var(--text-primary); }
.db-mobile-menu {
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--border-light);
}
.db-mobile-menu a { color: var(--text-secondary); }
.db-mobile-menu a:hover,
.db-mobile-menu a.db-active {
  color: var(--accent-blue);
  background: var(--surface-2);
}

.hero,
.blogs-hero,
.cat-hero,
.books-hero,
.db-page-hero {
  background:
    linear-gradient(135deg, rgba(232, 245, 250, 0.96) 0%, rgba(255,255,255,0.94) 62%),
    #ffffff !important;
  border-bottom: 1px solid var(--border-light);
}
.hero { min-height: auto; padding: 48px 0 56px; }
.hero::before,
.cat-hero::before,
.books-hero::before {
  background-image:
    linear-gradient(rgba(11, 116, 209, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 116, 209, 0.06) 1px, transparent 1px) !important;
  background-size: 44px 44px !important;
  opacity: 0.6;
}
.hero-orb,
.cat-orb,
.books-hero-orb { display: none !important; }
.hero-eyebrow,
.db-section-label,
.cat-label,
.books-hero-label,
.db-cat-badge,
.cat-count-badge,
.badge {
  border-radius: 6px !important;
  background: var(--accent-blue-dim) !important;
  border: 1px solid var(--border-accent) !important;
  color: var(--accent-blue) !important;
  letter-spacing: 0.04em;
}
.hero h1 em,
.db-gradient-text {
  background: none !important;
  -webkit-text-fill-color: currentColor !important;
  color: var(--accent-blue) !important;
  animation: none !important;
}
.hero-sub,
.blogs-hero p,
.cat-hero p,
.books-hero p,
.db-page-hero p {
  color: var(--text-secondary);
}

.home-news-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  gap: 32px;
  align-items: stretch;
  max-width: min(1200px, calc(100% - 48px)) !important;
  padding: 0 !important;
}
.home-lead-story {
  display: block;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.home-lead-media {
  display: block;
  min-height: 0;
  height: 220px;
  border: 0;
  border-bottom: 1px solid var(--border-light);
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  background: var(--surface-2);
}
.home-lead-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.home-lead-copy h1 {
  max-width: 780px;
  margin-bottom: 14px;
  font-size: clamp(32px, 3.4vw, 46px);
}
.home-lead-copy {
  padding: 24px 32px 28px;
}
.home-lead-copy .hero-sub {
  max-width: 760px;
  font-size: 17px;
  margin-bottom: 20px;
}
.home-latest-panel {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: 22px;
}
.home-latest-panel h2 {
  font-size: 18px;
  margin-bottom: 16px;
}
.home-latest-item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--border-light);
  color: var(--text-primary);
}
.home-latest-item:first-of-type { border-top: 0; padding-top: 0; }
.home-latest-item img {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
}
.home-latest-item span {
  font-size: 14px;
  line-height: 1.45;
}
.home-latest-item strong {
  display: block;
  color: var(--accent-blue);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.disclaimer-bar {
  background: #fff7ed;
  border-bottom: 1px solid #fed7aa;
  color: #9a3412;
}

.trust-bar,
.featured-section,
.newsletter-section {
  background: var(--surface-2) !important;
  border-color: var(--border-light);
}
.categories-section,
.recent-section,
.books-callout {
  background: #ffffff !important;
}
.books-callout {
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.cat-card,
.h-stat,
.db-article-card,
.article-row,
.recent-article,
.book-preview-card,
.book-card,
.db-sidebar-card,
.db-download-card,
.skeleton-card,
.alert,
details {
  background: #ffffff !important;
  border: 1px solid var(--border-light) !important;
  border-radius: 8px !important;
  box-shadow: var(--shadow-sm);
}
.cat-card:hover,
.db-article-card:hover,
.article-row:hover,
.recent-article:hover,
.book-card:hover {
  transform: translateY(-3px) !important;
  border-color: var(--border-accent) !important;
  box-shadow: var(--shadow-md) !important;
}
.cat-card h3,
.db-article-card h3,
.db-article-card h4,
.article-row-body h3,
.recent-text h4,
.book-preview-title,
.footer-brand-name,
.db-sidebar-card h5 {
  color: var(--text-primary) !important;
}
.db-article-card-body h4 a,
.db-article-card-body h3 a,
.article-row-body h3,
.article-row-body h3 a {
  color: var(--text-primary) !important;
}
.db-article-card-body h4 a:hover,
.db-article-card-body h3 a:hover,
.article-row:hover h3,
.article-row:hover h3 a {
  color: var(--accent-blue) !important;
}
.db-article-card-accent,
.book-card::before {
  height: 0 !important;
  background: none !important;
}

.db-card-media,
.article-row-media,
.db-story-visual,
.db-hero-media {
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
}
.db-card-media,
.article-row-media {
  position: relative;
  flex-shrink: 0;
}
.db-card-media {
  aspect-ratio: 16 / 10;
  width: 100%;
  border-radius: 8px 8px 0 0;
  border-width: 0 0 1px;
}
.article-row-media {
  width: 162px;
  min-height: 118px;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
}
.recent-article .db-card-media {
  width: 150px;
  min-width: 150px;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border-light);
  border-radius: 8px;
}
.db-card-media img,
.article-row-media img,
.db-story-visual img,
.db-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.db-image-credit {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 12px;
}
.db-story-visual {
  max-width: 1120px;
  margin: 32px auto 0;
  border-radius: 8px;
  aspect-ratio: 16 / 7;
  box-shadow: var(--shadow-md);
}
.db-page-hero + .db-story-visual {
  margin-top: -24px;
}

.article-row > a {
  align-items: stretch !important;
}
.articles-list.grid-view .article-row > a {
  flex-direction: column;
}
.articles-list.grid-view .article-row-media {
  width: 100%;
  aspect-ratio: 16 / 10;
}

.db-article-layout,
.cat-layout,
.blogs-layout {
  max-width: 1240px;
}
.db-article-body {
  background: #ffffff !important;
  color: var(--text-primary);
  border: 1px solid var(--border-light) !important;
  border-radius: 8px !important;
  box-shadow: var(--shadow-sm);
}
.db-article-body h2,
.db-article-body h3 {
  color: var(--text-primary) !important;
}
.db-article-body p,
.db-article-body li {
  color: #2e4050 !important;
  font-size: 18px;
  line-height: 1.78;
  max-width: 68ch;
}
.db-article-body h2 {
  font-family: var(--font-serif);
  font-size: clamp(28px, 3vw, 38px) !important;
}
.db-disclaimer {
  background: #fff7ed !important;
  border: 1px solid #fed7aa !important;
  color: #7c2d12 !important;
  border-radius: 8px !important;
}

input,
select,
textarea,
.search-input-row input,
.cat-search input,
.books-search {
  background: #ffffff !important;
  border: 1px solid var(--border-medium) !important;
  color: var(--text-primary) !important;
  border-radius: 8px !important;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-blue) !important;
  box-shadow: 0 0 0 3px var(--accent-blue-dim) !important;
}
.chip,
.cat-filter-btn,
.era-btn,
.view-btn,
.page-btn {
  border-radius: 7px !important;
  border-color: var(--border-light) !important;
  background: #ffffff !important;
  color: var(--text-secondary) !important;
}
.chip.active,
.cat-filter-btn.active,
.era-btn.active,
.view-btn.active,
.page-btn.active {
  background: var(--accent-blue-dim) !important;
  border-color: var(--border-accent) !important;
  color: var(--accent-blue) !important;
}
.cat-filters {
  background: rgba(255,255,255,0.94) !important;
  border-color: var(--border-light) !important;
}

.db-back-top {
  background: var(--accent-blue) !important;
  color: #ffffff !important;
  border-radius: 8px !important;
}

footer {
  background: #0b1720 !important;
  border-top: 0 !important;
}
footer,
footer p,
footer a,
.footer-bottom p,
.footer-bottom a,
.footer-col ul a {
  color: #c9d8e3 !important;
}
.footer-brand-name,
.footer-col h6 {
  color: #ffffff !important;
}
.footer-disclaimer { color: #fed7aa !important; }

@media (max-width: 768px) {
  .db-nav-inner { padding: 0 20px; }
  .hero { min-height: auto; padding: 64px 0 52px; }
  .article-row > a {
    flex-direction: column;
  }
  .article-row-media {
    width: 100%;
    aspect-ratio: 16 / 10;
  }
  .recent-article {
    flex-direction: column;
  }
  .recent-article .db-card-media {
    width: 100%;
    min-width: 0;
    aspect-ratio: 16 / 10;
  }
  .db-story-visual {
    margin: 20px 20px 0;
    aspect-ratio: 16 / 10;
  }
  .db-article-body p,
  .db-article-body li {
    font-size: 16px;
  }
}

@media (max-width: 1100px) {
  .home-news-hero {
    grid-template-columns: 1fr;
  }
  .home-lead-media {
    height: 340px;
  }
}
