/* ============================================================
   Medical Newsletter Magazine — styles.css
   ============================================================ */

:root {
  --blue: #1a56db;
  --blue-dark: #1442b0;
  --teal: #14b8a6;
  --teal-light: #5eead4;
  --green: #10b981;
  --error: #ef4444;
  --ink: #0f2d4f;
  --ink-deep: #0b1f3a;
  --text: #1e293b;
  --text-light: #64748b;
  --bg: #ffffff;
  --bg-alt: #f4f8fb;
  --border: #e2e8f0;
  --border-light: #eef2f7;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(15, 45, 79, 0.08);
  --shadow-md: 0 6px 20px rgba(15, 45, 79, 0.1);
  --shadow-lg: 0 16px 48px rgba(15, 45, 79, 0.16);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --t-fast: 150ms ease;
  --t-base: 250ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input { font-family: inherit; font-size: inherit; }
h1, h2, h3, h4 { line-height: 1.2; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 5rem 0; }
.section-white { background: var(--bg); }
.section-alt { background: var(--bg-alt); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-weight: 700; font-size: 1rem; padding: 0.85rem 1.7rem;
  border-radius: var(--radius-full); transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast), color var(--t-fast);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--teal), var(--blue));
  color: #fff; box-shadow: 0 6px 18px rgba(26, 86, 219, 0.3);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(26, 86, 219, 0.4); }
.btn-primary:disabled { opacity: 0.7; cursor: default; }
.btn-outline { border: 2px solid var(--blue); color: var(--blue); background: transparent; }
.btn-outline:hover { background: var(--blue); color: #fff; }

/* ===== PILL BADGE ===== */
.pill-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.85rem; font-weight: 600; padding: 0.45rem 1.1rem;
  border-radius: var(--radius-full); margin-bottom: 1.25rem;
}
.pill-badge { background: rgba(20, 184, 166, 0.15); color: var(--teal-light); border: 1px solid rgba(20, 184, 166, 0.3); }
.pill-badge-soft { background: rgba(26, 86, 219, 0.08); color: var(--blue); border: 1px solid rgba(26, 86, 219, 0.15); }
.pill-badge-light { background: rgba(255, 255, 255, 0.15); color: #fff; border: 1px solid rgba(255, 255, 255, 0.3); }

/* ===== HEADER ===== */
.site-header {
  position: sticky; top: 0; z-index: 800;
  background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border); transition: box-shadow var(--t-base);
}
.site-header.scrolled { box-shadow: var(--shadow-sm); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 0.7rem 0; }
.header-nav { display: flex; align-items: center; gap: 1.8rem; margin-left: auto; }
.nav-link { font-size: 0.95rem; font-weight: 600; color: var(--text-light); transition: color var(--t-fast); }
.nav-link:hover { color: var(--blue); }
.header-cta { padding: 0.6rem 1.4rem; font-size: 0.9rem; }

