/* =============================================================
   SACM redesign — shared theme for modernized pages
   ============================================================= */
:root {
  --cream: #FAF4EB;
  --cream-deep: #F4EADB;
  --rose: #F3E3DB;
  --ink: #2a1a14;
  --ink-soft: #5a4a42;
  --muted: #8a7a72;
  --teal: #2b9b95;
  --teal-dark: #22807b;
  --maroon: #3e1a15;
  --maroon-light: #5a2822;
  --border: #e8dccb;
  --card: #ffffff;
  --shadow-sm: 0 1px 2px rgba(60, 30, 20, 0.04), 0 1px 3px rgba(60, 30, 20, 0.06);
  --shadow-md: 0 4px 12px rgba(60, 30, 20, 0.08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--maroon); color: #fff; padding: .75rem 1rem; z-index: 2000;
}
.skip-link:focus { left: 1rem; top: 1rem; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

/* Top nav */
.topnav {
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.topnav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 2rem;
  max-width: 1200px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; letter-spacing: .08em; color: var(--ink); }
.brand-mark {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--teal);
}
.brand-mark svg { width: 100%; height: 100%; }
.brand-text { font-family: Georgia, "Times New Roman", serif; font-size: 1.15rem; }
.topnav ul { list-style: none; display: flex; gap: 2rem; margin: 0; padding: 0; align-items: center; }
.topnav a { color: var(--ink); font-size: .95rem; }
.topnav a:hover { color: var(--teal-dark); text-decoration: none; }
.topnav ul a {
  background: var(--maroon); color: #fff !important;
  padding: .65rem 1.25rem; border-radius: 999px;
  font-size: .9rem; font-weight: 500;
  display: inline-block;
}
.topnav ul a:hover { background: var(--maroon-light); text-decoration: none; }
.btn-pill {
  background: var(--maroon); color: #fff !important;
  padding: .65rem 1.25rem; border-radius: 999px;
  font-size: .9rem; font-weight: 500;
  display: inline-block;
}
.btn-pill:hover { background: var(--maroon-light); text-decoration: none; }

/* Hero */
.hero {
  padding: 5rem 0 6rem;
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.tag {
  display: inline-block;
  background: var(--cream-deep);
  color: var(--ink-soft);
  padding: .45rem 1.1rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-bottom: 1.75rem;
}
.hero h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(3rem, 6vw, 5rem);
  line-height: 1.05;
  margin: 0 0 1.75rem;
  color: var(--ink);
}
.hero h1 em {
  display: block;
  font-style: italic;
  color: var(--teal);
  font-weight: 400;
}
.hero-lead {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 30rem;
  margin: 0 0 2.25rem;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .95rem 1.75rem;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 600;
  border: 2px solid transparent;
  transition: all .15s;
}
.btn-primary { background: var(--maroon); color: #fff !important; }
.btn-primary:hover { background: var(--maroon-light); text-decoration: none; }
.btn-outline { background: #fff; color: var(--ink) !important; border-color: var(--border); }
.btn-outline:hover { border-color: var(--teal); text-decoration: none; }
.btn-outline .dot { color: var(--teal); }

.hero-art {
  position: relative;
  min-height: 420px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.hero-art::before {
  content: "";
  position: absolute;
  width: 480px; height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(243, 227, 219, .9) 0%, rgba(250, 244, 235, 0) 70%);
  z-index: 0;
}
.hero-art img {
  position: relative;
  max-width: 595px;
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 20px 40px rgba(60, 30, 20, .18), 0 8px 16px rgba(60, 30, 20, .1);
  z-index: 1;
}

/* Author band */
.author-band {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--cream);
  padding: 2rem 0;
}
.author-band-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 2rem;
  align-items: start;
  max-width: 1200px; margin: 0 auto; padding: 0 2rem;
}
.author-band-inner .divider { align-self: center; }
.author-col .label.placeholder { visibility: hidden; }
.author-band .divider {
  width: 40px; height: 1px; background: var(--border);
}
.author-col .label {
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .35rem;
}
.author-col p { margin: 0; font-size: .9rem; color: var(--ink-soft); }
.author-col.center { display: block; }
.author-col.center .acvim-row { display: flex; align-items: flex-start; gap: .75rem; }
.author-col.center .acvim-row p { margin: 0; }
.author-col.center .icon {
  width: 28px; height: 28px; color: var(--teal); flex-shrink: 0;
  margin-top: .2rem;
}
.author-col .author-name,
.author-col .author-title-text { font-size: 1.35rem; line-height: 1.3; }
.author-col.center p,
.author-col.center a { font-size: 1.35rem; line-height: 1.3; }

