/* PillenABC – Main Stylesheet
   Aesthetic: Clean medical editorial – Playfair Display + DM Sans
   Palette: Deep teal / soft mint / warm white / charcoal
   ──────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --teal:       #0d6e6e;
  --teal-dark:  #094f4f;
  --teal-light: #e0f2f2;
  --mint:       #a8d5d5;
  --accent:     #e05a2b;
  --warm-white: #faf8f5;
  --charcoal:   #1c2526;
  --mid:        #4a5568;
  --light:      #e8edee;
  --border:     #d1dada;
  --shadow:     0 2px 20px rgba(13,110,110,.10);
  --shadow-lg:  0 8px 40px rgba(13,110,110,.16);
  --r:          8px;
  --r-lg:       16px;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans:  'DM Sans', system-ui, sans-serif;
  --max:        1160px;
  --nav-h:      68px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--warm-white);
  color: var(--charcoal);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-decoration: none; transition: color .2s; }
a:hover { color: var(--teal-dark); }

/* ── Typography ─────────────────────────────────────────────── */
h1,h2,h3,h4,h5 { font-family: var(--font-serif); line-height: 1.25; color: var(--charcoal); }
h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem);     font-weight: 600; }
h3 { font-size: 1.3rem; font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 600; }
p  { margin-bottom: 1.1rem; color: var(--mid); }

/* ── Layout helpers ─────────────────────────────────────────── */
.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.grid-2    { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 28px; }
.grid-3    { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 24px; }
.flex      { display: flex; align-items: center; }
.gap-sm    { gap: 8px; }
.gap       { gap: 16px; }

/* ── Navigation ─────────────────────────────────────────────── */
.navbar {
  background: var(--teal-dark);
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.navbar .container {
  height: 100%;
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.navbar-brand {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.navbar-brand span { color: var(--mint); }

/* Main nav */
.navbar-nav {
  display: flex; align-items: center; gap: 2px;
  list-style: none;
  flex: 1;
  justify-content: center;
}
.navbar-nav > li { position: relative; }
.navbar-nav > li > a {
  color: rgba(255,255,255,.85);
  font-size: .84rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--r);
  transition: background .2s, color .2s;
  white-space: nowrap;
  display: flex; align-items: center; gap: 4px;
}
.navbar-nav > li > a:hover,
.navbar-nav > li > a.active,
.navbar-nav > li:hover > a {
  background: rgba(255,255,255,.12);
  color: #fff;
}
.navbar-cta {
  background: var(--accent) !important;
  color: #fff !important;
  border-radius: 100px !important;
  padding: 7px 14px !important;
  font-weight: 600 !important;
  font-size: .82rem !important;
}
.navbar-cta:hover { background: #c44e24 !important; color: #fff !important; }

/* ── Dropdown ────────────────────────────────────────────────── */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--teal-dark);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--r-lg);
  padding: 8px;
  min-width: 200px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, transform .2s;
  transform: translateX(-50%) translateY(-6px);
  pointer-events: none;
}
.navbar-nav > li:hover .nav-dropdown,
.navbar-nav > li:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.nav-dropdown a {
  display: block;
  color: rgba(255,255,255,.8);
  font-size: .84rem;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.nav-dropdown a:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-dropdown-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  min-width: 340px;
}
.dropdown-arrow { font-size: .65rem; opacity: .7; }

/* Mobile nav toggle */
.nav-toggle {
  display: none; cursor: pointer;
  background: none; border: none;
  color: #fff; font-size: 1.4rem;
  flex-shrink: 0; padding: 4px 8px;
}

/* Search */
.nav-search { position: relative; flex-shrink: 0; }
.nav-search input {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  border-radius: 100px;
  padding: 6px 14px 6px 32px;
  font-size: .82rem;
  width: 150px;
  transition: width .3s, background .2s;
}
.nav-search input::placeholder { color: rgba(255,255,255,.45); }
.nav-search input:focus { outline: none; width: 190px; background: rgba(255,255,255,.16); }
.nav-search-icon {
  position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,.55); font-size: .85rem;
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 60%, #1a8a8a 100%);
  color: #fff;
  padding: 72px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 640px; }
