/* assets/guide.css - Styles for How to Make a Paper Fortune Teller Guide */
.guide-page {
  --guide-blue: #1765b5;
  --guide-red: #e64a2f;
  --guide-yellow: #dba11e;
  --guide-green: #66824e;
  --guide-bg: #fffaf1;
  --guide-card-border: #cec7bb;
  --guide-mat: #dcecf2;
}

.guide-page [hidden] { display: none !important; }

/* Site header tweaks for guide */
.guide-page .site-header {
  grid-template-columns: 1fr auto;
  height: 68px;
  padding: 0 max(24px, calc((100vw - 1280px) / 2));
  gap: 28px;
}
.guide-page .site-header nav {
  display: flex;
  gap: 28px;
}
.guide-page .site-header nav a[aria-current="page"] {
  color: var(--guide-blue);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 6px;
}

/* Main Container */
.guide-main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

/* Hero Section */
.guide-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 36px;
  padding: 36px 0 28px;
  border-bottom: 1px solid var(--line);
}
.guide-hero h1 {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(34px, 4vw, 54px);
  font-weight: 650;
  line-height: 1.1;
  margin: 8px 0 16px;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.guide-hero-lede {
  font-size: clamp(16px, 1.8vw, 19px);
  line-height: 1.55;
  color: #344957;
  margin: 0 0 24px;
  max-width: 660px;
}
.guide-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}
.guide-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--guide-bg);
  border: 1px solid var(--guide-card-border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #2e3e4c;
  box-shadow: 0 1px 3px rgba(40,49,48,0.06);
}
.guide-chip b {
  color: var(--guide-blue);
}
.guide-hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--guide-mat);
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.6) 0 1px, transparent 1px 20px),
                    repeating-linear-gradient(90deg, rgba(255,255,255,.6) 0 1px, transparent 1px 20px);
  border: 1px solid #bad2dc;
  border-radius: 12px;
  padding: 24px 18px;
  box-shadow: inset 0 0 18px rgba(0,0,0,.04), 0 4px 12px rgba(40,49,48,.08);
  text-align: center;
}
.guide-hero-visual img {
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 12px 14px rgba(35,50,60,.22));
}
.guide-hero-visual figcaption {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  color: #3b5060;
}

/* Quick Jump Navigation */
.guide-jump-nav {
  margin: 24px 0 36px;
  padding: 16px 20px;
  background: var(--guide-bg);
  border: 1px solid var(--guide-card-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.guide-jump-nav span {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--guide-blue);
  white-space: nowrap;
}
.guide-jump-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.guide-jump-nav a {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: #243b4e;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 4px;
  background: #f0e8dc;
  transition: background .15s ease, color .15s ease;
}
.guide-jump-nav a:hover, .guide-jump-nav a:focus-visible {
  background: var(--guide-blue);
  color: #fff;
}

/* Guide Section Common */
.guide-section {
  padding: 44px 0;
  border-bottom: 1px solid var(--line);
}
.guide-section h2 {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(28px, 3.2vw, 42px);
  font-weight: 650;
  line-height: 1.15;
  margin: 6px 0 16px;
  color: var(--ink);
}
.guide-section-intro {
  font-size: 16px;
  line-height: 1.6;
  color: #3e4a54;
  max-width: 780px;
  margin: 0 0 28px;
}

/* Square Preparation Box */
.square-prep-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}
.prep-card {
  background: var(--guide-bg);
  border: 1px solid var(--guide-card-border);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 3px 0 rgba(91,72,43,.1);
}
.prep-card h3 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 20px;
  margin: 0 0 12px;
  color: var(--ink);
}
.prep-card p, .prep-card li {
  font-size: 14.5px;
  line-height: 1.55;
  color: #344450;
}
.prep-card ol {
  padding-left: 20px;
  margin: 10px 0;
}
.prep-card li {
  margin-bottom: 8px;
}
.paper-rule-callout {
  margin-top: 16px;
  padding: 12px 16px;
  background: #f5eedf;
  border-left: 4px solid var(--guide-yellow);
  border-radius: 0 6px 6px 0;
  font-size: 13.5px;
  line-height: 1.5;
}

