/* ============================================================
   GLP Medication UK — design system
   Encyclopedic reference. Deep navy & steel blue on off-white.
   Fonts: "Spectral" (headlines) + "IBM Plex Sans" (body).
   Light mode only.
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
img, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
ul[role="list"], ol[role="list"] { list-style: none; }

/* ---------- Tokens ---------- */
:root {
  --paper: #f7f6f2;            /* off-white page background */
  --paper-raised: #ffffff;     /* cards, callouts, tables */
  --paper-sunken: #edecf5;     /* wells — cool tint */
  --ink: #1c2431;              /* primary text, near-navy black */
  --ink-soft: #4a5468;         /* secondary text */
  --ink-faint: #79839a;        /* meta, captions */
  --navy: #16324f;             /* brand navy — topbar, footer, marks */
  --navy-deep: #0d2137;        /* darkest navy */
  --steel: #35608f;            /* steel blue — links, accents */
  --steel-deep: #274a71;       /* link hover */
  --steel-light: #9db8d6;      /* pale steel on dark navy */
  --steel-wash: #e7edf4;       /* tinted panels, info callouts */
  --line: #dcdfe4;             /* hairline borders */
  --line-strong: #c2c8d1;
  --gold-wash: #faf3e2;        /* warnings only */
  --gold-edge: #c1912e;
  --gold-ink: #7c5a12;
  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --measure: 720px;            /* article measure */
  --wide: 1100px;              /* topbar / footer measure */
  --radius: 6px;
  --radius-sm: 3px;
  --shadow-soft: 0 1px 2px rgba(22, 50, 79, 0.06), 0 4px 18px rgba(22, 50, 79, 0.06);
}

/* ---------- Base ---------- */
body {
  font-family: var(--sans);
  font-size: 1.0625rem;               /* 17px */
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
}

::selection { background: var(--steel-wash); color: var(--navy-deep); }

a { color: var(--steel); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--steel-deep); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--steel);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ---------- Topbar (dark navy band) ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy);
  border-bottom: 3px solid var(--navy-deep);
}
.topbar-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0.8rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: #f7f6f2;
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  white-space: nowrap;
}
.brand:hover { color: #ffffff; }
.brand .brand-mark { flex: 0 0 auto; }
.brand em { font-style: normal; color: var(--steel-light); font-weight: 500; }

.nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(247, 246, 242, 0.82);
  text-decoration: none;
  padding: 0.42rem 0.62rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.nav a:hover { color: #ffffff; background: rgba(255, 255, 255, 0.09); }
.nav a[aria-current="page"] {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 -2px 0 var(--steel-light);
}

.nav-toggle {
  display: none;
  font-size: 1.3rem;
  line-height: 1;
  color: rgba(247, 246, 242, 0.9);
  padding: 0.35rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-sm);
  background: transparent;
}
.nav-toggle:hover { color: #fff; border-color: rgba(255, 255, 255, 0.5); }

/* ---------- Page scaffold ---------- */
.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 1.25rem; }
.wrap.narrow { max-width: var(--measure); }

main { display: block; }

/* ---------- Hero (index and section landings) ---------- */
.hero {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #f0f2f0;
  border-bottom: 3px solid var(--navy-deep);
}
.hero-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 3.25rem 1.25rem 3rem;
}
.hero .kicker { color: var(--steel-light); }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 2.9rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: #ffffff;
  max-width: 22ch;
  margin: 0.4rem 0 0.9rem;
  text-wrap: balance;
}
.hero p, .hero .hero-sub {
  font-size: 1.12rem;
  line-height: 1.65;
  color: rgba(247, 246, 242, 0.85);
  max-width: 62ch;
  margin: 0;
}
.hero a { color: var(--steel-light); }
.hero a:hover { color: #ffffff; }

/* Small-caps section label */
.kicker {
  display: block;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--steel);
}

/* ---------- Article typography ---------- */
.article,
.article-body {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.article { padding-top: 3rem; padding-bottom: 4rem; }

.article h1,
.page-title {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4.5vw, 2.55rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
  text-wrap: balance;
}
.article-body h2,
.article h2 {
  font-family: var(--serif);
  font-size: clamp(1.38rem, 3vw, 1.72rem);
  font-weight: 600;
  line-height: 1.3;
  margin: 2.6rem 0 0.9rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);   /* ruled headings — reference flavour */
}
.article-body h3,
.article h3 {
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 2rem 0 0.7rem;
}
.article-body p, .article p { margin-bottom: 1.15rem; }
.article-body ul, .article-body ol,
.article ul, .article ol { margin: 0 0 1.15rem 1.4rem; }
.article-body li, .article li { margin-bottom: 0.45rem; }
.article-body strong, .article strong { font-weight: 600; }

