/* =========================================================
   BrandRx.ca — Design System
   Concept: a pharmacy label, redrawn for the web. Old-style
   serif numerals and a clinical teal/ink palette carry the
   trust cues; a recurring "cost strip" (brand vs. card vs.
   generic) is the signature device tying every page together.
   ========================================================= */

:root {
  /* Color */
  --ink: #12312e;
  --ink-soft: #1c433f;
  --teal: #0d7a6c;
  --teal-dark: #095c52;
  --teal-tint: #e4f2ee;
  --amber: #c07a2b;
  --amber-tint: #fbeedc;
  --bg: #f4f7f5;
  --paper: #ffffff;
  --line: #dfe7e3;
  --text: #21302d;
  --text-soft: #5b6b67;
  --caution-bg: #fdf6ea;
  --caution-line: #e7cd98;
  --caution-text: #6b4c15;

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(18, 49, 46, 0.06), 0 8px 24px rgba(18, 49, 46, 0.07);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--teal-dark); text-decoration-color: rgba(13,122,108,0.35); text-underline-offset: 2px; }
a:hover { color: var(--teal); }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-dark);
}

/* ---------- Layout helpers ---------- */
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 1.5rem; }
section { padding: 4.5rem 0; }
.section-tight { padding: 2.5rem 0; }