/* Library / card grid */
.library { padding: 5.5rem 0; background: var(--cream); }
.library-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 400;
  text-align: center;
  margin: 0 0 .5rem;
}
.title-underline {
  display: block;
  width: 60px; height: 3px;
  background: var(--teal);
  margin: .75rem auto 3.5rem;
  border-radius: 2px;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.card {
  background: var(--card);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card-icon {
  width: 44px; height: 44px;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
}
.card h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0 0 .75rem;
  color: var(--ink);
}
.card p {
  margin: 0 0 1.5rem;
  color: var(--ink-soft);
  font-size: .95rem;
  flex: 1;
}
.card-link {
  color: var(--teal-dark);
  font-weight: 600;
  font-size: .9rem;
  display: inline-flex; align-items: center; gap: .4rem;
}
.card-link:hover { text-decoration: none; color: var(--teal); }
.card-link::after { content: "\203A"; font-size: 1.1rem; }

.card-cta {
  background: var(--maroon);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.card-cta::after {
  content: "";
  position: absolute;
  right: -60px; bottom: -60px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.06) 0%, transparent 70%);
}
.card-cta h3 { color: #fff; }
.card-cta p { color: rgba(255,255,255,.8); }
.btn-white {
  display: inline-block;
  background: #fff;
  color: var(--maroon) !important;
  padding: .85rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  text-align: center;
  font-size: .9rem;
}
.btn-white:hover { background: #f5eee2; text-decoration: none; }

/* Final CTA */
.final-cta {
  background: var(--rose);
  border-radius: 16px;
  padding: 4.5rem 2rem;
  text-align: center;
  max-width: 1136px;
  margin: 0 auto 5rem;
}
.final-cta h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 400;
  margin: 0 0 1rem;
  color: var(--ink);
}
.final-cta p {
  max-width: 40rem;
  margin: 0 auto 2rem;
  color: var(--ink-soft);
}

/* Footer */
.footer {
  background: var(--cream);
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}
.footer-brand { max-width: 24rem; }
.footer-brand p { color: var(--ink-soft); margin: 1rem 0; }
.footer-brand .copyright { font-weight: 600; color: var(--ink); margin-top: 1.5rem; }
.footer-col h4 {
  font-size: .85rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 1.25rem;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: .75rem; }
.footer-col a { color: var(--ink-soft); }
.footer-col a:hover { color: var(--teal-dark); text-decoration: none; }
.footer-bottom {
  padding-top: 2rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  font-size: .85rem; color: var(--ink-soft);
}
.footer-bottom .links { display: flex; gap: 2rem; }

/* Page header (used on subpages like ECG atlas) */
.page-head {
  padding: 4rem 0 1rem;
  text-align: center;
}
.page-head .tag { margin-bottom: 1.25rem; }
.page-head h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 400;
  line-height: 1.1;
  margin: 0 0 1rem;
}
.page-head h1 em { font-style: italic; color: var(--teal); font-weight: 400; }
.page-head p {
  max-width: 40rem; margin: 0 auto; color: var(--ink-soft); font-size: 1.1rem;
}
.page-body { padding: 2rem 0 5rem; }

/* Tile grid (for ECG/Echo/etc. numbered listings) */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}
.tile {
  background: var(--card);
  border-radius: 10px;
  padding: 1.25rem 1rem;
  box-shadow: var(--shadow-sm);
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
  color: var(--ink) !important;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  border: 2px solid transparent;
}
.tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--teal);
  text-decoration: none;
}
.tile .tile-label {
  font-size: .7rem; letter-spacing: .15em; text-transform: uppercase; color: var(--muted);
}
.tile .tile-num {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.75rem; font-weight: 600; color: var(--ink);
}
.tile.tile-wide { grid-column: span 2; }
.tile.tile-wide .tile-num { font-size: 1.1rem; line-height: 1.3; }

