:root {
  --mahogany: #4a2e2a;
  --steel-grey: #475569;
  --safety-orange: #f97316;
  --off-white: #fafafa;
  --pure-white: #ffffff;

  --primary: var(--mahogany);
  --secondary: var(--safety-orange);
  --accent: var(--steel-grey);
  --bg: var(--off-white);
  --text: #111827;
  --text-muted: #4b5563;
  --glass: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(0, 0, 0, 0.08);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Playfair Display', serif;
  --card-bg: white;
}

body.dark-mode {
  --bg: #121212;
  /* Very dark grey, almost black */
  --text: #e0e0e0;
  --text-muted: #a0a0a0;
  --glass: rgba(18, 18, 18, 0.95);
  --glass-border: rgba(255, 255, 255, 0.1);
  --mahogany: #E6B8B8;
  /* Lighter mahogany for contrast */
  --steel-grey: #b0bec5;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --card-bg: #1e1e1e;
  --off-white: #121212;
  /* Override off-white background */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

ul {
  list-style: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Minimalist Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: var(--glass);
  border-bottom: 1px solid var(--glass-border);
  z-index: 1000;
  display: flex;
  align-items: center;
}

nav {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  /* Ensure spacing between logo, links, and button */
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 3rem;
  /* Spacing between logo and desktop nav */
}

.logo span {
  color: var(--secondary);
}

.nav-links {
  display: flex;
  gap: 3rem;
  /* Generous spacing for clear navigation */
}

.nav-links a {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.nav-links a:hover {
  color: var(--primary);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  cursor: pointer;
  z-index: 1100;
}

.menu-toggle span {
  display: block;
  width: 25px;
  height: 2px;
  background-color: var(--primary);
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* Hero Section */
.hero {
  position: relative;
  padding: 200px 0 160px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: white;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  /* Dark overlay for readability */
  z-index: 1;
}

.hero .container {
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: 5rem;
  line-height: 1.05;
  font-weight: 900;
  color: white;
  margin-bottom: 2rem;
  letter-spacing: -0.03em;
  animation: fadeUp 0.8s ease-out;
}

.hero p {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 700px;
  margin: 0 auto 2.5rem;
  animation: fadeUp 1s ease-out;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  /* Compact professional sizing */
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.7rem;
  /* Elegant smaller font */
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  /* Reset border for buttons */
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: #3a2421;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--secondary);
  color: white;
}

.btn-secondary:hover {
  background-color: #e6620e;
  transform: translateY(-1px);
}

/* Section Styling */
.section {
  padding: 100px 0;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 3rem;
  text-align: center;
}

/* Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-10px);
}

/* Subpage Hero */
.subhero {
  padding: 140px 0 60px;
  background: var(--primary);
  color: white;
  text-align: center;
}

.subhero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.subhero p {
  opacity: 0.8;
  max-width: 600px;
  margin: 0 auto;
}

/* Article Typography */
.article-header {
  text-align: center;
  padding: 160px 0 80px;
  background: var(--bg);
  border-bottom: 1px solid var(--glass-border);
}

.article-header .category-label {
  color: var(--safety-orange);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.article-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  max-width: 900px;
  margin: 0 auto 1.5rem;
  line-height: 1.1;
  color: var(--mahogany);
}

.article-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}

.article-content {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text);
}

.article-content p {
  margin-bottom: 2rem;
}

.article-content h2,
.article-content h3 {
  font-family: var(--font-serif);
  color: var(--mahogany);
  margin-top: 4rem;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.article-content blockquote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.8rem;
  color: var(--steel-grey);
  border-left: 4px solid var(--secondary);
  padding: 1rem 0 1rem 2.5rem;
  margin: 4rem -2.5rem;
  line-height: 1.4;
}

.article-hero-img {
  width: 100%;
  max-height: 550px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 4rem;
  box-shadow: var(--shadow);
}

.article-author-card {
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 2rem;
  margin: 4rem 0;
  border: 1px solid var(--glass-border);
}

.article-author-card img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
}

.article-author-card .author-info h4 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.article-author-card .author-info p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 992px) {
  .nav-links {
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.2rem;
  }

  .hero p {
    font-size: 1.1rem;
  }

  .logo {
    font-size: 1.1rem;
    margin-right: auto;
    /* Push other elements to the right */
  }

  /* Mobile Nav Logic */
  .menu-toggle {
    display: block;
    margin-right: 1.5rem;
    /* Space between toggle and button */
  }

  .nav-links {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
    transform: translateY(-150%);
    transition: transform 0.4s ease;
    z-index: 1000;
  }

  .nav-links.active {
    transform: translateY(0);
  }

  /* Extra compact button for mobile header */
  header .btn {
    padding: 0.4rem 1rem;
    font-size: 0.65rem;
  }

  /* Adjust grids for mobile */
  .grid {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 0 1.5rem;
  }

  .section {
    padding: 60px 0;
  }
}

/* Article Card Hover Effect */
.grid-sidebar {
  gap: 4rem;
}