.article-meta,
.byline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-size: 0.875rem;
  color: var(--ink-faint);
  margin-bottom: 2.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--navy);   /* heavy rule under the masthead */
}

.lede {
  font-family: var(--serif);
  font-size: 1.24rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--steel);
  color: var(--ink-soft);
  font-family: var(--serif);
  font-style: italic;
}

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

figure { margin: 1.75rem 0; }
figcaption { font-size: 0.85rem; color: var(--ink-faint); margin-top: 0.5rem; }

/* ---------- Data tables (informational only — never pricing) ---------- */
.table-scroll { overflow-x: auto; margin: 1.5rem 0; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
table { border-collapse: collapse; width: 100%; font-size: 0.925rem; background: var(--paper-raised); }
caption { text-align: left; font-size: 0.85rem; color: var(--ink-faint); padding: 0.6rem 0.9rem; caption-side: bottom; }
th, td { text-align: left; padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #f7f6f2;
  background: var(--navy);              /* navy header band — reference-table look */
  border-bottom: 2px solid var(--navy-deep);
}
tbody th[scope="row"] { font-weight: 600; color: var(--ink); }
tbody tr:nth-child(even) { background: #fbfaf7; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: none; }

/* ---------- Callouts ---------- */
.callout {
  background: var(--steel-wash);
  border: 1px solid rgba(53, 96, 143, 0.28);
  border-left: 4px solid var(--steel);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.3rem;
  margin: 1.75rem 0;
  font-size: 0.975rem;
}
.callout > :last-child { margin-bottom: 0; }
.callout-title {
  display: block;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--steel-deep);
  margin-bottom: 0.4rem;
}
.callout.warning {
  background: var(--gold-wash);
  border-color: rgba(193, 145, 46, 0.45);
  border-left-color: var(--gold-edge);
}
.callout.warning .callout-title { color: var(--gold-ink); }

/* ---------- FAQ accordion (details/summary) ---------- */
.faq { margin: 1.75rem 0; }
.faq-item {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--navy);
  border-radius: var(--radius-sm);
  margin-bottom: 0.7rem;
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.15rem;
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  flex: 0 0 auto;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--steel);
  transition: transform 0.15s ease;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item summary:hover { color: var(--steel-deep); }
.faq-item .faq-answer { padding: 0 1.15rem 1.05rem; color: var(--ink-soft); font-size: 0.975rem; }
.faq-item .faq-answer > :last-child { margin-bottom: 0; }

/* ---------- References ---------- */
.refs {
  margin: 2.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 2px solid var(--navy);
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.refs h2, .refs h3 {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-faint);
  margin: 0 0 0.8rem;
  border-bottom: none;
  padding-bottom: 0;
}
.refs ol { margin: 0 0 0 1.3rem; }
.refs li { margin-bottom: 0.5rem; line-height: 1.55; }
.refs li::marker { color: var(--navy); font-weight: 600; }
.refs a { word-break: break-word; color: var(--steel); }

/* ---------- Cards (blog listing, medicine index) ---------- */
.listing-head { padding: 3rem 0 0.5rem; }
.listing-head .page-title { margin-bottom: 0.6rem; }
.listing-head .listing-intro { color: var(--ink-soft); max-width: 60ch; }

