/* ===========================
   SAHO Employee Portal — Design Tokens & Styles
   Brand: Teal #0097B2, Orange #FF5C00, Warm Cream #F4F1EB
   =========================== */

/* --- Type Scale --- */
:root {
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);

  /* Spacing (4px base) */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;

  /* Fonts */
  --font-display: 'General Sans', 'Inter', sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;
}

/* --- SAHO Color Palette (Light) --- */
:root, [data-theme="light"] {
  /* Surfaces — warm cream */
  --color-bg:             #F4F1EB;
  --color-surface:        #FFFFFF;
  --color-surface-2:      #F8F7F6;
  --color-surface-offset: #EDE9E2;
  --color-divider:        #D9D4CC;
  --color-border:         #D4D1CA;

  /* Text */
  --color-text:           #260A00;
  --color-text-muted:     #5A5449;
  --color-text-faint:     #9B9590;
  --color-text-inverse:   #FFFFFF;

  /* Primary — Teal */
  --color-primary:        #0097B2;
  --color-primary-hover:  #007A91;
  --color-primary-active: #006070;
  --color-primary-light:  #E6F5F8;

  /* Accent — Orange */
  --color-accent:         #FF5C00;
  --color-accent-hover:   #E05200;
  --color-accent-light:   #FFF0E6;

  /* Semantic */
  --color-success:        #437A22;
  --color-warning:        #B8860B;
  --color-error:          #C0392B;

  /* Hero gradient */
  --color-hero-start:     #0A4C5C;
  --color-hero-end:       #0097B2;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(38, 10, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(38, 10, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(38, 10, 0, 0.12);
}

/* --- Dark Mode --- */
[data-theme="dark"] {
  --color-bg:             #1A1816;
  --color-surface:        #232120;
  --color-surface-2:      #2B2927;
  --color-surface-offset: #1E1C1A;
  --color-divider:        #3A3735;
  --color-border:         #454240;

  --color-text:           #E8E4DE;
  --color-text-muted:     #A09A94;
  --color-text-faint:     #6B6660;
  --color-text-inverse:   #1A1816;

  --color-primary:        #3DB8CF;
  --color-primary-hover:  #5CC9DC;
  --color-primary-active: #2A9FB5;
  --color-primary-light:  #1A3035;

  --color-accent:         #FF7A33;
  --color-accent-hover:   #FF9555;
  --color-accent-light:   #352520;

  --color-success:        #6DAA45;
  --color-warning:        #D4A017;
  --color-error:          #E74C3C;

  --color-hero-start:     #0D2E35;
  --color-hero-end:       #0A4C5C;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:             #1A1816;
    --color-surface:        #232120;
    --color-surface-2:      #2B2927;
    --color-surface-offset: #1E1C1A;
    --color-divider:        #3A3735;
    --color-border:         #454240;
    --color-text:           #E8E4DE;
    --color-text-muted:     #A09A94;
    --color-text-faint:     #6B6660;
    --color-text-inverse:   #1A1816;
    --color-primary:        #3DB8CF;
    --color-primary-hover:  #5CC9DC;
    --color-primary-active: #2A9FB5;
    --color-primary-light:  #1A3035;
    --color-accent:         #FF7A33;
    --color-accent-hover:   #FF9555;
    --color-accent-light:   #352520;
    --color-success:        #6DAA45;
    --color-warning:        #D4A017;
    --color-error:          #E74C3C;
    --color-hero-start:     #0D2E35;
    --color-hero-end:       #0A4C5C;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
  }
}

/* ===========================
   LAYOUT
   =========================== */

.container {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

/* ===========================
   TEAL HERO HEADER
   =========================== */

.hero-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(135deg, var(--color-hero-start), var(--color-hero-end));
}

.hero-header-inner {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding: var(--space-2) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.hero-logo-area {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: #FFFFFF;
  flex-shrink: 0;
}

.hero-logo-icon {
  width: 28px;
  height: 28px;
}

.hero-logo-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #FFFFFF;
}

