/*
 * ALGORITHM BLOG UNIFIED STYLESHEET
 * Editorial-inspired design for technical reference content
 * Theme: Cream/Navy/Orange - Matches ChaiWithJai brand
 *
 * Aesthetic: Premium Technical Journal
 * - Clean, spacious layouts with generous whitespace
 * - Strong typographic hierarchy
 * - Navy accents with orange highlights
 * - Card-based organization for scanability
 */

/* === GOOGLE FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,400&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* === DESIGN TOKENS === */
:root {
  /* Brand Colors */
  --cream: #f8f6f3;
  --cream-dark: #f0ede8;
  --navy: #001666;
  --navy-light: #0a2472;
  --orange: #ff5900;
  --orange-light: #ff7a33;
  --slate: #2a3132;
  --light-slate: #5f6566;
  --white: #ffffff;

  /* Semantic Colors */
  --bg-primary: var(--cream);
  --bg-secondary: var(--white);
  --bg-elevated: var(--white);
  --bg-header: var(--navy);
  --text-primary: var(--slate);
  --text-secondary: var(--light-slate);
  --text-heading: var(--navy);
  --accent: var(--orange);

  /* Difficulty Colors - Fix CDX-002: More distinct badge colors */
  --easy-bg: #d4edda;
  --easy-text: #155724;
  --easy-border: #28a745;
  --medium-bg: #fff3cd;
  --medium-text: #856404;
  --medium-border: #ffc107;
  --hard-bg: #f8d7da;
  --hard-text: #721c24;
  --hard-border: #dc3545;

  /* Typography */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 22, 102, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 22, 102, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 22, 102, 0.12);
  --shadow-card: 0 2px 8px rgba(0, 22, 102, 0.06);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

/* === BASE RESET === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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

/* === TYPOGRAPHY BASE === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-heading);
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }
h4 { font-size: 1.125rem; }

p {
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--orange-light);
}

/* === LAYOUT === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-md);
  }
}

/* ============================================
   HEADER STYLES (for blog pages)
   ============================================ */

.main-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(248, 246, 243, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 22, 102, 0.08);
  padding: var(--space-md) 0;
}

.main-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.logo:hover {
  color: var(--accent);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.main-nav a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9375rem;
  padding: var(--space-xs) 0;
  position: relative;
  transition: color var(--transition-fast);
}

.main-nav a:hover,
.main-nav a.active-link {
  color: var(--navy);
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition-base);
}

.main-nav a:hover::after,
.main-nav a.active-link::after {
  width: 100%;
}

.nav-cta {
  background: var(--accent) !important;
  color: var(--white) !important;
  padding: var(--space-sm) var(--space-md) !important;
  border-radius: var(--radius-md);
  font-weight: 600 !important;
  font-size: 0.875rem !important;
  transition: all var(--transition-fast) !important;
}

.nav-cta:hover {
  background: var(--orange-light) !important;
  transform: translateY(-1px);
}

.nav-cta::after {
  display: none !important;
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: var(--space-xs);
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--navy);
  margin: 3px 0;
  border-radius: 2px;
  transition: var(--transition-fast);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .main-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--cream);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-xl);
  }

  .main-nav.active {
    display: flex;
  }

  .main-nav a {
    font-size: 1.25rem;
  }
}

/* ============================================
   BLOG INDEX PAGE
   ============================================ */

/* Hero Section */
.blog-hero {
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-dark) 100%);
  padding: var(--space-3xl) 0 var(--space-2xl);
  text-align: center;
  border-bottom: 1px solid rgba(0, 22, 102, 0.08);
}

.blog-hero .subtitle {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-md);
}

.blog-hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--navy);
  margin-bottom: var(--space-lg);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.blog-hero .description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Stats Overview */
.stats-overview {
  background: var(--white);
  padding: var(--space-xl) 0;
  border-bottom: 1px solid rgba(0, 22, 102, 0.08);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-lg);
  text-align: center;
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-box {
  padding: var(--space-md);
}

.stat-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--navy);
  display: block;
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: var(--space-xs);
  font-weight: 500;
}

