/* Paste page styles — minimal additions on top of coach.css */

.paste-page {
  max-width: 920px;
}

.paste-section {
  margin: 1.5rem 0 1.25rem;
}

.paste-label {
  display: block;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.6rem;
  text-align: center;
  opacity: 0.85;
}

.paste-area {
  display: block;
  width: 100%;
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--surface, #fffaf2);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  resize: vertical;
  min-height: 9rem;
  box-shadow: 0 1px 0 rgba(60, 40, 30, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease;
  box-sizing: border-box;
}

.paste-area:focus {
  outline: none;
  border-color: rgba(60, 40, 30, 0.45);
  box-shadow: 0 0 0 3px rgba(60, 40, 30, 0.10);
}

.paste-area::placeholder {
  color: rgba(60, 40, 30, 0.45);
  font-style: italic;
}

/* -------- Error block: shown when line count is wrong or backend validation fails -------- */

.paste-error {
  margin: 1.1rem 0 0;
  padding: 1rem 1.1rem;
  background: rgba(200, 16, 46, 0.06);
  border: 1px solid rgba(200, 16, 46, 0.25);
  border-radius: 10px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
}

.paste-error[hidden] { display: none; }

.paste-error-title {
  font-weight: 700;
  color: #a30c25;
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.paste-error-list {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
}

.paste-error-list li {
  margin-bottom: 0.25rem;
}

.paste-error-suggestion {
  margin-top: 0.65rem;
  font-style: italic;
  color: rgba(60, 40, 30, 0.85);
}

.paste-error-suggestion a {
  color: #a30c25;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

/* -------- "Why this matters" explainer block inside error cards.
   Used by missing-title, line-count, and server-validation errors. -------- */

.paste-error-explainer {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(200, 16, 46, 0.35);
  font-family: var(--font-body);
  font-size: 0.98rem;
  line-height: 1.5;
  color: rgba(60, 40, 30, 0.92);
}

.paste-error-explainer p {
  margin: 0 0 0.55rem;
}

.paste-error-explainer p:last-child {
  margin-bottom: 0;
}

/* -------- Explanation pill: red rounded CTA used inside errors AND as a
   persistent CTA near the top of the page. -------- */

.explain-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.25rem;
  padding: 0.45rem 0.95rem;
  background: #a30c25;
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid #a30c25;
  box-shadow: 0 1px 2px rgba(60, 0, 10, 0.18);
  transition: background 120ms ease, transform 120ms ease;
}

.explain-pill:hover,
.explain-pill:focus-visible {
  background: #8a0a1f;
  text-decoration: none;
  transform: translateY(-1px);
}

.explain-pill:active {
  transform: translateY(0);
}

.explain-pill::before {
  content: "\2139"; /* info symbol */
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1;
}

/* Wide, full-width variant used on the Submit intro: double the height,
   centered, copy may wrap to two lines. */
.explain-pill--wide {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
  text-align: center;
  padding: 1.05rem 1.1rem;
  min-height: 5.5rem;
  font-size: 1.375rem;
  line-height: 1.2;
  gap: 0.5rem;
}

.explain-pill--wide::before {
  font-size: 1.15rem;
  align-self: center;
}

/* -------- Persistent Explanation CTA on the Submit intro -------- */

.submit-intro-cta {
  margin: 0.85rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.submit-intro-cta-label {
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: rgba(60, 40, 30, 0.82);
  margin: 0;
}

/* The Limerick Coach link button in the header looks identical to the
   coach page's "Click For Instructions" button. */
.paste-page .coach-controls {
  justify-content: center;
}
/* Sandbox-only styles for the new Coach-intro section on Write page */

/* Tame the subhead so it doesn't overflow horizontally */
.coach .coach-subhead {
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  line-height: 1.4;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.coach .coach-headline {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.1;
  text-align: center;
}
.coach .coach-header {
  margin-bottom: 1.5rem;
  text-align: center;
}

/* Intro copy under the headline */
.submit-intro {
  max-width: 720px;
  margin: 1.25rem auto 0;
  text-align: left;
}
.submit-intro p {
  margin: 0 0 0.9rem;
  font-size: 1rem;
  line-height: 1.6;
  color: #3d3220;
}
.submit-intro p:last-child {
  margin-bottom: 0;
}


/* Unboxed inline prompt: red text + black button, all on one line */
.coach-intro {
  max-width: none;
  margin: 1.5rem auto;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  white-space: nowrap;
}

.coach-intro-text {
  margin: 0;
  font-size: clamp(0.85rem, 1.3vw, 1.05rem);
  line-height: 1.3;
  color: #c0392b;
  white-space: nowrap;
}

.coach-intro-text strong {
  color: #c0392b;
}

.coach-intro-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: #1a1a1a;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s ease;
}

.coach-intro-button:hover,
.coach-intro-button:focus {
  background: #333;
  outline: none;
}

/* On narrow viewports the single-line constraint forces tiny text;
   allow wrapping there so it stays readable. */
@media (max-width: 760px) {
  .coach-intro {
    flex-wrap: wrap;
    white-space: normal;
    text-align: center;
  }
  .coach-intro-text {
    white-space: normal;
    font-size: 0.95rem;
  }
}

/* ------- Mobile-first refinements ------- */

/* Comfortable side gutters on phones so content never crowds the edges */
@media (max-width: 600px) {
  .coach.paste-page {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }
  .coach .coach-headline {
    font-size: clamp(1.6rem, 7vw, 2rem);
  }
  .submit-intro p {
    font-size: 0.97rem;
    line-height: 1.55;
  }
  /* Slightly shorter textarea on phones so Post button stays reachable */
  .paste-area {
    min-height: 180px;
  }
  /* Bigger touch target for the Post button; size matches the top red banner. */
  .post-btn {
    min-height: 56px;
    font-size: 1.375rem;
    padding-left: 1.8rem;
    padding-right: 1.8rem;
  }
  /* Coach prompt: bigger, clearer break between question and button */
  .coach-intro {
    gap: 0.75rem;
    margin-top: 2rem;
  }
  .coach-intro-text {
    font-size: 1rem;
    line-height: 1.45;
  }
  .coach-intro-button {
    min-height: 48px;
    padding: 0.75rem 1.4rem;
    font-size: 1rem;
  }
}

/* Tiny phones (iPhone SE-class, 360-375px) */
@media (max-width: 380px) {
  .coach.paste-page {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }
  .submit-intro p {
    font-size: 0.93rem;
  }
}

/* -------- Title input (optional) -------- */
.title-label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.4rem 0.15rem;
  opacity: 0.9;
}
.title-optional {
  font-weight: 400;
  opacity: 0.55;
  font-size: 0.85rem;
}
.title-policy {
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--ink);
  opacity: 0.78;
  margin: 0 0 0.6rem 0.15rem;
}
.title-policy strong { font-weight: 700; opacity: 1; }
.title-input {
  display: block;
  width: 100%;
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--surface, #fffaf2);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 0.7rem 0.95rem;
  margin: 0 0 0.8rem 0;
  box-sizing: border-box;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.title-input:focus {
  outline: none;
  border-color: rgba(60, 40, 30, 0.45);
  box-shadow: 0 0 0 3px rgba(60, 40, 30, 0.10);
}
.title-input::placeholder {
  color: rgba(60, 40, 30, 0.45);
  font-style: italic;
}

/* ----- Title input -----
   Matches the paste-limerick textarea above: same font-family, same size
   (1.1rem), same regular weight, normal case, italic placeholder.
*/
.title-input--capsule {
  font-family: var(--font-body);
  font-weight: 400;
  font-style: normal;
  font-size: 1.1rem;
  line-height: 1.7;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  background: var(--surface, #fffaf2);
  padding: 1rem 1.1rem;
  border-radius: 12px;
}
.title-input--capsule::placeholder {
  text-transform: none;
  font-style: italic;
  font-weight: 400;
  color: rgba(60, 40, 30, 0.45);
  letter-spacing: 0;
}
/* ----- AuthorAsk (Tune Box format, Aug 16) -----
   The one authorship prompt used site-wide. Label 23.5px / desc 16.4px
   centered, never wrapping (JS shrink-to-fit in write.js / fast.js);
   input 25px centered. */
.author-ask-label {
  font-family: var(--font-body);
  font-size: 23.5px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
}
.author-ask-desc {
  font-family: var(--font-body);
  font-size: 16.4px;
  color: var(--ink);
  opacity: 0.75;
  text-align: center;
  margin: 0; /* two hard-broken lines; gap lives on line 2 */
  white-space: nowrap;
  overflow: hidden;
}
.author-ask-desc-2 {
  margin: 0 0 10px;
}
.author-ask-input {
  text-align: center;
  font-size: 25px;
}
.author-ask-input::placeholder {
  text-align: center;
}

/* Width-cap warning */
.title-warn {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: #b03a2e;
  background: #fdecea;
  border: 1px solid #f5b7b1;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  margin: -0.4rem 0 0.9rem 0;
}
.title-input--capsule.is-at-max {
  border-color: #b03a2e;
  box-shadow: 0 0 0 3px rgba(176, 58, 46, 0.15);
}

/* -------- Missing-title confirmation dialog -------- */
.no-title-confirm {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 6, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.2rem;
  animation: ntcFade 140ms ease-out;
}
@keyframes ntcFade {
  from { opacity: 0; } to { opacity: 1; }
}
.no-title-confirm__panel {
  background: var(--surface, #fffaf2);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(20, 14, 6, 0.30);
  max-width: 26rem;
  width: 100%;
  padding: 1.4rem 1.3rem 1.2rem;
}
.no-title-confirm__title {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--ink);
  margin: 0 0 0.6rem 0;
  line-height: 1.25;
}
.no-title-confirm__body {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ink);
  margin: 0 0 1.1rem 0;
  opacity: 0.9;
}
.no-title-confirm__body strong { font-weight: 700; opacity: 1; }
.no-title-confirm__actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.no-title-confirm__back,
.no-title-confirm__proceed {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--ink, #2b2724);
  cursor: pointer;
  width: 100%;
  text-align: center;
}
.no-title-confirm__back {
  background: var(--ink, #2b2724);
  color: #fff5dc;
}
.no-title-confirm__back:hover { background: #1a1714; }
.no-title-confirm__proceed {
  background: transparent;
  color: var(--ink, #2b2724);
  opacity: 0.85;
}
.no-title-confirm__proceed:hover { opacity: 1; background: rgba(0,0,0,0.04); }

/* -------- Post-submit gallery popup chips -------- */
.post-submit-popup .no-title-confirm__body {
  font-size: 1rem;
  line-height: 1.55;
}
.post-submit-chip {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1;
  padding: 0.32rem 0.7rem;
  margin: 0 0.18rem;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  border: 1.5px solid currentColor;
}
.post-submit-chip--proposed {
  background: #f2e8d5;
  color: #2b5a2b;
  border-color: #2b5a2b;
}
.post-submit-chip--proposed:hover { background: #e6d9bf; }
.post-submit-chip--fixit {
  background: #fdecec;
  color: #b03a2e;
  border-color: #b03a2e;
}
.post-submit-chip--fixit:hover { background: #f9d6d6; }

/* -------- Post-submit 3-CTA stack (Deploy 2A) -------- */
.post-submit-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.9rem;
}
.post-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  box-sizing: border-box;
  min-height: 3rem;
}
.post-submit-btn__icon {
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 1.1rem;
  line-height: 1;
}
.post-submit-btn--primary {
  background: #24b400;
  color: #fff;
}
.post-submit-btn--primary:hover { background: #1d8f00; }
.post-submit-btn--primary:active { background: #187a00; }
.post-submit-btn--secondary {
  background: #f2e8d5;
  color: #2b1f0f;
  border: 1.5px solid #d9c9a8;
}
.post-submit-btn--secondary:hover { background: #e6d9bf; }
.post-submit-btn--tertiary {
  background: transparent;
  color: #5c4a2b;
  border: 0;
  padding: 0.55rem 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  min-height: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.post-submit-btn--tertiary:hover { color: #2b1f0f; }

/* When a title is missing, mark the input visibly. */
.title-input--capsule.input-error {
  border-color: #b03a2e;
  box-shadow: 0 0 0 3px rgba(176, 58, 46, 0.18);
}

/* -------- Rescue banner (visible only when ?rescue=<id>) -------- */
.rescue-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.4rem auto 1.1rem;
  padding: 0.7rem 1rem;
  background: rgba(196, 30, 58, 0.08);
  border: 1px solid rgba(196, 30, 58, 0.28);
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.98rem;
  line-height: 1.4;
  max-width: 95%;
  text-align: left;
}
.rescue-banner-icon {
  font-size: 1.1rem;
  line-height: 1;
}
.rescue-banner-text {
  flex: 1;
}

/* Page-level stacked back navigation */
.page-back-stack {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-start;
  margin: 0 0 1rem;
}
.page-back {
  display: inline-block;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 1.1rem;
  color: #1a2348;
  text-decoration: none;
}
.page-back--secondary { font-size: 0.95rem; opacity: 0.9; }
.page-back:hover { text-decoration: underline; }

/* ----------------------------------------------------------------
   Italics-as-rhyme-override picker.

   Mounts below the paste-area. The italic-I "icon" is purely visual
   (it is a label, not a separate toggle) and the line buttons 1–5
   (with a "none" placeholder of "–") form a radio group. Picking a
   line forces that line's last word to be treated as a perfect
   rhyme; the matching word in the textarea is shown in italics in
   the preview line below. Picking "–" clears the force.
---------------------------------------------------------------- */
.force-rhyme {
  margin: 0.85rem 0 0;
  padding: 0.65rem 0.85rem;
  background: var(--surface, #fffaf2);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.65rem;
  font-family: var(--font-body);
  color: var(--ink);
}

.force-rhyme__icon {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.55rem 0.25rem 0.4rem;
  border: none;
  background: transparent;
  color: var(--ink);
  cursor: default;
  font-family: var(--font-body);
}

.force-rhyme__I {
  display: inline-flex;
  width: 1.65rem;
  height: 1.65rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(60, 40, 30, 0.45);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  line-height: 1;
}

.force-rhyme__I em {
  font-style: italic;
  font-size: 1.05rem;
  font-family: Georgia, "Times New Roman", serif;
}

.force-rhyme__icon-label {
  font-size: 1.02rem;
  font-weight: 600;
  opacity: 0.85;
}

.force-rhyme__picker {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.force-rhyme__line {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.force-rhyme__line:hover { border-color: rgba(60, 40, 30, 0.45); }
.force-rhyme__line:focus-visible {
  outline: 2px solid rgba(60, 40, 30, 0.45);
  outline-offset: 2px;
}

.force-rhyme__line.is-active {
  background: #1a2348;
  border-color: #1a2348;
  color: #fffaf2;
}

.force-rhyme__preview {
  flex-basis: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  opacity: 0.85;
  padding-top: 0.3rem;
  border-top: 1px dashed var(--hairline);
  margin-top: 0.15rem;
}

.force-rhyme__preview[hidden] { display: none; }

.force-rhyme__preview em {
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
}

/* -------- Coach handoff pill (below entry area, above POST) --------
   Same red-pill idiom as .explain-pill--wide but stands alone (no info
   glyph, no wide-variant chrome). Passes the current textarea contents
   to Coach as ?text=<url-encoded> so no work is lost. */
.coach-handoff {
  margin: 1rem 0 0.85rem;
  display: flex;
  justify-content: center;
}
.coach-handoff-pill {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
  text-align: center;
  padding: 0.95rem 1.1rem;
  min-height: 4.25rem;
  align-items: center;
  background: #a30c25;
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.25;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid #a30c25;
  box-shadow: 0 1px 2px rgba(60, 0, 10, 0.18);
  transition: background 120ms ease, transform 120ms ease;
}
.coach-handoff-pill:hover,
.coach-handoff-pill:focus-visible {
  background: #8a0a1f;
  text-decoration: none;
  transform: translateY(-1px);
}
.coach-handoff-pill:active {
  transform: translateY(0);
}
