/* ============================================================
   DIABEETS — GLOBAL DESIGN SYSTEM (theme.css)
   Single source of truth. Edit this file to restyle ALL pages.
   ============================================================ */

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  --dark-navy:        #0A0F1C;
  --dark-charcoal:    #0A192F;
  --surface-elevation:#111827;
  --white:            #FFFFFF;
  --accent-blue:      #00D9FF;
  --accent-red:       #FF6B6B;
  --slate-gray:       #6B7280;
  --border-light:     rgba(229, 231, 235, 0.10);
  --text-secondary:   #9CA3AF;
  --transition-smooth:cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--dark-navy);
  color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== ANIMATED HEARTBEAT LOGO ===== */
@keyframes heartbeat {
  0%   { transform: scale(1);    }
  15%  { transform: scale(1.10); }
  30%  { transform: scale(1);    }
  45%  { transform: scale(1.15); }
  60%  { transform: scale(1);    }
  100% { transform: scale(1);    }
}
@keyframes heartbeatGlow {
  0%   { filter: drop-shadow(0 0 8px  rgba(0,217,255,.30)); }
  15%  { filter: drop-shadow(0 0 16px rgba(255,107,107,.60)); }
  30%  { filter: drop-shadow(0 0 8px  rgba(0,217,255,.30)); }
  45%  { filter: drop-shadow(0 0 20px rgba(255,107,107,.80)); }
  60%  { filter: drop-shadow(0 0 8px  rgba(0,217,255,.30)); }
  100% { filter: drop-shadow(0 0 8px  rgba(0,217,255,.30)); }
}
@keyframes pathStroke {
  from { stroke-dashoffset: 1000; }
  to   { stroke-dashoffset: 0; }
}
.db-heartbeat-logo { animation: heartbeat 1.5s ease-in-out infinite, heartbeatGlow 1.5s ease-in-out infinite; }
.db-heartbeat-path { stroke-dasharray: 1000; animation: pathStroke 2s ease-in-out infinite; }
.db-heartbeat-pulse { animation: heartbeatGlow 1.5s ease-in-out infinite; }

/* ===== TYPOGRAPHY ===== */
h1 { font-size: clamp(36px, 6vw, 72px); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
h2 { font-size: clamp(28px, 4vw, 48px); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
h3 { font-size: clamp(20px, 3vw, 32px); font-weight: 700; line-height: 1.3; }
h4 { font-size: 22px; font-weight: 600; line-height: 1.4; }
h5 { font-size: 18px; font-weight: 600; line-height: 1.4; }
p  { font-size: 16px; font-weight: 400; line-height: 1.7; color: var(--text-secondary); }
a  { color: var(--accent-blue); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--white); }

/* ===== NAVIGATION ===== */
.db-nav {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(10,15,28,.80);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: all .3s var(--transition-smooth);
}
.db-nav.scrolled {
  background: rgba(10,15,28,.96);
  box-shadow: 0 4px 24px rgba(0,0,0,.35);
}
.db-nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 48px;
  display: flex; justify-content: space-between; align-items: center; height: 80px;
}
.db-logo {
  font-size: 22px; font-weight: 800; letter-spacing: -.02em;
  color: var(--white); text-decoration: none;
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
  transition: color .2s ease;
}
.db-logo:hover { color: var(--accent-blue); }
.db-logo-icon { width:40px; height:40px; display:flex; align-items:center; justify-content:center; }
.db-nav-links { display: flex; gap: 28px; list-style: none; align-items: center; }
.db-nav-links a {
  font-size: 15px; font-weight: 500; color: var(--text-secondary);
  text-decoration: none; position: relative; transition: color .2s ease;
}
.db-nav-links a:hover, .db-nav-links a.db-active { color: var(--white); }
.db-nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 2px; background: var(--accent-blue);
  transition: width .3s var(--transition-smooth);
}
.db-nav-links a:hover::after, .db-nav-links a.db-active::after { width: 100%; }
.db-nav-cta {
  background: var(--accent-blue); color: var(--dark-navy);
  padding: 10px 22px; border-radius: 8px;
  font-weight: 600; font-size: 13px; letter-spacing: .05em; text-transform: uppercase;
  text-decoration: none; border: none; cursor: pointer; transition: all .2s ease;
  white-space: nowrap;
}
.db-nav-cta:hover { transform: scale(1.02); box-shadow: 0 8px 24px rgba(0,217,255,.3); color: var(--dark-navy); }

/* Mobile hamburger */
.db-hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: none; padding: 8px; }
.db-hamburger span { display: block; width: 24px; height: 2px; background: var(--white); border-radius: 2px; transition: all .3s ease; }
.db-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.db-hamburger.open span:nth-child(2) { opacity: 0; }
.db-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* Mobile slide-out menu */
.db-mobile-menu {
  display: none; position: fixed; top: 80px; left: 0; right: 0; bottom: 0;
  background: rgba(10,15,28,.98); backdrop-filter: blur(20px);
  flex-direction: column; padding: 40px 28px; gap: 4px; z-index: 999; overflow-y: auto;
}
.db-mobile-menu.open { display: flex; }
.db-mobile-menu a {
  font-size: 18px; font-weight: 600; color: var(--text-secondary);
  text-decoration: none; padding: 14px 0; border-bottom: 1px solid var(--border-light);
  transition: color .2s ease;
}
.db-mobile-menu a:hover, .db-mobile-menu a.db-active { color: var(--white); }

