/* ============================================================
   health.css — /health/ category page styles
   Self-contained: includes all needed tokens, reset, header,
   search modal, footer, category page, and responsive rules.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  background: #f8fafc;
  color: #1e293b;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a  { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; font: inherit; border: none; background: none; }

/* ── Design tokens ────────────────────────────────────────── */
:root {
  --navy:      #11113A;
  --purple:    #6B21A8;
  --purple-sidebar: #4C3092;
  --blue:      #2563EB;
  --sky:       #0284c7;
  --emerald:   #059669;
  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --max-w:     80rem;
}

/* ── Utilities ────────────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1rem; }
.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ── HEADER ───────────────────────────────────────────────── */
.site-header {
  background: #fff;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  border-bottom: 1px solid #e5e7eb;
}
.header-nav-bar {
  overflow: hidden;
  max-height: 48px;
  transition: max-height .3s ease, opacity .3s ease;
  opacity: 1;
}
.header-nav-bar.nav-hidden { max-height: 0; opacity: 0; }
body { padding-top: var(--header-h, 97px); }

.header-top {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}
.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 1;
}
.header-right { justify-content: flex-end; }

.icon-btn {
  padding: .5rem;
  color: #000;
  border-radius: .25rem;
  transition: background .15s;
  line-height: 0;
}
.icon-btn:hover { background: #f3f4f6; }
.icon-btn svg   { width: 1.5rem; height: 1.5rem; }

.logo {
  display: flex;
  gap: 2px;
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
}
.logo-box {
  background: #000;
  color: #fff;
  width: 2rem; height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 1rem;
  font-weight: 700;
}

.search-desktop { display: none; }
.search-mobile  { display: flex; }

.header-nav-bar { border-top: 1px solid #e5e7eb; }
.header-nav-bar nav {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  gap: 1.5rem;
  height: 3rem;
  align-items: center;
  overflow-x: auto;
}
.nav-link {
  color: #000;
  font-weight: 700;
  font-size: .9375rem;
  height: 100%;
  display: flex;
  align-items: center;
  padding: .25rem .25rem 0;
  border-bottom: 4px solid transparent;
  transition: border-color .15s;
  white-space: nowrap;
  text-decoration: none;
}
.nav-link:hover,
.nav-link.active { border-bottom-color: #000; }

.mobile-menu {
  display: none;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 4px 6px rgba(0,0,0,.07);
  position: absolute;
  width: 100%;
  left: 0;
  z-index: 49;
  max-height: 70vh;
  overflow-y: auto;
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block;
  padding: .75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  font-weight: 700;
  color: #000;
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover { background: #f9fafb; }

/* ── SEARCH MODAL ─────────────────────────────────────────── */
.search-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(4px);
  flex-direction: column;
}
.search-modal.open { display: flex; }
.search-modal-inner {
  max-width: 48rem;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1rem 1rem;
}
.search-close-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}
.search-close-btn {
  padding: .5rem;
  background: var(--slate-100);
  color: var(--slate-500);
  border-radius: 50%;
  transition: color .15s;
  line-height: 0;
}
.search-close-btn:hover { color: var(--slate-900); }
.search-close-btn svg { width: 1.5rem; height: 1.5rem; }
.search-input-wrap { position: relative; }
.search-input-wrap svg {
  position: absolute;
  left: 1rem; top: 50%;
  transform: translateY(-50%);
  width: 1.5rem; height: 1.5rem;
  color: var(--slate-400);
}
#search-input {
  width: 100%;
  padding: 1rem 1rem 1rem 3.5rem;
  font-size: 1.25rem;
  background: #fff;
  border: 2px solid var(--slate-200);
  border-radius: 1rem;
  outline: none;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
}
#search-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 4px rgba(56,189,248,.2);
}
.search-results {
  margin-top: 2rem;
  max-height: 60vh;
  overflow-y: auto;
}
.search-count {
  font-size: .75rem;
  font-weight: 700;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 1rem;
}
.search-result-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--slate-100);
  border-radius: .75rem;
  padding: 1rem;
  margin-bottom: .75rem;
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
  cursor: pointer;
}
.search-result-item:hover {
  border-color: #bae6fd;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.search-result-thumb {
  width: 6rem; height: 4rem;
  flex-shrink: 0;
  border-radius: .5rem;
  overflow: hidden;
  background: var(--slate-100);
}
.search-result-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.search-result-item:hover .search-result-thumb img { transform: scale(1.05); }
.search-result-cat   { font-size: .75rem; font-weight: 500; color: var(--emerald); display: block; margin-bottom: .25rem; }
.search-result-title { font-weight: 700; color: var(--slate-900); transition: color .15s; }
.search-result-item:hover .search-result-title { color: var(--sky); }
.search-result-excerpt { font-size: .875rem; color: var(--slate-500); margin-top: .25rem; }
.search-empty { text-align: center; padding: 3rem 0; }
.search-empty-icon {
  width: 4rem; height: 4rem;
  background: var(--slate-100);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.search-empty-icon svg { width: 2rem; height: 2rem; color: var(--slate-400); }

/* ── BADGE ────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: .625rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: .2rem .55rem;
  border-radius: 9999px;
}
.badge-emerald { background: #ecfdf5; color: var(--emerald); }

/* ── CATEGORY HERO ────────────────────────────────────────── */
.cat-hero {
  background: #faf9ff;
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--slate-200);
  text-align: center;
}
.cat-hero-badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #7C3AED;
  margin-bottom: .75rem;
}
.cat-hero h1 {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: .75rem;
}
.cat-hero-desc {
  color: var(--slate-500);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto .75rem;
}
.cat-hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  margin-top: 1.25rem;
}
.cat-hero-tags span {
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--navy);
  padding: .25rem .75rem;
  border: 1px solid var(--slate-200);
  border-radius: 9999px;
  background: #fff;
}

