/*
 * Classic Byte — Full-text reading view styles.
 *
 * Relies on CSS custom properties from theme.css:
 *   --ink, --ink-light, --terracotta, --old-gold,
 *   --paper, --bg, --dust, --dust-gray, --serif, --sans
 */

/* ---------------------------------------------------------------- wrapper */
.full-text-wrapper {
  max-width: 720px;
  margin: 0 auto 2.5rem;
  padding: 0 1.25rem;
}

/* ------------------------------------------------------------------- body */
.full-text {
  position: relative;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--ink);
  counter-reset: line-counter;
}

/* --- Collapsed state ---------------------------------------------------- */
.full-text.collapsed {
  max-height: 14rem;          /* ~8 visible lines */
  overflow: hidden;
}

/* Gradient fade at the bottom when collapsed */
.full-text.collapsed::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 5rem;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--bg) 90%
  );
  pointer-events: none;
}

/* ----------------------------------------------------------------- stanza */
.full-text-stanza {
  margin-bottom: 1.4rem;
}
.full-text-stanza:last-child {
  margin-bottom: 0;
}

/* ------------------------------------------------------------------- line */
.full-text-line {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.1rem 0.4rem 0.1rem 0;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.full-text-line:hover {
  background-color: color-mix(in srgb, var(--dust) 40%, transparent);
}

/* --- Gutter number ------------------------------------------------------ */
.line-num {
  flex: 0 0 2.4rem;
  text-align: right;
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--dust-gray);
  user-select: none;
  line-height: inherit;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.full-text-line:hover .line-num {
  opacity: 1;
}

/* --- Line text ---------------------------------------------------------- */
.line-text {
  flex: 1 1 auto;
  min-width: 0;
}

/* -------------------------------------------------------------- toggle btn */
.full-text-toggle {
  display: block;
  margin: 1rem auto 0;
  padding: 0.5rem 1.6rem;
  border: 1px solid var(--dust-gray);
  border-radius: 999px;
  background: var(--paper);
  color: var(--terracotta);
  font-family: var(--serif);
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
  letter-spacing: 0.01em;
}

.full-text-toggle:hover {
  border-color: var(--old-gold);
  color: var(--old-gold);
  background: color-mix(in srgb, var(--paper) 85%, var(--old-gold) 15%);
}

.full-text-toggle:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ toast */
.copy-toast {
  position: absolute;
  z-index: 100;
  padding: 0.3rem 0.8rem;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 0.78rem;
  border-radius: 6px;
  pointer-events: none;
  white-space: nowrap;
  animation: toast-pop 1.4s ease forwards;
}

@keyframes toast-pop {
  0%   { opacity: 0; transform: translateY(4px); }
  15%  { opacity: 1; transform: translateY(0); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-6px); }
}

/* ---------------------------------------------------------- section title */
/* Re-use the shared .section-title style from theme.css.
   If the integrator wraps the reading view in a <section>,
   the existing .section-title class will just work. */

/* ----------------------------------------------------------- responsive -- */
@media (max-width: 600px) {
  .line-num {
    flex: 0 0 1.8rem;
    font-size: 0.65rem;
  }
  .full-text {
    font-size: 0.95rem;
  }
  .full-text-toggle {
    font-size: 0.9rem;
    padding: 0.45rem 1.2rem;
  }
}
