/* Velynoriva: Editorial Publication Stylesheet */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --font-serif: "Charter", "Bitstream Charter", "Sitka Text", "Cambria", Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Restrained Editorial Palette */
  --bg-color: #fafbfc;
  --surface-color: #ffffff;
  --text-main: #1e293b;       /* Slate 800 - dark charcoal */
  --text-muted: #64748b;      /* Slate 500 */
  --text-heading: #0f172a;    /* Slate 900 */
  --accent-color: #0f4c81;    /* Classic Deep Classic Cobalt/Indigo */
  --accent-hover: #0a3356;
  --accent-light: #e8f0f8;
  --border-color: #e2e8f0;    /* Slate 200 */
  --border-light: #f1f5f9;
  --success-color: #065f46;
  --success-bg: #ecfdf5;
  --error-color: #991b1b;
  --error-bg: #fef2f2;
  
  --max-width-site: 1180px;
  --max-width-prose: 74ch;    /* 65-80 ch optimal reading width */
  --header-height: 72px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

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

html {
  font-size: 16px;
  line-height: 1.7;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 10px;
  background: var(--text-heading);
  color: #fff;
  padding: 8px 16px;
  z-index: 1000;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 10px;
}

.container {
  width: 100%;
  max-width: var(--max-width-site);
  margin: 0 auto;
  padding: 0 24px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-heading);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1.25rem;
}

a {
  color: var(--accent-color);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Header & Navigation */
.site-header {
  background: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: 16px;
}

.brand-area {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-logo {
  text-decoration: none;
  display: flex;
  flex-direction: column;
}

.wordmark {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-heading);
  line-height: 1.1;
}

.tagline {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-shrink: 1;
  min-width: 0;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: clamp(8px, 1.2vw, 16px);
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav-list a {
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-main);
  padding: 6px 4px;
  position: relative;
  white-space: nowrap;
  display: inline-block;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-list a:hover {
  color: var(--accent-color);
}

.nav-list a.active {
  color: var(--accent-color);
  font-weight: 600;
  border-bottom: 2px solid var(--accent-color);
}

.header-search {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

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

.search-form-mini input {
  padding: 6px 36px 6px 12px;
  font-size: 0.84rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-color);
  width: 150px;
  transition: width 0.2s ease, border-color 0.2s ease;
}

.search-form-mini input:focus {
  width: 200px;
  border-color: var(--accent-color);
  outline: none;
  background: #fff;
}

.search-form-mini button {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.search-form-mini button:hover {
  color: var(--accent-color);
}

/* Hero Section */
.hero-section {
  background: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  padding: 56px 0 48px 0;
}

.hero-container {
  max-width: 860px;
}

.badge-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  background: var(--accent-light);
  color: var(--accent-color);
  border-radius: 20px;
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.18;
  margin-bottom: 18px;
}

.hero-lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  gap: 14px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--accent-color);
  color: #fff;
  border: 1px solid var(--accent-color);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--text-heading);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background: #fff;
  border-color: var(--text-muted);
  color: var(--text-heading);
}

/* Sections Common */
.section-header {
  margin: 54px 0 28px 0;
}

.section-tag {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-color);
  margin-bottom: 6px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.95rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 680px;
}