/* Stages Overview Bar */
.stages-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}
.stages-print-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--guide-blue);
  color: var(--guide-blue);
  font-size: 14px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(23,101,181,0.12);
  transition: all .15s ease;
}
.stages-print-cta:hover {
  background: var(--guide-blue);
  color: #fff;
}

/* 8 Numbered Stages Grid */
.stages-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
}
.stage-card {
  background: var(--guide-bg);
  border: 1px solid var(--guide-card-border);
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 3px 0 rgba(91,72,43,.12), 0 8px 18px rgba(40,49,48,.06);
  display: flex;
  flex-direction: column;
}
.stage-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.stage-badge {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #fff;
  font-family: "Fraunces", Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,.15);
}
.stage-badge-1 { background: var(--guide-blue); }
.stage-badge-2 { background: var(--guide-yellow); color: #122638; }
.stage-badge-3 { background: var(--guide-red); }
.stage-badge-4 { background: var(--guide-green); }
.stage-badge-5 { background: var(--guide-blue); }
.stage-badge-6 { background: var(--guide-yellow); color: #122638; }
.stage-badge-7 { background: var(--guide-red); }
.stage-badge-8 { background: var(--guide-green); }

.stage-card h3 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 21px;
  margin: 0;
  color: var(--ink);
  line-height: 1.2;
}
.stage-orientation {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #4a5d6e;
  background: #f1ebd9;
  padding: 6px 12px;
  border-radius: 6px;
  margin-bottom: 16px;
}
.stage-orientation b {
  color: var(--guide-blue);
  font-weight: 700;
}
.stage-diagram-wrap {
  display: grid;
  place-items: center;
  background: var(--guide-mat);
  border: 1px solid #bfd7e0;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  min-height: 180px;
}
.stage-svg {
  width: 100%;
  max-width: 280px;
  height: auto;
  display: block;
}
.stage-instruction {
  font-size: 14.5px;
  line-height: 1.55;
  color: #2b3944;
  margin: 0 0 16px;
}
.stage-instruction strong {
  color: var(--ink);
}
.stage-checkpoint {
  margin-top: auto;
  padding: 10px 14px;
  background: #eef6fb;
  border-left: 4px solid var(--guide-blue);
  border-radius: 0 6px 6px 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: #1a3c58;
}
.stage-checkpoint strong {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--guide-blue);
  margin-bottom: 2px;
}

/* Play Handoff Section */
.play-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 24px 0;
}
.play-beat {
  background: var(--guide-bg);
  border: 1px solid var(--guide-card-border);
  border-radius: 8px;
  padding: 18px 16px;
  box-shadow: 0 2px 0 rgba(91,72,43,.08);
}
.play-beat-num {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--guide-red);
  margin-bottom: 6px;
}
.play-beat h3 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 17px;
  margin: 0 0 8px;
  color: var(--ink);
}
.play-beat p {
  font-size: 13.5px;
  line-height: 1.45;
  color: #3d4f5e;
  margin: 0;
}

/* Troubleshooting / Error Recovery */
.trouble-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.trouble-card {
  background: var(--guide-bg);
  border: 1px solid var(--guide-card-border);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 3px 0 rgba(91,72,43,.08);
  border-top: 4px solid var(--guide-red);
}
.trouble-card h3 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 19px;
  margin: 0 0 10px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.trouble-field {
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.5;
}
.trouble-field strong {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6a747e;
  margin-bottom: 2px;
}
.trouble-field p {
  margin: 0;
  color: #313f4c;
}
.trouble-fix {
  padding: 10px 14px;
  background: #f8efe4;
  border-radius: 6px;
  border-left: 3px solid var(--guide-yellow);
}
.trouble-fix strong {
  color: #7d5b12;
}

