/**
 * Medi Blues Blog - Core Design System & Global Styles
 */

:root {
  /* Brand color tokens from mediblues.com */
  --mb-primary: #136dec;
  --mb-primary-dark: #0d55bc;
  --mb-primary-light: #e8f1fd;
  --mb-accent: #2ecc71;
  --mb-accent-dark: #27ae60;
  --mb-accent-light: #eafaf1;
  --mb-teal: #2ecc71;
  --mb-heading: #111418;
  --mb-text: #334155;
  --mb-muted: #64748b;
  --mb-tint: #f0f4fc;
  --mb-surface: #f0f2f4;
  --mb-line: #e2e8f0;
  --mb-background-dark: #101822;
  --mb-surface-dark: #1a232e;
  --mb-max: 1180px;
  --mb-radius: 8px;

  /* Aliases for article & component compatibility */
  --primary: var(--mb-primary);
  --primary-dark: var(--mb-primary-dark);
  --teal: var(--mb-accent);
  --heading: var(--mb-heading);
  --text: var(--mb-text);
  --muted: var(--mb-muted);
  --tint: var(--mb-tint);
  --line: var(--mb-line);
  --max: 960px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  color: var(--mb-text);
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
}

/* Common Layout Containers */
.mb-wrap {
  width: min(100% - 2rem, var(--mb-max));
  margin-inline: auto;
}

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Site Header with Translucent Glassmorphism & Scroll Animation */
.mb-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid rgba(230, 237, 242, 0.8);
  transition: background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              backdrop-filter 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              -webkit-backdrop-filter 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mb-header.scrolled {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px) saturate(190%);
  -webkit-backdrop-filter: blur(18px) saturate(190%);
  box-shadow: 0 4px 20px -2px rgba(11, 37, 69, 0.08);
  border-bottom-color: rgba(203, 215, 230, 0.65);
}

.mb-header-inner {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  transition: min-height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mb-header.scrolled .mb-header-inner {
  min-height: 68px;
}

.mb-brand-logo {
  height: 58px;
  width: auto;
  max-width: 250px;
  object-fit: contain;
  display: block;
  transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mb-header.scrolled .mb-brand-logo {
  height: 48px;
}

@supports (animation-timeline: scroll()) {
  .mb-header {
    animation: mb-header-glass linear both;
    animation-timeline: scroll();
    animation-range: 0px 80px;
  }

  @keyframes mb-header-glass {
    from {
      background-color: rgba(255, 255, 255, 0.98);
      box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    }
    to {
      background-color: rgba(255, 255, 255, 0.78);
      backdrop-filter: blur(18px) saturate(190%);
      -webkit-backdrop-filter: blur(18px) saturate(190%);
      box-shadow: 0 4px 20px -2px rgba(11, 37, 69, 0.08);
      border-bottom-color: rgba(203, 215, 230, 0.65);
    }
  }
}

.mb-brand,
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--mb-heading);
}


.mb-brand-mark,
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--mb-primary), var(--mb-accent));
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
}

.mb-brand-name,
.brand-name {
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.mb-brand-tag,
.brand-tag {
  display: block;
  font-size: 0.55rem;
  letter-spacing: 0.16em;
  color: var(--mb-accent);
  font-weight: 700;
  margin-top: -2px;
}

/* Navigation Links */
.mb-nav,
.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.mb-nav a,
.nav a {
  color: #172033;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.94rem;
  transition: color 0.15s ease;
  white-space: nowrap;
}

.mb-nav a:hover,
.nav a:hover,
.mb-nav a.active {
  color: var(--mb-primary);
  font-weight: 600;
}

.mb-appointment,
.appointment {
  background: var(--mb-primary);
  color: #fff !important;
  padding: 0.65rem 1.4rem;
  border-radius: 9999px;
  box-shadow: 0 4px 14px rgba(19, 109, 236, 0.22);
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.mb-appointment:hover,
.appointment:hover {
  background: var(--mb-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(19, 109, 236, 0.32);
}

.mb-menu {
  display: none;
  border: 0;
  background: none;
  font-size: 1.5rem;
  color: var(--mb-heading);
  cursor: pointer;
}

/* Common Buttons */
.mb-btn {
  display: inline-block;
  padding: 0.72rem 1.45rem;
  border: 1px solid var(--mb-primary);
  border-radius: 4px;
  background: #fff;
  color: var(--mb-primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.mb-btn:hover {
  background: var(--mb-primary);
  color: #fff;
}

/* Common Status & Error States */
.mb-status,
.status {
  text-align: center;
  color: var(--mb-muted);
  padding: 3rem 0;
  font-size: 1rem;
}

.error {
  color: #c0392b;
  font-weight: 600;
}

/* Site Footer */
.mb-footer,
.footer {
  background: var(--mb-background-dark);
  color: #dce8f1;
  padding: 3.5rem 0 1.5rem;
}

.mb-footer-grid,
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 3rem;
}

.mb-footer h3,
.footer h3 {
  color: #fff;
  font-size: 1rem;
  margin: 0 0 0.8rem;
}

.mb-footer p,
.mb-footer a,
.footer p,
.footer a {
  font-size: 0.88rem;
  color: #b8c9d6;
  text-decoration: none;
}

.mb-footer a,
.footer a {
  display: block;
  margin: 0.35rem 0;
  transition: color 0.15s ease;
}

.mb-footer a:hover,
.footer a:hover {
  color: #fff;
}

.mb-footer-bottom,
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 2rem;
  padding-top: 1rem;
  text-align: center;
  font-size: 0.78rem;
  color: #9eb2c1;
}

/* Mayo Clinic Style Breadcrumb Navigation */
.mb-breadcrumb-bar {
  background: #f8fafc;
  border-bottom: 1px solid var(--mb-line);
  padding: 0.75rem 0;
  font-size: 0.84rem;
}

.mb-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  color: var(--mb-muted);
}

.mb-breadcrumb a {
  color: var(--mb-primary);
  text-decoration: none;
  font-weight: 500;
}

.mb-breadcrumb a:hover {
  text-decoration: underline;
}

.mb-breadcrumb span[aria-current="page"] {
  color: var(--mb-heading);
  font-weight: 600;
}

/* Secondary Button */
.mb-btn-secondary {
  border-color: #cbd5e1;
  color: var(--mb-heading);
  background: #fff;
}

.mb-btn-secondary:hover {
  background: #f1f5f9;
  color: var(--mb-primary);
  border-color: #94a3b8;
}

/* Responsive Overrides */
@media (max-width: 1100px) {
  .mb-nav {
    gap: 1rem;
  }
  .mb-nav a {
    font-size: 0.88rem;
  }
  .mb-appointment,
  .appointment {
    padding: 0.55rem 1.1rem;
    font-size: 0.88rem;
  }
}

@media (max-width: 900px) {
  .mb-nav {
    gap: 0.75rem;
  }
  .mb-nav a {
    font-size: 0.82rem;
  }
  .mb-appointment,
  .appointment {
    padding: 0.5rem 0.95rem;
    font-size: 0.82rem;
  }
  .mb-footer-grid,
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .mb-header-inner {
    flex-wrap: wrap;
    padding: 0.6rem 0;
    min-height: auto;
    gap: 0.75rem;
  }
  .mb-brand-logo {
    height: 44px;
    max-width: 190px;
  }
  .mb-nav {
    display: flex;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 0.35rem;
    gap: 0.85rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .mb-nav::-webkit-scrollbar {
    display: none;
  }
  .mb-nav a {
    font-size: 0.85rem;
  }
  .mb-footer-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
