/* ============================================================
   Lingadoo Presentation Mode
   Teacher-facing fullscreen overlay for classroom projection.
   Screen only — never prints.
   ============================================================ */

/* ── Expand button injected beside each exercise header ───── */

.pm-present-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 4px;
  border: 1.5px solid #aab8d8;
  background: transparent;
  color: #7b93c4;
  cursor: pointer;
  margin-left: 10px;
  vertical-align: middle;
  flex-shrink: 0;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.pm-present-btn:hover,
.pm-present-btn:focus-visible {
  background: #5b7fe8;
  border-color: #5b7fe8;
  color: #fff;
}

.pm-present-btn:focus-visible {
  outline: 2px solid #5b7fe8;
  outline-offset: 2px;
}

@media print {
  .pm-present-btn { display: none !important; }
}

/* ── Body lock while overlay is open ─────────────────────── */

body.pm-open {
  overflow: hidden;
}

/* ── Fullscreen overlay ───────────────────────────────────── */

.pm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background-color: #FBF6E9;
  background-image:
    repeating-linear-gradient(2deg, rgba(115, 91, 59, .018) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(91deg, rgba(255,255,255,.15) 0 1px, transparent 1px 11px),
    radial-gradient(ellipse at 16% 19%, rgba(230, 174, 47, .055) 0 1px, transparent 1.7px),
    radial-gradient(ellipse at 78% 67%, rgba(91, 70, 43, .04) 0 .8px, transparent 1.5px),
    linear-gradient(105deg, rgba(255,255,255,.08), transparent 38%, rgba(126,98,62,.025));
  background-size: auto, auto, 23px 21px, 31px 29px, 100% 100%;
  background-repeat: repeat, repeat, repeat, repeat, no-repeat;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  /* Keep overlay controls in the same typeface as the site navigation. */
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.pm-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

/* ── Control bar ──────────────────────────────────────────── */

.pm-controls {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  height: 52px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
}

.pm-controls-left,
.pm-controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.pm-controls-right {
  justify-content: flex-end;
}

.pm-controls-center {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}


/* ── Control buttons ──────────────────────────────────────── */

.pm-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1.5px solid #334155;
  background: transparent;
  color: #cbd5e1;
  /* Match the site header navigation (Games / Tools / Worksheets). */
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: normal;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.pm-btn:hover:not(:disabled) {
  background: #334155;
  border-color: #475569;
  color: #f1f5f9;
}

.pm-btn:focus-visible {
  outline: 2px solid #5b7fe8;
  outline-offset: 2px;
}

.pm-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.pm-btn-exit {
  border-color: #475569;
  color: #94a3b8;
}

.pm-btn-exit:hover {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #fff !important;
}

.pm-btn-nav {
  padding: 7px 12px;
}

.pm-btn-reveal {
  border-color: #5b7fe8;
  color: #93c5fd;
}

.pm-btn-reveal:hover:not(:disabled) {
  background: #5b7fe8 !important;
  border-color: #5b7fe8 !important;
  color: #fff !important;
}

.pm-btn-reset {
  color: #94a3b8;
}

/* Keyboard shortcut hints */
.pm-btn-shortcut {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #fff;
  background: #0f172a;
  border-radius: 3px;
  padding: 1px 4px;
  margin-left: 2px;
  line-height: 1.5;
}

/* ── Content area ─────────────────────────────────────────── */

.pm-content {
  flex: 1;
  min-height: 0;
  /* Long worksheet sections remain readable: scroll inside the presentation
     popup rather than shrinking or clipping the content. */
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 48px 48px;
}

.pm-content > * {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 860px;
  padding: 48px 56px;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.4);
}

/* ── Enlarged projection typography ──────────────────────── */

/* Override the small print-first sizes from grammar-worksheet.css */

.pm-content .ws-exercise-header {
  margin-bottom: 10px;
  gap: 12px;
}

.pm-content .ex-num {
  width: 32px;
  height: 32px;
  font-size: 15pt;
  border-radius: 50%;
  top: 0;
}

.pm-content .ex-name {
  font-size: 20pt;
  font-weight: 800;
}

.pm-content .ex-instruction {
  font-size: 14pt;
  margin-bottom: 20px;
  padding-left: 0;
}

.pm-content .ex-example {
  font-size: 13pt;
  margin-bottom: 16px;
  padding-left: 0;
}

.pm-content .ws-exercise ol,
.pm-content .ws-speaking ul {
  padding-left: 28px;
}

.pm-content .ws-exercise li,
.pm-content .ws-speaking li {
  font-size: 18pt;
  line-height: 1.7;
  margin-bottom: 24px;
}

.pm-content .ws-exercise li:last-child {
  margin-bottom: 0;
}

/* Answer spans — visible & prominent when revealed */