.guide-cards {
  display: grid;
  gap: 1.1rem;
  padding: 1.75rem 0 3.5rem;
}
.guide-card {
  display: block;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-top: 3px solid var(--navy);     /* top rule instead of the sibling's plain card */
  border-radius: var(--radius-sm);
  padding: 1.35rem 1.5rem;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.guide-card:hover {
  color: var(--ink);
  border-color: var(--steel);
  border-top-color: var(--steel);
  box-shadow: var(--shadow-soft);
}
.guide-card .guide-card-meta {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
  margin-bottom: 0.4rem;
}
.guide-card h2, .guide-card h3 {
  font-family: var(--serif);
  font-size: 1.26rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 0.45rem;
  color: var(--ink);
  border-bottom: none;
  padding-bottom: 0;
}
.guide-card:hover h2, .guide-card:hover h3 { color: var(--steel-deep); }
.guide-card p { font-size: 0.94rem; color: var(--ink-soft); margin: 0; }

@media (min-width: 720px) {
  .guide-cards.cols { grid-template-columns: repeat(2, 1fr); }
}

/* Empty state (blog before first post) */
.empty-state {
  background: var(--paper-raised);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--ink-soft);
  margin: 1.75rem 0 3.5rem;
}
.empty-state .empty-state-title {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.4rem;
}
.empty-state p { font-size: 0.95rem; max-width: 46ch; margin: 0 auto; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-bottom: 1.5rem;
}
.breadcrumbs a { color: var(--ink-faint); text-decoration: none; }
.breadcrumbs a:hover { color: var(--steel-deep); text-decoration: underline; }

/* ---------- 404 ---------- */
.error-page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 5rem 1.25rem 6rem;
  text-align: center;
}
.error-page .error-code {
  font-family: var(--serif);
  font-size: clamp(4.5rem, 14vw, 7rem);
  font-weight: 600;
  line-height: 1;
  color: var(--steel-light);
  margin-bottom: 0.5rem;
}
.error-page h1 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  margin-bottom: 0.9rem;
}
.error-page p { color: var(--ink-soft); max-width: 52ch; margin: 0 auto 1.1rem; }
.error-page .error-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.75rem;
}
.error-page .error-links a {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper-raised);
  color: var(--steel-deep);
  font-size: 0.925rem;
  font-weight: 500;
  text-decoration: none;
}
.error-page .error-links a:hover { border-color: var(--steel); color: var(--navy); box-shadow: var(--shadow-soft); }
.error-page .error-links a.primary {
  background: var(--navy);
  border-color: var(--navy);
  color: #f7f6f2;
}
.error-page .error-links a.primary:hover { background: var(--navy-deep); color: #ffffff; }

/* ---------- Footer (dark navy) ---------- */
.footer {
  background: var(--navy);
  border-top: 3px solid var(--navy-deep);
  margin-top: 3rem;
  font-size: 0.875rem;
  color: rgba(247, 246, 242, 0.75);
}
.footer-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 2rem;
}
.footer-disclaimer {
  max-width: 82ch;
  margin-bottom: 1rem;
  line-height: 1.65;
}
.footer-disclaimer strong { color: #f7f6f2; }
.footer a { color: var(--steel-light); }
.footer a:hover { color: #ffffff; }
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.4rem;
  margin: 1.5rem 0 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.footer-nav a { color: rgba(247, 246, 242, 0.85); text-decoration: none; font-weight: 500; }
.footer-nav a:hover { color: #ffffff; text-decoration: underline; }
.footer-meta { font-size: 0.8rem; color: rgba(247, 246, 242, 0.55); }

/* ---------- Utility ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    background: var(--navy-deep);
    border-bottom: 3px solid var(--navy-deep);
    box-shadow: 0 12px 24px rgba(13, 33, 55, 0.35);
    padding: 0.75rem 1.25rem 1rem;
  }
  .nav.open { display: flex; }
  .nav a { padding: 0.7rem 0.75rem; font-size: 1rem; }
}

@media (max-width: 520px) {
  body { font-size: 1rem; }
  .article { padding-top: 2rem; padding-bottom: 3rem; }
  .hero-inner { padding: 2.25rem 1.25rem 2rem; }
  .guide-card { padding: 1.15rem 1.2rem; }
  .error-page { padding: 3.5rem 1.25rem 4.5rem; }
}

/* ---------- Print ---------- */
@media print {
  .topbar, .nav-toggle, .skip-link, .footer-nav { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .article, .article-body { max-width: 100%; padding: 0; }
  a { color: #000; text-decoration: none; }
  .article-body a[href^="http"]::after,
  .article a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #444; }
  .hero { background: #fff; color: #000; border-bottom: 2px solid #000; }
  .hero h1, .hero p { color: #000; }
  .callout, .faq-item, .guide-card { border: 1px solid #999; background: #fff; box-shadow: none; }
  thead th { background: #eee; color: #000; }
  .footer { background: #fff; color: #000; border-top: 1px solid #999; }
  .footer-disclaimer strong { color: #000; }
}
