/* Shared styles for blog landing + blog posts */

.article-wrapper {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  font-family: 'Barlow', sans-serif;
  color: #1a1a1a;
  line-height: 1.65;
  text-align: left;
}
.article-wrapper h1 {
  font-family: 'Barlow', sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 24px;
  color: #1a1a1a;
}
.article-wrapper .article-meta {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 32px;
}
.article-wrapper .header-image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 0 0 40px;
  display: block;
}
.article-wrapper h2 {
  font-family: 'Barlow', sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 48px 0 16px;
  color: #1a1a1a;
}
.article-wrapper h3 {
  font-family: 'Barlow', sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 36px 0 12px;
  color: #1a1a1a;
}
.article-wrapper p {
  font-size: 1.05rem;
  margin: 0 0 18px;
}
.article-wrapper a {
  color: #006e5a;
  text-decoration: underline;
}
.article-wrapper a:hover {
  color: #00513f;
}
.article-wrapper ol,
.article-wrapper ul {
  font-size: 1.05rem;
  padding-left: 24px;
  margin: 0 0 18px;
}
.article-wrapper li {
  margin-bottom: 10px;
}
.article-wrapper table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0 32px;
  font-size: 0.98rem;
}
.article-wrapper th,
.article-wrapper td {
  border: 1px solid #e0e0e0;
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}
.article-wrapper th {
  background: #f5f5f5;
  font-weight: 600;
}
.article-wrapper .references {
  font-size: 0.9rem;
  color: #555;
  word-break: break-word;
}
.article-wrapper .references a {
  word-break: break-word;
}
.article-wrapper .related-reading {
  margin: 48px 0 0;
  padding: 16px 20px;
  background: #f5f8f7;
  border-left: 4px solid #006e5a;
  border-radius: 4px;
  font-size: 1rem;
  line-height: 1.5;
}
.article-wrapper .related-reading strong {
  color: #006e5a;
}
.article-wrapper .related-reading ul {
  margin: 8px 0 0;
  padding-left: 20px;
}
.article-wrapper .related-reading li {
  margin-bottom: 6px;
}

/* Clickable citations with hover popover */
.article-wrapper .citation-ref {
  color: #006e5a;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}
.article-wrapper .citation-ref:hover,
.article-wrapper .citation-ref:focus {
  text-decoration: underline;
}
.article-wrapper sup {
  position: relative;
}
.article-wrapper sup .citation-ref::after,
.article-wrapper sup .citation-ref::before {
  opacity: 0;
  transition: opacity 0.12s ease-out;
  pointer-events: none;
}
.article-wrapper sup .citation-ref::after {
  content: attr(data-citation);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #232360;
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  white-space: normal;
  width: 300px;
  max-width: calc(100vw - 32px);
  z-index: 10;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  text-align: left;
  text-transform: none;
}
.article-wrapper sup .citation-ref::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #232360;
  z-index: 10;
}
.article-wrapper sup .citation-ref:hover::after,
.article-wrapper sup .citation-ref:focus::after,
.article-wrapper sup .citation-ref.citation-open::after,
.article-wrapper sup .citation-ref:hover::before,
.article-wrapper sup .citation-ref:focus::before,
.article-wrapper sup .citation-ref.citation-open::before {
  opacity: 1;
}
.article-wrapper ol.references li,
.article-wrapper p.references,
.article-wrapper h2[id] {
  scroll-margin-top: 80px;
}
.article-wrapper ol.references li:target,
.article-wrapper p.references:target {
  background: #fff8d6;
  transition: background 0.4s;
}

/* Table of contents */
.article-wrapper .toc {
  margin: 8px 0 40px;
  padding: 18px 22px;
  background: #f7f9f8;
  border: 1px solid #e6ece9;
  border-radius: 8px;
  font-size: 0.95rem;
}
.article-wrapper .toc strong {
  display: block;
  margin-bottom: 10px;
  color: #232360;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.article-wrapper .toc ol {
  margin: 0;
  padding-left: 22px;
  font-size: 0.97rem;
  line-height: 1.55;
}
.article-wrapper .toc li {
  margin-bottom: 4px;
}
.article-wrapper .toc a {
  color: #006e5a;
  text-decoration: none;
}
.article-wrapper .toc a:hover,
.article-wrapper .toc a:focus {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .article-wrapper {
    padding: 24px 16px 60px;
  }
  .article-wrapper h1 {
    font-size: 1.85rem;
  }
  .article-wrapper h2 {
    font-size: 1.4rem;
  }
  .article-wrapper h3 {
    font-size: 1.15rem;
  }
  .article-wrapper table {
    font-size: 0.9rem;
  }
  .article-wrapper th,
  .article-wrapper td {
    padding: 8px 10px;
  }
  .article-wrapper sup .citation-ref::after {
    width: 260px;
    font-size: 12px;
  }
}
