/* ── PRINT LAYOUT ── */
@page {
  size: A4;
  margin: 0;
}

@media print {
  html,
  body {
    margin: 0;
    padding: 0;
    background: white;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .guide-page {
    page-break-after: always;
    break-after: page;
  }

  .guide-page:last-child {
    page-break-after: auto;
    break-after: auto;
  }
}

html,
body {
  background: #f3f4f6;
}

/* Grey bg for screen preview */
.guide-wrapper {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 0;
  gap: 2rem;
}

.guide-page {
  width: 210mm;
  height: 297mm;
  padding: 20mm;
  box-sizing: border-box;
  background: white;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  position: relative;
  color: var(--ki-fg);
  overflow: hidden;
}

@media print {
  .guide-wrapper {
    padding: 0;
    gap: 0;
    display: block;
  }

  .guide-page {
    box-shadow: none;
    border: none;
  }
}

/* Typography & Base */
h1,
h2,
h3 {
  margin: 0;
}

p {
  margin: 0;
  line-height: 1.5;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Page 1 Specifics */
.guide-page.page-1 {
  padding: 0 0 20mm 0;
}

.guide-page.page-1> :not(.guide-hero) {
  padding-left: 20mm;
  padding-right: 20mm;
}

.guide-hero {
  margin-bottom: 15mm;
  padding: 30mm 20mm 15mm 20mm;
  color: #fff;
}

.guide-hero h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  color: #fff;
}

.guide-hero .sub {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.8);
  max-width: 80%;
  line-height: 1.4;
}

.guide-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.guide-meta span {
  padding: 0.3rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--ki-radius-pill);
  background: rgba(0, 0, 0, 0.3);
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Shared Layouts */
.guide-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15mm;
}

.guide-box {
  background: var(--ki-bg);
  border: 1px solid var(--ki-border);
  border-radius: var(--ki-radius-lg);
  padding: 10mm;
}

.guide-box.highlight {
  background: var(--ki-accent-bg);
  border-color: var(--ki-accent);
}

.guide-box.highlight h2,
.guide-box.highlight h3 {
  color: var(--ki-accent-fg);
}

/* Fix for icons shrinking in flexbox lists */
.guide-box ul li svg {
  flex-shrink: 0;
}

/* Sections */
.section-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ki-muted-fg);
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: block;
}

.section-content h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--ki-fg);
}

.section-content p {
  font-size: 0.95rem;
  color: var(--ki-muted-fg);
  margin-bottom: 1rem;
}

/* Timeline / Phases */
.guide-phase {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  margin-bottom: 1rem;
  page-break-inside: avoid;
}

.guide-phase .phase-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ki-accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}

.guide-phase .phase-content {
  flex: 1;
  padding-bottom: 1.5rem;
  border-left: 2px solid var(--ki-border);
  padding-left: 1.5rem;
  margin-left: -1rem;
}

.guide-phase:last-child .phase-content {
  border-left-color: transparent;
}

.guide-phase .phase-time {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ki-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

.guide-phase h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.guide-phase p {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.guide-phase ul li {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.95rem;
  color: var(--ki-muted-fg);
  margin-bottom: 0.4rem;
}

.guide-phase ul li svg {
  flex-shrink: 0;
  margin-top: 0.1rem;
  color: var(--ki-accent);
}

/* Context Box */
.manus-box {
  border-left: 4px solid var(--ki-accent);
  padding: 1rem 1rem 1rem 1.5rem;
  margin: 1rem 0;
  background: var(--ki-bg);
  border-radius: 0 var(--ki-radius) var(--ki-radius) 0;
}

.manus-box .quote {
  font-size: 1.2rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--ki-fg);
}

/* Headers/Footers */
.guide-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--ki-border);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
  font-size: 0.85rem;
  color: var(--ki-muted-fg);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.guide-footer {
  margin-top: auto;
  border-top: 1px solid var(--ki-border);
  padding-top: 1rem;
  font-size: 0.8rem;
  color: var(--ki-muted-fg);
  text-align: center;
}

/* Table */
.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.guide-table th,
.guide-table td {
  border-bottom: 1px solid var(--ki-border);
  padding: 0.75rem 0.5rem;
  text-align: left;
}

.guide-table th {
  color: var(--ki-muted-fg);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--ki-border);
}

.guide-table tr:last-child td {
  border-bottom: none;
}

.guide-table td:first-child {
  font-weight: 700;
  color: var(--ki-accent);
  width: 30%;
}

/* Slide Badge */
.slide-badge {
  font-size: 0.8rem;
  color: var(--ki-accent);
  border: 1px solid var(--ki-accent);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  background: white;
}
