/* ============================================================
   MSK Ultrasound Procedures — 2026 Redesign
   Pure CSS, no framework dependencies
   ============================================================ */

/* ---- Custom Properties ---- */
:root {
  --primary:       #1d4ed8;
  --primary-dark:  #1e3a8a;
  --primary-light: #dbeafe;
  --surface:       #ffffff;
  --bg:            #f1f5f9;
  --bg-2:          #e2e8f0;
  --text:          #0f172a;
  --text-2:        #475569;
  --text-3:        #94a3b8;
  --border:        #cbd5e1;
  --shadow:        0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg:     0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --radius:        8px;
  --radius-lg:     14px;
  --nav-h:         60px;
  --sidebar-w:     248px;
  --font:          system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;

  /* Body-region color palette */
  --c-shoulder: #7c3aed;
  --c-elbow:    #dc2626;
  --c-wrist:    #d97706;
  --c-hip:      #059669;
  --c-knee:     #0891b2;
  --c-ankle:    #2563eb;
  --c-foot:     #db2777;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { font-size: 16px; scroll-behavior: smooth; }
body  {
  font-family: var(--font);
  background:  var(--bg);
  color:       var(--text);
  line-height: 1.6;
  min-height:  100vh;
}
img  { max-width: 100%; height: auto; display: block; }
a    { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; }

/* ---- Site Header ---- */
.site-header {
  position:   sticky;
  top:        0;
  z-index:    100;
  background: var(--primary-dark);
  color:      white;
  height:     var(--nav-h);
  display:    flex;
  align-items: center;
  padding:    0 1.25rem;
  gap:        .75rem;
  box-shadow: var(--shadow-lg);
}
.hamburger {
  display:    none;
  background: none;
  border:     none;
  color:      white;
  padding:    6px;
  border-radius: 6px;
  transition: background .15s;
}
.hamburger:hover { background: rgba(255,255,255,.15); }
.hamburger svg   { display: block; }

.site-logo {
  font-size:   1.05rem;
  font-weight: 800;
  color:       white;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.site-logo span { color: #93c5fd; }

.header-search {
  flex:       1;
  max-width:  360px;
  margin-left: auto;
}
.header-search input {
  width:       100%;
  padding:     .4rem .9rem;
  border-radius: 20px;
  border:      1.5px solid rgba(255,255,255,.25);
  background:  rgba(255,255,255,.12);
  color:       white;
  font-size:   .875rem;
  outline:     none;
  transition:  border-color .2s, background .2s;
}
.header-search input::placeholder { color: rgba(255,255,255,.5); }
.header-search input:focus {
  border-color: rgba(255,255,255,.6);
  background:   rgba(255,255,255,.2);
}

.nav-links {
  display:     flex;
  gap:         .25rem;
  align-items: center;
  flex-shrink: 0;
}
.nav-links a {
  color:       rgba(255,255,255,.8);
  font-size:   .875rem;
  padding:     .35rem .65rem;
  border-radius: 6px;
  transition:  background .15s, color .15s;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
  color:       white;
  background:  rgba(255,255,255,.15);
  text-decoration: none;
}

/* ---- Page Layout (sidebar + main) ---- */
.page-layout {
  display:     grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  max-width:   1280px;
  margin:      0 auto;
  min-height:  calc(100vh - var(--nav-h));
}

/* ---- Sidebar Nav ---- */
.sidebar {
  background:  var(--surface);
  border-right: 1px solid var(--border);
  position:    sticky;
  top:         var(--nav-h);
  height:      calc(100vh - var(--nav-h));
  overflow-y:  auto;
  padding:     1.25rem 0;
  scrollbar-width: thin;
}
.sidebar-home {
  display:     flex;
  align-items: center;
  gap:         .4rem;
  padding:     .4rem 1.25rem;
  font-size:   .875rem;
  font-weight: 600;
  color:       var(--text-2);
  margin-bottom: .5rem;
  transition:  color .15s;
}
.sidebar-home:hover { color: var(--primary); text-decoration: none; }

.sidebar-region-btn {
  width:       100%;
  display:     flex;
  align-items: center;
  gap:         .5rem;
  padding:     .45rem 1.25rem;
  background:  none;
  border:      none;
  font-size:   .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color:       var(--text-3);
  cursor:      pointer;
  user-select: none;
  transition:  color .15s;
}
.sidebar-region-btn:hover { color: var(--text-2); }
.sidebar-region-btn .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sidebar-region-btn .chevron {
  margin-left: auto;
  transition:  transform .2s;
  opacity:     .5;
}
.sidebar-region-btn.open .chevron { transform: rotate(90deg); }

.sidebar-region-links {
  max-height:  0;
  overflow:    hidden;
  transition:  max-height .25s ease;
}
.sidebar-region-links.open { max-height: 300px; }

.sidebar-region-links a {
  display:     block;
  padding:     .38rem 1.25rem .38rem 2.5rem;
  font-size:   .875rem;
  color:       var(--text-2);
  border-left: 2px solid transparent;
  transition:  color .12s, background .12s, border-color .12s;
}
.sidebar-region-links a:hover {
  color:       var(--primary);
  background:  var(--primary-light);
  border-left-color: var(--primary);
  text-decoration: none;
}
.sidebar-region-links a.active {
  color:       var(--primary);
  background:  var(--primary-light);
  border-left-color: var(--primary);
  font-weight: 500;
}

/* Sidebar backdrop (mobile) */
.sidebar-backdrop {
  display:  none;
  position: fixed;
  inset:    0;
  background: rgba(0,0,0,.45);
  z-index:  89;
}
.sidebar-backdrop.show { display: block; }

/* ---- Main Content Area ---- */
.main-content {
  padding:   2rem 2.25rem 5rem;
  min-width: 0;
}

/* ---- Home: Hero ---- */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 55%, #3b82f6 100%);
  border-radius: var(--radius-lg);
  color:     white;
  padding:   3rem 2rem 2.5rem;
  text-align: center;
  margin-bottom: 2rem;
}
.hero h1 {
  font-size:   clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 900;
  letter-spacing: -.03em;
  margin-bottom: .6rem;
}
.hero p {
  color:     rgba(255,255,255,.85);
  font-size: 1.05rem;
  max-width: 520px;
  margin:    0 auto 1.75rem;
}
.hero-search {
  position:  relative;
  max-width: 500px;
  margin:    0 auto;
}
.hero-search input {
  width:        100%;
  padding:      .8rem 1rem .8rem 2.8rem;
  border-radius: 40px;
  border:       none;
  font-size:    1rem;
  outline:      none;
  color:        var(--text);
  box-shadow:   0 4px 20px rgba(0,0,0,.2);
}
.hero-search .search-icon {
  position:  absolute;
  left:      .9rem;
  top:       50%;
  transform: translateY(-50%);
  color:     var(--text-3);
  pointer-events: none;
}

/* ---- Disclaimer Banner ---- */
.disclaimer {
  background: #fefce8;
  border:     1px solid #fde047;
  border-radius: var(--radius);
  padding:   .8rem 1rem;
  font-size: .875rem;
  color:     #854d0e;
  margin-bottom: 1.75rem;
  display:   flex;
  gap:       .6rem;
  align-items: flex-start;
  line-height: 1.5;
}
.disclaimer svg { flex-shrink: 0; margin-top: 2px; }

/* ---- Home: Authors ---- */
.authors-row {
  font-size:  .875rem;
  color:      var(--text-2);
  margin-bottom: 2rem;
  padding:   .75rem 1rem;
  background: var(--surface);
  border:    1px solid var(--border);
  border-radius: var(--radius);
}
.authors-row strong { color: var(--text); }

/* ---- Procedure Index ---- */
.region-section { margin-bottom: 2.5rem; }
.region-section[hidden] { display: none !important; }

.region-header {
  display:    flex;
  align-items: center;
  gap:        .65rem;
  margin-bottom: .9rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--border);
}
.region-header h2 {
  font-size:   1.05rem;
  font-weight: 800;
  color:       var(--text);
}

.region-badge {
  font-size:   .75rem;
  font-weight: 700;
  padding:     .2rem .65rem;
  border-radius: 999px;
  color:       white;
  letter-spacing: .02em;
}

.procedures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap:    .875rem;
}

