/* ==========================================================================
   SMALL GROUP STUDIES — one page per study, one collapsible section per
   chapter (or lesson). Notes and discussion questions live inside each section.
   ========================================================================== */

.study-body {
  padding: 2rem 2.5rem 3rem;
  background: var(--surface);
}

/* Expand / collapse all */
.study-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.study-toolbar button {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.5rem 0.9rem;
  background: none;
  color: var(--gold);
  border: 1px solid rgba(201,168,76,0.5);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.study-toolbar button:hover {
  background: var(--gold-faint);
  color: var(--gold-light);
}

.study-toolbar button:focus-visible,
.study-print-btn:focus-visible,
.study-chapter > summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Chapter sections */
.study-chapter {
  border: 1px solid var(--glass-border);
  background: var(--glass);
  border-radius: 4px;
  margin-bottom: 1rem;
  scroll-margin-top: 4.5rem;
}

.study-chapter[open] {
  border-color: rgba(201,168,76,0.35);
}

.study-chapter > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.4rem;
  transition: background 0.2s;
}

.study-chapter > summary::-webkit-details-marker { display: none; }

.study-chapter > summary:hover { background: var(--gold-faint); }

.study-chapter-text {
  flex: 1;
  min-width: 0;
}

.study-chapter-ch {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.study-chapter-title {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.55rem;
  font-weight: 400;
  line-height: 1.25;
  color: var(--text);
  text-wrap: balance;
}

.study-chev {
  color: var(--gold);
  flex-shrink: 0;
  transition: transform 0.25s;
}

.study-chapter[open] .study-chev { transform: rotate(180deg); }

.study-chapter-content {
  padding: 0.25rem 1.6rem 1.6rem;
  border-top: 1px solid var(--rule);
}

.study-chapter-tools {
  float: right;
  margin: 0.3rem -0.4rem 0.2rem 1rem;
}

/* Same look as the Print button on article pages */
.study-print-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: var(--gold);
  transition: color 0.2s, background 0.2s;
}
.study-print-btn svg { flex-shrink: 0; }
.study-print-btn:hover,
.study-print-btn:focus-visible { color: var(--gold-light); background: var(--gold-faint); }

.study-chapter-content p,
.study-chapter-content li {
  color: var(--text);
  line-height: 1.85;
  max-width: 740px;
}

.study-chapter-content p { margin-bottom: 1.2rem; }

.study-chapter-content h3 {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--text);
  margin: 1.8rem 0 0.6rem;
}

.study-chapter-content ul,
.study-chapter-content ol {
  padding-left: 1.6rem;
  margin: 0.5rem 0 1rem;
}

.study-chapter-content li { margin-bottom: 0.55rem; }
.study-chapter-content li ul { margin-top: 0.5rem; }

/* Discussion questions — inside each chapter */
.study-questions {
  margin-top: 2rem;
  padding: 1.2rem 1.5rem;
  border-left: 2px solid var(--gold);
  background: var(--glass);
  border-radius: 0 4px 4px 0;
}

.study-questions h3 {
  margin-top: 0;
  font-family: 'Cinzel', serif;
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.study-questions ol { margin-bottom: 0; }
.study-questions li { margin-bottom: 1rem; }

@media (max-width: 600px) {
  .study-body { padding: 1.5rem 1rem 2rem; }
  .study-chapter > summary { padding: 1rem; }
  .study-chapter-content { padding: 0.25rem 1rem 1.25rem; }
  .study-questions { padding: 1rem; }
  .study-chapter-title { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  .study-chev { transition: none; }
}

/* Hero image with a verse over it (same treatment as the glossary banner) */
.study-hero { position: relative; }
.study-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 72%, rgba(8,12,20,0.55) 0%, rgba(8,12,20,0.2) 60%, rgba(8,12,20,0) 100%),
    radial-gradient(ellipse 60% 40% at 50% 42%, rgba(8,12,20,0.55) 0%, rgba(8,12,20,0.2) 65%, rgba(8,12,20,0) 100%),
    linear-gradient(180deg, rgba(8,12,20,0.15) 0%, rgba(8,12,20,0) 30%, rgba(8,12,20,0) 55%, rgba(8,12,20,0.6) 100%);
  pointer-events: none;
}
.study-hero-verse {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 0 1.5rem 1.3rem;
  text-align: center;
  text-wrap: balance;
}
.study-hero-verse p {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(0.95rem, 1.7vw, 1.15rem);
  line-height: 1.45;
  color: #f3eee4;
  text-shadow: 0 1px 2px rgba(0,0,0,0.9), 0 0 14px rgba(0,0,0,0.75);
  margin: 0 auto;
  display: inline;
}
.study-hero-verse cite {
  display: inline;
  margin-left: 0.6rem;
  white-space: nowrap;
  font-family: 'Cinzel', serif;
  font-style: normal;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #e5c97a;
  text-shadow: 0 1px 2px rgba(0,0,0,0.9);
}
.study-hero-title {
  position: absolute;
  left: 0;
  right: 0;
  top: 42%;
  transform: translateY(-50%);
  z-index: 1;
  padding: 0 1.5rem;
  text-align: center;
}
.study-hero-title h1 {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: clamp(2.3rem, 7vw, 4.4rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  margin: 0;
  line-height: 1.15;
  text-shadow: 0 2px 12px rgba(0,0,0,0.75), 0 1px 2px rgba(0,0,0,0.9);
}
.study-hero-title p {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #e5c97a;
  margin: 0.55rem 0 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.9), 0 0 10px rgba(0,0,0,0.7);
}
/* With the title in the image, the description below stands alone a bit larger */
.study-intro .article-subtitle { font-size: 1.3rem; line-height: 1.6; color: var(--text-mid); max-width: 46rem; }
.study-intro .article-byline { margin-top: 1rem; }
@media (max-width: 600px) {
  .study-hero-verse { padding: 0 1rem 1rem; }
  .study-hero-verse p { font-size: 0.88rem; }
  .study-hero-verse cite { font-size: 0.55rem; margin-left: 0.4rem; }
  .study-hero-title { top: 34%; }
  .study-hero-title h1 { font-size: 2rem; }
  .study-hero-title p { font-size: 0.62rem; margin-top: 0.35rem; }
  .study-intro .article-subtitle { font-size: 1.12rem; }
}