.hero-logo-text span {
  display: block;
  font-size: var(--text-xs);
  font-weight: 400;
  opacity: 0.7;
  letter-spacing: 0.02em;
}

/* Search group — two search bars side by side */
.hero-search-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  max-width: 520px;
  margin-left: auto;
}

.hero-search-wrapper {
  flex: 1;
  min-width: 0;
  position: relative;
}

.hero-search-wrapper .hero-search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.5);
  pointer-events: none;
  z-index: 1;
}

.hero-search-form {
  display: flex;
  align-items: center;
  position: relative;
}

.hero-search-form input {
  width: 100%;
  padding: 6px var(--space-8) 6px 36px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.12);
  color: #FFFFFF;
  font-size: var(--text-xs);
  backdrop-filter: blur(8px);
  transition: border-color var(--transition-interactive), background var(--transition-interactive);
}

.hero-search-form input::placeholder {
  color: rgba(255,255,255,0.5);
}

.hero-search-form input:focus {
  outline: none;
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.18);
}

.hero-search-submit {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px;
  border-radius: var(--radius-full);
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-search-submit:hover {
  color: #FFFFFF;
  background: rgba(255,255,255,0.12);
}

/* Header right-side actions */
.hero-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}

.theme-toggle {
  padding: var(--space-2);
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.7);
}

.theme-toggle:hover {
  background: rgba(255,255,255,0.1);
  color: #FFFFFF;
}

.mobile-menu-btn {
  display: none;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.7);
}

.mobile-menu-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #FFFFFF;
}

/* ===========================
   SECTION NAV BAR (below teal header)
   =========================== */

.section-nav {
  position: sticky;
  top: 52px; /* matches hero-header height */
  z-index: 40;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
}

.section-nav-inner {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
}

.section-nav-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.section-nav-tabs::-webkit-scrollbar { display: none; }

/* --- Quick Links dropdown --- */
.section-tab-dropdown {
  position: relative;
  z-index: 60;
}

.section-tab-dropdown .section-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dropdown-caret {
  transition: transform var(--transition-interactive);
  opacity: 0.5;
}

.section-tab-dropdown:hover .dropdown-caret {
  transform: rotate(180deg);
  opacity: 1;
}

/* Dropdown menu is appended to body via JS for z-index escape */
.section-tab-menu {
  position: fixed;
  min-width: 210px;
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2) 0;
  z-index: 9999;
}

.section-tab-menu a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition-interactive), color var(--transition-interactive);
}

.section-tab-menu a:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.section-tab-menu a svg {
  flex-shrink: 0;
  opacity: 0.5;
}

.section-tab-menu a:hover svg {
  opacity: 1;
  color: var(--color-primary);
}

/* Section tab links (used inside section-nav-tabs) */
.section-tab {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-interactive);
}

.section-tab:hover {
  color: var(--color-text);
}

.section-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* ===========================
   CONTENT SECTIONS
   =========================== */

main {
  position: relative;
  z-index: 1;
}

.content-section {
  padding: clamp(var(--space-4), 2.5vw, var(--space-8)) 0;
}

.content-section:not(:last-of-type) {
  border-bottom: 1px solid var(--color-divider);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  gap: var(--space-4);
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.section-header .see-all {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
}

.section-header .see-all:hover {
  color: var(--color-primary-hover);
}

/* ===========================
   NEWS CARDS
   =========================== */

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: var(--space-5);
}

.news-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-interactive), transform var(--transition-interactive);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.news-card-img {
  aspect-ratio: 16 / 7;
  overflow: hidden;
  background: var(--color-surface-offset);
}

.news-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-card-body {
  padding: var(--space-3) var(--space-4) var(--space-3);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.news-card-tag {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}

.news-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: var(--space-1);
  color: var(--color-text);
}

.news-card p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.45;
  flex: 1;
}

.news-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

/* ===========================
   SOP CARDS
   =========================== */

.sop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: var(--space-4);
}

.sop-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition-interactive), transform var(--transition-interactive);
}

.sop-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.sop-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.sop-icon svg {
  width: 16px;
  height: 16px;
}

.sop-card-content h3 {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.sop-card-content p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.45;
}