/* Printable Guide Banner */
.printable-guide-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #eef6fb;
  border: 1px solid #b3d2e6;
  border-radius: 10px;
  padding: 28px;
  box-shadow: 0 3px 0 rgba(23,101,181,.12);
  margin-top: 24px;
}
.printable-guide-card h3 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 24px;
  margin: 0 0 8px;
  color: var(--guide-blue);
}
.printable-guide-card p {
  font-size: 15px;
  line-height: 1.5;
  color: #27435b;
  margin: 0;
  max-width: 650px;
}
.print-guide-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--guide-blue);
  color: #fff;
  border: 1px solid #10538e;
  padding: 14px 24px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 0 #0d4679;
  white-space: nowrap;
  flex-shrink: 0;
}
.print-guide-button:hover {
  background: #11569a;
}

/* History and Sources */
.history-content {
  background: var(--guide-bg);
  border: 1px solid var(--guide-card-border);
  border-radius: 8px;
  padding: 26px;
  box-shadow: 0 3px 0 rgba(91,72,43,.08);
}
.history-content p {
  font-size: 15px;
  line-height: 1.6;
  color: #344552;
  margin: 0 0 16px;
}
.source-citation-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 14px;
  display: grid;
  gap: 10px;
}
.source-citation-list li {
  font-size: 13.5px;
  line-height: 1.5;
  color: #4a5c6c;
  padding-left: 20px;
  position: relative;
}
.source-citation-list li::before {
  content: "•";
  position: absolute;
  left: 6px;
  color: var(--guide-blue);
  font-weight: bold;
}
.source-citation-list a {
  color: var(--guide-blue);
  text-decoration: underline;
}
.editorial-disclaimer {
  font-size: 12.5px;
  line-height: 1.5;
  color: #637584;
  margin-top: 14px;
  font-style: italic;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}