.pm-content .ans,
.pm-content .ans-short {
  min-width: 80px;        /* shorter — sized closer to actual answer word width */
  min-height: 1.25em;
  height: auto;
  line-height: 1.25;
  font-size: 17pt;
  vertical-align: baseline;
  padding: 0 6px 4px;
}

.pm-content .ans-short {
  min-width: 54px;
  width: 54px;
}

.pm-content .ans-line {
  height: 46px;           /* pre-allocated: 17pt × 1.6 line-height ≈ 36px + 6px bottom padding */
  min-height: 46px;
  margin-top: 10px;
  font-size: 17pt;
}

.pm-content li.revealed .ans,
.pm-content li.revealed .ans-short {
  min-height: 1.25em;
  height: auto;
  line-height: 1.25;
  font-size: 17pt;
  vertical-align: baseline;
  padding: 0 6px 4px;  /* keeps revealed answers on the text baseline while the rule sits below */
}

.pm-content li.revealed .ans-line {
  height: 46px;
  font-size: 17pt;
  padding-left: 4px;
  padding-bottom: 6px;   /* extra bottom padding lifts text above the underline */
  line-height: 1.6;
}

/* Reveal checkboxes: dark when activated, not blue */
.pm-content li.revealed .reveal-btn {
  background: #222;
  border-color: #222;
  color: #fff;
}

/* T/F boxes */

.pm-content .tf-box {
  width: 28px;
  height: 28px;
  font-size: 14pt;
}

/* Reveal buttons in the presentation clone */

.pm-content .reveal-btn {
  width: 26px;
  height: 26px;
  font-size: 12pt;
  border-radius: 4px;
  margin-right: 10px;
  top: 0;
}

/* Speaking activity */

.pm-content .ws-speaking {
  border-width: 2px;
  padding: 20px 24px;
}

.pm-content .ws-speaking-header {
  font-size: 11pt;
  margin-bottom: 10px;
}

.pm-content .ws-speaking p {
  font-size: 16pt;
  margin-bottom: 12px;
  line-height: 1.6;
}

.pm-content .ws-speaking-followup {
  font-size: 14pt;
  margin-top: 12px;
}

/* Remove present buttons from clone (JS also removes them, belt-and-suspenders) */
.pm-content .pm-present-btn {
  display: none !important;
}

/* ── Keyboard shortcut legend ─────────────────────────────── */

.pm-shortcut-strip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 6px 20px;
  background: #0f172a;
  border-top: 1px solid #1e293b;
}

.pm-shortcut-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: #475569;
  white-space: nowrap;
}

.pm-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 4px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  color: #64748b;
  line-height: 1;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 768px) {
  .pm-controls {
    flex-wrap: wrap;
    height: auto;
    padding: 8px 12px;
    gap: 6px;
  }

  .pm-controls-left,
  .pm-controls-center,
  .pm-controls-right {
    flex: none;
  }

  .pm-controls-center {
    order: -1;
    width: 100%;
    justify-content: center;
  }

  .pm-section-label {
    font-size: 11px;
    min-width: 0;
  }

  .pm-content {
    padding: 20px 16px 24px;
  }

  .pm-content > * {
    padding: 28px 24px;
    border-radius: 12px;
  }

  .pm-content .ex-name    { font-size: 15pt; }
  .pm-content .ex-instruction { font-size: 12pt; }
  .pm-content .ws-exercise li { font-size: 14pt; }
  .pm-content .ws-speaking p  { font-size: 13pt; }

  .pm-shortcut-strip { display: none; }
}

@media (max-width: 640px) {
  /* The presentation overlay is also used inside the mobile worksheet
     viewer. Keep every control reachable by giving the action buttons their
     own two-column grid instead of allowing a single row to overflow. */
  .pm-controls {
    display: block;
    padding: 8px 12px;
  }

  .pm-controls-left {
    margin-bottom: 6px;
  }

  .pm-controls-left .pm-btn {
    flex: 1;
    justify-content: center;
  }

  .pm-controls-right {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  .pm-controls-right .pm-btn {
    width: 100%;
    justify-content: center;
  }

  .pm-btn { padding: 8px 10px; font-size: 13px; }
  .pm-btn-shortcut { display: none; }
  .pm-content .ex-name    { font-size: 13pt; }
  .pm-content .ws-exercise li { font-size: 12pt; }
}

/* Compact layout for 720p projectors and small-height viewports */
@media (max-height: 780px) {
  .pm-controls {
    height: 48px;
  }

  .pm-shortcut-strip {
    display: none;
  }

  .pm-content {
    padding: 16px 32px 20px;
  }

  .pm-content > * {
    padding: 28px 40px;
  }

  .pm-content .ex-name          { font-size: 16pt; }
  .pm-content .ex-instruction   { font-size: 12pt; margin-bottom: 12px; }
  .pm-content .ws-exercise li,
  .pm-content .ws-speaking li   { font-size: 15pt; line-height: 1.5; margin-bottom: 14px; }
}

@media print {
  .pm-overlay { display: none !important; }
}