.header-split {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.view-all-link {
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

/* Featured & Article Grid Cards */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  margin-bottom: 30px;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-image-wrap {
  display: block;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
}

.card-image-wrap img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.card:hover .card-image-wrap img {
  transform: scale(1.02);
}

.card-content {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.8rem;
}

.category-tag {
  font-weight: 700;
  color: var(--accent-color);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

.category-tag:hover {
  text-decoration: underline;
}

.reading-time {
  color: var(--text-muted);
}

.card-title {
  font-size: 1.22rem;
  line-height: 1.35;
  margin-bottom: 10px;
  font-family: var(--font-serif);
}

.card-title a {
  color: var(--text-heading);
  text-decoration: none;
}

.card-title a:hover {
  color: var(--accent-color);
}

.card-excerpt {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
  margin-bottom: 18px;
  flex-grow: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  border-top: 1px solid var(--border-light);
  padding-top: 12px;
  color: var(--text-muted);
}

.read-more-link {
  font-weight: 600;
  text-decoration: none;
}

/* Category Grid on Home */
.categories-section {
  background: #f1f5f9;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 48px 0 56px 0;
  margin: 40px 0;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.category-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.category-name {
  font-size: 1.25rem;
  margin-bottom: 8px;
  font-family: var(--font-serif);
}

.category-name a {
  color: var(--text-heading);
  text-decoration: none;
}

.category-name a:hover {
  color: var(--accent-color);
}

.category-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 16px;
  flex-grow: 1;
}

.category-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  border-top: 1px solid var(--border-light);
  padding-top: 10px;
}

.article-count {
  font-weight: 600;
  color: var(--text-muted);
}

.cat-link {
  font-weight: 600;
  text-decoration: none;
}

/* Archive Call to Action */
.archive-cta {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 28px;
  text-align: center;
  margin-top: 20px;
}

.archive-cta p {
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 12px;
}

/* Breadcrumbs */
.breadcrumb {
  margin: 24px 0 16px 0;
  font-size: 0.85rem;
}

.breadcrumb ol {
  display: flex;
  list-style: none;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.breadcrumb li+li::before {
  content: "/";
  color: var(--text-muted);
  margin-right: 8px;
}

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

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

.breadcrumb li[aria-current="page"] {
  color: var(--text-heading);
  font-weight: 500;
}

/* Article Page Layout */
.article-page {
  padding-bottom: 72px;
}

.article-container {
  max-width: 860px;
}

.article-header {
  margin-bottom: 28px;
}

.article-meta-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.85rem;
}

.word-count {
  color: var(--text-muted);
}

.article-title {
  font-family: var(--font-serif);
  font-size: 2.7rem;
  line-height: 1.18;
  letter-spacing: -0.025em;
  margin-bottom: 18px;
}

.article-lead {
  font-size: 1.25rem;
  line-height: 1.55;
  color: #475569;
  margin-bottom: 20px;
}

.article-byline {
  font-size: 0.88rem;
  color: var(--text-muted);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.byline-details {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.author-name {
  font-weight: 600;
  color: var(--text-heading);
}

.separator {
  color: #cbd5e1;
}

/* Featured Figure */
.featured-figure {
  margin: 28px 0 36px 0;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.featured-img {
  width: 100%;
  height: auto;
  display: block;
}

.figure-caption {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 10px 16px;
  background: var(--surface-color);
  border-top: 1px solid var(--border-light);
}

.image-credit {
  font-style: italic;
}

/* Key Takeaways Box */
.takeaways-box {
  background: #f0f7ff;
  border-left: 4px solid var(--accent-color);
  border-radius: 0 8px 8px 0;
  padding: 22px 24px;
  margin-bottom: 24px;
}

.takeaways-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--accent-color);
}

.takeaways-header h3 {
  font-size: 1.12rem;
  margin-bottom: 0;
  color: var(--accent-color);
}

.takeaways-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.takeaways-list li {
  position: relative;
  padding-left: 24px;
  font-size: 0.98rem;
  line-height: 1.55;
  color: #1e293b;
}

.takeaways-list li::before {
  content: "✔";
  position: absolute;
  left: 0;
  color: var(--accent-color);
  font-weight: bold;
}

/* Table of Contents Box (Inline companion to Key Takeaways) */
.toc-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-left: 4px solid #64748b;
  border-radius: 0 8px 8px 0;
  padding: 22px 24px;
  margin-bottom: 40px;
}

.toc-box-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.toc-box-header svg {
  color: #64748b;
  flex-shrink: 0;
}

.toc-box-header h3 {
  font-size: 1.12rem;
  margin-bottom: 0;
  color: var(--text-heading);
  font-weight: 600;
}

.toc-box-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toc-box-list .toc-item a {
  display: inline-flex;
  align-items: baseline;
  font-size: 0.96rem;
  line-height: 1.5;
  color: var(--accent-color);
  text-decoration: none;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.toc-box-list .toc-item a:hover {
  background: var(--accent-light);
  color: var(--accent-hover);
  text-decoration: underline;
}

.toc-box-list .toc-item.level-2 > a::before {
  content: "→";
  margin-right: 8px;
  color: #94a3b8;
  font-weight: bold;
}

.toc-box-list .toc-item.level-3 {
  padding-left: 20px;
}

.toc-box-list .toc-item.level-3 > a {
  font-size: 0.90rem;
  color: #475569;
}

.toc-box-list .toc-item.level-3 > a::before {
  content: "•";
  margin-right: 8px;
  color: #cbd5e1;
}

.toc-box-list .toc-item a.active {
  background: var(--accent-light);
  color: var(--accent-color);
  font-weight: 600;
}

/* Article Prose Formatting (Full aligned width) */
.article-content {
  width: 100%;
  max-width: 100%;
  font-size: 1.08rem;
  line-height: 1.75;
  color: #1e293b;
}

.article-content h2 {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  margin-top: 2.2rem;
  margin-bottom: 1rem;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  scroll-margin-top: 88px;
}

.article-content h3 {
  font-size: 1.35rem;
  margin-top: 1.6rem;
  margin-bottom: 0.75rem;
  scroll-margin-top: 88px;
}

.article-content p {
  margin-bottom: 1.35rem;
}

.article-content ul, .article-content ol {
  margin-bottom: 1.4rem;
  padding-left: 1.7rem;
}

.article-content li {
  margin-bottom: 0.45rem;
}

.article-content strong {
  color: var(--text-heading);
  font-weight: 600;
}

.article-content blockquote {
  border-left: 4px solid var(--accent-color);
  padding: 12px 20px;
  margin: 1.8rem 0;
  background: #f8fafc;
  color: #334155;
  font-style: italic;
  border-radius: 0 6px 6px 0;
}

/* Responsive Table Styling */
.table-container {
  overflow-x: auto;
  margin: 2rem 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--surface-color);
  box-shadow: var(--shadow-sm);
}

.table-container:focus {
  outline: 2px solid var(--accent-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  text-align: left;
}

th {
  background: #f1f5f9;
  color: var(--text-heading);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
  line-height: 1.5;
}

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

tr:nth-child(even) td {
  background-color: #fbfcfe;
}

/* Code Blocks */
pre {
  background: #0f172a;
  color: #f8fafc;
  padding: 18px 20px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 1.6rem 0;
  position: relative;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  color: #0f172a;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.copy-code-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #334155;
  color: #f8fafc;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
}

pre:hover .copy-code-btn {
  opacity: 1;
}

/* FAQ Section */
.faq-section {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-color);
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 1.4rem;
}

.faq-item {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 18px 22px;
}

.faq-question {
  font-size: 1.12rem;
  margin-bottom: 8px;
  color: var(--text-heading);
}

.faq-answer {
  font-size: 0.95rem;
  color: #334155;
  line-height: 1.6;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

/* Authoritative References */
.sources-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.sources-intro {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.sources-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.source-item {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 0.9rem;
}

.source-title {
  font-weight: 600;
  text-decoration: underline;
}

.source-org {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.source-verified {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.source-note {
  margin-top: 6px;
  margin-bottom: 0;
  font-size: 0.85rem;
  color: #475569;
}

/* Related Guides Grid */
.related-section {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 2px solid var(--border-color);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.related-card .card-content {
  padding: 18px;
}

.related-card .card-title {
  font-size: 1.08rem;
}

/* Pagination */
.pagination-nav {
  margin: 40px 0 60px 0;
  display: flex;
  justify-content: center;
}

.pagination-list {
  list-style: none;
  display: flex;
  gap: 8px;
  align-items: center;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--surface-color);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

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

.pagination-link.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
  font-weight: 600;
}

/* Search Page */
.search-header {
  margin: 36px 0 28px 0;
  max-width: 720px;
}

.search-form-full {
  margin-top: 20px;
}

.search-input-group {
  display: flex;
  gap: 10px;
}

.search-input-group input {
  flex-grow: 1;
  padding: 12px 18px;
  font-size: 1.05rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: #fff;
}

.search-input-group input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.search-results-summary {
  margin-bottom: 24px;
  font-size: 1rem;
  color: var(--text-muted);
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 820px;
  margin-bottom: 60px;
}

.search-result-item {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 22px;
}

.result-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 0.8rem;
  margin-bottom: 8px;
}

.result-title {
  font-size: 1.35rem;
  font-family: var(--font-serif);
  margin-bottom: 8px;
}

.result-title a {
  color: var(--text-heading);
  text-decoration: none;
}

.result-title a:hover {
  color: var(--accent-color);
}

.result-snippet {
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.55;
  margin-bottom: 12px;
}

.suggestion-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin-top: 14px;
}

.suggestion-tags a {
  display: inline-block;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.88rem;
  text-decoration: none;
  color: var(--text-heading);
}

.suggestion-tags a:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

/* Standard Static Pages (About, Contact, Terms, etc.) */
.page-container {
  padding-bottom: 60px;
}

.standard-page {
  max-width: 780px;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 32px;
}

.page-title {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  margin-bottom: 12px;
}

.page-lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.page-body {
  font-size: 1.05rem;
  line-height: 1.7;
}

.page-body h2 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  margin-top: 2rem;
  margin-bottom: 0.8rem;
}

.page-body h3 {
  font-size: 1.2rem;
  margin-top: 1.4rem;
  margin-bottom: 0.6rem;
}

.principles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 24px 0;
}

.principle-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
}

.principle-card h3 {
  font-size: 1.05rem;
  margin-top: 0;
  margin-bottom: 8px;
  color: var(--accent-color);
}

.principle-card p {
  font-size: 0.92rem;
  color: #334155;
  margin-bottom: 0;
}

/* Forms & Alerts */
.contact-form {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 28px;
  margin: 28px 0;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 6px;
  color: var(--text-heading);
}

.form-group input, .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
}