/* ── PRINT ─────────────────────────────────────────────────────────────
   "Print this chapter" prints only that chapter, text only, with writing
   space under each discussion question. */
@media print {
  /* Our own footer (web address + page number) replaces the browser's header and
     footer. Defining page margin boxes turns off Chrome's built-in date/title header. */
  @page {
    margin: 0.6in 0.75in 0.7in;
    @top-left { content: none; }
    @top-center { content: none; }
    @top-right { content: none; }
    @bottom-left {
      content: "whosoeverbelieves.com/studies/titus";
      font-family: Georgia, serif; font-size: 8pt; color: #555;
    }
    @bottom-right {
      content: counter(page) "/" counter(pages);
      font-family: Georgia, serif; font-size: 8pt; color: #555;
    }
  }

  nav, header, footer, .study-hero img, .study-hero::after, .study-hero-verse,
  .study-toolbar, .study-chapter-tools,
  .study-chev, #verse-tooltip, #search-results, .article-byline,
  .article-subtitle { display: none !important; }

  body, .site-wrapper, .article-header, .study-body, .study-chapter,
  .study-questions { background: #fff !important; color: #000 !important; box-shadow: none !important; }

  body::before { display: none !important; }

  .study-hero { background: none !important; overflow: visible; }
  .study-hero-title { position: static; transform: none; padding: 0 0 0.6rem; text-align: left; }
  .study-hero-title h1 { color: #000; text-shadow: none; font-size: 1.4rem; }
  .study-hero-title p { color: #444; text-shadow: none; font-size: 0.65rem; margin-top: 0.2rem; }

  body[data-print-chapter] .study-chapter:not(.is-printing) { display: none !important; }

  .article-header { padding: 0 0 0.75rem; border: 0; animation: none; }
  .study-body { padding: 0; }
  .study-chapter { border: 0; margin: 0; }
  .study-chapter > summary { padding: 0 0 0.5rem; }
  .study-chapter-content { padding: 0; border: 0; }

  .study-chapter-ch, .study-questions h3, .study-chapter-title,
  .study-chapter-content p, .study-chapter-content li, .study-chapter-content h3 { color: #000 !important; }

  a.scripture-ref { color: #000 !important; text-decoration: none !important; }

  /* Tighter text on paper so each chapter fits on fewer sheets */
  .study-chapter-content p, .study-chapter-content li { line-height: 1.55; }
  .study-chapter-content h3 { margin: 1.1rem 0 0.4rem; }
  /* keep each subheading on the same sheet as the text under it */
  .study-chapter-content h3 { break-after: avoid; page-break-after: avoid; break-inside: avoid; }
  .study-chapter-content h3 + p, .study-chapter-content h3 + ul, .study-chapter-content h3 + ol { break-before: avoid; page-break-before: avoid; }
  .study-chapter-content li { margin-bottom: 0.35rem; }

  .study-questions { border-left: 0; padding: 0; margin-top: 1.5rem; }
  .study-questions li {
    padding-bottom: 6.5rem;
    border-bottom: 1px solid #bbb;
    break-inside: avoid;
  }
}
