/* Field Notes — article presentation. Uses the site's three theme palettes. */
.gl-article-main {
  padding: 8.5rem 2.5rem 6rem;
}

.gl-article {
  --article-copy: color-mix(in srgb, var(--text) 87%, var(--bg));
  max-width: 1120px;
  margin: 0 auto;
}

.gl-article-header {
  max-width: 960px;
  margin: 0 auto 3rem;
}

.gl-article-back {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 44px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.gl-article-header > .gl-article-back { margin-bottom: 2rem; }
.gl-article-back:hover { color: var(--accent); }

.gl-article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem 1.5rem;
  margin-bottom: 1.2rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.6;
  letter-spacing: 0.03em;
}

.gl-article-category { color: var(--accent); }

.gl-article-title {
  max-width: 22ch;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.35rem, 4.7vw, 4.25rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.035em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.gl-article-deck {
  max-width: 760px;
  margin: 1.5rem 0 0;
  color: var(--article-copy, var(--text));
  font-size: clamp(1.1rem, 1.65vw, 1.35rem);
  line-height: 1.65;
}

.gl-article-byline {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.gl-article-hero {
  overflow: hidden;
  margin: 0 auto 3.5rem;
  border-radius: var(--radius);
  background: var(--bg-2);
}

.gl-article-hero > img,
.gl-article-slide > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.gl-article-hero figcaption {
  max-width: none;
  padding: 0.85rem 1rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}
.gl-article-image-caption { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.4rem 1.5rem; }
.gl-article-image-caption a { text-decoration: underline; text-underline-offset: 0.2em; }

.gl-article-reading {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.gl-article-toc {
  margin: 0 0 2.75rem;
  border-top: 1px solid var(--border-h);
  border-bottom: 1px solid var(--border-h);
}

.gl-article-toc[hidden],
.gl-article-slide[hidden],
.gl-article-carousel-controls[hidden] { display: none; }

.gl-article-toc summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 56px;
  gap: 1rem;
  padding: 0.9rem 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.74rem;
  cursor: pointer;
  list-style: none;
}

.gl-article-toc summary::-webkit-details-marker { display: none; }
.gl-article-toc summary > span { font-size: 1.2rem; color: var(--accent); }
.gl-article-toc[open] summary > span { transform: rotate(45deg); }
.gl-article-toc ol { padding: 0 0 1.2rem; list-style: none; }
.gl-article-toc li { margin: 0; }
.gl-article-toc li.is-subsection { padding-left: 1rem; }
.gl-article-toc a {
  display: block;
  padding: 0.65rem 0;
  color: var(--article-copy, var(--text));
  font-size: 0.875rem;
  line-height: 1.5;
}
.gl-article-toc a:hover { color: var(--accent); }

.gl-article-content {
  color: var(--article-copy, var(--text));
  font-size: 1.125rem;
  line-height: 1.85;
  overflow-wrap: break-word;
}

.gl-article-content p {
  max-width: none;
  margin: 0 0 1.6rem;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.gl-article-content > p:first-child > em:only-child {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  font-style: normal;
}

.gl-article-content h1,
.gl-article-content h2,
.gl-article-content h3,
.gl-article-content h4,
.gl-article-content h5,
.gl-article-content h6 {
  margin: 2.8rem 0 1.1rem;
  color: var(--text);
  line-height: 1.3;
  scroll-margin-top: 7rem;
  text-wrap: pretty;
}

.gl-article-content h1,
.gl-article-content h2 { font-size: clamp(1.6rem, 2.3vw, 2rem); }
.gl-article-content h3 { font-size: clamp(1.35rem, 1.9vw, 1.6rem); }
.gl-article-content h4 { font-family: var(--sans); font-size: 1.15rem; font-weight: 600; }
.gl-article-content h5,
.gl-article-content h6 { font-family: var(--sans); font-size: 1rem; font-weight: 600; }
.gl-article-content > :first-child { margin-top: 0; }

.gl-article-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  overflow-wrap: anywhere;
}
.gl-article-content a:hover { text-decoration-thickness: 2px; }
.gl-article-content strong { color: var(--text); font-weight: 600; }
.gl-article-content ul,
.gl-article-content ol { margin: 0 0 1.6rem; padding-left: 1.5rem; }
.gl-article-content li { margin: 0.5rem 0; padding-left: 0.25rem; }
.gl-article-content li > ul,
.gl-article-content li > ol { margin: 0.5rem 0; }
.gl-article-content li::marker { color: var(--accent); }

.gl-article-content blockquote {
  margin: 2.25rem 0;
  padding: 0.3rem 0 0.3rem 1.5rem;
  border-left: 2px solid var(--accent);
  color: var(--text);
}
.gl-article-content blockquote p { font-family: var(--serif); font-size: 1.3rem; line-height: 1.65; }
.gl-article-content blockquote > :last-child { margin-bottom: 0; }
.gl-article-content hr { margin: 2.75rem 0; border: 0; border-top: 1px solid var(--border-h); }

.gl-article-content code {
  padding: 0.12em 0.3em;
  border-radius: 3px;
  background: var(--bg-3);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.82em;
  overflow-wrap: anywhere;
}

.gl-article-content pre {
  max-width: 100%;
  margin: 1.75rem 0;
  padding: 1.4rem 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--border-h);
  border-radius: var(--radius);
  background: var(--bg-2);
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.75;
  tab-size: 2;
}
.gl-article-content pre code { padding: 0; border: 0; background: none; color: var(--text); font-size: inherit; overflow-wrap: normal; }
.gl-article-content .highlight { max-width: 100%; }

.gl-article-table-wrap { max-width: 100%; margin: 2rem 0; overflow-x: auto; }
.gl-article-content table { width: 100%; margin: 2rem 0; border-collapse: collapse; font-size: 0.9rem; line-height: 1.65; }
.gl-article-table-wrap table { margin: 0; }
.gl-article-content th,
.gl-article-content td { padding: 0.85rem 1rem; border: 1px solid var(--border-h); text-align: left; vertical-align: top; }
.gl-article-content th { background: var(--bg-2); color: var(--text); font-weight: 600; }
.gl-article-content caption { padding: 0.7rem 0; text-align: left; color: var(--muted); }

.gl-article-content img { width: auto; max-width: 100%; height: auto; margin: 2rem auto; border-radius: var(--radius); }
.gl-article-content video { width: 100%; height: auto; margin: 2rem 0; }
.gl-article-content iframe { width: 100%; max-width: 100%; min-height: 220px; margin: 1.5rem 0; border: 0; }
.gl-article-content figure { margin: 2rem 0; }
.gl-article-content figcaption { color: var(--muted); font-size: 0.8rem; line-height: 1.6; }
.gl-article-media-unavailable {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border-h);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
}
.gl-article-media-status { color: var(--text); font-weight: 600; }
.gl-article-media-reference { color: var(--accent); font-size: 0.8rem; }

