/* Optimum° Reading v3 - 2026-05-25
   Additive visual enhancements for article reading flow.
   Loads AFTER optimum-overrides.css. Targets existing markup (no content changes needed).

   Components:
   1. PMID paragraphs become academic source cards (breaks the text wall)
   2. <hr> becomes an ornamental fleuron divider
   3. Middle-of-article <blockquote> as pull-quote
   4. <h2> with rust accent line above (visual cadence per section)
   5. "Bold-only" paragraphs (Angle headers) as italic rust callouts
   6. List bullets in rust
   7. Subtle fade-in on key elements as reader scrolls (reward)
*/

/* ========== 1. PMID paragraphs as source cards ========== */
.gh-content p:has(a[href*="pubmed.ncbi"]) {
  margin: 2rem 0 !important;
  padding: 1.25rem 1.5rem !important;
  background-color: #F5F2EA;
  border-left: 3px solid #7C2D12;
  font-size: 0.95em;
  line-height: 1.55;
  color: #3A352E;
  border-radius: 0;
  position: relative;
}
.gh-content p:has(a[href*="pubmed.ncbi"])::before {
  content: "SOURCE PUBMED";
  display: block;
  font-family: 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 0.7em;
  letter-spacing: 0.2em;
  color: #7C2D12;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.gh-content p:has(a[href*="pubmed.ncbi"]) a[href*="pubmed"],
.gh-content p:has(a[href*="pubmed.ncbi"]) a[href*="doi.org"] {
  color: #7C2D12;
  font-weight: 600;
  font-family: 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 0.88em;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-bottom: 1px solid rgba(124, 45, 18, 0.3);
  transition: border-bottom-color 0.2s ease;
}
.gh-content p:has(a[href*="pubmed.ncbi"]) a[href*="pubmed"]:hover,
.gh-content p:has(a[href*="pubmed.ncbi"]) a[href*="doi.org"]:hover {
  border-bottom-color: #7C2D12;
}

/* ========== 2. <hr> as ornamental fleuron ========== */
.gh-content hr {
  border: none !important;
  height: auto !important;
  margin: 3rem 0 !important;
  background: none !important;
  text-align: center;
  position: relative;
}
.gh-content hr::after {
  content: "❦";
  display: block;
  color: #7C2D12;
  opacity: 0.55;
  font-size: 1.4rem;
  font-family: 'Fraunces', Georgia, serif;
  letter-spacing: 0.5em;
  padding-left: 0.5em;
  line-height: 1;
}

/* ========== 3. Pull-quote: every <blockquote> in article body ========== */
.gh-content blockquote {
  margin: 2.5rem 0 !important;
  padding: 0.75rem 0 0.75rem 1.5rem !important;
  border-left: 3px solid #7C2D12 !important;
  background: transparent !important;
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.5;
  color: rgba(26, 24, 21, 0.9);
}
.gh-content blockquote p {
  margin: 0 !important;
  font-style: italic;
}
.gh-content blockquote em {
  font-style: italic;
}

/* ========== 4. <h2> with rust accent line above ========== */
.gh-content h2 {
  margin-top: 3.5rem !important;
  margin-bottom: 1.25rem !important;
  padding-top: 0.5rem;
  position: relative;
}
.gh-content h2::before {
  content: "";
  display: block;
  width: 48px;
  height: 2px;
  background-color: #7C2D12;
  margin-bottom: 1.25rem;
  opacity: 0.65;
}

/* ========== 5. Bold-only paragraphs (Angle headers) as italic rust callouts ========== */
.gh-content p:has(> strong:only-child) {
  margin-top: 2.5rem !important;
  margin-bottom: 1.25rem !important;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.2rem;
  line-height: 1.4;
  color: #7C2D12;
  font-style: italic;
  border-bottom: 1px solid rgba(124, 45, 18, 0.25);
  padding-bottom: 0.65rem;
}
.gh-content p:has(> strong:only-child) strong {
  font-weight: 600;
}

/* ========== 6. List bullets in rust ========== */
.gh-content ul li::marker,
.gh-content ol li::marker {
  color: #7C2D12;
  font-weight: 700;
}
.gh-content ul li,
.gh-content ol li {
  margin-bottom: 0.65rem;
  padding-left: 0.25rem;
}

/* ========== 7. Subtle scroll-reveal (JS adds .optimum-revealed when entering viewport) ========== */
.gh-content h2.optimum-reveal,
.gh-content hr.optimum-reveal,
.gh-content blockquote.optimum-reveal,
.gh-content p.optimum-reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.gh-content h2.optimum-revealed,
.gh-content hr.optimum-revealed,
.gh-content blockquote.optimum-revealed,
.gh-content p.optimum-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ========== Mobile tightening ========== */
@media (max-width: 640px) {
  .gh-content p:has(a[href*="pubmed.ncbi"]) {
    padding: 1rem 1.1rem !important;
    font-size: 0.92em;
  }
  .gh-content blockquote {
    font-size: 1.15rem;
    padding-left: 1.1rem !important;
  }
  .gh-content h2 {
    margin-top: 2.75rem !important;
  }
  .gh-content h2::before {
    width: 36px;
    margin-bottom: 1rem;
  }
}
