/* ============================================================
   The Shift — Healthcare Professional Relocation Engine
   Design System (shf- prefix)
   ============================================================ */

/* --- Design Tokens --- */
:root {
  /* Colors — medical/professional palette */
  --shf-primary: #1a5276;
  --shf-primary-light: #2980b9;
  --shf-primary-dark: #0e3a56;
  --shf-accent: #27ae60;
  --shf-accent-hover: #219a52;
  --shf-negative: #c0392b;
  --shf-negative-light: #e74c3c;
  --shf-warning: #e67e22;
  --shf-neutral: #7f8c8d;

  /* Backgrounds */
  --shf-bg: #f8f9fa;
  --shf-bg-white: #ffffff;
  --shf-bg-data: #f0f2f5;
  --shf-bg-stories: #fdf6e3;
  --shf-card-bg: #ffffff;

  /* Text */
  --shf-text: #2c3e50;
  --shf-text-secondary: #636e72;
  --shf-text-inverse: #ffffff;
  --shf-text-link: var(--shf-primary-light);

  /* Border */
  --shf-border: #e2e8f0;
  --shf-border-focus: var(--shf-primary-light);

  /* Typography */
  --shf-font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --shf-font-display: var(--shf-font-body);
  --shf-size-base: 16px;
  --shf-size-sm: 14px;
  --shf-size-lg: 20px;
  --shf-size-xl: 28px;
  --shf-size-hero: 40px;
  --shf-line-height: 1.6;
  --shf-line-height-tight: 1.3;

  /* Spacing */
  --shf-space-xs: 4px;
  --shf-space-sm: 8px;
  --shf-space-md: 16px;
  --shf-space-lg: 24px;
  --shf-space-xl: 40px;
  --shf-space-section: 64px;

  /* Layout */
  --shf-max-width: 1200px;
  --shf-content-width: 800px;
  --shf-drawer-width: 420px;
  --shf-border-radius: 8px;

  /* Shadows */
  --shf-shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shf-shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shf-shadow-lg: 0 8px 24px rgba(0,0,0,0.15);

  /* Accessibility */
  --shf-touch-target: 44px;
  --shf-focus-ring: 3px solid var(--shf-primary-light);
}

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

html {
  font-size: var(--shf-size-base);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--shf-font-body);
  font-size: var(--shf-size-base);
  line-height: var(--shf-line-height);
  color: var(--shf-text);
  background: var(--shf-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--shf-text-link); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }

/* Focus rings — all interactive elements */
:focus-visible {
  outline: var(--shf-focus-ring);
  outline-offset: 2px;
}

/* --- Skip Link --- */
.shf-skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  background: var(--shf-primary);
  color: var(--shf-text-inverse);
  padding: var(--shf-space-sm) var(--shf-space-md);
  border-radius: var(--shf-border-radius);
  z-index: 10000;
  font-size: var(--shf-size-sm);
}
.shf-skip-link:focus { top: 8px; }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--shf-font-display);
  line-height: var(--shf-line-height-tight);
  color: var(--shf-text);
  font-weight: 700;
}
h1 { font-size: var(--shf-size-hero); margin-bottom: var(--shf-space-lg); }
h2 { font-size: var(--shf-size-xl); margin-bottom: var(--shf-space-md); }
h3 { font-size: var(--shf-size-lg); margin-bottom: var(--shf-space-sm); }
h4 { font-size: var(--shf-size-base); margin-bottom: var(--shf-space-sm); font-weight: 600; }

p { margin-bottom: var(--shf-space-md); }
.shf-lead { font-size: var(--shf-size-lg); color: var(--shf-text-secondary); }
.shf-caption { font-size: var(--shf-size-sm); color: var(--shf-text-secondary); }
.shf-label { font-size: var(--shf-size-sm); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--shf-text-secondary); }

/* --- Brokerage Bar --- */
.shf-brokerage-bar {
  background: var(--shf-text);
  color: rgba(255,255,255,0.7);
  text-align: center;
  font-size: 12px;
  padding: 6px var(--shf-space-md);
  line-height: 1.4;
}
.shf-brokerage-bar p { margin: 0; }