/* ===== BREADCRUMB ===== */
.db-breadcrumb { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 24px; }
.db-breadcrumb a { font-size: 13px; color: var(--text-secondary); text-decoration: none; transition: color .2s; }
.db-breadcrumb a:hover { color: var(--accent-blue); }
.db-breadcrumb-sep { font-size: 13px; color: var(--slate-gray); }
.db-breadcrumb-current { font-size: 13px; color: var(--white); font-weight: 500; }

/* ===== PAGE HERO ===== */
.db-page-hero {
  position: relative;
  background: linear-gradient(135deg, var(--dark-navy) 0%, var(--dark-charcoal) 70%);
  padding: 80px 48px 64px; overflow: hidden; border-bottom: 1px solid var(--border-light);
}
.db-page-hero::before {
  content: ''; position: absolute; top: -30%; right: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(0,217,255,.06) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.db-page-hero-inner { max-width: 1280px; margin: 0 auto; position: relative; z-index: 1; }
.db-cat-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(0,217,255,.10); border: 1px solid rgba(0,217,255,.30);
  padding: 6px 14px; border-radius: 32px; margin-bottom: 20px;
  font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--accent-blue);
}
.db-page-hero h1 { margin-bottom: 20px; color: var(--white); }
.db-page-hero .db-subtitle {
  font-size: 18px; max-width: 700px; line-height: 1.8; margin-bottom: 32px;
}
.db-meta { display: flex; gap: 24px; flex-wrap: wrap; font-size: 14px; color: var(--text-secondary); }

/* ===== ARTICLE LAYOUT ===== */
.db-article-layout {
  max-width: 1280px; margin: 0 auto; padding: 64px 48px 120px;
  display: grid; grid-template-columns: 1fr 320px; gap: 48px; align-items: start;
}
.db-article-body {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border-light); border-radius: 16px;
  padding: 48px; line-height: 1.9;
}
.db-article-body h2 { font-size: 22px; color: var(--white); margin: 2em 0 .75em; padding-top: 1em; border-top: 1px solid var(--border-light); }
.db-article-body h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.db-article-body h3 { font-size: 18px; color: var(--white); margin: 1.5em 0 .5em; }
.db-article-body p { font-size: 16px; color: var(--text-secondary); margin-bottom: 1.25em; line-height: 1.85; }
.db-article-body ul, .db-article-body ol { color: var(--text-secondary); padding-left: 24px; margin-bottom: 1.25em; }
.db-article-body li { margin-bottom: .5em; font-size: 16px; }
.db-article-body a { color: var(--accent-blue); }
.db-article-body a:hover { color: var(--white); text-decoration: underline; }
.db-article-body strong { color: var(--white); font-weight: 600; }
.db-article-body blockquote {
  border-left: 3px solid var(--accent-blue); padding-left: 24px;
  margin: 1.5em 0; color: var(--text-secondary); font-style: italic;
}

/* Medical disclaimer */
.db-disclaimer {
  background: rgba(252,165,165,.08); border: 1px solid rgba(252,165,165,.20);
  border-radius: 12px; padding: 16px 20px; margin: 32px 0;
  font-size: 14px; color: #FCA5A5; line-height: 1.6;
}

/* Post-navigation */
.db-article-nav {
  display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; padding-top: 32px;
  border-top: 1px solid var(--border-light);
}
.db-article-nav a {
  background: rgba(255,255,255,.05); border: 1px solid var(--border-light);
  border-radius: 8px; padding: 10px 20px; font-size: 14px; font-weight: 600;
  color: var(--text-secondary); text-decoration: none; transition: all .2s ease;
}
.db-article-nav a:hover { background: rgba(0,217,255,.1); border-color: var(--accent-blue); color: var(--white); }

/* ===== SIDEBAR ===== */
.db-sidebar { position: sticky; top: 104px; display: flex; flex-direction: column; gap: 24px; }
.db-sidebar-card {
  background: rgba(255,255,255,.04); border: 1px solid var(--border-light);
  border-radius: 16px; padding: 24px; overflow: hidden;
}
.db-sidebar-card h5 { color: var(--white); margin-bottom: 16px; font-size: 15px; }
.db-sidebar-cat-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--text-secondary); text-decoration: none;
  transition: all .2s ease; margin-bottom: 4px;
}
.db-sidebar-cat-link:hover, .db-sidebar-cat-link.db-active {
  background: rgba(0,217,255,.10); color: var(--white); border-left: 2px solid var(--accent-blue); padding-left: 14px;
}
.db-cta-card {
  background: linear-gradient(135deg, rgba(0,217,255,.12), rgba(255,107,107,.08));
  border: 1px solid rgba(0,217,255,.25); border-radius: 16px; padding: 24px; text-align: center;
}
.db-cta-card h5 { color: var(--white); margin-bottom: 10px; font-size: 16px; }
.db-cta-card p { font-size: 13px; margin-bottom: 16px; }

