/* Mistopia Respiratory Health Journal (blog.mistopianebulizer.com) — Editorial Magazine CSS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #ffffff;
  --surface: #f8f9fb;
  --surface-warm: #fff7f2;
  --border: #eaedf2;
  --border-strong: #d5dce6;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --brand: #ea580c;
  --brand-hover: #c2410c;
  --brand-soft: rgba(234, 88, 12, 0.1);
  --ink: #0f172a;
  --radius-sm: 10px;
  --radius-card: 18px;
  --radius-lg: 24px;
  --container-max: 1220px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

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

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

/* Top Announcement / Brand Strip (Clean & Subtle) */
.top-bar {
  background: var(--ink);
  color: #e5e7eb;
  font-size: 13px;
  padding: 9px 0;
  text-align: center;
}

.top-bar a {
  color: #ffffff;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-left: 6px;
}

.top-bar a:hover { color: #fdba74; }

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

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

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.22);
}

.brand-divider {
  width: 1px;
  height: 18px;
  background: var(--border-strong);
}

.brand-sub {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

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

.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(--brand); }

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

.btn-primary {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(234, 88, 12, 0.22);
}

.btn-primary:hover {
  background: var(--brand-hover);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-dark {
  background: var(--ink);
  color: #ffffff;
}

.btn-dark:hover { background: #1e293b; color: #ffffff; }

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

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

.btn-full { width: 100%; }

/* Centered Editorial Hero (TruNeb-Inspired Magazine Masthead) */
.hero-masthead {
  padding-block: clamp(52px, 7vw, 88px) clamp(36px, 5vw, 56px);
  text-align: center;
  background: radial-gradient(900px 340px at 50% 0%, rgba(234, 88, 12, 0.065), transparent 70%), var(--bg);
  border-bottom: 1px solid var(--border);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.hero-title {
  margin: 0 auto;
  max-width: 18ch;
  font-size: clamp(2.5rem, 5.5vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.04;
  color: var(--ink);
}

.hero-sub {
  margin: 18px auto 0;
  max-width: 58ch;
  font-size: clamp(16px, 1.4vw, 18.5px);
  color: var(--text-secondary);
  line-height: 1.6;
}

.hero-search-wrap {
  margin: 28px auto 0;
  max-width: 560px;
  position: relative;
}

.search-input {
  width: 100%;
  min-height: 52px;
  padding: 12px 22px 12px 46px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  font-size: 15.5px;
  font-family: inherit;
  color: var(--text-primary);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.14);
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Section Headers */
.section-band {
  padding-block: clamp(44px, 5.5vw, 68px);
}

.section-band-tinted {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.section-kicker {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
  margin-bottom: 6px;
}

.section-heading {
  margin: 0;
  font-size: clamp(1.55rem, 2.5vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

/* Featured Magazine Grid (1 Large Left + 2 Stacked Right) */
.featured-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 24px;
}

.featured-main-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  text-decoration: none;
  color: inherit;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.featured-main-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.09);
}

.featured-main-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface);
}

.featured-main-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.featured-main-card:hover .featured-main-media img { transform: scale(1.03); }

.featured-main-body {
  padding: 26px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.featured-main-body h3 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.featured-main-body p {
  margin: 0;
  font-size: 15.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.featured-side-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.featured-side-card {
  display: grid;
  grid-template-columns: 185px minmax(0, 1fr);
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  text-decoration: none;
  color: inherit;
  flex: 1;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.featured-side-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.featured-side-media {
  height: 100%;
  min-height: 165px;
  overflow: hidden;
  background: var(--surface);
}

.featured-side-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-side-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.featured-side-body h3 {
  margin: 0;
  font-size: 17.5px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.featured-side-body p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Popular Topics Grid */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.topic-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 18px 16px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.18s ease;
}

.topic-card:hover,
.topic-card.is-active {
  border-color: var(--brand);
  background: var(--surface-warm);
  transform: translateY(-2px);
}

.topic-card strong {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.topic-count {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand);
}

/* Filter Tabs */
.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: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.tab-btn:hover { border-color: var(--brand); color: var(--brand); }
.tab-btn.is-active { background: var(--ink); color: #ffffff; border-color: var(--ink); }

/* Editorial Post Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.article-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.article-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.card-cover {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface);
  position: relative;
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.article-card:hover .card-cover img { transform: scale(1.04); }

.card-cat-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.card-body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

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

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

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

.card-excerpt {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

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

.card-read-link:hover { text-decoration: underline; }

.load-more-wrap {
  margin-top: 36px;
  text-align: center;
}

/* Article Detail Page */
.article-hero {
  padding-block: 44px 36px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

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

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

.verified-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  font-size: 12px;
  font-weight: 700;
}

.article-h1 {
  margin: 12px 0 0;
  max-width: 24ch;
  font-size: clamp(2rem, 3.8vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
  color: var(--ink);
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 36px;
  padding-block: 42px 68px;
  align-items: start;
}

.article-main {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3.5vw, 44px);
}

.article-hero-cover {
  border-radius: var(--radius-card);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  margin-bottom: 26px;
  background: var(--surface);
}

.article-hero-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.disclaimer-box {
  background: var(--surface-warm);
  border-left: 3.5px solid var(--brand);
  padding: 14px 18px;
  border-radius: 0 12px 12px 0;
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

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

.prose h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 34px 0 12px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 96px;
}

.prose h2:first-of-type { margin-top: 4px; padding-top: 0; border-top: none; }
.prose h3 { font-size: 1.15rem; font-weight: 700; color: var(--ink); margin: 24px 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(--brand); font-weight: 600; text-underline-offset: 2px; }

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

.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.prose thead th {
  background: var(--surface);
  text-align: left;
  padding: 13px 15px;
  border-bottom: 1px solid var(--border-strong);
  font-weight: 700;
  color: var(--ink);
}
.prose tbody td {
  padding: 12px 15px;
  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: 92px;
}

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

.side-card-brand {
  background: linear-gradient(180deg, #fff7f2 0%, #ffffff 100%);
  border-color: rgba(234, 88, 12, 0.22);
}

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

.toc-list {
  list-style: none;
  margin: 12px 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 12px;
  border-left: 2px solid var(--border-strong);
  transition: all 0.15s ease;
}

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

.side-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 14px;
}

/* Footer */
.site-footer {
  background: var(--ink);
  color: #9ca3af;
  padding-block: 52px 36px;
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  font-weight: 800;
  font-size: 19px;
  text-decoration: none;
  margin-bottom: 12px;
}

.footer-col h4 {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

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

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 22px;
  font-size: 13px;
  color: #64748b;
}

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

@media (max-width: 640px) {
  .site-nav { display: none; }
  .featured-side-card { grid-template-columns: 1fr; }
  .topics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards-grid { grid-template-columns: 1fr; }
}