/* Filter Bar */
.filter-bar {
  background: var(--cream);
  padding: var(--space-lg) 0;
  position: sticky;
  top: 60px;
  z-index: 100;
  border-bottom: 1px solid rgba(0, 22, 102, 0.08);
}

.filter-buttons {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: center;
}

/* Fix BLG-004: Mobile horizontal scroll for filter pills */
@media (max-width: 768px) {
  .filter-buttons {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-sm);
    scrollbar-width: thin;
    justify-content: flex-start;
  }

  .filter-buttons::-webkit-scrollbar {
    height: 4px;
  }

  .filter-buttons::-webkit-scrollbar-thumb {
    background: var(--light-slate);
    border-radius: var(--radius-full);
  }

  .filter-btn {
    scroll-snap-align: start;
    flex-shrink: 0;
    white-space: nowrap;
  }
}

.filter-btn {
  padding: var(--space-sm) var(--space-lg);
  border: 2px solid var(--navy);
  background: var(--white);
  color: var(--navy);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  background: var(--navy);
  color: var(--white);
}

.filter-btn.active {
  background: var(--navy);
  color: var(--white);
}

/* Algorithm Grid */
.algorithm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-xl);
  padding: var(--space-2xl) 0;
}

@media (max-width: 480px) {
  .algorithm-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
}

/* Algorithm Cards */
.algorithm-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-xl);
  transition: all var(--transition-base);
  border-left: 4px solid var(--navy);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.algorithm-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--navy) 0%, var(--accent) 100%);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.algorithm-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.algorithm-card:hover::before {
  opacity: 1;
}

.algorithm-card.easy { border-left-color: var(--easy-border); }
.algorithm-card.medium { border-left-color: var(--medium-border); }
.algorithm-card.hard { border-left-color: var(--hard-border); }

.algorithm-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-md);
  gap: var(--space-md);
}

.algorithm-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  line-height: 1.3;
}

.difficulty-badge {
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.difficulty-badge.easy {
  background: var(--easy-bg);
  color: var(--easy-text);
}

.difficulty-badge.medium {
  background: var(--medium-bg);
  color: var(--medium-text);
}

.difficulty-badge.hard {
  background: var(--hard-bg);
  color: var(--hard-text);
}

.algorithm-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin: var(--space-md) 0;
}

.meta-item {
  display: flex;
  flex-direction: column;
}

.meta-label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.meta-value {
  color: var(--navy);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  margin-top: 2px;
}

.algorithm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}

.tag {
  padding: var(--space-xs) var(--space-sm);
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.algorithm-analogy {
  background: var(--cream);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-top: var(--space-md);
  font-size: 0.9375rem;
  color: var(--text-secondary);
  font-style: italic;
  border-left: 3px solid var(--accent);
}

/* ============================================
   BLOG POST PAGE
   ============================================ */

/* Post Header */
.blog-post-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  padding: var(--space-3xl) 0 var(--space-2xl);
  color: var(--white);
}

.blog-post-header .container {
  max-width: 900px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  font-size: 0.9375rem;
  margin-bottom: var(--space-xl);
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: var(--accent);
}

.blog-post-header .difficulty-badge {
  margin-bottom: var(--space-md);
}

.interview-badge {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  margin-left: var(--space-sm);
  display: inline-block;
}

.blog-post-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  color: var(--white);
  margin: var(--space-md) 0;
  line-height: 1.15;
}

.blog-post-header p {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.7;
  margin: 0;
}

.blog-post-header .tag {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.3);
  margin-right: var(--space-sm);
  margin-top: var(--space-md);
}

/* Post Content Container */
.blog-post-content {
  max-width: 840px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-xl);
  background: var(--cream);
}

@media (max-width: 768px) {
  .blog-post-content {
    padding: var(--space-xl) var(--space-md);
  }
}

/* Section Blocks */
.section-block {
  background: var(--white);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-xl);
}

@media (max-width: 768px) {
  .section-block {
    padding: var(--space-lg);
  }
}

.section-block h2 {
  font-family: var(--font-display);
  color: var(--navy);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 3px solid var(--accent);
  font-size: 1.5rem;
}