/* --- Navigation --- */
.shf-nav {
  background: var(--shf-bg-white);
  border-bottom: 1px solid var(--shf-border);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.shf-nav-inner {
  max-width: var(--shf-max-width);
  margin: 0 auto;
  padding: 0 var(--shf-space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
}
.shf-nav-brand {
  font-size: var(--shf-size-lg);
  font-weight: 700;
  color: var(--shf-primary);
  text-decoration: none;
  white-space: nowrap;
}
.shf-nav-brand:hover { text-decoration: none; color: var(--shf-primary-dark); }
.shf-nav-links {
  display: flex;
  gap: var(--shf-space-xs);
  align-items: center;
}
.shf-nav-links a {
  padding: var(--shf-space-sm) var(--shf-space-md);
  font-size: var(--shf-size-sm);
  font-weight: 500;
  color: var(--shf-text-secondary);
  border-radius: var(--shf-border-radius);
  min-height: var(--shf-touch-target);
  display: flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
}
.shf-nav-links a:hover,
.shf-nav-links a[aria-current="page"] {
  color: var(--shf-primary);
  background: rgba(26, 82, 118, 0.06);
  text-decoration: none;
}
.shf-nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: var(--shf-space-sm);
  cursor: pointer;
  min-width: var(--shf-touch-target);
  min-height: var(--shf-touch-target);
  align-items: center;
  justify-content: center;
}

/* Campus context in nav */
.shf-nav-campus {
  font-size: var(--shf-size-sm);
  color: var(--shf-accent);
  padding: var(--shf-space-xs) var(--shf-space-sm);
  background: rgba(39, 174, 96, 0.08);
  border-radius: var(--shf-border-radius);
  white-space: nowrap;
}

/* --- Main Layout --- */
.shf-main {
  min-height: 60vh;
}

/* --- Visual Zones --- */
.shf-lobby {
  background: var(--shf-bg-white);
  padding: var(--shf-space-section) var(--shf-space-md);
}
.shf-data-room {
  background: var(--shf-bg-data);
  padding: var(--shf-space-section) var(--shf-space-md);
}
.shf-tool-room {
  background: var(--shf-bg-white);
  padding: var(--shf-space-xl) var(--shf-space-lg);
  border-radius: var(--shf-border-radius);
  box-shadow: var(--shf-shadow-md);
  margin: var(--shf-space-lg) auto;
  max-width: var(--shf-max-width);
}
.shf-stories {
  background: var(--shf-bg-stories);
  padding: var(--shf-space-section) var(--shf-space-md);
}
.shf-bridge {
  background: var(--shf-primary);
  color: var(--shf-text-inverse);
  padding: var(--shf-space-xl) var(--shf-space-md);
  text-align: center;
}
.shf-bridge h2,
.shf-bridge h3,
.shf-bridge p { color: var(--shf-text-inverse); }
.shf-bridge a { color: rgba(255,255,255,0.9); text-decoration: underline; }

/* Zone inner container */
.shf-zone-inner {
  max-width: var(--shf-max-width);
  margin: 0 auto;
}

/* --- Hub Hero --- */
.shf-hub-hero {
  background: var(--shf-bg-white);
  padding: var(--shf-space-section) var(--shf-space-md) var(--shf-space-xl);
  text-align: center;
  border-bottom: 1px solid var(--shf-border);
}
.shf-hub-hero .shf-zone-inner { max-width: var(--shf-content-width); }
.shf-hub-tag {
  display: inline-block;
  font-size: var(--shf-size-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--shf-primary);
  margin-bottom: var(--shf-space-md);
}
.shf-hub-hero h1 { margin-bottom: var(--shf-space-md); }
.shf-hub-hero .shf-lead { margin-bottom: 0; }

/* --- Content Section --- */
.shf-content-section {
  max-width: var(--shf-content-width);
  margin: 0 auto;
  padding: var(--shf-space-xl) var(--shf-space-md);
}

/* --- Cards --- */
.shf-card {
  background: var(--shf-card-bg);
  border: 1px solid var(--shf-border);
  border-radius: var(--shf-border-radius);
  padding: var(--shf-space-lg);
  box-shadow: var(--shf-shadow-sm);
}
.shf-card + .shf-card { margin-top: var(--shf-space-md); }
.shf-card-title {
  font-size: var(--shf-size-lg);
  font-weight: 600;
  margin-bottom: var(--shf-space-sm);
}

/* Card grid */
.shf-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--shf-space-lg);
}