.procedure-card {
  display:     block;
  background:  var(--surface);
  border:      1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius);
  padding:     1rem 1.1rem;
  text-decoration: none;
  color:       inherit;
  transition:  box-shadow .2s, transform .15s;
}
.procedure-card:hover {
  box-shadow:  var(--shadow-lg);
  transform:   translateY(-2px);
  text-decoration: none;
}
.procedure-card h3 {
  font-size:   .9375rem;
  font-weight: 600;
  color:       var(--text);
  margin-bottom: .25rem;
  line-height: 1.4;
}
.procedure-card .card-meta {
  font-size:  .8rem;
  color:      var(--text-3);
  display:    flex;
  align-items: center;
  gap:        .3rem;
}
.procedure-card[hidden] { display: none !important; }

.no-results {
  text-align: center;
  padding:    3rem 1rem;
  color:      var(--text-2);
  display:    none;
}
.no-results h3 { font-size: 1.2rem; margin-bottom: .5rem; }

/* ---- Procedure Page Header ---- */
.proc-header { margin-bottom: 2rem; }

.breadcrumb {
  display:     flex;
  align-items: center;
  flex-wrap:   wrap;
  gap:         .3rem;
  font-size:   .8125rem;
  color:       var(--text-3);
  margin-bottom: .6rem;
}
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--primary); text-decoration: none; }
.breadcrumb .sep { color: var(--text-3); }