.section-block h3 {
  font-family: var(--font-display);
  color: var(--navy);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
  font-size: 1.25rem;
}

.section-block h4 {
  color: var(--slate);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
  font-size: 1rem;
  font-weight: 600;
}

.section-block p {
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.85;
  margin-bottom: var(--space-md);
  max-width: 70ch;
}

.section-block ul,
.section-block ol {
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: var(--space-md);
  padding-left: var(--space-xl);
}

.section-block li {
  margin-bottom: var(--space-sm);
}

.section-block > *:last-child {
  margin-bottom: 0;
}

.section-block strong {
  color: var(--navy);
  font-weight: 600;
}

.section-block a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.section-block a:hover {
  color: var(--navy);
}

/* Table of Contents Block */
.section-block.toc-block {
  background: var(--cream);
}

.section-block.toc-block h3 {
  margin-top: 0;
  color: var(--navy);
}

.section-block.toc-block ol {
  line-height: 2;
}

.section-block.toc-block ol a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.section-block.toc-block ol a:hover {
  color: var(--navy);
  text-decoration: underline;
}

/* Code Blocks */
.code-block {
  background: #1a1b26;
  color: #c0caf5;
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: var(--space-lg) 0;
  box-shadow: var(--shadow-md);
  border: 1px solid #2a2b36;
}

.code-block code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
  white-space: pre;
  display: block;
  color: inherit;
  background: transparent;
  padding: 0;
  border: none;
}

/* Inline code */
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--cream-dark);
  color: var(--navy);
  padding: 0.125em 0.375em;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 22, 102, 0.1);
}

@media (max-width: 768px) {
  .code-block {
    padding: var(--space-md);
  }

  .code-block code {
    font-size: 0.8125rem;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* Analogy Box */
.analogy-box {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  border-left: 5px solid var(--accent);
  margin: var(--space-xl) 0;
}

.analogy-box h3 {
  color: #92400e;
  margin-top: 0;
  margin-bottom: var(--space-md);
  font-size: 1.25rem;
}

.analogy-box p,
.analogy-box strong {
  color: #78350f;
  line-height: 1.85;
  font-size: 1rem;
}

.analogy-box strong {
  font-weight: 700;
}

/* Two Sum readability fixes and reusable complexity styles */
.complexity-list {
  margin: var(--space-md) 0 var(--space-lg) 0;
  padding-left: 1.2rem;
}

.complexity-list li {
  margin-bottom: 0.65rem;
}

.complexity-subheading {
  color: var(--navy);
  font-weight: 700;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.complexity-code {
  margin: var(--space-sm) 0 var(--space-lg) 0;
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  background: #111827;
  color: #dbe7ff;
  overflow-x: auto;
  font-family: var(--font-mono);
  line-height: 1.7;
  box-shadow: var(--shadow-md);
}

.complexity-code code {
  background: transparent;
  border: none;
  color: inherit;
  padding: 0;
  font-size: 0.9rem;
}

.complexity-table {
  margin-top: var(--space-md);
}

/* Tables */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: var(--space-lg) 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  font-size: 0.9375rem;
}

thead {
  background: var(--navy);
}

thead th {
  padding: var(--space-md);
  text-align: left;
  color: var(--white);
  font-weight: 600;
  font-size: 0.875rem;
}

tbody tr {
  background: var(--white);
  transition: background var(--transition-fast);
}

tbody tr:nth-child(even) {
  background: var(--cream);
}

tbody tr:hover {
  background: var(--cream-dark);
}

tbody td {
  padding: var(--space-md);
  border-bottom: 1px solid rgba(0, 22, 102, 0.08);
  color: var(--text-primary);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Interview Section */
.section-block[style*="background: linear-gradient(135deg, #dbeafe"] {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
  border-left: 5px solid #1e40af;
}

.section-block[style*="background: linear-gradient(135deg, #dbeafe"] h2 {
  color: #1e40af !important;
  border-bottom-color: #60a5fa;
}

/* Key Takeaways Section */
.section-block[style*="background: linear-gradient(135deg, #d1fae5"] {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%) !important;
  border-left: 5px solid #059669;
}

.section-block[style*="background: linear-gradient(135deg, #d1fae5"] h2 {
  color: #065f46 !important;
  border-bottom-color: #10b981;
}

/* ============================================
   BRIEFCASE PAGE POLISH
   ============================================ */

.briefcase-page {
  --briefcase-accent: var(--accent);
  --briefcase-accent-soft: rgba(255, 89, 0, 0.16);
  --briefcase-pill-solid-start: var(--briefcase-accent);
  --briefcase-pill-solid-end: var(--briefcase-accent);
  --briefcase-pill-text: var(--white);
}

.briefcase-page .blog-post-header {
  position: relative;
  overflow: hidden;
}

.briefcase-page .blog-post-header::after {
  content: '';
  position: absolute;
  inset: auto -12% -28% auto;
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  background: radial-gradient(circle, var(--briefcase-accent-soft) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}

.briefcase-page .blog-post-header .container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-md);
}

.briefcase-page .briefcase-back-link {
  margin-bottom: var(--space-sm);
  padding: 0.7rem 1rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--white);
  box-shadow: 0 10px 24px rgba(0, 22, 102, 0.14);
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
}

