/* Mistopia Health Library (blog.mistopianebulizer.com) — Apple-Clean Editorial CSS */
:root {
  --bg: #ffffff;
  --surface: #f5f5f7;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text-primary: #1d1d1f;
  --text-secondary: #4b5563;
  --accent: #0071e3;
  --accent-hover: #005bb5;
  --radius-card: 16px;
  --container-max: 1180px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: min(var(--container-max), 92vw);
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
}

.brand-link {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.brand-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(0, 113, 227, 0.1);
  padding: 2px 8px;
  border-radius: 999px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14.5px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.site-nav a:hover { color: var(--text-primary); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover { background: var(--accent-hover); color: #ffffff; }

.btn-ghost {
  background: var(--bg);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-full { width: 100%; }

/* Hero Band */
.hero-band {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding-block: 48px 36px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }

.meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.verified-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.1);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.page-title {
  margin: 0;
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--text-primary);
}

.page-sub {
  margin: 12px 0 0;
  font-size: 16.5px;
  color: var(--text-secondary);
  max-width: 64ch;
}

/* Filter & Search Toolbar */
.toolbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 24px;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn:hover { border-color: var(--accent); color: var(--accent); }
.tab-btn.is-active { background: var(--text-primary); color: #ffffff; border-color: var(--text-primary); }

.search-input {
  width: 100%;
  max-width: 540px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.14);
}

/* Cards Grid */
.catalog-band { padding-block: 44px 72px; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.article-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  background: var(--bg);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.article-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.card-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.card-title a { color: var(--text-primary); text-decoration: none; }
.card-title a:hover { color: var(--accent); }

.card-excerpt {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
}

.card-read-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.card-read-link:hover { text-decoration: underline; }

/* Article Layout */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 32px;
  padding-block: 40px 64px;
  align-items: start;
}

.article-main {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: clamp(22px, 3vw, 38px);
}

.disclaimer-box {
  background: #f8fafc;
  border-left: 3px solid var(--accent);
  padding: 14px 16px;
  border-radius: 0 10px 10px 0;
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 22px;
}

.prose {
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--text-primary);
}

.prose h2 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 32px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 90px;
}

.prose h2:first-of-type { margin-top: 6px; padding-top: 0; border-top: none; }
.prose h3 { font-size: 1.12rem; margin: 22px 0 8px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose a { color: var(--accent); font-weight: 500; }

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 20px 0 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.prose thead th {
  background: var(--surface);
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-strong);
  font-weight: 700;
}
.prose tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
}
.prose tbody tr:last-child td { border-bottom: none; }
.prose tbody tr:nth-child(even) td { background: rgba(15, 23, 42, 0.018); }

/* Sidebar */
.article-aside {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 88px;
}

.side-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
}

.side-card h3 { margin: 6px 0 10px; font-size: 17px; }
.side-card p { margin: 0 0 14px; font-size: 14px; color: var(--text-secondary); }

.toc-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toc-list a {
  display: block;
  font-size: 13.5px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 3px 0 3px 10px;
  border-left: 2px solid var(--border-strong);
}

.toc-list a:hover { color: var(--accent); border-left-color: var(--accent); }

.spec-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.spec-row:last-child { border-bottom: none; }

.related-band { padding-block: 0 64px; }
.related-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }

/* Footer */
.site-footer {
  background: #111317;
  color: #9ca3af;
  padding-block: 40px;
  font-size: 13.5px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.site-footer a { color: #d1d5db; text-decoration: none; }
.site-footer a:hover { color: #ffffff; text-decoration: underline; }

@media (max-width: 960px) {
  .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: 1fr; }
  .article-aside { position: static; }
}

@media (max-width: 640px) {
  .cards-grid { grid-template-columns: 1fr; }
  .site-nav { display: none; }
}