.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.field-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.required {
  color: var(--error-color);
}

.alert {
  padding: 16px 20px;
  border-radius: 6px;
  margin-bottom: 24px;
}

.alert h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.alert-success {
  background: var(--success-bg);
  border: 1px solid #a7f3d0;
  color: var(--success-color);
}

.alert-error {
  background: var(--error-bg);
  border: 1px solid #fecaca;
  color: var(--error-color);
}

.contact-guidelines {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  margin-top: 32px;
}

.contact-guidelines h3 {
  font-size: 1.05rem;
  margin-top: 0;
  margin-bottom: 10px;
}

.contact-guidelines ul {
  padding-left: 20px;
  font-size: 0.92rem;
}

/* 404 Page */
.notfound-page {
  padding: 60px 0 80px 0;
  display: flex;
  justify-content: center;
}

.notfound-card {
  max-width: 640px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 44px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.status-code {
  font-size: 4rem;
  font-weight: 800;
  font-family: var(--font-serif);
  color: var(--accent-color);
  line-height: 1;
}

.notfound-title {
  font-size: 1.8rem;
  margin: 12px 0;
}

.notfound-lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 28px;
}

.notfound-search {
  margin-bottom: 32px;
}

.notfound-categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 16px 0 28px 0;
}

.category-pill {
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-heading);
}