/* ===========================
   QUICK TOOLS GRID
   =========================== */

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: var(--space-4);
}

.tool-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-2);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-interactive), transform var(--transition-interactive);
}

.tool-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.tool-card-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: #FFFFFF;
}

.tool-card-icon.teal { background: var(--color-primary); }
.tool-card-icon.orange { background: var(--color-accent); }
.tool-card-icon.green { background: var(--color-success); }
.tool-card-icon.dark { background: var(--color-hero-start); }

.tool-card-icon svg {
  width: 18px;
  height: 18px;
}

.tool-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
}

.tool-card p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.45;
}

/* ===========================
   EMPLOYEE RESOURCES
   =========================== */

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: var(--space-5);
}

.resource-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-interactive);
}

.resource-card:hover {
  box-shadow: var(--shadow-md);
}

.resource-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.resource-card h3 svg {
  width: 20px;
  height: 20px;
  color: var(--color-primary);
  flex-shrink: 0;
}

.resource-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.resource-list li a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  margin: 0 calc(-1 * var(--space-3));
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-decoration: none;
}

.resource-list li a:hover {
  background: oklch(from var(--color-primary) l c h / 0.06);
  color: var(--color-primary);
}

.resource-list li a svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.5;
}

/* (Employee directory search is now in header — results open in a new tab) */

/* ===========================
   FOOTER
   =========================== */

.footer {
  background: var(--color-surface-2);
  border-top: 1px solid var(--color-divider);
  padding: var(--space-4) 0;
}

.footer-inner {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.footer-text {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.footer-text a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.footer-text a:hover {
  color: var(--color-primary);
}

/* ===========================
   RESPONSIVE
   =========================== */

/* Nav drawer — hidden by default on all sizes */
.nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  flex-direction: column;
  background: var(--color-bg);
  padding: var(--space-4);
}

.nav-drawer.open {
  display: flex;
}

.nav-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-divider);
  margin-bottom: var(--space-4);
}

.nav-drawer a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-2);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  border-radius: var(--radius-md);
}

.nav-drawer a:hover,
.nav-drawer a:active {
  background: oklch(from var(--color-primary) l c h / 0.08);
  color: var(--color-primary);
}

@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; }

  .hero-header-inner {
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
  }

  .hero-search-group {
    order: 3;
    flex-basis: 100%;
    max-width: 100%;
    margin-left: 0;
    flex-direction: column;
    gap: var(--space-1);
  }

  .section-nav {
    top: auto; /* let it flow naturally on mobile */
    position: relative;
  }

  .section-nav-inner {
    padding: 0 var(--space-3);
  }

  .section-nav-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .section-nav-tabs::-webkit-scrollbar { display: none; }

  /* On mobile, show dropdown on tap via JS — hover won't work */
  .section-tab-menu {
    position: fixed;
    top: auto;
    left: var(--space-3);
    right: var(--space-3);
    min-width: auto;
  }

  .sop-grid {
    grid-template-columns: 1fr;
  }

  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }
}

/* ===========================
   ANIMATIONS
   =========================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

.animate-in:nth-child(1) { animation-delay: 0ms; }
.animate-in:nth-child(2) { animation-delay: 60ms; }
.animate-in:nth-child(3) { animation-delay: 120ms; }
.animate-in:nth-child(4) { animation-delay: 180ms; }
.animate-in:nth-child(5) { animation-delay: 240ms; }
.animate-in:nth-child(6) { animation-delay: 300ms; }

/* ===========================
   LOADING STATES
   =========================== */

/* Loading states */
.loading-placeholder {
  padding: var(--space-8) var(--space-4);
  text-align: center;
  color: var(--color-text-faint);
  font-size: var(--text-sm);
}

/* ===========================
   SUBPAGE STYLES
   =========================== */

/* Breadcrumb */
.breadcrumb {
  margin-bottom: var(--space-4);
  padding-top: var(--space-3);
}

.breadcrumb ol {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1);
  list-style: none;
  font-size: var(--text-xs);
}

.breadcrumb li {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.breadcrumb a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-interactive);
}