/* ===== BUTTONS ===== */
.db-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 8px; font-weight: 600; font-size: 14px;
  text-decoration: none; text-transform: uppercase; letter-spacing: .04em;
  border: none; cursor: pointer; transition: all .2s ease; position: relative; overflow: hidden;
}
.db-btn::before {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 0; height: 0; background: rgba(255,255,255,.25); border-radius: 50%;
  transform: translate(-50%,-50%); transition: width .5s, height .5s;
}
.db-btn:hover::before { width: 250px; height: 250px; }
.db-btn-primary { background: var(--accent-blue); color: var(--dark-navy); }
.db-btn-primary:hover { transform: scale(1.02); box-shadow: 0 10px 28px rgba(0,217,255,.3); color: var(--dark-navy); }
.db-btn-secondary { background: transparent; color: var(--accent-blue); border: 1px solid rgba(0,217,255,.35); }
.db-btn-secondary:hover { background: rgba(0,217,255,.10); border-color: var(--accent-blue); color: var(--white); }
.db-btn-sm { padding: 8px 16px; font-size: 13px; }

/* ===== BOOK PAGE ===== */
.db-book-cover {
  width: 180px; height: 240px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 64px;
  background: linear-gradient(135deg, rgba(0,217,255,.15), rgba(255,107,107,.10));
  border: 1px solid var(--border-light);
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.db-download-card {
  background: rgba(255,255,255,.04); border: 1px solid var(--border-light);
  border-radius: 12px; padding: 20px;
}
.db-download-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--border-light);
}
.db-download-item:last-child { border-bottom: none; padding-bottom: 0; }
.db-format-badge {
  background: rgba(0,217,255,.15); border: 1px solid rgba(0,217,255,.3);
  color: var(--accent-blue); padding: 4px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
}

/* ===== CTA BAND ===== */
.db-cta-band {
  background: linear-gradient(135deg, rgba(255,107,107,.05), rgba(0,217,255,.05));
  border: 1px solid rgba(0,217,255,.18); border-radius: 24px;
  padding: 80px 48px; text-align: center; position: relative; overflow: hidden;
  margin: 0 48px 120px;
}
.db-cta-band::before {
  content: ''; position: absolute; top: -50%; right: -30%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,107,107,.10) 0%, transparent 70%);
  border-radius: 50%;
}
.db-cta-band h2 { margin-bottom: 16px; position: relative; z-index: 1; }
.db-cta-band p { font-size: 18px; max-width: 560px; margin: 0 auto 28px; position: relative; z-index: 1; }
.db-cta-band .db-btn { position: relative; z-index: 1; }

/* ===== FOOTER ===== */
.db-footer {
  background: var(--surface-elevation); border-top: 1px solid var(--border-light);
  padding: 80px 48px 32px; color: var(--text-secondary);
}
.db-footer-inner { max-width: 1280px; margin: 0 auto; }
.db-footer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 48px; margin-bottom: 48px;
}
.db-footer-col h5 { color: var(--white); margin-bottom: 20px; font-size: 15px; font-weight: 600; }
.db-footer-col p  { font-size: 14px; line-height: 1.8; }
.db-footer-col a  { display: block; color: var(--text-secondary); font-size: 14px; line-height: 2.1; transition: color .2s; }
.db-footer-col a:hover { color: var(--accent-blue); }
.db-footer-bottom { border-top: 1px solid var(--border-light); padding-top: 28px; text-align: center; font-size: 13px; }
.db-footer-bottom a { color: var(--text-secondary); transition: color .2s; }
.db-footer-bottom a:hover { color: var(--accent-blue); }

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(36px); }
  to   { opacity: 1; transform: translateY(0);    }
}
@keyframes float {
  0%, 100% { transform: translateY(0);   }
  50%       { transform: translateY(-8px); }
}
@keyframes pulseGlow {
  0%, 100% { opacity: .5; transform: scale(1);   }
  50%       { opacity: .8; transform: scale(1.1); }
}
.db-fade-up { animation: fadeInUp .8s var(--transition-smooth) both; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .db-nav-links, .db-nav-cta { display: none; }
  .db-hamburger { display: flex; }
  .db-article-layout { grid-template-columns: 1fr; }
  .db-sidebar { position: static; }
}
@media (max-width: 768px) {
  .db-nav-inner { padding: 0 24px; }
  .db-page-hero { padding: 60px 24px 48px; }
  .db-article-layout { padding: 40px 24px 80px; }
  .db-article-body { padding: 32px 24px; }
  .db-cta-band { margin: 0 24px 80px; padding: 60px 24px; }
  .db-footer { padding: 60px 24px 24px; }
  .db-meta { gap: 12px; }
}
@media (max-width: 640px) {
  h1 { font-size: 32px; }
  h2 { font-size: 24px; }
  .db-article-body { padding: 24px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