.category-pill:hover {
  background: var(--accent-light);
  color: var(--accent-color);
  border-color: var(--accent-color);
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: #0f172a;
  color: #94a3b8;
  padding: 56px 0 40px 0;
  border-top: 1px solid #1e293b;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}

.wordmark-footer {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 800;
  color: #f8fafc;
  display: block;
  margin-bottom: 12px;
}

.footer-desc {
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 380px;
  margin-bottom: 18px;
}

.footer-meta {
  font-size: 0.8rem;
  color: #64748b;
}

.footer-heading {
  color: #f8fafc;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: #38bdf8;
}

/* Planning tools and visible maintenance */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.tools-preview-section {
  padding-top: 56px;
  padding-bottom: 22px;
}

.tool-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.tool-preview-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: 26px;
  overflow: hidden;
  background: linear-gradient(145deg, #ffffff 0%, #f4f8fc 100%);
  border: 1px solid #cbd9e7;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.tool-preview-card h3 {
  max-width: 280px;
  margin-top: 28px;
  font-family: var(--font-serif);
  font-size: 1.3rem;
}

.tool-preview-card h3 a {
  color: var(--text-heading);
  text-decoration: none;
}

.tool-preview-card h3 a:hover {
  color: var(--accent-color);
}

.tool-preview-card p {
  color: #475569;
  font-size: 0.94rem;
  line-height: 1.62;
}

.tool-preview-card .read-more-link {
  margin-top: auto;
}

.tool-preview-index {
  position: absolute;
  top: 14px;
  right: 20px;
  color: #d8e4ef;
  font-family: var(--font-serif);
  font-size: 3.3rem;
  font-weight: 800;
  line-height: 1;
}

.maintenance-strip {
  margin-top: 64px;
  padding: 42px 0;
  color: #dbeafe;
  background: #0f2740;
  border-top: 1px solid #173b60;
}

.maintenance-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
}

.maintenance-strip .section-tag {
  color: #7dd3fc;
}

.maintenance-strip h2 {
  margin-bottom: 6px;
  color: #ffffff;
  font-family: var(--font-serif);
  font-size: 1.7rem;
}

.maintenance-strip p {
  margin-bottom: 0;
  color: #cbd5e1;
}

.maintenance-links {
  display: flex;
  flex-shrink: 0;
  gap: 12px;
}