.logo { display: flex; align-items: center; gap: 0.65rem; }
.logo-mark { display: block; flex-shrink: 0; line-height: 0; }
.logo-mark svg { display: block; filter: drop-shadow(0 2px 6px rgba(26, 86, 219, 0.25)); border-radius: 11px; }
.logo-text { display: flex; flex-direction: column; line-height: 1.05; }
.logo-title { font-family: var(--font-display); font-weight: 800; font-size: 1.12rem; color: var(--text); letter-spacing: -0.01em; }
.logo-title-light { color: #fff; }
.logo-sub { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.34em; color: var(--teal); }

/* Mobile menu */
.mobile-menu-btn { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.mobile-menu-btn span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: var(--t-fast); }
.mobile-nav { display: none; flex-direction: column; gap: 0.5rem; padding: 1rem 1.5rem 1.5rem; border-top: 1px solid var(--border); }
.mobile-nav.open { display: flex; }
.mobile-nav .nav-link { padding: 0.5rem 0; }
.mobile-nav .btn { margin-top: 0.5rem; }

@media (max-width: 820px) {
  .header-nav { display: none; }
  .mobile-menu-btn { display: flex; }
}

/* ===== HERO ===== */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background: linear-gradient(135deg, var(--ink-deep) 0%, var(--ink) 45%, #0a3a3a 100%);
}
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 10% 15%, rgba(20, 184, 166, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse at 90% 85%, rgba(26, 86, 219, 0.28) 0%, transparent 55%);
}
.hero-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 3.5rem; align-items: center;
  padding: 5rem 1.5rem;
}
.hero-heading { font-family: var(--font-display); font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 800; margin-bottom: 1.25rem; }
.hero-heading span { background: linear-gradient(120deg, var(--teal-light), #60a5fa); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub { font-size: 1.12rem; color: rgba(255, 255, 255, 0.78); max-width: 540px; margin-bottom: 1.8rem; }

.hero-stats { display: flex; flex-direction: column; gap: 1rem; }
.hero-stat {
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius); padding: 1.3rem 1.6rem; backdrop-filter: blur(4px);
}
.stat-num { display: block; font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: var(--teal-light); }
.stat-label { font-size: 0.9rem; color: rgba(255, 255, 255, 0.7); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; padding: 3.5rem 1.5rem; }
  .hero-stats { flex-direction: row; }
  .hero-stat { flex: 1; text-align: center; padding: 1rem; }
}
@media (max-width: 560px) {
  .hero-stats { flex-direction: column; }
  .hero-stat { text-align: left; }
}

/* ===== FORM CARD / NEWSLETTER ===== */
.form-card {
  background: #fff; border-radius: var(--radius-lg); padding: 1.6rem; box-shadow: var(--shadow-lg);
  max-width: 560px; color: var(--text);
}
.form-card-cta { margin: 0 auto; }
.form-label { font-weight: 700; font-size: 1.05rem; margin-bottom: 0.9rem; color: var(--text); }
.news-form { width: 100%; }
.news-input-row { display: flex; gap: 0.6rem; }
.input-group { position: relative; flex: 1; }
.input-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); opacity: 0.55; font-size: 1rem; }
.news-form input[type="email"] {
  width: 100%; padding: 0.9rem 1rem 0.9rem 2.7rem;
  border: 2px solid var(--border); border-radius: var(--radius-full); background: #fff; color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.news-form input[type="email"]:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18); }
.news-form input.error { border-color: var(--error); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12); }
.input-error { display: none; color: var(--error); font-size: 0.82rem; margin-top: 0.5rem; }
.input-error.visible { display: block; }
.form-note { font-size: 0.8rem; color: var(--text-light); margin-top: 0.9rem; }
.form-note-light { color: rgba(255, 255, 255, 0.7); }
.link-btn { color: var(--blue); font-weight: 600; text-decoration: underline; font-size: inherit; }
.link-btn-light { color: #fff; }

.form-success {
  display: flex; align-items: center; gap: 0.85rem;
  background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius); padding: 1.1rem 1.3rem;
}
.success-icon { flex-shrink: 0; }
.form-success strong { display: block; font-size: 1.05rem; }
.form-success p { font-size: 0.9rem; color: var(--text-light); }

@media (max-width: 540px) {
  .news-input-row { flex-direction: column; }
  .news-form .btn { width: 100%; }
}

/* ===== SECTION HEADERS ===== */
.section-header { text-align: center; max-width: 640px; margin: 0 auto 3rem; }
.section-header h2 { font-family: var(--font-display); font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 800; margin-bottom: 0.6rem; }
.section-sub { color: var(--text-light); font-size: 1.05rem; }

/* ===== ARTICLE CARDS ===== */
.featured-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.8rem; }
.articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.8rem; }

.article-card {
  display: flex; flex-direction: column; text-align: left; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}