/* --- Tool Container --- */
.shf-tool-container {
  background: var(--shf-card-bg);
  border-radius: var(--shf-border-radius);
  padding: var(--shf-space-xl);
  box-shadow: var(--shf-shadow-md);
  border: 1px solid var(--shf-border);
}
.shf-tool-container h2 { text-align: center; }

/* --- Buttons --- */
.shf-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--shf-touch-target);
  padding: var(--shf-space-sm) var(--shf-space-lg);
  font-size: var(--shf-size-base);
  font-weight: 600;
  font-family: var(--shf-font-body);
  color: var(--shf-text-inverse);
  background: var(--shf-primary);
  border: 2px solid var(--shf-primary);
  border-radius: var(--shf-border-radius);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
  gap: var(--shf-space-sm);
}
.shf-btn-primary:hover {
  background: var(--shf-primary-dark);
  border-color: var(--shf-primary-dark);
  text-decoration: none;
  color: var(--shf-text-inverse);
}
.shf-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--shf-touch-target);
  padding: var(--shf-space-sm) var(--shf-space-lg);
  font-size: var(--shf-size-base);
  font-weight: 600;
  font-family: var(--shf-font-body);
  color: var(--shf-primary);
  background: transparent;
  border: 2px solid var(--shf-primary);
  border-radius: var(--shf-border-radius);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  gap: var(--shf-space-sm);
}
.shf-btn-secondary:hover {
  background: var(--shf-primary);
  color: var(--shf-text-inverse);
  text-decoration: none;
}

/* --- Data Table --- */
.shf-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--shf-size-base);
}
.shf-data-table th,
.shf-data-table td {
  padding: var(--shf-space-sm) var(--shf-space-md);
  text-align: left;
  border-bottom: 1px solid var(--shf-border);
}
.shf-data-table th {
  font-weight: 600;
  color: var(--shf-text-secondary);
  font-size: var(--shf-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--shf-bg);
}
.shf-data-table tbody tr:hover { background: rgba(26, 82, 118, 0.03); }
.shf-data-positive { color: var(--shf-accent); font-weight: 600; }
.shf-data-negative { color: var(--shf-negative); font-weight: 600; }

/* --- Timeline --- */
.shf-timeline {
  position: relative;
  padding-left: var(--shf-space-xl);
}
.shf-timeline::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--shf-border);
}
.shf-timeline-item {
  position: relative;
  padding-bottom: var(--shf-space-lg);
}
.shf-timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--shf-space-xl) + 7px);
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--shf-border);
  border: 2px solid var(--shf-bg-white);
}
.shf-timeline-item[data-status="completed"]::before { background: var(--shf-accent); }
.shf-timeline-item[data-status="in-progress"]::before { background: var(--shf-primary-light); }
.shf-timeline-item[data-status="blocked"]::before { background: var(--shf-negative); }
.shf-timeline-title { font-weight: 600; margin-bottom: var(--shf-space-xs); }
.shf-timeline-meta { font-size: var(--shf-size-sm); color: var(--shf-text-secondary); }