.maintenance-strip .btn-outline {
  color: #e0f2fe;
  border-color: #7dd3fc;
  background: transparent;
}

.tools-page {
  padding-bottom: 72px;
}

.tools-hero {
  max-width: 900px;
  padding: 32px 0 48px;
}

.tools-hero h1 {
  max-width: 760px;
  margin-top: 14px;
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 5vw, 3.7rem);
  letter-spacing: -0.035em;
}

.tools-hero > p {
  max-width: 760px;
  color: #475569;
  font-size: 1.1rem;
  line-height: 1.72;
}

.tool-privacy-note {
  padding: 14px 18px;
  background: #eef7f2;
  border: 1px solid #bbdbc9;
  border-radius: 7px;
  font-size: 0.93rem !important;
}

.tool-jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.tool-jump-nav a {
  padding: 8px 14px;
  color: var(--text-heading);
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.tool-jump-nav a:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
}

.tool-panel {
  margin: 30px 0 58px;
  padding: 34px;
  scroll-margin-top: 90px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.tool-panel-heading {
  display: grid;
  grid-template-columns: 58px minmax(0, 760px);
  gap: 20px;
  margin-bottom: 28px;
}

.tool-panel-heading h2 {
  margin: 3px 0 10px;
  font-family: var(--font-serif);
  font-size: clamp(1.65rem, 3vw, 2.25rem);
}

.tool-panel-heading p:last-child {
  color: #475569;
  line-height: 1.68;
}

.tool-number {
  color: #b8cce0;
  font-family: var(--font-serif);
  font-size: 2.7rem;
  font-weight: 800;
  line-height: 1;
}

.tool-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 28px;
  align-items: start;
}

.calculator-form,
.result-panel {
  padding: 24px;
  border-radius: 9px;
}

.calculator-form {
  background: #f8fafc;
  border: 1px solid var(--border-color);
}

.calculator-form fieldset {
  border: 0;
}

.calculator-form legend {
  margin-bottom: 18px;
  color: var(--text-heading);
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tool-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-heading);
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.4;
}

.tool-field input,
.tool-field select {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  color: var(--text-heading);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
  font-size: 0.94rem;
}

.tool-field input:focus,
.tool-field select:focus {
  outline: 3px solid var(--accent-light);
  border-color: var(--accent-color);
}

.tool-field small {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.tool-actions button,
.copy-result-btn {
  font-family: inherit;
  cursor: pointer;
}

.tool-error {
  margin: 16px 0 0;
  padding: 10px 12px;
  color: var(--error-color);
  background: var(--error-bg);
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 0.88rem;
}

.result-panel {
  color: #e2e8f0;
  background: #102a43;
  border: 1px solid #234e70;
}

.result-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.result-heading h3,
.result-explanation h4 {
  color: #ffffff;
}

.result-heading h3 {
  margin-bottom: 0;
  font-family: var(--font-serif);
  font-size: 1.35rem;
}

.result-eyebrow {
  margin-bottom: 4px;
  color: #7dd3fc;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.copy-result-btn {
  flex-shrink: 0;
  padding: 6px 9px;
  color: #e0f2fe;
  background: transparent;
  border: 1px solid #4f799e;
  border-radius: 5px;
  font-size: 0.76rem;
}

.copy-result-btn:hover {
  border-color: #7dd3fc;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: #365b7c;
  border: 1px solid #365b7c;
  border-radius: 7px;
}

.result-grid > div {
  min-height: 92px;
  padding: 14px;
  background: #163a59;
}

.result-grid dt {
  margin-bottom: 5px;
  color: #9fb8cf;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.result-grid dd {
  color: #ffffff;
  font-size: 1.03rem;
  font-weight: 700;
  line-height: 1.4;
}

.result-explanation {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #365b7c;
}

.result-explanation h4 {
  margin-bottom: 8px;
  font-size: 0.96rem;
}

.result-explanation p,
.result-explanation li {
  color: #cbd5e1;
  font-size: 0.88rem;
  line-height: 1.65;
}

.result-explanation p:last-child {
  margin-bottom: 0;
}

.result-explanation ul {
  padding-left: 20px;
}

.score-grid {
  display: grid;
  gap: 8px;
}

.score-grid > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 13px;
  background: #163a59;
  border-radius: 6px;
}

.score-grid span {
  color: #cbd5e1;
  font-size: 0.87rem;
}