.article-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card-thumb {
  height: 130px; display: flex; align-items: center; justify-content: center;
  border-bottom: 3px solid var(--accent, var(--blue));
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, #fff), color-mix(in srgb, var(--accent) 5%, #fff));
}
.card-thumb-icon { font-size: 2.8rem; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.12)); }
.card-body { padding: 1.3rem; display: flex; flex-direction: column; flex: 1; }
.card-cat { align-self: flex-start; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent, var(--blue)); margin-bottom: 0.5rem; }
.card-title { font-family: var(--font-display); font-size: 1.18rem; font-weight: 700; line-height: 1.3; margin-bottom: 0.55rem; color: var(--text); }
.card-excerpt { font-size: 0.9rem; color: var(--text-light); margin-bottom: 1rem; flex: 1; }
.card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; color: var(--text-light); border-top: 1px solid var(--border-light); padding-top: 0.7rem; }
.card-readtime { font-weight: 600; }

/* ===== SEARCH + FILTER ===== */
.search-wrap { position: relative; max-width: 520px; margin: 0 auto 1.6rem; }
.search-icon { position: absolute; left: 1.1rem; top: 50%; transform: translateY(-50%); opacity: 0.5; }
#article-search {
  width: 100%; padding: 0.85rem 1rem 0.85rem 2.9rem; border: 2px solid var(--border);
  border-radius: var(--radius-full); background: #fff; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
#article-search:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.15); }

.filter-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.55rem; margin-bottom: 2.5rem; }
.pill {
  display: inline-flex; align-items: center; gap: 0.35rem; background: #fff;
  border: 1.5px solid var(--border); color: var(--text); font-size: 0.86rem; font-weight: 600;
  padding: 0.5rem 1rem; border-radius: var(--radius-full); transition: all var(--t-fast);
}
.pill:hover { border-color: var(--blue); color: var(--blue); }
.pill.active { background: var(--accent, var(--blue)); border-color: var(--accent, var(--blue)); color: #fff; }
.pill.active:hover { color: #fff; }
.pill-count { font-size: 0.72rem; opacity: 0.7; font-weight: 700; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 3.5rem 0; }
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { font-family: var(--font-display); font-size: 1.4rem; margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-light); margin-bottom: 1.3rem; }

/* ===== CTA BAND ===== */
.section-cta {
  color: #fff; text-align: center;
  background: linear-gradient(135deg, var(--ink) 0%, #0a3a3a 100%);
  position: relative; overflow: hidden;
}
.section-cta::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, rgba(20, 184, 166, 0.2) 0%, transparent 60%);
}
.cta-container { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; }
.cta-content h2 { font-family: var(--font-display); font-size: clamp(1.9rem, 3.6vw, 2.7rem); font-weight: 800; margin-bottom: 1rem; }
.cta-content > p { color: rgba(255, 255, 255, 0.8); font-size: 1.05rem; margin-bottom: 2rem; }

/* ===== DISCLAIMER BAND ===== */
.disclaimer-band { background: var(--bg-alt); padding: 2rem 0; border-top: 1px solid var(--border); }
.disclaimer-band p { font-size: 0.82rem; color: var(--text-light); max-width: 900px; margin: 0 auto; text-align: center; line-height: 1.6; }