/* ---------- Header ---------- */
.site-header {
  background: var(--ink);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.nav {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.brand-mark {
  width: 30px; height: 30px; flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.9rem;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a {
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 500;
}
.nav-links a:hover { color: #fff; }

.nav-cta {
  background: var(--amber);
  color: #241505 !important;
  padding: 0.55rem 1.1rem;
  border-radius: 100px;
  font-weight: 600 !important;
}
.nav-cta:hover { background: #d68b3d; }

.nav-toggle { display: none; }

@media (max-width: 780px) {
  .nav-links { display: none; }
  .nav-toggle {
    display: inline-flex;
    background: none; border: 1px solid rgba(255,255,255,0.3); color: #fff;
    border-radius: 8px; padding: 0.4rem 0.7rem; font-size: 0.85rem;
  }
  .nav-links.open {
    display: flex; flex-direction: column; align-items: flex-start;
    position: absolute; top: 100%; left: 0; right: 0; background: var(--ink);
    padding: 1rem 1.5rem 1.5rem; border-top: 1px solid rgba(255,255,255,0.08);
    gap: 1rem;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600; font-size: 0.95rem;
  padding: 0.85rem 1.5rem;
  border-radius: 100px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); color: #fff; transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--teal); color: var(--teal-dark); }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--ink) 0%, var(--ink-soft) 100%);
  color: #fff;
  padding: 4.5rem 0 6rem;
}
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 3.5rem; align-items: center;
}
.hero h1 {
  color: #fff;
  font-size: clamp(2.1rem, 3.6vw, 3.1rem);
  margin-bottom: 1.1rem;
}
.hero-lede {
  color: rgba(255,255,255,0.82);
  font-size: 1.12rem;
  max-width: 46ch;
  margin-bottom: 1.8rem;
}
.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.hero-note { color: rgba(255,255,255,0.55); font-size: 0.85rem; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* ---------- Cost strip (signature element) ---------- */
.cost-card {
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: 1.9rem;
  color: var(--text);
  box-shadow: var(--shadow);
}
.cost-card-title {
  font-family: var(--font-body);
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-soft); margin-bottom: 1.1rem;
}
.cost-strip { display: flex; flex-direction: column; gap: 0.8rem; }
.cost-row { display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 0.8rem; }
.cost-label { font-size: 0.86rem; color: var(--text-soft); font-weight: 600; }
.cost-bar-track { background: var(--bg); border-radius: 100px; height: 12px; overflow: hidden; border: 1px solid var(--line); }
.cost-bar-fill { height: 100%; border-radius: 100px; }
.cost-row.brand .cost-bar-fill { width: 100%; background: #c8595a; }
.cost-row.card .cost-bar-fill { width: 34%; background: var(--amber); }
.cost-row.generic .cost-bar-fill { width: 27%; background: var(--teal); }
.cost-amount { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--ink); white-space: nowrap; }
.cost-foot { margin-top: 1.2rem; font-size: 0.78rem; color: var(--text-soft); border-top: 1px dashed var(--line); padding-top: 0.9rem; }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
.step {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.9rem;
}
.step-num {
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; color: var(--amber);
  margin-bottom: 0.6rem; font-variant-numeric: oldstyle-nums;
}
.step h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.step p { color: var(--text-soft); font-size: 0.95rem; }
@media (max-width: 780px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Section heads ---------- */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: 2.2rem; flex-wrap: wrap; }
.section-head h2 { font-size: 1.8rem; }
.section-head p { color: var(--text-soft); margin-top: 0.4rem; max-width: 55ch; }

/* ---------- Cards / grid ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
@media (max-width: 900px) { .card-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .card-grid { grid-template-columns: 1fr; } }

.info-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.7rem; text-decoration: none; color: inherit; display: block;
  border-top: 3px solid var(--teal);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.info-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.info-card h3 { font-size: 1.14rem; margin-bottom: 0.55rem; color: var(--ink); }
.info-card p { color: var(--text-soft); font-size: 0.92rem; margin-bottom: 1rem; }
.info-card .cta { color: var(--teal-dark); font-weight: 600; font-size: 0.88rem; }

/* ---------- Trust / disclaimer strip ---------- */
.trust-strip {
  background: var(--teal-tint); border: 1px solid #c9e4dc; border-radius: var(--radius-lg);
  padding: 1.6rem 1.9rem; display: flex; gap: 1.2rem; align-items: flex-start;
}
.trust-strip svg { flex-shrink: 0; margin-top: 0.15rem; }
.trust-strip p { color: var(--ink-soft); font-size: 0.93rem; }
.trust-strip strong { color: var(--ink); }

.disclaimer {
  background: var(--caution-bg); border: 1px solid var(--caution-line); border-radius: var(--radius);
  padding: 1.3rem 1.5rem; font-size: 0.9rem; color: var(--caution-text); line-height: 1.65;
}
.disclaimer strong { display: block; margin-bottom: 0.25rem; font-family: var(--font-body); }

/* ---------- Article / prose ---------- */
.article-header { padding: 3.2rem 0 2rem; background: var(--paper); border-bottom: 1px solid var(--line); }
.article-header .eyebrow { margin-bottom: 0.9rem; }
.article-header h1 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
.article-header .dek { color: var(--text-soft); font-size: 1.08rem; margin-top: 0.8rem; max-width: 62ch; }

.byline {
  display: flex; align-items: center; gap: 0.75rem; margin-top: 1.6rem;
  font-size: 0.87rem; color: var(--text-soft);
}
.byline .avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--teal);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: 0.9rem; flex-shrink: 0;
}
.byline strong { color: var(--ink); font-weight: 600; }

.prose { font-size: 1.05rem; }
.prose > * + * { margin-top: 1.15rem; }
.prose h2 { font-size: 1.4rem; margin-top: 2.3rem; margin-bottom: 0.2rem; }
.prose h3 { font-size: 1.15rem; margin-top: 1.6rem; }
.prose p { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: 0.4rem; }
.prose .disclaimer, .prose .cost-card, .prose .trust-strip { margin: 1.8rem 0; }

.faq-item { border-top: 1px solid var(--line); padding: 1.3rem 0; }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item h3 { font-size: 1.02rem; margin-bottom: 0.5rem; }
.faq-item p { color: var(--text-soft); font-size: 0.96rem; }

/* ---------- Directory / search ---------- */
.search-bar {
  display: flex; gap: 0.7rem; background: var(--paper); border: 1px solid var(--line);
  border-radius: 100px; padding: 0.4rem 0.4rem 0.4rem 1.3rem; align-items: center; box-shadow: var(--shadow);
}
.search-bar svg { flex-shrink: 0; color: var(--text-soft); }
.search-bar input {
  border: none; outline: none; flex: 1; font-size: 1rem; font-family: var(--font-body);
  background: transparent; padding: 0.6rem 0;
}
.search-count { font-size: 0.85rem; color: var(--text-soft); margin-top: 0.8rem; }

.med-directory { margin-top: 2.2rem; }
.med-group + .med-group { margin-top: 2.4rem; }
.med-group-title {
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--teal-dark); border-bottom: 1px solid var(--line); padding-bottom: 0.6rem; margin-bottom: 1rem;
}
.med-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem 1.2rem; }
@media (max-width: 900px) { .med-list { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px) { .med-list { grid-template-columns: repeat(2, 1fr); } }
.med-list a {
  display: block; padding: 0.55rem 0; color: var(--text); text-decoration: none; font-size: 0.94rem;
  border-bottom: 1px solid transparent;
}
.med-list a:hover { color: var(--teal-dark); border-bottom-color: var(--teal); }
.med-empty { color: var(--text-soft); padding: 2rem 0; text-align: center; display: none; }

/* ---------- News list ---------- */
.news-entry { padding: 2.2rem 0; border-bottom: 1px solid var(--line); }
.news-entry:first-child { padding-top: 0; }
.news-entry h2 { font-size: 1.3rem; margin-bottom: 0.3rem; }
.news-meta { font-size: 0.85rem; color: var(--text-soft); margin-bottom: 0.9rem; }
.news-entry p { color: var(--text); }
.news-tag {
  display: inline-block; background: var(--teal-tint); color: var(--teal-dark);
  font-size: 0.78rem; font-weight: 600; padding: 0.25rem 0.7rem; border-radius: 100px; margin-top: 1rem;
}

/* ---------- Team / about ---------- */
.team-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.6rem; margin-top: 1rem; }
@media (max-width: 700px) { .team-grid { grid-template-columns: 1fr; } }
.team-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.6rem; }
.team-card .avatar { width: 46px; height: 46px; font-size: 1.05rem; margin-bottom: 0.9rem; }
.team-card h3 { font-size: 1.05rem; }
.team-card .role { color: var(--teal-dark); font-size: 0.85rem; font-weight: 600; margin-bottom: 0.6rem; }
.team-card p { color: var(--text-soft); font-size: 0.92rem; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
@media (max-width: 780px) { .contact-grid { grid-template-columns: 1fr; } }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--ink); margin-bottom: 0.4rem; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 0.75rem 0.9rem;
  font-family: var(--font-body); font-size: 0.96rem; background: var(--paper);
}
.field textarea { resize: vertical; min-height: 110px; }