.hero-label { font-size: .8rem; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--mint); margin-bottom: 12px; }
.hero h1 { color: #fff; margin-bottom: 16px; }
.hero p  { color: rgba(255,255,255,.78); font-size: 1.1rem; margin-bottom: 28px; }
.hero-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; color: var(--teal-dark);
  font-weight: 600; font-size: .95rem;
  padding: 12px 26px; border-radius: 100px;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
}
.hero-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(0,0,0,.2); color: var(--teal-dark); }

/* ── Category pills ─────────────────────────────────────────── */
.cat-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 36px 0 12px; }
.cat-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; color: var(--teal);
  border: 1.5px solid var(--border);
  padding: 7px 16px; border-radius: 100px;
  font-size: .85rem; font-weight: 500;
  transition: all .2s; white-space: nowrap;
}
.cat-pill:hover, .cat-pill.active {
  background: var(--teal); color: #fff; border-color: var(--teal);
}

/* ── Article card ───────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-img { aspect-ratio: 16/9; overflow: hidden; background: var(--teal-light); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-img img { transform: scale(1.04); }
.card-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: var(--teal); opacity: .35;
}
.card-body { padding: 22px 24px 20px; flex: 1; display: flex; flex-direction: column; }
.card-cat {
  display: inline-block;
  font-size: .75rem; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  color: var(--teal); margin-bottom: 8px;
}
.card-title { font-size: 1.1rem; margin-bottom: 10px; flex: 1; }
.card-title a { color: var(--charcoal); }
.card-title a:hover { color: var(--teal); }
.card-excerpt { font-size: .88rem; color: var(--mid); margin-bottom: 16px; line-height: 1.55; }
.card-footer { display: flex; align-items: center; justify-content: space-between; }
.card-date { font-size: .78rem; color: #9aadad; }
.card-link { font-size: .85rem; font-weight: 600; color: var(--teal); }
.card-link:hover { color: var(--teal-dark); }

/* ── Article page ───────────────────────────────────────────── */
.article-layout { display: grid; grid-template-columns: 1fr 320px; gap: 48px; align-items: start; padding: 52px 0 80px; }
.article-header { margin-bottom: 32px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: #9aadad; margin-bottom: 16px; flex-wrap: wrap; }
.breadcrumb a { color: var(--teal); }
.breadcrumb-sep { color: var(--border); }
.article-cat-badge {
  display: inline-block;
  background: var(--teal-light); color: var(--teal);
  font-size: .78rem; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  padding: 4px 12px; border-radius: 100px; margin-bottom: 14px;
}
.article-header h1 { margin-bottom: 14px; }
.article-meta { display: flex; gap: 20px; color: #9aadad; font-size: .83rem; flex-wrap: wrap; align-items: center; }
.article-meta strong { color: var(--mid); }
.article-hero-img { width: 100%; border-radius: var(--r-lg); margin-bottom: 36px; aspect-ratio: 16/6; object-fit: cover; }

/* Article content typography */
.article-content h2 { margin: 2.2rem 0 .9rem; border-left: 4px solid var(--teal); padding-left: 14px; }
.article-content h3 { margin: 1.8rem 0 .7rem; color: var(--teal-dark); }
.article-content p  { color: var(--mid); line-height: 1.8; }
.article-content ul, .article-content ol { margin: .8rem 0 1.2rem 1.4rem; color: var(--mid); }
.article-content li { margin-bottom: .4rem; }
.article-content table { width: 100%; border-collapse: collapse; margin: 1.4rem 0; font-size: .9rem; }
.article-content th { background: var(--teal); color: #fff; padding: 10px 14px; text-align: left; }
.article-content td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.article-content tr:nth-child(even) td { background: var(--teal-light); }
.article-content blockquote { background: var(--teal-light); border-left: 4px solid var(--teal); padding: 16px 20px; border-radius: 0 var(--r) var(--r) 0; margin: 1.5rem 0; }
.article-content blockquote p { color: var(--teal-dark); margin: 0; font-style: italic; }

/* ── Info box ───────────────────────────────────────────────── */
.info-box {
  background: var(--teal-light);
  border: 1px solid var(--mint);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  margin: 24px 0;
}
.info-box-title { font-weight: 600; color: var(--teal-dark); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.warning-box { background: #fff7ed; border-color: #f6ad55; }
.warning-box .info-box-title { color: #c05621; }

/* ── Drug info table ────────────────────────────────────────── */
.drug-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 1.5rem 0; }
.drug-table th { background: var(--teal-dark); color: #fff; padding: 10px 16px; text-align: left; font-family: var(--font-serif); }
.drug-table td { padding: 10px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.drug-table td:first-child { font-weight: 600; color: var(--charcoal); width: 40%; }
.drug-table tr:last-child td { border-bottom: none; }
.drug-table tr:nth-child(even) td { background: #f8fafa; }

/* ── FAQ Section ────────────────────────────────────────────── */
.faq-section { margin: 48px 0 0; }
.faq-section h2 { margin-bottom: 24px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 10px; overflow: hidden; }
.faq-question {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 18px 22px; display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-sans); font-size: .95rem; font-weight: 600; color: var(--charcoal);
  transition: background .2s;
}
.faq-question:hover { background: var(--teal-light); }
.faq-question.open { background: var(--teal); color: #fff; }
.faq-icon { font-size: 1.2rem; transition: transform .3s; flex-shrink: 0; margin-left: 12px; }
.faq-question.open .faq-icon { transform: rotate(45deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height .35s ease, padding .35s; }
.faq-answer.open { max-height: 600px; }
.faq-answer-inner { padding: 0 22px 18px; color: var(--mid); font-size: .92rem; line-height: 1.7; }

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar { position: sticky; top: calc(var(--nav-h) + 20px); }
.sidebar-widget { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px; margin-bottom: 24px; }
.sidebar-title { font-family: var(--font-serif); font-size: 1.1rem; color: var(--teal-dark); margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid var(--teal-light); }
.sidebar-cats { list-style: none; }
.sidebar-cats li { padding: 8px 0; border-bottom: 1px solid var(--light); }
.sidebar-cats li:last-child { border-bottom: none; }
.sidebar-cats a { display: flex; justify-content: space-between; color: var(--mid); font-size: .9rem; }
.sidebar-cats a:hover { color: var(--teal); }
.sidebar-cats .count { background: var(--teal-light); color: var(--teal); font-size: .75rem; padding: 1px 8px; border-radius: 100px; }
.sidebar-recent li { padding: 10px 0; border-bottom: 1px solid var(--light); list-style: none; }
.sidebar-recent li:last-child { border-bottom: none; }
.sidebar-recent a { font-size: .88rem; font-weight: 500; color: var(--charcoal); line-height: 1.35; }
.sidebar-recent a:hover { color: var(--teal); }
.sidebar-recent .recent-cat { font-size: .75rem; color: #9aadad; display: block; margin-top: 2px; }

/* Affiliate CTA box */
.affiliate-box {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  color: #fff; border-radius: var(--r-lg);
  padding: 24px; text-align: center;
}
.affiliate-box p { color: rgba(255,255,255,.8); font-size: .88rem; margin-bottom: 16px; }
.affiliate-box h4 { color: #fff; margin-bottom: 10px; }
.btn-affiliate {
  display: inline-block;
  background: var(--accent); color: #fff;
  font-weight: 700; font-size: .9rem;
  padding: 12px 22px; border-radius: 100px;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 3px 14px rgba(0,0,0,.2);
}
.btn-affiliate:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.25); color: #fff; }

/* ── Section headers ────────────────────────────────────────── */
.section { padding: 60px 0; }
.section-alt { background: #f0f7f7; }
.section-header { margin-bottom: 36px; }
.section-header h2 { margin-bottom: 8px; }
.section-header p { color: var(--mid); max-width: 520px; }
.section-header-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.see-all { font-size: .88rem; font-weight: 600; color: var(--teal); white-space: nowrap; }

/* ── ABC index ──────────────────────────────────────────────── */
.abc-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 36px; }
.abc-nav a { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: var(--r); font-weight: 700; font-size: .9rem; background: #fff; border: 1.5px solid var(--border); color: var(--teal); transition: all .2s; }
.abc-nav a:hover { background: var(--teal); color: #fff; border-color: var(--teal); }
.abc-letter { margin-bottom: 40px; }
.abc-letter-header { font-family: var(--font-serif); font-size: 2.5rem; font-weight: 700; color: var(--teal); border-bottom: 3px solid var(--teal-light); margin-bottom: 16px; padding-bottom: 6px; }
.abc-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.abc-list a { padding: 7px 12px; border-radius: var(--r); font-size: .9rem; color: var(--mid); display: block; transition: background .2s; }
.abc-list a:hover { background: var(--teal-light); color: var(--teal); }
.abc-list .abc-cat { font-size: .72rem; color: #9aadad; }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 48px; flex-wrap: wrap; }
.pagination a, .pagination span {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--r); font-size: .9rem; font-weight: 600;
  border: 1.5px solid var(--border); color: var(--mid); background: #fff;
  transition: all .2s;
}
.pagination a:hover { border-color: var(--teal); color: var(--teal); }
.pagination .current { background: var(--teal); border-color: var(--teal); color: #fff; }

/* ── Search results ─────────────────────────────────────────── */
.search-result { padding: 20px 0; border-bottom: 1px solid var(--border); }
.search-result:first-child { border-top: 1px solid var(--border); }
.search-result h3 a { color: var(--charcoal); }
.search-result h3 a:hover { color: var(--teal); }
.search-result p { margin: 4px 0 0; font-size: .9rem; }

/* ── Footer ─────────────────────────────────────────────────── */
footer {
  background: var(--charcoal);
  color: rgba(255,255,255,.65);
  padding: 52px 0 32px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand { font-family: var(--font-serif); font-size: 1.4rem; color: #fff; margin-bottom: 10px; }
.footer-brand span { color: var(--mint); }
.footer-tagline { font-size: .85rem; color: rgba(255,255,255,.45); }
.footer-col h5 { color: #fff; font-size: .85rem; letter-spacing: 1.5px; text-transform: uppercase; font-family: var(--font-sans); font-weight: 600; margin-bottom: 14px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { font-size: .88rem; color: rgba(255,255,255,.55); transition: color .2s; }
.footer-col a:hover { color: var(--mint); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 24px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.footer-bottom p { font-size: .82rem; margin: 0; }
.footer-legal { display: flex; gap: 20px; }
.footer-legal a { font-size: .82rem; color: rgba(255,255,255,.45); }
.footer-legal a:hover { color: var(--mint); }

/* ── Disclaimer bar ─────────────────────────────────────────── */
.disclaimer-bar {
  background: #fff3cd; border-bottom: 1px solid #ffe69c;
  padding: 10px 0; font-size: .8rem; color: #856404; text-align: center;
}

/* ── Admin navbar ───────────────────────────────────────────── */
.admin-bar {
  background: #1a1a2e; color: rgba(255,255,255,.7);
  padding: 8px 0; font-size: .8rem;
}
.admin-bar .container { display: flex; justify-content: space-between; align-items: center; }
.admin-bar a { color: var(--mint); font-weight: 500; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 22px; border-radius: var(--r); font-weight: 600; font-size: .9rem; cursor: pointer; transition: all .2s; border: none; text-decoration: none; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); color: #fff; }
.btn-secondary { background: transparent; color: var(--teal); border: 1.5px solid var(--teal); }
.btn-secondary:hover { background: var(--teal); color: #fff; }
.btn-danger { background: #e53e3e; color: #fff; }
.btn-danger:hover { background: #c53030; color: #fff; }
.btn-sm { padding: 7px 14px; font-size: .82rem; }

/* ── Flash messages ─────────────────────────────────────────── */
.flash { padding: 12px 18px; border-radius: var(--r); margin-bottom: 16px; font-size: .9rem; font-weight: 500; }
.flash-success { background: #c6f6d5; color: #22543d; }
.flash-error   { background: #fed7d7; color: #742a2a; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .article-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .navbar-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h); left: 0; right: 0;
    background: var(--teal-dark);
    padding: 12px 16px 16px;
    gap: 2px;
    border-top: 1px solid rgba(255,255,255,.1);
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
  }
  .navbar-nav.open { display: flex; }
  .navbar-nav > li { width: 100%; }
  .navbar-nav > li > a { padding: 10px 14px; width: 100%; border-radius: 8px; }
  .nav-dropdown {
    position: static;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    background: rgba(255,255,255,.06);
    border: none;
    border-radius: 8px;
    padding: 4px 0 4px 12px;
    box-shadow: none;
    min-width: unset;
    display: none;
  }
  .navbar-nav > li.open .nav-dropdown { display: block; }
  .nav-dropdown-cols { grid-template-columns: 1fr; min-width: unset; }
  .nav-toggle { display: block; }
  .nav-search { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
