/* ============================================================
   /vocabulary/smart-words/<lesson>/ — Smart Words in Plain English.
   Loaded AFTER grammar-pictures.css, which supplies the shared pieces
   (.gp-quizbar, .gp-trline, the #gp-app quiz, .gp-pn, .gp-section[hidden]);
   this file draws the word entries: picture beside the word, its plain
   meaning, and three sentence pairs — the smart sentence and, under it, the
   plain twin.
   ============================================================ */

.sw-page { --gp-c: #7c3aed; }

.sw-word {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: var(--esl-space-4) var(--esl-space-5);
  align-items: start;
  padding: var(--esl-space-4);
  border: 1px solid var(--esl-border);
  border-radius: var(--esl-radius-lg);
  background: #fff;
  box-shadow: var(--esl-shadow-sm);
}
.sw-word[hidden] { display: none; }
.sw-word__pic img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: var(--esl-radius);
}
.sw-word__name {
  margin: 0;
  font-size: 1.9rem;
  line-height: 1.15;
  color: var(--gp-c);
}
.sw-word__meta { margin: 2px 0 var(--esl-space-2); color: var(--esl-ink-muted); }
.sw-word__respell { font-weight: 600; letter-spacing: .01em; }
.sw-word__pos { font-style: italic; }
.sw-word__pos::before { content: "· "; font-style: normal; }
.sw-word__def { margin: 0 0 var(--esl-space-2); font-size: var(--esl-fs-lg); font-weight: 700; line-height: 1.35; }

.sw-word__tools { display: flex; flex-wrap: wrap; gap: var(--esl-space-2); margin: 0 0 var(--esl-space-3); }
.sw-tool {
  font: inherit;
  font-size: var(--esl-fs-sm);
  font-weight: 700;
  padding: 4px 12px;
  border: 1px solid var(--esl-border-strong);
  border-radius: var(--esl-radius-pill);
  background: var(--esl-surface);
  color: var(--esl-ink-soft);
  cursor: pointer;
}
/* .gp-trans is a round badge pinned to a picture corner on the grammar
   cards; here it is one of the pills. */
.sw-tool.gp-trans {
  position: static;
  width: auto;
  height: auto;
  line-height: inherit;
  text-align: left;
  border-radius: var(--esl-radius-pill);
  background: var(--esl-surface);
  font-size: var(--esl-fs-sm);
  outline: none;
}
.sw-tool[hidden] { display: none; }
.sw-tool:hover,
.sw-tool:focus-visible,
.sw-tool.is-playing { border-color: var(--esl-action); color: var(--esl-action); background: var(--esl-action-soft); }
.sw-tool.gp-save--on { background: var(--esl-success); border-color: var(--esl-success); color: #fff; }

/* Sentence pairs: the smart line, and its plain twin hanging under it. */
/* Two classes each: .esl-prose styles ol / li with one class + one element. */
.sw-word .sw-pairs { list-style: none; margin: 0; padding: 0; }
.sw-word .sw-pair { margin: 0 0 var(--esl-space-3); padding: 0; }
.sw-line {
  display: block;
  position: relative;
  padding: 3px 8px 3px 2rem;
  border-radius: var(--esl-radius-sm);
  cursor: pointer;
  line-height: 1.45;
}
/* The play mark is drawn here, not typed: a glyph in the markup would land
   in the search index and in every excerpt. */
.sw-line::before {
  content: "";
  position: absolute;
  left: .65rem;
  top: .62em;
  border-style: solid;
  border-width: .32em 0 .32em .5em;
  border-color: transparent transparent transparent var(--esl-action);
  opacity: .55;
}
.sw-line:hover,
.sw-line:focus-visible,
.sw-line.is-playing { background: var(--esl-action-soft); outline: none; }
.sw-line:focus-visible { box-shadow: 0 0 0 2px var(--esl-action); }
.sw-line:hover::before,
.sw-line.is-playing::before { opacity: 1; }
.sw-line--smart { font-weight: 600; font-size: var(--esl-fs-lg); }
.sw-line--plain { color: var(--esl-ink-muted); }
.sw-plainhl {
  font-weight: 600;
  color: var(--esl-ink);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.sw-word__note {
  margin: 0;
  padding: var(--esl-space-2) var(--esl-space-3);
  border-radius: var(--esl-radius);
  background: var(--esl-surface-2);
  color: var(--esl-ink-muted);
  font-size: var(--esl-fs-sm);
}

/* The quiz: the plain sentence to read, a small 🔊 beside it, and the smart
   sentence shown once the word is found. */
.gp-q__prompt { font-size: var(--esl-fs-lg); line-height: 1.45; max-width: 36rem; margin: 0 auto var(--esl-space-3); }
.gp-q__prompt .gp-hl { color: var(--esl-ink); text-decoration: underline dotted; text-underline-offset: 3px; }
.gp-q__hear {
  font: inherit;
  font-size: .9rem;
  padding: 1px 8px;
  border: 1px solid var(--esl-border);
  border-radius: var(--esl-radius-pill);
  background: var(--esl-surface);
  cursor: pointer;
}
.gp-q__hear:hover { border-color: var(--esl-action); background: var(--esl-action-soft); }
.gp-q__reveal { margin: var(--esl-space-3) auto 0; max-width: 36rem; font-size: var(--esl-fs-lg); font-weight: 600; }
.gp-q__reveal[hidden] { display: none; }
.gp-q__reveal .gp-hl { color: #15803d; }

/* Lesson cards on the Smart Words list page. */
.sw-lessons { margin: var(--esl-space-5) 0; }

@media (max-width: 700px) {
  .sw-word { grid-template-columns: 1fr; padding: var(--esl-space-3); }
  .sw-word__pic { max-width: 320px; margin: 0 auto; width: 100%; }
  .sw-line--smart { font-size: var(--esl-fs-base); }
}
@media print {
  .sw-word__tools { display: none; }
  .sw-word { break-inside: avoid; box-shadow: none; }
  .sw-line::before { display: none; }
  .sw-line { padding-left: 0; }
}