/* Maker CTA Banner */
.guide-maker-cta {
  background: linear-gradient(135deg, #1765b5 0%, #104a84 100%);
  color: #fff;
  border-radius: 12px;
  padding: 36px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin: 44px 0 20px;
  box-shadow: 0 6px 20px rgba(18,63,110,.25);
}
.guide-maker-cta h2 {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(24px, 3vw, 34px);
  color: #fff;
  margin: 0 0 10px;
}
.guide-maker-cta p {
  font-size: 15.5px;
  line-height: 1.55;
  color: #dbe7f3;
  margin: 0;
  max-width: 600px;
}
.cta-button-white {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff;
  color: var(--guide-blue);
  font-size: 16px;
  font-weight: 750;
  padding: 14px 28px;
  border-radius: 6px;
  text-decoration: none;
  box-shadow: 0 3px 0 #d0dbe5;
  white-space: nowrap;
  flex-shrink: 0;
}
.cta-button-white:hover {
  background: #f7f9fc;
}

/* FAQ Styles */
.guide-faq-list {
  display: grid;
  gap: 12px;
}
.guide-faq-list details {
  background: var(--guide-bg);
  border: 1px solid var(--guide-card-border);
  border-radius: 8px;
  padding: 18px 22px;
  box-shadow: 0 2px 0 rgba(91,72,43,.06);
}
.guide-faq-list summary {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  line-height: 1.35;
}
.guide-faq-list p {
  font-size: 14.5px;
  line-height: 1.6;
  color: #3a4b58;
  margin: 12px 0 0;
}

/* Responsive Breakpoints */
@media (max-width: 1020px) {
  .guide-hero {
    grid-template-columns: 1fr;
  }
  .guide-hero-visual {
    max-width: 420px;
    margin: 0 auto;
  }
  .play-flow {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .guide-page .site-header {
    height: auto;
    min-height: 60px;
    padding: 12px 16px;
  }
  .guide-page .site-header nav {
    display: none;
  }
  .guide-page.menu-open .site-header nav {
    display: grid;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    padding: 16px 20px;
    gap: 0;
    background: #fffaf1;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 10px 20px rgba(27,35,32,.12);
  }
  .guide-page.menu-open .site-header nav a {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }
  .guide-main {
    padding: 0 16px 40px;
  }
  .guide-hero h1 {
    font-size: 32px;
  }
  .square-prep-grid {
    grid-template-columns: 1fr;
  }
  .stages-grid {
    grid-template-columns: 1fr;
  }
  .play-flow {
    grid-template-columns: 1fr;
  }
  .trouble-grid {
    grid-template-columns: 1fr;
  }
  .printable-guide-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .guide-maker-cta {
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 20px;
  }
  .cta-button-white {
    width: 100%;
  }
}

@media (max-width: 420px) {
  body { overflow-x: hidden; }
  .guide-page .site-header { padding: 8px 10px; }
  .guide-page .brand { font-size: 14px; gap: 6px; }
  .guide-page .brand-art { width: 32px; }
  .guide-page .brand span:last-child { font-size: 14px; }
  .guide-main { padding: 0 10px 40px; }
  .guide-hero h1 { font-size: 25px; }
  .prep-card { padding: 16px 12px; }
  .stage-card { padding: 16px 12px; }
  .stage-badge { width: 36px; height: 36px; font-size: 17px; }
  .stage-card h3 { font-size: 18px; }
  .trouble-card { padding: 16px 12px; }
  .printable-guide-card { padding: 18px 12px; }
  .history-content { padding: 18px 12px; }
  .guide-faq-list details { padding: 14px 12px; }
  .guide-page footer { padding: 20px 10px; }
  .guide-page footer nav { flex-wrap: wrap; gap: 8px 14px; }
}

/* Accessible focus ring */
.guide-page :focus-visible {
  outline: 3px solid #e0a61d;
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Printable 1-Page Cheatsheet Layout */
@media print {
  @page {
    size: letter portrait;
    margin: 0.35in 0.35in 0.3in 0.35in;
  }
  body, html {
    background: #fff !important;
    color: #000 !important;
    font-size: 10pt !important;
    line-height: 1.2 !important;
  }
  /* Hide non-printable elements */
  .site-header,
  .guide-hero,
  .guide-jump-nav,
  .square-prep-section,
  .stages-header,
  .play-handoff-section,
  .trouble-section,
  .printable-guide-section,
  .history-section,
  .faq-section,
  .guide-maker-cta,
  footer,
  .menu-button,
  #questionImportNotice {
    display: none !important;
  }
  
  /* Show print header and stages */
  .stages-section {
    padding: 0 !important;
    border: 0 !important;
    display: block !important;
  }
  .print-only-header {
    display: block !important;
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 4px;
    margin-bottom: 8px;
  }
  .print-only-header .print-title {
    font-size: 14pt !important;
    font-weight: bold !important;
    margin: 0 0 2px !important;
    font-family: Georgia, serif !important;
  }
  .print-only-header p {
    font-size: 8pt !important;
    margin: 0 !important;
    color: #444 !important;
  }
  
  .stages-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    grid-template-rows: repeat(2, auto) !important;
    gap: 6px !important;
  }
  .stage-card {
    border: 1px solid #666 !important;
    padding: 6px !important;
    background: #fff !important;
    box-shadow: none !important;
    border-radius: 4px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
  .stage-card-header {
    margin-bottom: 4px !important;
    gap: 6px !important;
  }
  .stage-badge {
    width: 22px !important;
    height: 22px !important;
    font-size: 10pt !important;
    background: #222 !important;
    color: #fff !important;
    box-shadow: none !important;
    border-radius: 3px !important;
  }
  .stage-card h3 {
    font-size: 9.5pt !important;
    line-height: 1.1 !important;
    color: #000 !important;
  }
  .stage-orientation {
    display: none !important;
  }
  .stage-diagram-wrap {
    padding: 4px !important;
    background: #fafafa !important;
    border: 1px solid #ddd !important;
    min-height: 80px !important;
    max-height: 95px !important;
    margin-bottom: 4px !important;
  }
  .stage-svg {
    max-width: 90px !important;
    height: auto !important;
  }
  .stage-instruction {
    font-size: 7.5pt !important;
    line-height: 1.25 !important;
    margin: 0 0 4px !important;
    color: #111 !important;
  }
  .stage-checkpoint {
    padding: 3px 5px !important;
    font-size: 7pt !important;
    line-height: 1.15 !important;
    border-left: 2px solid #222 !important;
    background: #f5f5f5 !important;
  }
  .stage-checkpoint strong {
    font-size: 6.5pt !important;
    color: #000 !important;
  }
}