.briefcase-page .briefcase-back-link:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.briefcase-page .briefcase-back-link__icon {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.9rem;
  line-height: 1;
}

.briefcase-page .briefcase-header-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.briefcase-page .briefcase-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  max-width: 100%;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  font-size: 0.8125rem;
  line-height: 1.3;
}

.briefcase-page .briefcase-pill--brand {
  background: linear-gradient(135deg, var(--briefcase-pill-solid-start) 0%, var(--briefcase-pill-solid-end) 100%);
  color: var(--briefcase-pill-text);
  box-shadow: 0 8px 22px rgba(0, 22, 102, 0.16);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.briefcase-page .briefcase-pill--ghost {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
  text-wrap: balance;
}

.briefcase-page .briefcase-summary-meta {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.briefcase-page .briefcase-takeaways {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--white) 0%, var(--cream) 100%);
  border: 1px solid rgba(0, 22, 102, 0.08);
  border-left: 5px solid var(--briefcase-accent);
  box-shadow: 0 18px 40px rgba(0, 22, 102, 0.08);
}

.briefcase-page .briefcase-takeaways::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--briefcase-accent) 0%, rgba(255, 255, 255, 0.96) 100%);
  opacity: 0.7;
}

.briefcase-page .briefcase-takeaways h2 {
  color: var(--navy);
  border-bottom-color: var(--briefcase-accent-soft);
}

.briefcase-page .briefcase-takeaways ul {
  font-size: 1.05rem;
  line-height: 2;
}

@media (max-width: 640px) {
  .briefcase-page .briefcase-back-link {
    width: 100%;
    justify-content: center;
  }

  .briefcase-page .briefcase-header-meta {
    width: 100%;
  }

  .briefcase-page .briefcase-pill--stack-mobile {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

/* Buttons */
.btn {
  display: inline-block;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-md);
  font-weight: 600;
  text-align: center;
  transition: all var(--transition-fast);
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-family: var(--font-body);
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--orange-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 89, 0, 0.3);
}

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

.main-footer {
  background: var(--navy);
  color: var(--white);
  padding: var(--space-2xl) 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }
}

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

.footer-brand .logo {
  color: var(--white);
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
  display: block;
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.footer-section {
  min-width: 0;
}

.footer-heading {
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
}

.footer-links-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-links-column a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9375rem;
  transition: color var(--transition-fast);
  text-decoration: none;
}

.footer-links-column a:hover {
  color: var(--accent);
}

.footer-bottom {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.footer-bottom p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
  margin: 0;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center { text-align: center; }
.text-gold { color: var(--accent); }
.text-navy { color: var(--navy); }

/* ============================================
   ACCESSIBILITY
   ============================================ */

a:focus,
button:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  .main-header,
  .main-footer,
  .back-link,
  .btn,
  .filter-bar {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .section-block {
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }

  .code-block {
    background: #f5f5f5 !important;
    color: #333 !important;
    border: 1px solid #ccc;
  }
}
