/* ==========================================================================
   HEALTHINSIGHT — Design System
   main.css · Global tokens, reset, typography, layout, header, footer
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Google Fonts
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800;1,9..40,400;1,9..40,500&family=Rethink+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500;1,700&display=swap');

/* --------------------------------------------------------------------------
   2. CSS Custom Properties (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
  /* Brand Colors */
  --color-primary:   #0891B2;
  --color-accent:    #22D3EE;
  --color-navy:      #164E63;
  --color-cta:       #059669;
  --color-cta-hover: #047857;
  --color-medical:   #ECFEFF;

  /* Semantic */
  --color-danger:    #e11d48;
  --color-warning:   #d97706;
  --color-success:   #10b981;

  /* Neutral scale */
  --color-white:     #ffffff;
  --color-slate-50:  #f8fafc;
  --color-slate-100: #f1f5f9;
  --color-slate-200: #e2e8f0;
  --color-slate-300: #cbd5e1;
  --color-slate-400: #94a3b8;
  --color-slate-500: #64748b;
  --color-slate-600: #475569;
  --color-slate-700: #334155;
  --color-slate-900: #0f172a;

  /* Typography */
  --font-display: 'Rethink Sans', sans-serif;
  --font-sans:    'DM Sans', sans-serif;
  --font-cursive: 'Rethink Sans', sans-serif;

  /* Spacing (8-pt grid) */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* Radii */
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:  0 8px 30px rgba(0,0,0,.10);
  --shadow-xl:  0 20px 40px rgba(0,0,0,.12);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   500ms ease;

  /* Layout */
  --max-width:      1152px;
  --max-width-md:   768px;
  --max-width-lg:   900px;
  --content-px:     1rem;
}

/* --------------------------------------------------------------------------
   3. Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--color-white);
  color: var(--color-navy);
  line-height: 1.65;
  font-size: 1rem;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

/* --------------------------------------------------------------------------
   4. Material Symbols Utility
   -------------------------------------------------------------------------- */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  user-select: none;
  line-height: 1;
  vertical-align: middle;
}

.fill-1 {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* --------------------------------------------------------------------------
   5. Keyframe Animations
   -------------------------------------------------------------------------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes led-pulse {
  0%, 100% { opacity: 1; filter: brightness(1.2); }
  50%       { opacity: 0.7; filter: brightness(0.8); }
}

@keyframes ping {
  75%, 100% { transform: scale(2); opacity: 0; }
}

@keyframes bounce-vertical {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

.animate-fade-in {
  animation: fadeInUp 0.8s ease-out forwards;
}

/* --------------------------------------------------------------------------
   6. Layout Utilities
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--content-px);
}

@media (min-width: 768px) {
  :root { --content-px: 1.5rem; }
}

@media (min-width: 1024px) {
  :root { --content-px: 2rem; }
}

/* Two-column grid (article + sidebar) */
.layout-with-sidebar {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
}

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

/* --------------------------------------------------------------------------
   7. Typography Helpers
   -------------------------------------------------------------------------- */
.font-display { font-family: var(--font-display); }
.font-sans    { font-family: var(--font-sans); }
.font-cursive { font-family: var(--font-cursive); }

/* --------------------------------------------------------------------------
   8. Button Components
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-weight: 700;
  border-radius: var(--radius-sm);
  padding: var(--space-4) var(--space-6);
  transition: background var(--transition-base), transform var(--transition-fast), box-shadow var(--transition-base);
  cursor: pointer;
  text-align: center;
  line-height: 1;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--color-cta);
  color: var(--color-white);
  box-shadow: 0 8px 20px rgba(5,150,105,.25);
}
.btn-primary:hover {
  background: var(--color-cta-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(5,150,105,.30);
}

.btn-navy {
  background: var(--color-navy);
  color: var(--color-white);
}
.btn-navy:hover {
  background: var(--color-primary);
}

.btn-lg {
  padding: 1.25rem 2.5rem;
  font-size: 1.125rem;
}

/* --------------------------------------------------------------------------
   9. Header
   -------------------------------------------------------------------------- */
.site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-slate-100);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  transition: transform var(--transition-base);
}
.logo-link:hover .logo-icon {
  transform: rotate(12deg);
}
.logo-icon .material-symbols-outlined {
  font-size: 2.25rem;
}