.gl-article-footer { margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--border-h); }
.gl-article-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.75rem; }
.gl-article-tag {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--border-h);
  border-radius: var(--radius);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.5;
}
.gl-article-tag:hover { color: var(--text); border-color: var(--accent); }
.gl-article .gl-post-share { gap: 0.5rem; }
.gl-article .gl-share-btn { min-width: 44px; min-height: 44px; }
.gl-article .gl-post-share-label { margin-right: 0.5rem; }

.gl-article-continue { margin-top: 5rem; padding-top: 2.5rem; border-top: 1px solid var(--border-h); }
.gl-article-continue-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.75rem; }
.gl-article-continue-heading h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
.gl-article-next-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
.gl-article-next { display: grid; grid-template-columns: 130px minmax(0, 1fr); align-items: start; gap: 1.25rem; }
.gl-article-next:only-child { grid-column: 1 / -1; max-width: 680px; grid-template-columns: 200px minmax(0, 1fr); }
.gl-article-next > img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.gl-article-next-meta { display: block; color: var(--muted); font-family: var(--mono); font-size: 0.64rem; line-height: 1.6; }
.gl-article-next-meta > span { padding: 0 0.3rem; }
.gl-article-next h3 { margin: 0.65rem 0; color: var(--text); font-size: 1.25rem; line-height: 1.35; }
.gl-article-next-action { color: var(--accent); font-family: var(--mono); font-size: 0.68rem; }
.gl-article-next-action > span { padding-left: 0.3rem; }
.gl-article-next:hover h3 { color: var(--accent); }

.gl-article-carousel-controls { display: flex; justify-content: center; align-items: center; gap: 1rem; padding: 0.65rem 1rem; }
.gl-article-carousel-controls button { width: 44px; height: 44px; border: 1px solid var(--border-h); border-radius: var(--radius); background: var(--bg); color: var(--text); font-size: 1.1rem; cursor: pointer; }
.gl-article-carousel-controls button:hover { border-color: var(--accent); color: var(--accent); }
.gl-article-carousel-controls span { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.gl-article-video { aspect-ratio: 16 / 9; }
.gl-article-video iframe { width: 100%; height: 100%; border: 0; display: block; }
.gl-article-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin: 2rem 0; }
.gl-article-gallery figure { margin: 0; }
.gl-article-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin: 0 0 0.65rem; }

.gl-article :is(a, button, summary, pre, .gl-article-table-wrap):focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }

@media (max-width: 900px) {
  .gl-article-next { grid-template-columns: 100px minmax(0, 1fr); gap: 1rem; }
  .gl-article-next-grid { gap: 1.5rem; }
}

@media (max-width: 767px) {
  .gl-article-main { padding: 6.5rem 1.25rem 4rem; }
  .gl-article-header { margin-bottom: 2rem; }
  .gl-article-header > .gl-article-back { margin-bottom: 1.25rem; }
  .gl-article-meta { column-gap: 1rem; font-size: 0.65rem; }
  .gl-article-title { max-width: none; font-size: clamp(2rem, 7.5vw, 3.2rem); letter-spacing: -0.025em; }
  .gl-article-deck { margin-top: 1.15rem; font-size: 1.06rem; }
  .gl-article-byline { margin-top: 1.25rem; }
  .gl-article-hero { margin-bottom: 2.25rem; }
  .gl-article-content { font-size: 1.05rem; line-height: 1.8; }
  .gl-article-content pre { padding: 1rem; font-size: 0.78rem; }
  .gl-article-content blockquote { padding-left: 1.1rem; }
  .gl-article-content blockquote p { font-size: 1.2rem; }
  .gl-article-content th,
  .gl-article-content td { padding: 0.7rem; min-width: 130px; }
  .gl-article-toc { margin-bottom: 2rem; }
  .gl-article-footer { margin-top: 2.5rem; }
  .gl-article-continue { margin-top: 3.5rem; padding-top: 2rem; }
  .gl-article-next-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .gl-article-next, .gl-article-next:only-child { grid-template-columns: 110px minmax(0, 1fr); }
  .gl-article-next h3 { font-size: 1.15rem; }
}

@media (max-width: 420px) {
  .gl-article-next, .gl-article-next:only-child { grid-template-columns: 85px minmax(0, 1fr); gap: 0.9rem; }
  .gl-article-next-meta { font-size: 0.6rem; }
  .gl-article-gallery { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .gl-article *, .gl-article *::before, .gl-article *::after { transition: none !important; animation: none !important; }
}