/* Responsive */
@media (max-width: 900px) {
  .topnav-inner { flex-wrap: wrap; gap: 1rem; padding: 1rem; }
  .topnav ul { gap: 1.25rem; flex-wrap: wrap; }
  .hero { padding: 3rem 0 4rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero-art { min-height: auto; }
  .author-band-inner { grid-template-columns: 1fr; gap: 1rem; text-align: center; }
  .author-band .divider { display: none; }
  .author-col.center { justify-content: center; }
  .card-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* ------------------------------------------------------------
   Case pages — sidebar + content layout
   ------------------------------------------------------------ */
.case-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
  align-items: flex-start;
}
.case-sidebar {
  position: sticky;
  top: 96px;
  background: #fff;
  border-radius: 12px;
  padding: 1.75rem 1.25rem;
  box-shadow: var(--shadow-sm);
}
.case-sidebar .case-label {
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 1rem;
}
.case-sidebar ul { list-style: none; padding: 0; margin: 0; }
.case-sidebar li { margin: 0; }
.case-sidebar a {
  display: block;
  padding: .6rem .85rem;
  border-radius: 6px;
  color: var(--ink-soft) !important;
  font-size: .95rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.case-sidebar a:hover {
  background: var(--cream-deep);
  color: var(--ink) !important;
  text-decoration: none;
}
.case-sidebar a[aria-current="page"] {
  background: var(--cream-deep);
  color: var(--maroon) !important;
  border-left-color: var(--teal);
  font-weight: 600;
}
.case-sidebar hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: .75rem 0;
}

.case-content { min-width: 0; }
.case-breadcrumb {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .9rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.case-breadcrumb a { color: var(--ink-soft); }
.case-breadcrumb a:hover { color: var(--teal-dark); text-decoration: none; }
.case-content h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 1rem;
  color: var(--ink);
}
.case-content h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2rem 0 .75rem;
  color: var(--ink);
}
.case-content p,
.case-content li,
.case-content label { color: var(--ink-soft); font-size: 1.1rem; font-weight: 500; }
.case-content ul, .case-content ol { padding-left: 1.25rem; margin: 0 0 1.25rem; }
.case-content li { margin-bottom: .35rem; }
.case-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}
.case-content .image-block,
.case-content figure {
  margin: 1.5rem 0;
  text-align: center;
}
.case-content figcaption {
  margin-top: .75rem;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink-soft);
  font-style: italic;
}
.case-content hr,
.case-content .section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}
.case-content video { border-radius: 8px; box-shadow: var(--shadow-sm); display: block; margin: 1.5rem 0; }
.case-content strong { color: var(--ink); }

/* Case listing (cases.htm) */
.case-list {
  list-style: none; padding: 0; margin: 2.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  counter-reset: caseno;
}
.case-list li { margin: 0; }
.case-list a {
  display: flex; align-items: center; gap: 1rem;
  background: #fff;
  padding: 1.25rem 1.5rem;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  color: var(--ink) !important;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  border: 2px solid transparent;
}
.case-list a:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--teal);
  text-decoration: none;
}
.case-list a::before {
  counter-increment: caseno;
  content: counter(caseno, decimal-leading-zero);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  color: var(--teal);
  min-width: 2.5rem;
}

@media (max-width: 900px) {
  .case-layout { grid-template-columns: 1fr; gap: 1.5rem; padding: 2rem 1rem; }
  .case-sidebar { position: static; }
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 24px; right: 24px; z-index: 1000;
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  background: var(--maroon); color: #fff !important;
  border-radius: 50%;
  font-size: 1.5rem; font-weight: bold;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  text-decoration: none;
}
.back-to-top:hover { background: var(--maroon-light); text-decoration: none; }