/* --- Tags --- */
.shf-tag {
  display: inline-block;
  padding: 2px var(--shf-space-sm);
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.shf-tag-system { background: rgba(26, 82, 118, 0.1); color: var(--shf-primary); }
.shf-tag-specialty { background: rgba(39, 174, 96, 0.1); color: var(--shf-accent); }
.shf-tag-schedule { background: rgba(230, 126, 34, 0.1); color: var(--shf-warning); }
.shf-tag-status-done { background: rgba(39, 174, 96, 0.1); color: var(--shf-accent); }
.shf-tag-status-pending { background: rgba(127, 140, 141, 0.1); color: var(--shf-neutral); }
.shf-tag-status-blocked { background: rgba(192, 57, 43, 0.1); color: var(--shf-negative); }

/* --- Brief Strip --- */
.shf-brief-strip {
  background: var(--shf-primary-dark);
  color: var(--shf-text-inverse);
  padding: var(--shf-space-sm) var(--shf-space-md);
  font-size: var(--shf-size-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--shf-space-md);
  min-height: var(--shf-touch-target);
}
.shf-brief-strip a {
  color: rgba(255,255,255,0.9);
  text-decoration: underline;
  font-weight: 600;
}

/* --- Footer --- */
.shf-footer {
  background: var(--shf-text);
  color: rgba(255,255,255,0.7);
  padding: var(--shf-space-xl) var(--shf-space-md);
  font-size: var(--shf-size-sm);
}
.shf-footer-inner {
  max-width: var(--shf-max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--shf-space-xl);
}
.shf-footer a { color: rgba(255,255,255,0.85); }
.shf-footer a:hover { color: #fff; }
.shf-footer h4 { color: #fff; margin-bottom: var(--shf-space-sm); }
.shf-footer ul { display: flex; flex-direction: column; gap: var(--shf-space-xs); }
.shf-footer-about p { line-height: 1.5; }
.shf-footer-bottom {
  max-width: var(--shf-max-width);
  margin: var(--shf-space-lg) auto 0;
  padding-top: var(--shf-space-lg);
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

/* --- Landing Page Hero --- */
.shf-landing-hero {
  background: linear-gradient(135deg, var(--shf-primary-dark) 0%, var(--shf-primary) 100%);
  color: var(--shf-text-inverse);
  padding: var(--shf-space-section) var(--shf-space-md);
  text-align: center;
}
.shf-landing-hero h1 { color: var(--shf-text-inverse); font-size: 48px; }
.shf-landing-hero .shf-lead { color: rgba(255,255,255,0.85); max-width: 640px; margin: 0 auto var(--shf-space-lg); }
.shf-landing-hero .shf-hub-tag { color: rgba(255,255,255,0.7); }
.shf-landing-hero .shf-hero-note {
  font-size: var(--shf-size-sm);
  color: rgba(255,255,255,0.6);
  margin-top: var(--shf-space-lg);
}

/* Hub anchors on landing page */
.shf-hub-anchors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--shf-space-sm);
  margin-top: var(--shf-space-xl);
}
.shf-hub-anchor {
  padding: var(--shf-space-sm) var(--shf-space-lg);
  background: rgba(255,255,255,0.12);
  color: var(--shf-text-inverse);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--shf-border-radius);
  font-weight: 500;
  font-size: var(--shf-size-sm);
  min-height: var(--shf-touch-target);
  display: flex;
  align-items: center;
  transition: background 0.15s;
  text-decoration: none;
}
.shf-hub-anchor:hover {
  background: rgba(255,255,255,0.2);
  text-decoration: none;
  color: var(--shf-text-inverse);
}

/* --- Responsive --- */
@media (max-width: 1023px) {
  h1 { font-size: var(--shf-size-xl); }
  .shf-landing-hero h1 { font-size: 36px; }
  .shf-footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  :root {
    --shf-space-section: 40px;
  }
  h1 { font-size: var(--shf-size-lg); }
  .shf-landing-hero h1 { font-size: var(--shf-size-xl); }
  .shf-nav-toggle { display: flex; }
  .shf-nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--shf-bg-white);
    flex-direction: column;
    border-top: 1px solid var(--shf-border);
    box-shadow: var(--shf-shadow-md);
    padding: var(--shf-space-sm) 0;
  }
  .shf-nav-links.shf-nav-open { display: flex; }
  .shf-nav-links a {
    padding: var(--shf-space-md) var(--shf-space-lg);
    width: 100%;
  }
  .shf-cards-grid { grid-template-columns: 1fr; }
  .shf-tool-container { padding: var(--shf-space-lg); }
}

/* --- Print --- */
@media print {
  .shf-nav, .shf-brokerage-bar, .shf-brief-strip, .shf-footer,
  .shf-skip-link, .shf-btn-primary, .shf-btn-secondary { display: none; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .shf-tool-container, .shf-card { box-shadow: none; border: 1px solid #ccc; }
  a { color: #000; text-decoration: underline; }
  a::after { content: " (" attr(href) ")"; font-size: 10pt; }
  h1 { font-size: 24pt; }
  h2 { font-size: 18pt; }
}
