/* --- Tokens (theme-aware) --- */
:root {
  --qs-radius: 1.25rem;

  /* Overlay strength (tuned per theme below) */
  --qs-overlay-top: rgba(0, 0, 0, 0.00);
  --qs-overlay-bottom: rgba(0, 0, 0, 0.28);

  /* Overlay text */
  --qs-overlay-text: rgba(255, 255, 255, 0.92);
  --qs-overlay-text-muted: rgba(255, 255, 255, 0.70);

  /* Decorative quote mark */
  --qs-quote-mark: rgba(255, 255, 255, 0.70);

  /* Shadows */
  --qs-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.10);
  --qs-shadow-hover: 0 1rem 2.75rem rgba(0, 0, 0, 0.14);

  /* Typography */
  --qs-title-color: var(--bs-body-color);
  --qs-muted-color: var(--bs-secondary-color);
  --qs-border-color: var(--bs-border-color);
}

html[data-bs-theme="dark"] {
  /* Dark mode: a bit stronger so overlay text stays readable */
  --qs-overlay-top: rgba(0, 0, 0, 0.06);
  --qs-overlay-bottom: rgba(0, 0, 0, 0.55);

  --qs-overlay-text: rgba(255, 255, 255, 0.92);
  --qs-overlay-text-muted: rgba(255, 255, 255, 0.72);
  --qs-quote-mark: rgba(255, 255, 255, 0.62);

  --qs-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.35);
  --qs-shadow-hover: 0 1rem 3rem rgba(0, 0, 0, 0.45);
}

/* --- Cards / surfaces --- */
.shadow-soft {
  box-shadow: var(--qs-shadow) !important;
}

.shadow-soft:hover {
  box-shadow: var(--qs-shadow-hover) !important;
}

.card {
  border-radius: var(--qs-radius);
}

/* Quote image: square bottom corners */
.quote-image-wrap {
  border-radius: var(--qs-radius) var(--qs-radius) 0 0; /* TL TR BR BL */
  overflow: hidden;
}

/* Keep the image itself matching the container */

.quote-image-wrap img {
  border-radius: inherit;
}

/* Ensure overlay doesn’t block clicks/selection */
.quote-image-overlay {
  pointer-events: none;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: .35rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(
    180deg,
    var(--qs-overlay-top) 0%,
    var(--qs-overlay-bottom) 100%
  );
}

/* Big quote mark */
.quote-mark {
  font-size: clamp(3.25rem, 6vw, 4.5rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--qs-quote-mark);
  text-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.25);
  margin-bottom: -0.25rem;
}

/* Overlay label */
.quote-image-overlay .small {
  color: var(--qs-overlay-text-muted);
  text-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.25);
}

/* --- Quote text consistency --- */
#quoteText {
  color: var(--qs-title-color);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.blockquote-footer,
#quoteAuthor {
  color: var(--qs-muted-color);
}

/* --- Badges look consistent across themes --- */
.badge-meta {
  border-color: var(--qs-border-color) !important;
}

/* --- “Callout” section polish --- */
.callout.card {
  border-color: var(--qs-border-color);
  border-radius: var(--qs-radius);
}

/* --- Nav slabs: consistent feel --- */
.nav-slab {
  border-radius: var(--qs-radius);
}

/* --- Back-to-top button: keep readable in both themes --- */
.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  display: none;
  border-radius: 999px;
  box-shadow: var(--qs-shadow);
}

/* Optional: reduce overlay even more in LIGHT mode only (if you still feel it’s heavy) */
html[data-bs-theme="light"] .quote-image-overlay {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.00) 0%,
    rgba(0, 0, 0, 0.22) 100%
  );
}

/* --- Download tooltip: responsive width (wide but not too wide) --- */
.tooltip.qs-download-tip {
  --bs-tooltip-max-width: min(92vw, 420px);
}
.tooltip.qs-download-tip .tooltip-inner {
  white-space: normal;
  text-align: left;
}
.tooltip.qs-download-tip code {
  word-break: break-word;
}

#apaText {
  padding-left: 1.5rem;
  text-indent: -1.5rem;
}

/* quote aside links */

.quote-aside-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem 1rem;
  text-decoration: none;
  color: var(--bs-body-color);

  border-top: 1px solid var(--bs-border-color);
  border-bottom: 1px solid var(--bs-border-color);

  margin-top: -1px;
}

.quote-aside-list-item[href]:hover {
  background-color: var(--bs-secondary-bg);
}

.quote-aside-list-item.is-current {
  color: var(--bs-secondary-color);
  cursor: default;
}

.quote-aside-list-item.is-current::after {
  content: "✓";
  color: var(--bs-success);
  font-weight: 600;
}