.proc-title {
  font-size:   clamp(1.3rem, 3vw, 2rem);
  font-weight: 900;
  letter-spacing: -.025em;
  color:       var(--text);
  margin-bottom: .75rem;
  line-height: 1.2;
}
.proc-badge {
  display:     inline-flex;
  align-items: center;
  gap:         .35rem;
  font-size:   .8rem;
  font-weight: 700;
  padding:     .25rem .75rem;
  border-radius: 999px;
  color:       white;
  letter-spacing: .02em;
}

/* ---- Equipment Card ---- */
.equipment-card {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       1.5rem;
  margin-bottom: 2rem;
}
.section-label {
  font-size:   .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color:       var(--text-3);
  margin-bottom: 1rem;
}
.equipment-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap:    1.25rem;
}
.equip-col h3 {
  font-size:   .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color:       var(--text-2);
  margin-bottom: .5rem;
}
.equip-tags {
  display:  flex;
  flex-wrap: wrap;
  gap:      .4rem;
}
.equip-tag {
  display:     inline-flex;
  align-items: center;
  gap:         .3rem;
  font-size:   .8125rem;
  border-radius: 6px;
  padding:     .2rem .65rem;
  border:      1px solid;
}
.equip-tag img.equip-thumb {
  height: 28px;
  width: auto;
  max-width: 40px;
  object-fit: contain;
  border-radius: 3px;
  background: white;
  flex-shrink: 0;
}
.equip-tag.probe   { background: #ede9fe; border-color: #c4b5fd; color: #5b21b6; }
.equip-tag.needle  { background: #fff7ed; border-color: #fed7aa; color: #92400e; }
.equip-tag.syringe { background: #ecfeff; border-color: #a5f3fc; color: #155e75; }
.equip-tag.med     { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }
.equip-tag.default { background: var(--bg); border-color: var(--border); color: var(--text-2); }

/* ---- Procedure Steps ---- */
.steps-section { margin-bottom: 2rem; }

.step {
  display:    grid;
  grid-template-columns: 40px 1fr;
  gap:        1rem;
  background: var(--surface);
  border:     1px solid var(--border);
  border-radius: var(--radius);
  padding:    1.25rem;
  margin-bottom: 1rem;
  align-items: start;
}
.step-num {
  width:       40px;
  height:      40px;
  border-radius: 50%;
  background:  var(--primary);
  color:       white;
  font-size:   .9rem;
  font-weight: 800;
  display:     flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-body p {
  font-size:   .9375rem;
  color:       var(--text);
  line-height: 1.65;
}
.step-media {
  margin-top: .875rem;
  display:    flex;
  flex-wrap:  wrap;
  gap:        .75rem;
  align-items: flex-start;
}

/* Annotated US image widget */
.us-image {
  position:    relative;
  border-radius: 8px;
  overflow:    hidden;
  border:      1px solid var(--border);
  cursor:      pointer;
  flex-shrink: 0;
  max-width:   280px;
  transition:  box-shadow .2s;
}
.us-image:hover { box-shadow: var(--shadow-lg); }
.us-image img   { width: 100%; transition: opacity .1s; }
.us-image .annotate-badge { display: none; }
.us-image.no-annotated    { cursor: default; }

/* Static image (no hover/lightbox) */
.static-img {
  border-radius: 8px;
  border:      1px solid var(--border);
  max-width:   420px;
}

/* YouTube embed (aspect-ratio box) */
.yt-wrap {
  position:    relative;
  width:       100%;
  max-width:   520px;
  border-radius: 8px;
  overflow:    hidden;
  background:  #000;
  aspect-ratio: 16/9;
}
.yt-wrap iframe {
  position:  absolute;
  inset:     0;
  width:     100%;
  height:    100%;
  border:    none;
}

/* ---- Lightbox ---- */
.lightbox-overlay {
  position:  fixed;
  inset:     0;
  background: rgba(0,0,0,.88);
  z-index:   1000;
  display:   flex;
  align-items: center;
  justify-content: center;
  padding:   1rem;
  cursor:    zoom-out;
}
.lightbox-overlay.hidden { display: none; }
.lightbox-overlay img {
  max-width:  92vw;
  max-height: 88vh;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  cursor:     default;
}
.lightbox-close {
  position:  absolute;
  top:       1rem;
  right:     1rem;
  background: rgba(255,255,255,.18);
  border:    1.5px solid rgba(255,255,255,.3);
  color:     white;
  font-size: 1.4rem;
  line-height: 1;
  width:     36px;
  height:    36px;
  border-radius: 50%;
  display:   flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.lightbox-close:hover { background: rgba(255,255,255,.3); }
.lightbox-caption {
  position:  absolute;
  bottom:    1.5rem;
  left:      50%;
  transform: translateX(-50%);
  color:     rgba(255,255,255,.8);
  font-size: .875rem;
  background: rgba(0,0,0,.5);
  padding:   .4rem .9rem;
  border-radius: 999px;
  white-space: nowrap;
  max-width:  80vw;
  overflow:   hidden;
  text-overflow: ellipsis;
}

/* ---- References ---- */
.references-section {
  margin-top:   3rem;
  padding-top:  1.5rem;
  border-top:   1px solid var(--border);
}
.references-section ol {
  list-style:  decimal;
  padding-left: 1.25rem;
  font-size:   .875rem;
  color:       var(--text-2);
  line-height: 1.8;
}

/* ---- About / Contact page ---- */
.prose {
  max-width: 680px;
}
.prose h2 {
  font-size:   1.25rem;
  font-weight: 800;
  margin-bottom: .5rem;
  margin-top:  2rem;
  color:       var(--text);
}
.prose h2:first-child { margin-top: 0; }
.prose p {
  font-size:  .9375rem;
  color:      var(--text-2);
  margin-bottom: .75rem;
  line-height: 1.7;
}
.prose a { color: var(--primary); }

.author-list {
  display:        flex;
  flex-direction: column;
  gap:            .75rem;
  margin-top:     1rem;
  max-width:      560px;
}
.author-card {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       1rem 1.25rem;
}
.author-card h3 { font-size: .9375rem; font-weight: 700; color: var(--text); }
.author-card p  { font-size: .875rem;  color: var(--text-2); margin-top: .2rem; }

/* ---- Footer ---- */
.site-footer {
  background:  var(--primary-dark);
  color:       rgba(255,255,255,.65);
  padding:     2rem 1.5rem;
  margin-top:  4rem;
  font-size:   .875rem;
}
.footer-inner {
  max-width:   1280px;
  margin:      0 auto;
  display:     flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap:   wrap;
  gap:         1rem;
}
.footer-links { display: flex; gap: 1.25rem; }
.footer-links a { color: rgba(255,255,255,.7); transition: color .2s; }
.footer-links a:hover { color: white; text-decoration: none; }
.footer-copy { font-size: .75rem; color: rgba(255,255,255,.4); margin-top: .4rem; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 960px) {
  .page-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position:  fixed;
    top:       var(--nav-h);
    left:      0;
    width:     var(--sidebar-w);
    height:    calc(100vh - var(--nav-h));
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    z-index:   90;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open    { transform: translateX(0); }
  .hamburger       { display: flex; }
  .nav-links       { display: none; }
  .header-search   { max-width: 260px; }
}
@media (max-width: 640px) {
  .main-content   { padding: 1.25rem 1rem 3rem; }
  .hero           { padding: 2rem 1rem 1.75rem; }
  .hero p         { font-size: .9375rem; }
  .equipment-cols { grid-template-columns: 1fr; }
  .step           { grid-template-columns: 32px 1fr; gap: .75rem; }
  .step-num       { width: 32px; height: 32px; font-size: .8rem; }
  .procedures-grid { grid-template-columns: 1fr 1fr; }
  .yt-wrap        { max-width: 100%; }
  .us-image       { max-width: 240px; }
}
@media (max-width: 400px) {
  .procedures-grid { grid-template-columns: 1fr; }
}