/* ===== FOOTER ===== */
.site-footer { background: var(--ink-deep); color: rgba(255, 255, 255, 0.75); padding: 3rem 0 2rem; }
.footer-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1.3rem; }
.footer-brand { max-width: 620px; }
.site-footer .logo { justify-content: center; margin-bottom: 1rem; }
.footer-disclaimer { font-size: 0.85rem; color: rgba(255, 255, 255, 0.55); line-height: 1.6; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.6rem; }
.footer-link { color: rgba(255, 255, 255, 0.7); font-weight: 500; text-decoration: none; font-size: 0.9rem; }
.footer-link:hover { color: #fff; }
.footer-copy { font-size: 0.8rem; color: rgba(255, 255, 255, 0.4); border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 1.3rem; width: 100%; }

/* ===== READER MODAL ===== */
.reader-backdrop {
  position: fixed; inset: 0; z-index: 1000; background: rgba(8, 15, 30, 0.7); backdrop-filter: blur(5px);
  display: flex; align-items: flex-start; justify-content: center; padding: 2rem 1.5rem; overflow-y: auto;
  animation: fadeIn 0.25s ease;
}
.reader {
  position: relative; background: #fff; border-radius: var(--radius-lg); max-width: 720px; width: 100%;
  margin: auto; box-shadow: var(--shadow-lg); overflow: hidden; animation: slideUp 0.3s ease;
}
.reader-close {
  position: absolute; top: 1rem; right: 1rem; width: 38px; height: 38px; border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.92); color: var(--text); font-size: 1.05rem;
  display: flex; align-items: center; justify-content: center; z-index: 2; transition: background var(--t-fast);
}
.reader-close:hover { background: #fff; }
.reader-hero {
  padding: 2.5rem 2.5rem 1.8rem; border-bottom: 3px solid var(--accent, var(--blue));
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 13%, #fff), color-mix(in srgb, var(--accent) 4%, #fff));
}
.reader-cat { display: inline-block; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent, var(--blue)); margin-bottom: 0.6rem; }
.reader-title { font-family: var(--font-display); font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 800; line-height: 1.2; margin-bottom: 0.9rem; color: var(--text); }
.reader-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; font-size: 0.88rem; color: var(--text-light); }
.reader-dot { opacity: 0.5; }
.reader-body { padding: 2.2rem 2.5rem; }
.reader-p { font-size: 1.05rem; line-height: 1.8; color: #334155; margin-bottom: 1.3rem; }
.reader-h2 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; margin: 1.8rem 0 0.9rem; color: var(--text); }
.reader-list { margin: 0 0 1.3rem; padding-left: 1.3rem; }
.reader-list li { font-size: 1.02rem; line-height: 1.7; color: #334155; margin-bottom: 0.55rem; }
.reader-newsletter { margin-top: 2.2rem; padding: 1.6rem; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); }
.reader-newsletter h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; margin-bottom: 0.4rem; }
.reader-newsletter p { color: var(--text-light); font-size: 0.95rem; margin-bottom: 1.1rem; }
.reader-disclaimer { margin-top: 1.8rem; padding-top: 1.3rem; border-top: 1px solid var(--border); font-size: 0.8rem; font-style: italic; color: var(--text-light); line-height: 1.6; }

@media (max-width: 560px) {
  .reader-hero { padding: 2rem 1.4rem 1.4rem; }
  .reader-body { padding: 1.5rem 1.4rem; }
  .reader-newsletter { padding: 1.3rem; }
}

/* ===== LEGAL MODAL ===== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000; background: rgba(8, 15, 30, 0.7); backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem; animation: fadeIn 0.25s ease;
}
.modal-box { background: #fff; border-radius: var(--radius-lg); max-width: 640px; width: 100%; max-height: 85vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slideUp 0.3s ease; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1.3rem 1.8rem; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.modal-close {
  width: 36px; height: 36px; border-radius: var(--radius-full); background: var(--bg-alt); color: var(--text-light);
  display: flex; align-items: center; justify-content: center; font-size: 1rem; transition: var(--t-fast);
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-body { padding: 1.8rem; overflow-y: auto; }
.modal-body h3 { font-size: 1.05rem; font-weight: 700; margin: 1.4rem 0 0.5rem; color: var(--ink); }
.modal-body h3:first-child { margin-top: 0; }
.modal-body p, .modal-body li { font-size: 0.92rem; color: var(--text-light); line-height: 1.7; margin-bottom: 0.7rem; }
.modal-body ul { padding-left: 1.3rem; margin-bottom: 0.7rem; }

/* ===== ANIMATIONS / REVEAL ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
