/* ==========================================================================
   Base Reset, Editorial Typography & Page Layout
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.72;
  color: var(--text-body);
  background-color: var(--bg-primary);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

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

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent-emerald);
  outline-offset: 3px;
}

h1, h2, h3, h4 {
  margin: 0 0 0.75rem;
  color: var(--text-heading);
  line-height: 1.24;
  letter-spacing: -0.02em;
  font-weight: 700;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p {
  margin: 0 0 1rem;
}

ul, ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}

/* Accessibility Skip Link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.75rem;
  z-index: 9999;
  padding: 0.65rem 1.2rem;
  background: var(--text-heading);
  color: var(--text-inverse);
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.skip-link:focus {
  left: 1rem;
}

/* Containers & Sections */
.container {
  width: min(100% - 2.4rem, var(--container-max));
  margin-inline: auto;
}

.container--narrow {
  width: min(100% - 2.4rem, var(--container-narrow));
  margin-inline: auto;
}

.section {
  padding-block: var(--section-py);
  position: relative;
}

.section--alt {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, #F7FBFA 100%);
  border-block: 1px solid rgba(220, 233, 232, 0.72);
}

.section-header {
  max-width: 720px;
  margin-inline: auto;
  text-align: center;
  margin-bottom: clamp(2.2rem, 4vw, 3.4rem);
}

.section-header--left {
  margin-inline: 0;
  text-align: left;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.9rem;
  margin-bottom: 0.9rem;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-emerald);
  background: rgba(96, 223, 193, 0.14);
  border: 1px solid rgba(67, 203, 176, 0.34);
  border-radius: var(--radius-pill);
}

.section-title {
  font-size: var(--text-3xl);
  margin-bottom: 0.85rem;
}

.section-desc {
  font-size: var(--text-lg);
  color: var(--text-body);
  margin-bottom: 0;
}

/* Grids */
.grid {
  display: grid;
  gap: 1.5rem;
}

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

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* Gradient Accent Text */
.text-gradient {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

/* Breadcrumb */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: 1.1rem;
  list-style: none;
  padding: 0;
}

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

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

.breadcrumb li + li::before {
  content: "/";
  margin-right: 0.45rem;
  color: #B4C3C2;
}

/* Article Layout */
.article-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 2.5rem;
  align-items: start;
}

.article-content {
  min-width: 0;
}

.article-content h2 {
  margin-top: 2.5rem;
  padding-top: 0.5rem;
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
}

.article-content h3 {
  margin-top: 1.65rem;
  font-size: 1.18rem;
}

.article-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 1.4rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Tables with safe horizontal scroll wrapper */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-xs);
  margin-block: 1.4rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  text-align: left;
  min-width: 520px;
}

.data-table th,
.data-table td {
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid rgba(220, 233, 232, 0.78);
  vertical-align: middle;
}

.data-table th {
  background: rgba(241, 248, 247, 0.85);
  color: var(--text-heading);
  font-weight: 700;
  white-space: nowrap;
}

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

.data-table tbody tr:hover {
  background: rgba(96, 223, 193, 0.06);
}

.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text-heading);
}
