/* static/factor_app/css/phonics.css  —  [PHONICS-P4]
   The Phonics reader tooltip. Uses the existing tooltip frame (.tooltip-dropdown / __content: black panel,
   white text, QiMeta teal #4ec6c2) and Andika, a free font made for beginning readers, for words and boxes.
   Loaded only on Phonics articles. */

/* ---------- in the article ---------- */
.qm-phonics-on .qm-w {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* backgrounds only: no change to text layout or position */
qimeta-phonics-tooltip.qm-s-active {
  background-color: rgba(255, 214, 102, 0.35);
  border-radius: 3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.qm-w.qm-w-active {
  background-color: rgba(255, 166, 0, 0.55);
  border-radius: 3px;
}
/* [PHONICS-P7a] read-along: the word being spoken (after .qm-w-active so it wins) */
.qm-w.qm-read-on {
  background-color: rgba(78, 198, 194, 0.65);
  box-shadow: 0 2px 0 #2a9d99;
  border-radius: 3px;
}

/* ---------- the tooltip ---------- */
.qm-ph-dropdown {
  padding-top: 0 !important;
  z-index: 99;
}
.tooltip-dropdown__content.qm-ph {
  position: relative;
  box-sizing: border-box;
  width: min(440px, calc(100vw - 16px)) !important;
  max-width: calc(100vw - 16px) !important;
  padding: 14px 14px 12px;
  border-radius: 10px;
  font-family: century-gothic, "Century Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.3;
  color: #fff;
  background-color: #000;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
.qm-ph button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.qm-ph .qm-close {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  color: #bbb;
}

/* 1. sentence chips */
.qm-ph .qm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 40px 10px 0;
}
.qm-ph .qm-chip {
  min-height: 44px;
  padding: 4px 10px;
  border: 1px solid #555;
  border-radius: 8px;
  background: #1b1b1b;
  font-family: Andika, century-gothic, sans-serif;
  font-size: 20px;
}
.qm-ph .qm-chip.qm-read-on {
  border-color: #4ec6c2;
  background: #4ec6c2;
  color: #000;
  font-weight: 700;
}
.qm-ph .qm-chip-on {
  border-color: #ffa600;
  background: #ffa600;
  color: #000;
  font-weight: 700;
}

/* 2. read the sentence, steps */
.qm-ph .qm-read,
.qm-ph .qm-step,
.qm-ph .qm-meaning {
  min-height: 44px;
  padding: 6px 14px;
  border: 1px solid #4ec6c2;
  border-radius: 22px;
  background: transparent;
  color: #4ec6c2;
  font-weight: 700;
}
.qm-ph .qm-read { margin-bottom: 12px; }
.qm-ph .qm-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.qm-ph .qm-meaning {
  display: block;
  margin-top: 12px;
  border-color: #fff;
  color: #fff;
}
.qm-ph .qm-playing,
.qm-ph .qm-read:active,
.qm-ph .qm-step:active {
  background: #4ec6c2;
  color: #000;
}

/* 3. the word and its type */
.qm-ph .qm-word {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.qm-ph .qm-big {
  font-family: Andika, century-gothic, sans-serif;
  font-size: 40px;
  line-height: 1.1;
}
.qm-ph .qm-pill {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #000;
}
.qm-ph .qm-pill-decodable { background: #7ed492; }
.qm-ph .qm-pill-heart     { background: #ff8fa3; }
.qm-ph .qm-pill-sight     { background: #8fc3ff; }
.qm-ph .qm-pill-story     { background: #d9c2ff; }
.qm-ph .qm-help {
  margin: 4px 0 8px;
  font-size: 14px;
  color: #ccc;
}

/* 4. sound boxes */
.qm-ph .qm-boxes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.qm-ph .qm-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 64px;
  padding: 4px 8px;
  border: 2px solid #4ec6c2;
  border-radius: 8px;
  background: #111;
  transition: background-color 0.15s, transform 0.15s;
}
.qm-ph .qm-box-g {
  font-family: Andika, century-gothic, sans-serif;
  font-size: 28px;
  line-height: 1.1;
}
.qm-ph .qm-box-s {
  font-size: 13px;
  color: #aaa;
}
.qm-ph .qm-box-heart { border-color: #ff4d6d; }
/* [PHONICS-P2b] a part not taught yet at this grade (story word with a later pattern) */
.qm-ph .qm-box-new { border-color: #ffc94d; border-style: dashed; }
.qm-ph .qm-new {
  position: absolute;
  top: -9px;
  right: -7px;
  font-size: 15px;
  color: #ffc94d;
}
.qm-ph .qm-heart {
  position: absolute;
  top: -9px;
  right: -7px;
  font-size: 16px;
  color: #ff4d6d;
}
.qm-ph .qm-box-on {
  background: #4ec6c2;
  transform: scale(1.08);
}
.qm-ph .qm-box-on .qm-box-g,
.qm-ph .qm-box-on .qm-box-s { color: #000; }

.qm-ph .qm-link {
  display: inline-block;
  margin-top: 10px;
  color: #4ec6c2;
}

@media (max-width: 600px) {
  .qm-ph .qm-big { font-size: 34px; }
  .qm-ph .qm-chip { font-size: 18px; }
}
