/* /guides — static reading pages styled to the ProMSRA design system.
   Tokens mirror tailwind.config.ts: ink-navy #0f172a, academic-gold #c5a059,
   medical-slate #475569, parchment #f1f0e9, stethoscope-silver #cbd5e1.
   Fonts mirror the app stacks: Playfair Display/Literata -> Georgia serif,
   Inter -> system sans. */

:root {
  --ink-navy: #0f172a;
  --gold: #c5a059;
  --gold-deep: #7f5c1f;
  --slate: #475569;
  --slate-light: #64748b;
  --border: rgba(226, 232, 240, 0.9);
  --link-blue: #1557b0;
  --font-display: "Playfair Display", "Literata", Georgia, serif;
  --font-serif: "Literata", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink-navy);
  font-family: var(--font-serif);
  line-height: 1.7;
  background: #ffffff;
}

a {
  color: var(--gold-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

a:hover, a:focus-visible { color: #6f511c; }
a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ===== Header (mirrors the logged-out app header) ===== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.site-header__inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  min-width: 0;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 0.5rem;
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
}

.brand__text { display: flex; flex-direction: column; line-height: 1.05; }

.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink-navy);
}

.brand__by {
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.55);
  margin-top: 2px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav__link {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-navy);
  text-decoration: none;
  padding: 0.45rem 0.65rem;
  border-radius: 0.5rem;
}

.site-nav__link:hover { color: var(--gold-deep); background: rgba(241, 240, 233, 0.8); }
.site-nav__link--active { color: var(--gold-deep); }

.site-nav__cta {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  color: #ffffff;
  background: var(--ink-navy);
  text-decoration: none;
  padding: 0.5rem 0.9rem;
  border-radius: 0.5rem;
  margin-left: 0.35rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.site-nav__cta:hover { background: #0a0c10; color: #ffffff; box-shadow: 0 4px 12px rgba(15, 23, 42, 0.28); }

@media (max-width: 520px) {
  .site-nav__link { display: none; }
  .brand__by { display: none; }
  .site-nav__cta { padding: 0.45rem 0.7rem; font-size: 0.8rem; }
  .brand__name { font-size: 0.98rem; }
}

/* ===== Guide hero and provenance ===== */

.guide-hero {
  background: rgba(197, 160, 89, 0.065);
  border-bottom: 1px solid var(--border);
}

.guide-hero__inner {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.65rem 1.25rem 1.55rem;
}

.breadcrumb {
  margin: 0 0 0.85rem;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--slate-light);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--slate); text-decoration: none; }
