/* Walkthrough blog page — minimal, mobile-first, readable.
 * No framework. No JS. The page is the SEO surface.
 */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.6;
  color: #1a1a1a;
  background: #fafaf7;
}

.site-nav {
  background: #1a4480;
  color: #fff;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.95rem;
}

.site-nav .site-name {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.site-nav .nav-link {
  color: #cfe0ff;
  text-decoration: none;
}

.site-nav .nav-link:hover {
  color: #fff;
}

.site-footer {
  max-width: 720px;
  margin: 2rem auto 0;
  padding: 1.5rem 1rem 2rem;
  border-top: 1px solid #ddd;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.9rem;
  color: #666;
}

.site-footer a {
  color: #1a4480;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

article > header {
  border-bottom: 1px solid #ddd;
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

h1 {
  font-size: 2rem;
  margin: 0 0 0.25rem;
  line-height: 1.2;
}

.meta {
  color: #666;
  font-size: 0.95rem;
  margin: 0;
}

h2 {
  font-size: 1.4rem;
  margin: 2.5rem 0 1rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.25rem;
}

h3 {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

h4 {
  font-size: 1rem;
  margin: 1rem 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #555;
}

p { margin: 0.75rem 0; }

.intro p:first-child { margin-top: 0; }
.intro p:last-child  { margin-bottom: 0; }

.favourites ul, .vocab dl { margin: 0.5rem 0; padding-left: 1.25rem; }

.vocab dl { padding-left: 0; }
.vocab dt {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: bold;
  margin-top: 0.75rem;
}
.vocab dd { margin: 0.25rem 0 0 0; padding-left: 1rem; }

.clue {
  background: #fff;
  border: 1px solid #e5e5e0;
  border-radius: 4px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.clue h3 .enum { color: #888; font-weight: normal; font-size: 0.9rem; }

blockquote.clue-text {
  margin: 0.5rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid #999;
  background: #f5f5f0;
  font-style: italic;
}

.definition mark {
  background: #fff3a8;
  padding: 0 0.15em;
}

ol.wordplay {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}
ol.wordplay li { margin: 0.25rem 0; }

/* Per-clue step list — the trainer's completed-step view, rendered
 * inline. Each <li> is one step row; sub-rows (indicator_type,
 * fodder_check) carry .substep and indent under their parent. */
.walkthrough-steps {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.95rem;
  line-height: 1.5;
}
.walkthrough-steps .step {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  border-left: 3px solid #e5e7eb;
  margin: 0.25rem 0;
  background: #fbfcfd;
  border-radius: 0 4px 4px 0;
  transition: background 120ms ease, border-color 120ms ease;
}
.walkthrough-steps .step:hover { background: #f4f7fb; }
.walkthrough-steps .step.substep {
  margin-left: 1.4rem;
  border-left-color: #cbd5e1;
  background: #fafbfc;
  font-size: 0.9rem;
  color: #475569;
}
.walkthrough-steps .step-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.walkthrough-steps .step-badge.def       { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.walkthrough-steps .step-badge.type      { background: #f3e8ff; color: #6b21a8; border: 1px solid #d8b4fe; }
.walkthrough-steps .step-badge.indicator { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.walkthrough-steps .step-badge.outer     { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.walkthrough-steps .step-badge.inner     { background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe; }
.walkthrough-steps .step-badge.synonym   { background: #ecfeff; color: #155e75; border: 1px solid #a5f3fc; }
.walkthrough-steps .step-badge.abbrev    { background: #ecfeff; color: #155e75; border: 1px solid #a5f3fc; }
.walkthrough-steps .step-badge.fodder    { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }
.walkthrough-steps .step-badge.assembly  { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.walkthrough-steps .step-body {
  flex: 1;
  min-width: 0;
}
.walkthrough-steps .step-title {
  display: inline;
}
.walkthrough-hint-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.5rem;
  padding: 0.1rem 0.55rem;
  background: #fff;
  border: 1px solid #cbd5e1;
  color: #1a4480;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  vertical-align: middle;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.walkthrough-hint-toggle::before {
  content: "💡";
  font-size: 0.85em;
  line-height: 1;
}
.walkthrough-hint-toggle:hover {
  background: #f0f7ff;
  border-color: #2c5aa0;
  color: #2c5aa0;
}
.walkthrough-hint-toggle[aria-expanded="true"] {
  background: #2c5aa0;
  border-color: #2c5aa0;
  color: #fff;
}
.walkthrough-hint {
  margin-top: 0.5rem;
  padding: 0.6rem 0.8rem;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-left: 3px solid #2c5aa0;
  border-radius: 4px;
  color: #1f2937;
  font-size: 0.92rem;
  line-height: 1.55;
}

@media (max-width: 480px) {
  .walkthrough-steps { font-size: 0.9rem; }
  .walkthrough-steps .step { padding: 0.45rem 0.55rem; gap: 0.5rem; }
  .walkthrough-steps .step.substep { margin-left: 1rem; }
  .walkthrough-hint-toggle {
    margin-left: 0;
    margin-top: 0.4rem;
    display: inline-flex;
  }
}

.cta {
  margin-top: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.95rem;
}
.cta a {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: #1a4480;
  color: #fff;
  text-decoration: none;
  border-radius: 3px;
}
.cta a:hover { background: #0d2b52; }

a { color: #1a4480; }
a:hover { text-decoration: none; }

.closing {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid #ddd;
  color: #555;
  font-style: italic;
}

/* Walkthroughs index */

.filter-tabs {
  display: flex;
  gap: 0.25rem;
  margin: 0 0 1.5rem;
  border-bottom: 1px solid #ddd;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.filter-tabs .tab {
  padding: 0.5rem 1rem;
  color: #555;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-size: 0.95rem;
}
.filter-tabs .tab:hover { color: #1a4480; }
.filter-tabs .tab.active {
  color: #1a4480;
  border-bottom-color: #1a4480;
  font-weight: bold;
}

.walkthrough-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.walkthrough-list li {
  margin: 0 0 0.5rem;
}
.walkthrough-list a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid #e5e5e0;
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
}
.walkthrough-list a:hover {
  border-color: #1a4480;
  background: #f5f8ff;
}
.walkthrough-list .row-date {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.85rem;
  color: #666;
  white-space: nowrap;
  min-width: 7em;
}
.walkthrough-list .row-title {
  font-weight: bold;
  color: #1a4480;
}

.empty {
  text-align: center;
  color: #888;
  padding: 2rem 1rem;
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  main { padding: 1rem 0.75rem 3rem; }
  h1 { font-size: 1.6rem; }
  .clue { padding: 0.85rem 1rem; }
  .site-nav { padding: 0.6rem 0.75rem; gap: 1rem; font-size: 0.9rem; }
  .site-footer { padding: 1.25rem 0.75rem 1.5rem; font-size: 0.85rem; }
  .walkthrough-list a { flex-direction: column; gap: 0.25rem; padding: 0.75rem; }
  .walkthrough-list .row-date { min-width: 0; }
}

/* -------------------------------------------------------------------
 * Trainer-in-modal overlay (opened from "Try this clue in the trainer")
 *
 * Full-bleed iframe wrapper. The inner trainer-modal (with its own
 * blue header + Close button) provides ALL chrome. The outer overlay
 * is transparent plumbing — no padding, no panel background, no
 * outer Close button, so the reader sees a single modal not a
 * modal-within-a-modal.
 * ------------------------------------------------------------------- */
.trainer-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
}
.trainer-modal-overlay[hidden] { display: none; }
body.trainer-modal-open { overflow: hidden; }

.trainer-modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* The outer overlay's Close is removed — the inner trainer's own
 * Close (in its blue header) posts a message back to dismiss the
 * overlay. Hidden in CSS so the click handler can stay as a safety
 * net. */
.trainer-modal-close { display: none; }

.trainer-modal-frame {
  flex: 1;
  width: 100%;
  border: 0;
  display: block;
}
