/* === Article Page Styles === */
/* Extends style.css — article-specific typography and layout */

/* Article container: narrower than landing page */
.article-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Back link */
.article-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 2rem 0 1.5rem;
  transition: color 0.2s;
}

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

/* Article header */
.article-header {
  margin-bottom: 2rem;
}

.article-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

/* Metadata */
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.article-meta-sep {
  color: var(--divider);
}

.article-meta a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.article-meta a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Table of contents */
.article-toc {
  background: var(--bg-alt);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
}

.article-toc-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.article-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.article-toc li {
  margin-bottom: 0.35rem;
}

.article-toc a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

/* Article body typography */
.article-body {
  font-size: 1.125rem;
  line-height: 1.75;
}

.article-body p {
  margin-bottom: 1.5rem;
}

.article-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 3rem;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.article-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

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

.article-body ul,
.article-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.article-body li {
  margin-bottom: 0.5rem;
}

.article-body strong {
  font-weight: 600;
}

/* Callout box */
.article-callout {
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  border-radius: 0 8px 8px 0;
  font-size: 1.05rem;
  font-style: italic;
  color: var(--text);
}

/* Code styling (for future articles) */
.article-body code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.9em;
  background: var(--tag-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.article-body pre {
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 1.5rem 0;
}

.article-body pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

/* Cross-reference card */
.article-related {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 3rem 0 2rem;
  text-decoration: none;
  display: block;
  transition: transform 0.2s, box-shadow 0.2s;
}

.article-related:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .article-related:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.article-related-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.article-related-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.article-related-link {
  font-size: 0.9rem;
  color: var(--accent);
}

/* Article footer spacing */
.article-page .footer {
  margin-top: 2rem;
}

/* Architecture diagram */
.article-diagram {
  margin: 2rem 0;
}

.article-diagram img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.article-diagram figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  font-style: italic;
}

[data-theme="dark"] .article-diagram img {
  filter: invert(0.88) hue-rotate(180deg);
}

/* Screenshot figure */
.article-screenshot {
  margin: 2rem 0;
}

.article-screenshot a {
  display: block;
  cursor: zoom-in;
}

.article-screenshot img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.2s;
}

.article-screenshot a:hover img {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .article-screenshot a:hover img {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.article-screenshot figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  font-style: italic;
}

/* Lightbox (pure CSS) */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox:target {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2.5rem;
  color: #fff;
  text-decoration: none;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.lightbox-close:hover {
  opacity: 1;
}

/* Responsive */
@media (max-width: 640px) {
  .article-container {
    padding: 0 1.25rem;
  }

  .article-body {
    font-size: 1.125rem;
  }

  .article-body h2 {
    margin-top: 2.5rem;
  }
}