.score-grid strong {
  color: #ffffff;
  white-space: nowrap;
}

.tool-notes {
  max-width: 900px;
  margin-top: 24px;
  padding: 18px 20px;
  background: #f8fafc;
  border-left: 4px solid #94a3b8;
  border-radius: 0 7px 7px 0;
}

.tool-notes h3 {
  margin-bottom: 7px;
  font-size: 1rem;
}

.tool-notes p {
  margin-bottom: 0;
  color: #475569;
  font-size: 0.88rem;
  line-height: 1.65;
}

.tools-guidance {
  margin-top: 64px;
  padding-top: 38px;
  border-top: 1px solid var(--border-color);
}

.article-tool-callout {
  margin-top: 44px;
  padding: 24px 26px;
  background: linear-gradient(135deg, #eef6fd 0%, #f8fbfe 100%);
  border: 1px solid #c8dbea;
  border-radius: 9px;
}

.article-tool-callout h2 {
  margin: 4px 0 8px;
  font-family: var(--font-serif);
  font-size: 1.45rem;
}

.article-tool-callout p {
  color: #475569;
}

.tool-secondary-link {
  display: inline-block;
  margin-left: 14px;
  font-size: 0.9rem;
  font-weight: 600;
}

.policy-meta,
.update-date {
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.update-entry {
  margin-bottom: 38px;
  padding: 24px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-color);
  border-radius: 0 8px 8px 0;
}

.update-entry h2 {
  margin-top: 0;
}

.update-entry li {
  margin-bottom: 8px;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }


  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .tool-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 16px;
    gap: 10px;
  }

  .site-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-list {
    gap: 14px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .featured-grid, .categories-grid, .articles-grid, .related-grid, .principles-grid, .tool-preview-grid {
    grid-template-columns: 1fr;
  }

  .maintenance-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .article-title {
    font-size: 2rem;
  }
}

@media (max-width: 640px) {
  .tool-panel {
    padding: 22px 16px;
  }

  .tool-panel-heading {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .field-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .calculator-form,
  .result-panel {
    padding: 18px 14px;
  }

  .maintenance-links,
  .hero-actions,
  .tool-actions {
    width: 100%;
    flex-direction: column;
  }

  .maintenance-links .btn,
  .hero-actions .btn,
  .tool-actions .btn {
    width: 100%;
    text-align: center;
  }

  .tool-secondary-link {
    display: block;
    margin: 14px 0 0;
  }
}

/* Labs, revision history, and accountability note (2026-11-03) */
.labs-preview-section {
  padding: 3rem 0 1rem;
}

.labs-preview-section .tool-preview-card {
  min-height: 0;
}

.labs-preview-section .tool-preview-card h3 {
  margin-top: 0;
  max-width: none;
}

.lab-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--success-color);
  background: var(--success-bg);
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  padding: 2px 10px;
  text-decoration: none;
}

.lab-badge:hover,
.lab-badge:focus-visible {
  text-decoration: underline;
}

.revision-section {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.revision-list {
  list-style: none;
  font-size: 0.92rem;
  color: var(--text-main);
}

.revision-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
}

.revision-list time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.accountability-note {
  margin-top: 2rem;
  padding: 14px 18px;
  background: var(--accent-light);
  border-left: 3px solid var(--accent-color);
  border-radius: 4px;
  font-size: 0.92rem;
}

.lab-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 1rem 0 2rem;
}

.lab-entry {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 18px 20px;
}

.lab-entry h3 {
  margin: 0.2rem 0 0.6rem;
  font-family: var(--font-serif);
}

.lab-entry p {
  margin: 0.4rem 0;
}

.lab-entry-category,
.lab-entry-guide {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Category reading paths (2026-11-03) */
.category-guide {
  max-width: var(--max-width-prose);
  margin: 0 0 2rem;
}

.category-intro {
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

.category-guide h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  margin: 1.5rem 0 0.75rem;
}

.reading-path {
  padding-left: 1.4rem;
}

.reading-path li {
  margin-bottom: 1rem;
}

.reading-path li > a {
  font-weight: 600;
  color: var(--text-heading);
}

.reading-path p {
  margin: 0.2rem 0 0;
  font-size: 0.95rem;
}

.reading-path .path-lab {
  color: var(--success-color);
  font-size: 0.88rem;
}

.category-tool {
  margin-top: 1rem;
  padding: 12px 16px;
  background: var(--accent-light);
  border-radius: 6px;
}