/* ---------- Policy pages ---------- */
.policy-section + .policy-section { margin-top: 2.1rem; }
.policy-section h2 { font-size: 1.25rem; margin-bottom: 0.7rem; }
.policy-section p, .policy-section li { color: var(--text-soft); font-size: 0.98rem; }
.policy-section ul { padding-left: 1.3rem; margin-top: 0.5rem; }
.policy-section li + li { margin-top: 0.4rem; }
.updated-note { color: var(--text-soft); font-size: 0.88rem; margin-bottom: 2rem; }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--ink); color: #fff; border-radius: var(--radius-lg);
  padding: 3rem; text-align: center;
}
.cta-band h2 { color: #fff; font-size: 1.7rem; margin-bottom: 0.7rem; }
.cta-band p { color: rgba(255,255,255,0.75); margin-bottom: 1.6rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,0.7); padding: 3.5rem 0 2rem; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2.5rem; }
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h4 { color: #fff; font-family: var(--font-body); font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 1rem; }
.footer-grid ul { list-style: none; display: flex; flex-direction: column; gap: 0.65rem; }
.footer-grid a { color: rgba(255,255,255,0.68); text-decoration: none; font-size: 0.92rem; }
.footer-grid a:hover { color: #fff; }
.footer-brand-name { font-family: var(--font-display); color: #fff; font-size: 1.2rem; margin-bottom: 0.8rem; }
.footer-tagline { font-size: 0.9rem; max-width: 32ch; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12); margin-top: 2.8rem; padding-top: 1.6rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.8rem;
  font-size: 0.82rem; color: rgba(255,255,255,0.5);
}

/* ---------- Utility ---------- */
.bg-paper { background: var(--paper); }
.text-center { text-align: center; }
.mt-lg { margin-top: 3rem; }
.badge {
  display: inline-block; background: var(--amber-tint); color: var(--amber);
  font-size: 0.78rem; font-weight: 700; padding: 0.3rem 0.8rem; border-radius: 100px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