.breadcrumb a:hover { color: var(--gold-deep); }
.breadcrumb span[aria-hidden] { color: #cbd5e1; }
.breadcrumb__current {
  color: var(--slate-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 16rem;
}

.guide-kicker {
  margin: 0 0 0.4rem;
  color: var(--gold-deep);
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.guide-hero h1 {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.guide-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.15rem 0.45rem;
  color: var(--slate-light);
  font-family: var(--font-sans);
  font-size: 0.78rem;
}

.guide-meta p { margin: 0; }
.guide-meta a { color: inherit; text-underline-offset: 0.15em; }
.guide-meta a:hover { color: var(--gold-deep); }
.byline a { font-weight: 650; }

/* ===== Reading column ===== */

.guide-main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3.75rem;
}

.guide-main article {
  overflow-wrap: break-word;
}

.hero {
  margin: 0 0 1.75rem;
}

.hero img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

.guide-main article p,
.guide-main article li { font-size: 1rem; }

article p { margin: 0 0 0.95rem; }
article a { color: var(--link-blue); overflow-wrap: anywhere; }
article a:hover { color: #0f438c; }

h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.3;
  font-weight: 700;
  color: var(--ink-navy);
  margin: 2.15rem 0 0.7rem;
  scroll-margin-top: 5.25rem;
}

.site-footer__heading {
  margin: 0 0 0.75rem;
  color: #e2e8f0;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.site-footer__heading::after { display: none; }

h3 {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink-navy);
  margin: 1.6rem 0 0.4rem;
  scroll-margin-top: 5.25rem;
}

ul, ol { margin: 0 0 1.1rem; padding-left: 1.3rem; }
li { margin-bottom: 0.4rem; }

blockquote {
  margin: 1.3rem 0;
  padding: 0.8rem 1.1rem;
  border-left: 3px solid var(--gold);
  background: rgba(241, 240, 233, 0.55);
  border-radius: 0 0.5rem 0.5rem 0;
  color: #334155;
}

blockquote p:last-child { margin-bottom: 0; }

strong { color: var(--ink-navy); }

/* ===== On this page ===== */

.guide-toc {
  margin: 0 0 1.8rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: rgba(241, 240, 233, 0.45);
}

.guide-toc__title {
  margin: 0 0 0.45rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
}

.guide-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 1.75rem;
}

.guide-toc li {
  break-inside: avoid;
  margin: 0 0 0.32rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  line-height: 1.45;
}

.guide-toc li.h3 { padding-left: 0.75rem; }
.guide-toc a { color: #334155; text-decoration: none; }
.guide-toc a:hover { color: var(--link-blue); text-decoration: underline; }

/* ===== Tables ===== */

.table-scroll {
  overflow-x: auto;
  margin: 1.3rem 0;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}

caption {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate-light);
  text-align: left;
  padding: 0.7rem 0.85rem 0.35rem;
}

th {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  color: var(--ink-navy);
  background: rgba(241, 240, 233, 0.7);
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  vertical-align: top;
  min-width: 7rem;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) td { background: rgba(248, 250, 252, 0.7); }

/* ===== CTA ===== */

.cta {
  margin: 2rem 0 0.4rem;
  padding: 1.15rem 1.35rem;
  border-radius: 0.5rem;
  background: rgba(197, 160, 89, 0.065);
  border: 1px solid rgba(197, 160, 89, 0.35);
  color: var(--ink-navy);
}

.cta p { margin: 0; }
.cta a { color: var(--gold-deep); font-weight: 600; }
.cta a:hover { color: #684817; }

/* ===== Hub list (index page) ===== */

.guide-list {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.guide-list li {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: #ffffff;
  padding: 0.95rem 1rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.guide-list li:hover {
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.10);
  border-color: rgba(197, 160, 89, 0.45);
}

.guide-list a {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.04rem;
  color: var(--ink-navy);
  text-decoration: none;
  display: block;
  margin-bottom: 0.3rem;
}

.guide-main--hub { padding-top: 2.4rem; }
.guide-group + .guide-group { margin-top: 2.45rem; }
.guide-group > h2 { margin: 0 0 0.2rem; font-size: 1.28rem; }

.guide-list a:hover { color: var(--gold-deep); }

.guide-list p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--slate);
}

@media (max-width: 700px) {
  .guide-list { grid-template-columns: 1fr; }
}

/* ===== Footer (mirrors the landing footer) ===== */

.site-footer {
  background: linear-gradient(180deg, #0a0c10, var(--ink-navy) 45%, #0a0c10);
  border-top: 1px solid rgba(197, 160, 89, 0.15);
  color: #94a3b8;
  font-family: var(--font-sans);
  margin-top: 0;
}

.site-footer__goldline {
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(197, 160, 89, 0.4), transparent);
}

.site-footer__inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 2.6rem 1.25rem 1.6rem;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr 0.9fr;
  gap: 2rem;
  align-items: start;
}

.brand--footer .brand__name { color: #ffffff; font-size: 1.2rem; }
.brand--footer .brand__by { color: #94a3b8; }
.brand--footer img { width: 40px; height: 40px; }

.site-footer__tagline {
  margin: 0.9rem 0 0.6rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #94a3b8;
}

.site-footer__mail {
  font-size: 0.82rem;
  color: #94a3b8;
  text-decoration: none;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  padding: 0.4rem 0.7rem;
  display: inline-block;
}

.site-footer__mail:hover { color: var(--gold); border-color: rgba(197, 160, 89, 0.4); background: rgba(197, 160, 89, 0.08); }

.site-footer__col h4 {
  margin: 0 0 0.9rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.site-footer__links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 1.4rem;
}

.site-footer__links a {
  font-size: 0.85rem;
  color: #94a3b8;
  text-decoration: none;
}

.site-footer__links a:hover { color: var(--gold); }

.site-footer__meta { text-align: right; }
.site-footer__meta p { margin: 0; font-size: 0.85rem; color: #cbd5e1; }

.site-footer__disclaimer {
  margin-top: 1.8rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.site-footer__disclaimer p {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.6;
  color: #64748b;
}

.site-footer__disclaimer span { font-weight: 600; color: rgba(197, 160, 89, 0.6); }

@media (max-width: 820px) {
  .site-footer__grid { grid-template-columns: 1fr; gap: 1.4rem; }
  .site-footer__meta { text-align: left; }
}

/* ===== Small screens ===== */

@media (max-width: 700px) {
  :root { font-size: 16px; }

  .guide-hero__inner { padding: 1.25rem 1rem 1.35rem; }
  .guide-main { padding: 1.4rem 1rem 3rem; }
  .guide-main--hub { padding-top: 1.8rem; }
  .guide-toc ol { columns: 1; }
  .guide-meta > span { display: none; }
  .guide-meta { display: block; }
  .hero { margin-bottom: 1.35rem; }
  .guide-hero h1 { font-size: 1.75rem; }
  h2 { font-size: 1.22rem; }
}