@media (min-width: 769px) {
  .grid-sidebar {
    grid-template-columns: 2fr 1fr;
  }

  .grid-footer {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.article-card {
  transition: all 0.3s ease;
  padding: 1.5rem;
  border-radius: 12px;
  background: white;
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
}

.article-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  background: #f5f5f5;
}

.article-card:hover {
  background: white;
  box-shadow: var(--shadow);
  transform: translateY(-5px);
}

/* Locked Card Styling */
.card.locked {
  position: relative;
  overflow: hidden;
}

/* Blur removed - content is visible */
.card.locked .card-content {
  filter: none;
  pointer-events: auto;
  user-select: auto;
}

/* Lock Overlay turned into Lock Footer */
.lock-overlay {
  position: relative;
  /* Changed from absolute */
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
  display: flex;
  flex-direction: row;
  /* Horizontal layout for "on the side" feel */
  justify-content: space-between;
  align-items: center;
  background: none;
  /* Remove overlay background */
  z-index: 10;
  margin-top: auto;
  /* Push to bottom of card */
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
}

.lock-icon {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 0;
  margin-right: 0.5rem;
}

/* Ensure the button looks good in this context */
.lock-overlay .btn {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}


/* Modal Styling */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
}

.modal-content {
  background-color: #fefefe;
  padding: 2.5rem;
  border: 1px solid #888;
  width: 100%;
  max-width: 450px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal.show .modal-content {
  transform: translateY(0);
}

.close-modal {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  top: 15px;
  right: 20px;
  line-height: 1;
}

.close-modal:hover,
.close-modal:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

.modal-header h2 {
  font-family: var(--font-serif);
  color: var(--mahogany);
  margin-bottom: 0.5rem;
}

.modal-body form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-group input {
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 1rem;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(74, 46, 42, 0.1);
}

.modal-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Print Optimization */
@media print {

  header,
  footer,
  .menu-toggle,
  .btn,
  .subhero,
  .sidebar,
  aside,
  .search-container {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
  }

  .grid {
    display: block !important;
  }

  .article-content {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  a {
    text-decoration: none !important;
    color: black !important;
  }

  /* Ensure text is black for readability */
  p,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  li {
    color: black !important;
  }
}

/* Dark Mode Toggle Button Styling */
#theme-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.5rem;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#theme-toggle:hover {
  color: var(--primary);
}

/* Article Featured Styling */
.article-card.featured {
  grid-column: span 2;
  display: flex;
  flex-direction: row !important;
  /* Side by side layout for featured */
  align-items: center;
  gap: 2rem;
}

.article-card.featured img {
  width: 60%;
  aspect-ratio: 16/9;
  margin-bottom: 0 !important;
}

.article-card.featured .content-wrapper {
  width: 40%;
}

@media (max-width: 768px) {
  .article-card.featured {
    grid-column: span 1;
    flex-direction: column !important;
  }

  .article-card.featured img,
  .article-card.featured .content-wrapper {
    width: 100%;
  }
}

/* BLUF Box Styling */
.bluf-box {
  background: #f8f9fa;
  border-left: 4px solid var(--safety-orange);
  padding: 1.5rem;
  margin-bottom: 2rem;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
}

.bluf-box strong {
  color: var(--mahogany);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.85rem;
  display: block;
  margin-bottom: 0.5rem;
}



/* Table Styling for Articles */
.article-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 3.5rem 0;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: table;
  /* Reset to table for better layout, wrapper handles scroll */
}

/* Container for responsive tables */
.table-wrapper {
  overflow-x: auto;
  margin: 3rem 0;
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
}

.article-content th {
  background: var(--mahogany);
  color: white;
  text-align: left;
  padding: 1.5rem 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.8rem;
  border: none;
}

.article-content td {
  padding: 1.25rem;
  border-bottom: 1px solid #f0f0f0;
  line-height: 1.6;
  color: var(--text);
  vertical-align: top;
  background: white;
}

.article-content td:first-child {
  font-weight: 700;
  color: var(--mahogany);
  width: 200px;
  min-width: 160px;
}

.article-content tr:last-child td {
  border-bottom: none;
}

.article-content tr:nth-child(even) td {
  background: #fafafa;
}

/* --- Share & Related --- */
.share-section {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--glass-border);
}

.share-section h4 {
  font-family: var(--font-serif);
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.share-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.share-btn {
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.share-btn.linkedin {
  background: #0077b5;
  color: white;
}

.share-btn.x {
  background: #000000;
  color: white;
}

.related-section {
  margin-top: 6rem;
}

.related-section h3 {
  font-family: var(--font-serif);
  color: var(--mahogany);
  margin-bottom: 2.5rem;
  border-bottom: 2px solid var(--safety-orange);
  display: inline-block;
}

.back-to-articles {
  margin-top: 5rem;
  text-align: center;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* --- Premium Resource States --- */
.resource-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.resource-card.locked .resource-status {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--mahogany);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  z-index: 2;
}

.resource-card.locked .content-wrapper {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
  opacity: 0.6;
}

.resource-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
  padding: 2rem;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.resource-card.locked .resource-overlay {
  opacity: 1;
  pointer-events: auto;
}

.resource-overlay h4 {
  color: var(--mahogany);
  margin-bottom: 1rem;
  font-family: var(--font-serif);
}

.resource-card.unlocked-anim {
  animation: unlockSuccess 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes unlockSuccess {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
    border-color: var(--safety-orange);
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.3);
  }

  100% {
    transform: scale(1);
  }
}