.logo-text {
  display: flex;
  flex-direction: column;
}
.logo-name {
  display: flex;
  align-items: baseline;
  line-height: 1;
}
.logo-name-health {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--color-navy);
  font-family: var(--font-display);
}
.logo-name-insight {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--color-primary);
  font-family: var(--font-display);
}
.logo-tagline {
  font-size: 0.5625rem;
  font-weight: 500;
  color: var(--color-slate-400);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  line-height: 1;
  margin-top: 4px;
}

/* Header Nav */
.header-nav {
  display: none;
  align-items: center;
  gap: 2rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-slate-500);
}

@media (min-width: 768px) {
  .header-nav { display: flex; }
}

.header-nav a {
  transition: color var(--transition-fast);
}
.header-nav a:hover { color: var(--color-primary); }

.header-nav .btn-watch {
  background: var(--color-navy);
  color: var(--color-white);
  padding: 0.6rem 1.5rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  transition: background var(--transition-base);
}
.header-nav .btn-watch:hover { 
  background: var(--color-primary); 
  color: var(--color-white); 
}

/* --------------------------------------------------------------------------
   10. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--color-medical);
  border-top: 1px solid var(--color-slate-200);
  margin-top: var(--space-20);
  padding: var(--space-20) 0 var(--space-16);
  font-family: var(--font-sans);
}

.footer-top {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  margin-bottom: var(--space-16);
}

@media (min-width: 768px) {
  .footer-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.footer-trust {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-navy);
  letter-spacing: 0.05em;
  flex-wrap: wrap;
}

.footer-trust span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-body {
  border-top: 1px solid rgba(22,78,99,.1);
  padding-top: var(--space-16);
  margin-bottom: var(--space-20);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
}

@media (min-width: 768px) {
  .footer-body { grid-template-columns: 4fr 4fr 4fr; }
}

.footer-col-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-navy);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: var(--space-8);
}

.footer-col p {
  font-size: 0.875rem;
  color: var(--color-slate-600);
  line-height: 1.7;
  max-width: 28rem;
}

.footer-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.footer-links li a {
  font-size: 0.875rem;
  color: var(--color-slate-600);
  transition: color var(--transition-fast);
}
.footer-links li a:hover { color: var(--color-primary); }

.footer-bottom {
  text-align: center;
  padding-top: var(--space-8);
  border-top: 1px solid rgba(22,78,99,.1);
}

.footer-copyright {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--color-slate-400);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

/* --------------------------------------------------------------------------
   11. Breadcrumb
   -------------------------------------------------------------------------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-slate-400);
  margin-bottom: var(--space-6);
  font-family: var(--font-sans);
}
.breadcrumb .material-symbols-outlined { font-size: 0.625rem; }

/* --------------------------------------------------------------------------
   12. Badges & Tags
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.5625rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.badge-medical {
  background: var(--color-medical);
  color: var(--color-primary);
  border: 1px solid rgba(8,145,178,.2);
}

/* --------------------------------------------------------------------------
   13. Author Meta Bar
   -------------------------------------------------------------------------- */
.article-meta {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  font-size: 0.8125rem;
  color: var(--color-slate-500);
  border-bottom: 1px solid var(--color-slate-100);
  padding-bottom: var(--space-6);
  margin-bottom: var(--space-8);
  font-family: var(--font-sans);
}

@media (min-width: 640px) {
  .article-meta { display: flex; }
}

.article-meta .author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.author-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(8,145,178,.2);
  object-fit: cover;
}

.article-meta .separator {
  color: var(--color-slate-300);
}

.article-meta .meta-icon {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.article-meta .meta-icon .material-symbols-outlined {
  font-size: 1.125rem;
}

/* ==========================================================================
   Mobile Global Adjustments for CTAs
   ========================================================================== */
@media (max-width: 767px) {
  .btn,
  .btn-watch,
  .btn-watch-video,
  .btn-article-cta {
    font-size: 0.8125rem !important; /* Forces smaller text to stay on one line */
    padding: 0.875rem 0.5rem !important;
    white-space: nowrap !important; /* Prevents text wrapping */
    letter-spacing: normal !important;
  }
  
  .btn .material-symbols-outlined,
  .btn-watch .material-symbols-outlined,
  .btn-watch-video .material-symbols-outlined,
  .btn-article-cta .material-symbols-outlined {
    font-size: 1.125rem !important; /* Scaled down icon to match text */
  }
}
