/* ===== Article tools: Print / PDF buttons ===== */
.article-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem 1.4rem;
}
.at-group { display: flex; align-items: center; gap: 1.4rem; }
.article-body a.at-btn { color: var(--text-mid); text-decoration: none; }
.article-body a.at-btn:hover, .article-body a.at-btn:focus-visible { color: var(--gold-light); }
.article-tools-end {
  margin-top: 2.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
}
.at-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mid);
  transition: color 0.2s;
}
.at-btn svg { color: var(--gold); flex-shrink: 0; }
.at-btn:hover,
.at-btn:focus-visible { color: var(--gold-light); }
.at-btn:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; }

.print-source { display: none; }

/* ===== Previous / Next article links ===== */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--rule);
  border-top: 1px solid var(--rule);
}
.an-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.5rem 2.5rem;
  background: var(--surface);
  text-decoration: none;
  transition: background 0.2s;
}
.an-next { text-align: right; align-items: flex-end; }
a.an-card:hover,
a.an-card:focus-visible { background-color: color-mix(in srgb, var(--surface) 88%, var(--gold)); }
.an-label {
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.an-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  text-wrap: balance;
}
a.an-card:hover .an-title { color: var(--gold-light); }

/* Phones: one row, labels only (title stays in the link's aria-label) */
@media (max-width: 600px) {
  .an-card { padding: 1rem 1.5rem; justify-content: center; }
  .an-title { display: none; }
  .an-label { font-size: 0.7rem; }
}

/* ===== Print / Save as PDF: plain text only ===== */
@media print {
  @page { margin: 0.8in 0.9in; }

  html, body, .site-wrapper, .article-header, .article-body {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    animation: none !important;
  }
  body::before, body::after { display: none !important; }

  /* Hide everything that isn't the article text */
  header, nav, footer, .article-hero, .article-tools, .article-nav,
  #search-results, #verse-tooltip, #comments, .wb-comments, [class*="wb-comment"],
  img, picture, figure, svg, video, iframe, canvas, button, .back-link {
    display: none !important;
  }

  .article-header { padding: 0 0 0.6rem !important; border-bottom: 1px solid #999 !important; }
  .article-body { padding: 0.8rem 0 0 !important; }

  .article-title { font-size: 22pt !important; color: #000 !important; margin: 0 !important; }
  .article-subtitle { font-size: 12pt !important; color: #333 !important; font-style: italic; }
  .article-byline { color: #333 !important; font-size: 8pt !important; }

  .article-body, .article-body p, .article-body li, .article-body td, .article-body th {
    font-family: 'EB Garamond', Georgia, 'Times New Roman', serif !important;
    font-size: 11.5pt !important;
    line-height: 1.5 !important;
    color: #000 !important;
  }
  .article-body h2, .article-body h3, .article-body h4 {
    color: #000 !important;
    margin: 1.3em 0 0.4em !important;
    break-after: avoid;
    page-break-after: avoid;
  }
  .article-body p, .article-body li, blockquote { orphans: 3; widows: 3; }
  blockquote { border-left: 2px solid #999 !important; color: #222 !important; background: none !important; }
  table { border-collapse: collapse; break-inside: avoid; }
  th, td { border: 1px solid #999 !important; background: none !important; }

  /* Scripture references and links print as plain text */
  .article-body a { color: #000 !important; text-decoration: none !important; }

  .print-source {
    display: block !important;
    margin-top: 1.2rem;
    padding-top: 0.4rem;
    break-before: avoid;
    page-break-before: avoid;
    border-top: 1px solid #999;
    font-size: 9pt !important;
    color: #444 !important;
  }
}