.breadcrumb a:hover {
  color: var(--color-primary);
}

.breadcrumb-current {
  color: var(--color-text);
  font-weight: 500;
}

.breadcrumb-sep {
  color: var(--color-text-faint);
  flex-shrink: 0;
}

/* Subpage layout */
.subpage {
  padding: var(--space-4) 0 var(--space-8);
}

/* Subpage header */
.subpage-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-divider);
}

.subpage-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
}

.subpage-icon svg {
  width: 24px;
  height: 24px;
}

.subpage-icon.sop-theme {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.subpage-icon.news-theme {
  /* gradient set inline */
}

.subpage-icon.resource-theme {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

.subpage-header-text {
  flex: 1;
  min-width: 0;
}

.subpage-category {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  margin-bottom: var(--space-1);
}

.subpage-header-text h1 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: var(--space-2);
}

.subpage-description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}

.subpage-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Subpage body — rich content area */
.subpage-body {
  max-width: 760px;
  line-height: 1.7;
  color: var(--color-text);
}

.subpage-body h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-divider);
}

.subpage-body h3:first-child {
  margin-top: 0;
}

.subpage-body p {
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
  max-width: none;
}

.subpage-body ul,
.subpage-body ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-3);
}

.subpage-body li {
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
  max-width: none;
}

.subpage-body strong {
  font-weight: 600;
  color: var(--color-text);
}

.subpage-body table {
  width: 100%;
  margin: var(--space-4) 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-divider);
  font-size: var(--text-xs);
}

.subpage-body th {
  background: var(--color-surface-2);
  padding: var(--space-2) var(--space-3);
  text-align: left;
  font-weight: 600;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-divider);
}

.subpage-body td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-divider);
  color: var(--color-text-muted);
}

.subpage-body tr:last-child td {
  border-bottom: none;
}

.subpage-body tr:hover td {
  background: oklch(from var(--color-primary) l c h / 0.04);
}

/* Prev/Next navigation */
.subpage-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-divider);
}

.subpage-nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--color-text);
  transition: box-shadow var(--transition-interactive), transform var(--transition-interactive);
  max-width: 45%;
}

.subpage-nav-link:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.subpage-nav-link span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.3;
}

.subpage-nav-link span small {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.subpage-nav-link.next {
  margin-left: auto;
  text-align: right;
}

.subpage-nav-link svg {
  flex-shrink: 0;
  color: var(--color-text-faint);
}

/* Back button */
.subpage-back {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-divider);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-interactive);
}

.btn-back:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* List page header */
.list-page-header {
  margin-bottom: var(--space-6);
}

.list-page-header h1 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.list-page-header p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* List page grids */
.news-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: var(--space-5);
}

.sop-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: var(--space-4);
}

.resources-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: var(--space-5);
}

/* SOP card category pill */
.sop-card-category {
  display: inline-block;
  margin-top: var(--space-2);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Responsive subpage */
@media (max-width: 768px) {
  .subpage-header {
    flex-direction: column;
    gap: var(--space-3);
  }

  .subpage-icon {
    width: 40px;
    height: 40px;
  }

  .subpage-icon svg {
    width: 20px;
    height: 20px;
  }

  .subpage-header-text h1 {
    font-size: var(--text-lg);
  }

  .subpage-nav {
    flex-direction: column;
    gap: var(--space-3);
  }

  .subpage-nav-link {
    max-width: 100%;
  }

  .subpage-nav-link.next {
    flex-direction: row-reverse;
    text-align: left;
  }

  .subpage-body table {
    display: block;
    overflow-x: auto;
  }
}

/* Sign-in bar */
.auth-bar {
  background: var(--color-hero-start);
  color: #fff;
  padding: var(--space-2) var(--space-4);
  text-align: center;
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}

.auth-bar button {
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  background: #fff;
  color: var(--color-hero-start);
  font-weight: 600;
  font-size: var(--text-xs);
  cursor: pointer;
  border: none;
}

.auth-bar button:hover {
  background: rgba(255,255,255,0.9);
}

.auth-bar.hidden {
  display: none;
}
