/* GAIO Tech — blog article page (long-form reading) */

/* Readable sans-serif for article content; nav/footer stay editorial mono */
body.marketing.article-page .article-header,
body.marketing.article-page .article-layout,
body.marketing.article-page .article-newsletter {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* Article pages: scroll-away nav for uninterrupted reading */
body.marketing.article-page > header {
  position: relative;
  background: var(--surface);
}

/* ---- ARTICLE HEADER ---- */
.article-header {
  position: relative;
  padding: clamp(1.75rem, 4vw, 2.5rem) var(--pad-x) clamp(1.5rem, 3vw, 2rem);
  border-bottom: var(--rule);
  background: var(--surface);
}

.article-header-inner {
  max-width: var(--article-max);
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.back-link:hover { color: var(--brand); }
.back-link::before { content: '←'; }

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.article-meta a {
  text-decoration: none;
  color: var(--brand);
  font-weight: 500;
}

.article-meta a:hover { text-decoration: underline; }

.article-cat {
  color: var(--brand);
  font-weight: 600;
}

.article-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin-bottom: 0.875rem;
}

.article-deck {
  font-size: clamp(1.0625rem, 1.75vw, 1.1875rem);
  color: var(--muted);
  max-width: 54ch;
  line-height: 1.6;
  margin-bottom: 0;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.topic-tag {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-2);
}

/* ---- ARTICLE LAYOUT ---- */
.article-layout {
  display: grid;
  gap: 0;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3rem) var(--pad-x);
}

@media (min-width: 1024px) {
  .article-layout {
    grid-template-columns: 200px 1fr;
    gap: 3rem;
    align-items: start;
  }
}

.article-toc {
  display: none;
}

@media (min-width: 1024px) {
  .article-toc {
    display: block;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }
}

.article-toc h2 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.875rem;
}

.article-toc ol {
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.article-toc a {
  display: block;
  font-size: 0.8125rem;
  text-decoration: none;
  color: var(--muted);
  line-height: 1.45;
  padding: 0.25rem 0;
}

.article-toc a:hover,
.article-toc a.active {
  color: var(--brand);
  font-weight: 500;
}

/* ---- ARTICLE BODY ---- */
.article-body {
  max-width: var(--article-max);
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 2.5vw, 1.75rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 2.75rem 0 1rem;
  scroll-margin-top: 1.5rem;
}

.article-body h2:first-child { margin-top: 0; }

.article-body h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 2rem 0 0.75rem;
  scroll-margin-top: 1.5rem;
}

.article-body p {
  margin-bottom: 1.35rem;
  max-width: 62ch;
  line-height: 1.75;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.35rem 1.25rem;
  max-width: 58ch;
  line-height: 1.7;
}

.article-body li { margin-bottom: 0.625rem; }
.article-body li::marker { color: var(--brand); }
.article-body strong { font-weight: 600; color: var(--fg); }

.callout {
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  max-width: 62ch;
  box-shadow: var(--shadow-sm);
}

.callout-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-dim);
  margin-bottom: 0.5rem;
}

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

.formula-block {
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  border-radius: var(--radius-md);
  background: var(--panel);
  color: var(--panel-fg);
  font-size: 0.9375rem;
  max-width: 62ch;
  box-shadow: var(--shadow-sm);
}

.formula-block .label {
  font-size: 0.75rem;
  font-weight: 600;
  color: color-mix(in oklch, var(--panel-fg) 60%, transparent);
  margin-bottom: 0.75rem;
}

.formula-block code {
  display: block;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--brand);
}

.metric-table-wrap {
  overflow-x: auto;
  margin: 2rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-width: 100%;
  box-shadow: var(--shadow-sm);
}

.metric-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.metric-table th,
.metric-table td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.metric-table th {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
}

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

.checklist {
  list-style: none;
  margin-left: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  max-width: 62ch;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.checklist li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  line-height: 1.55;
}

.checklist li:last-child { border-bottom: none; }

.checklist li::before {
  content: '□';
  color: var(--brand);
  font-weight: 700;
}

.article-cta {
  margin-top: 3rem;
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  display: grid;
  gap: 1.25rem;
  box-shadow: var(--shadow-md);
}

@media (min-width: 640px) {
  .article-cta {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

.article-cta h2 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}

.article-cta p {
  font-size: 0.9375rem;
  color: var(--muted);
  margin: 0;
  max-width: 40ch;
  line-height: 1.55;
}

/* ---- AUTHOR ---- */
.about-author {
  margin-top: 3rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  display: grid;
  gap: 1.25rem;
  max-width: 62ch;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 540px) {
  .about-author {
    grid-template-columns: auto 1fr;
    align-items: start;
  }
}

.author-avatar {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--panel);
  color: var(--panel-fg);
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  flex-shrink: 0;
}

.about-author h2 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.author-name {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.author-role {
  font-size: 0.8125rem;
  color: var(--brand-dim);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.author-bio {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
  max-width: 48ch;
}

.author-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.875rem;
}

.author-links a {
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--fg);
}

.author-links a:hover { color: var(--brand); }

/* ---- SHARE ---- */
.share-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: var(--rule);
  max-width: 62ch;
}

.share-section h2 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 1rem;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0 1rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.share-btn:hover {
  background: var(--fg);
  color: var(--surface);
  border-color: var(--fg);
}

.share-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.share-btn.copied {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

/* ---- RELATED ---- */
.related-posts {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: var(--rule);
}

.related-posts h2 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.related-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .related-grid { grid-template-columns: repeat(3, 1fr); }
}

.related-card {
  display: block;
  padding: 1.25rem;
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: box-shadow 0.15s, border-color 0.15s;
}

.related-card:hover {
  border-color: color-mix(in oklch, var(--brand) 40%, var(--border));
  box-shadow: var(--shadow-md);
  color: inherit;
}

.related-card h3 {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  line-height: 1.25;
}

.related-card .related-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 0.625rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.related-card .post-cat {
  color: var(--brand);
  font-weight: 600;
}

/* ---- NEWSLETTER ---- */
.article-newsletter {
  margin-top: var(--pad-y);
  border-top: var(--rule);
}

.article-newsletter-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--pad-y) var(--pad-x);
  display: grid;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

@media (min-width: 768px) {
  .article-newsletter-inner { grid-template-columns: 1fr 1fr; }
}

.article-newsletter-copy {
  padding: 2rem;
  background: var(--surface);
}

.article-newsletter-copy .kicker {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 0.5rem;
}

.article-newsletter-copy h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.article-newsletter-copy p {
  color: var(--muted);
  font-size: 0.9375rem;
  max-width: 38ch;
  margin: 0;
  line-height: 1.55;
}

.article-newsletter-form {
  padding: 2rem;
  background: var(--panel);
  color: var(--panel-fg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

.article-newsletter-form label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: color-mix(in oklch, var(--panel-fg) 70%, transparent);
}

.article-newsletter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.article-newsletter-row input {
  flex: 1;
  min-width: 200px;
  min-height: 44px;
  padding: 0 1rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  border: 1px solid color-mix(in oklch, var(--panel-fg) 25%, transparent);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--panel-fg);
}

.article-newsletter-row input::placeholder {
  color: color-mix(in oklch, var(--panel-fg) 45%, transparent);
}

.article-newsletter-row input:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.article-newsletter-form .btn-primary { align-self: flex-start; }

.article-newsletter-form .form-msg {
  font-size: 0.875rem;
  color: var(--brand);
  min-height: 1.25rem;
  margin: 0;
}