/* ── CATEGORY GRID ────────────────────────────────────────── */
.cat-grid {
  padding: 3rem 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
.cat-card {
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  border: 1px solid var(--slate-100);
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s;
  text-decoration: none;
}
.cat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.cat-card-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.cat-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.cat-card-title {
  font-weight: 700;
  color: var(--navy);
  font-size: 1.125rem;
  line-height: 1.35;
  margin-top: .5rem;
  transition: color .15s;
}
.cat-card:hover .cat-card-title { color: var(--sky); }
.cat-card-excerpt { font-size: .875rem; color: var(--slate-500); margin-top: .5rem; line-height: 1.6; }
.cat-card-meta {
  font-size: .8125rem;
  color: var(--slate-400);
  margin-top: auto;
  padding-top: .75rem;
  display: flex;
  gap: .5rem;
  align-items: center;
}

/* ── FOOTER ───────────────────────────────────────────────── */
.footer-main-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}
@media (min-width: 768px) {
  .footer-main-wrap { flex-direction: row; align-items: flex-start; gap: 3rem; }
}
.footer-left { flex-shrink: 0; min-width: 160px; }
.footer-middle { flex-shrink: 0; }
.footer-social-icon { color: #6b7280; text-decoration: none; transition: color .2s; }
.footer-social-icon:hover { color: #1C0E40; }
.footer-link-col {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: .875rem;
}
.footer-link-col a {
  color: #374151;
  text-decoration: none;
  font-size: .875rem;
  font-weight: 400;
  transition: color .15s;
  position: relative;
}
.footer-link-col a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -1px;
  width: 0; height: 1px;
  background: #1C0E40;
  transition: width .2s;
}
.footer-link-col a:hover { color: #1C0E40; }
.footer-link-col a:hover::after { width: 100%; }
.footer-bottom-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (min-width: 640px) {
  .search-desktop { display: flex; }
  .search-mobile  { display: none; }
  .container { padding: 0 1.5rem; }
  .logo-box  { width: 2.75rem; height: 2.75rem; font-size: 1.25rem; }
  .search-modal-inner { padding: 2.5rem 1.5rem 1rem; }
  #search-input { font-size: 1.5rem; }
}
@media (min-width: 768px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .container { padding: 0 2rem; }
}
