/* ============ Mainframe Modernization Playbook ============ */

:root {
  --navy: #0B2545;
  --navy-2: #13315C;
  --ink: #1D2D44;
  --gold: #C89B3C;
  --gold-soft: #E4C77E;
  --paper: #F7F5F0;
  --paper-2: #FFFFFF;
  --muted: #5A6B7E;
  --line: #E3DDD0;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--sans);
  background: #1a1f26;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.ebook {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 28px 0;
}

/* ---------- Page box ---------- */
.ebook-page {
  width: 850px;
  min-height: 1100px;
  background: var(--paper-2);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  border-radius: 4px;
}

/* ============ COVER & CLOSING (full-bleed) ============ */
.ebook-cover-page,
.ebook-closing-page {
  background: var(--navy);
  justify-content: center;
  color: #fff;
}

.cover-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(11, 37, 69, 0.86) 0%, rgba(11, 37, 69, 0.72) 55%, rgba(11, 37, 69, 0.88) 100%);
  z-index: 1;
}

.cover-content {
  position: relative;
  z-index: 2;
  padding: 0 90px;
}

.cover-kicker {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 26px;
}

.cover-title {
  font-family: var(--serif);
  font-size: 68px;
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 30px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

.cover-lede {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  color: #E8EDF4;
  max-width: 560px;
  margin-bottom: 34px;
}

.cover-rule {
  width: 72px;
  height: 3px;
  background: var(--gold);
  margin-bottom: 22px;
}

.cover-sub {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #C8D4E4;
}

.cover-footer {
  position: absolute;
  z-index: 2;
  bottom: 34px;
  left: 90px;
  right: 90px;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #9FB2C8;
}

.closing-title {
  font-family: var(--serif);
  font-size: 44px;
  line-height: 1.18;
  font-weight: 700;
  margin-bottom: 26px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

.closing-links a {
  color: var(--gold-soft);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(228, 199, 126, 0.55);
}
.closing-links a:hover { color: #fff; }

/* ============ TOC ============ */
.ebook-toc-page {
  padding: 72px 78px 60px;
  background: var(--paper);
}

.toc-header { margin-bottom: 40px; }

.toc-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}

.toc-title {
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
}

.toc-intro {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 620px;
}

.toc-list {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.toc-entry {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 21px 18px;
  text-decoration: none;
  border-top: 1px solid var(--line);
  transition: background 0.15s ease;
}
.toc-entry:last-child { border-bottom: 1px solid var(--line); }
.toc-entry:hover { background: rgba(200, 155, 60, 0.07); }

.toc-num {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  color: var(--gold);
  min-width: 44px;
}

.toc-info { flex: 1; display: flex; flex-direction: column; gap: 5px; }

.toc-chapter {
  font-family: var(--serif);
  font-size: 19.5px;
  font-weight: 700;
  color: var(--navy);
}

.toc-desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}

.toc-page-marker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* ============ CHAPTER PAGES ============ */
.ebook-chapter-page { background: var(--paper-2); }

.chapter-banner {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.chapter-body {
  padding: 28px 60px 34px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.play-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 5px 15px;
  margin-bottom: 10px;
}

.chapter-title {
  font-family: var(--serif);
  font-size: 31px;
  line-height: 1.14;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
}

.chapter-lede {
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.55;
  font-style: italic;
  color: var(--navy-2);
  border-left: 3px solid var(--gold);
  padding-left: 16px;
  margin-bottom: 16px;
}

.chapter-body .two-col {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 28px;
  flex: 1;
}

.subhead {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--navy);
  margin-bottom: 10px;
}

.chapter-body p {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: 12px;
}

.chapter-note {
  margin-top: 16px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 20px;
}

/* Callouts */
.callout {
  background: #F3EFE3;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  padding: 15px 18px;
  margin-bottom: 14px;
}

.callout-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #8A6A1F;
  margin-bottom: 8px;
}

.callout-text {
  font-family: var(--serif);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--navy-2);
  margin-bottom: 0;
}

/* Checklists */
.checklist {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 20px;
}

.checklist-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}

.checklist ul { list-style: none; }

.checklist li {
  position: relative;
  padding-left: 24px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: 8px;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--gold);
}

/* Data table (Play Two) */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 4px;
}

.data-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy);
  background: #EDE7D6;
  padding: 10px 14px;
}

.data-table th:first-child { border-radius: 8px 0 0 0; }
.data-table th:last-child { border-radius: 0 8px 0 0; }

.data-table td {
  padding: 8px 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  background: #fff;
}

.data-table td strong { color: var(--navy); font-size: 14px; }
.data-table tr:nth-child(even) td { background: var(--paper); }

/* Step flow (Play Three) */
.step-flow {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.step {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  padding: 9px 14px;
}

.step-num {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
}

.step strong {
  display: block;
  font-size: 13.5px;
  color: var(--navy);
  margin-bottom: 2px;
}

.step span:last-child { font-size: 12.5px; color: var(--muted); }

.step-arrow {
  width: 2px;
  height: 8px;
  background: var(--gold);
  margin-left: 32px;
  border-radius: 2px;
}

/* ============ QUOTE PAGE ============ */
.ebook-quote-page {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
  justify-content: center;
  align-items: center;
}

.quote-inner {
  padding: 0 110px;
  text-align: center;
}

.quote-mark {
  font-family: var(--serif);
  font-size: 120px;
  line-height: 0.6;
  color: var(--gold);
  margin-bottom: 30px;
}

.quote-text {
  font-family: var(--serif);
  font-size: 27px;
  line-height: 1.55;
  font-weight: 400;
  color: #F0F4F9;
  margin-bottom: 36px;
}

.quote-rule {
  width: 64px;
  height: 3px;
  background: var(--gold);
  margin: 0 auto 18px;
}

.quote-attribution {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #9FB2C8;
}

/* ============ CLOUD MIGRATIONS (link cards) ============ */
.ebook-card-grid-page {
  background: var(--paper);
  padding: 72px 78px 60px;
}

.section-header { margin-bottom: 34px; }

.link-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  flex: 1;
}

.link-card {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 5px solid var(--gold);
  border-radius: 10px;
  padding: 30px 30px 26px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 14px rgba(11, 37, 69, 0.06);
}

.link-card-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}

.link-card-title {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 700;
  margin-bottom: 14px;
}

.link-card-title a {
  color: var(--navy);
  text-decoration: none;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 2px;
  transition: color 0.15s ease;
}
.link-card-title a:hover { color: var(--navy-2); }

.link-card-text {
  font-size: 14px;
  line-height: 1.62;
  color: var(--ink);
  margin-bottom: 20px;
}

.link-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.link-url {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  word-break: break-all;
}

.link-qr {
  width: 110px;
  height: 110px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px;
  background: #fff;
}

.chapter-lede a,
.section-note a {
  color: var(--navy);
  font-weight: 600;
  font-style: normal;
  text-decoration: none;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 1px;
}
.chapter-lede a:hover,
.section-note a:hover { color: var(--navy-2); }

.section-note {
  margin-top: 28px;
  font-size: 14px;
  line-height: 1.62;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  padding: 16px 20px;
}

/* VIBE_OTTER_EBOOK_PAGE_STYLES_START */
:root {
  --ebook-page-width: 210mm;
  --ebook-page-height: 297mm;
  --ebook-page-padding: 18mm;
  --ebook-page-gap: 28px;
  --ebook-preview-bg: #ece8df;
  --ebook-page-bg: #ffffff;
  --ebook-ink: #1f2933;
}

.ebook,
.ebook * {
  box-sizing: border-box;
}

.ebook-page,
.ebook-page * {
  text-shadow: none !important;
}

.ebook {
  width: 100%;
  margin: 0 auto;
  padding: 32px 16px;
  background: var(--ebook-preview-bg);
  color: var(--ebook-ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--ebook-page-gap);
}

.ebook-page {
  width: var(--ebook-page-width);
  min-height: var(--ebook-page-height);
  height: var(--ebook-page-height);
  max-width: 100%;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(31, 41, 51, 0.18);
  break-after: page;
  page-break-after: always;
}

:where(.ebook-page) {
  padding: var(--ebook-page-padding);
  background: var(--ebook-page-bg);
  color: var(--ebook-ink);
}

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

.ebook-page img,
.ebook-page picture,
.ebook-page video,
.ebook-page canvas,
.ebook-page svg {
  max-width: 100%;
}

:where(.ebook-page img) {
  height: auto;
  object-fit: contain;
}

.ebook-page:not(.ebook-cover-page):not([data-ebook-full-bleed="true"]) img:not(.ebook-background-image):not([data-allow-crop="true"]) {
  object-fit: contain !important;
  object-position: center center;
}

:where(.ebook-cover-page, .ebook-closing-page) {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ebook-cover-page.ebook-full-bleed,
.ebook-cover-page .ebook-full-bleed,
.ebook-page[data-ebook-full-bleed="true"] {
  padding: 0;
}

.ebook-cover-page.ebook-full-bleed img,
.ebook-page[data-ebook-full-bleed="true"] img,
.ebook-page .ebook-background-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ebook-toc-page,
.ebook-chapter-page,
.ebook-text-page,
.ebook-text-image-page,
.ebook-quote-page,
.ebook-card-grid-page,
.ebook-table-page,
.ebook-tracker-page,
.ebook-closing-page {
  page-break-inside: avoid;
  break-inside: avoid;
}

:where(.ebook-text-image-page) {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 24px;
  align-items: start;
}

:where(.ebook-card-grid-page .ebook-card-grid),
:where(.ebook-card-grid-page [class*="card-grid"]) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

:where(.ebook-toc-page .toc-list) {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

:where(.ebook-toc-page .toc-entry) {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid rgba(31, 41, 51, 0.14);
  color: inherit;
  text-decoration: none;
}

:where(.ebook-toc-page .toc-entry:hover) {
  text-decoration: none;
}

:where(.ebook-toc-page .toc-num),
:where(.ebook-toc-page .toc-page-marker),
:where(.ebook-toc-page .toc-page-num) {
  font-weight: 700;
  white-space: nowrap;
}

:where(.ebook-toc-page .toc-info) {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

:where(.ebook-toc-page .toc-chapter) {
  font-weight: 700;
}

:where(.ebook-toc-page .toc-desc) {
  font-size: 0.9em;
  line-height: 1.35;
}

.ebook-table-page table,
.ebook-tracker-page table {
  width: 100%;
  border-collapse: collapse;
}

:where(.ebook-quote-page) {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media screen {
  .ebook-page-frame {
    position: relative;
    flex: 0 0 auto;
    margin: 0 auto;
    width: var(--ebook-page-width);
    height: var(--ebook-page-height);
  }

  .ebook-page-scale {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--ebook-page-width);
    height: var(--ebook-page-height);
    transform-origin: top left;
  }

  .ebook-page-frame > .ebook-page-scale > .ebook-page {
    width: var(--ebook-page-width) !important;
    min-width: var(--ebook-page-width) !important;
    max-width: none !important;
    height: var(--ebook-page-height) !important;
    min-height: var(--ebook-page-height) !important;
    max-height: var(--ebook-page-height) !important;
    margin: 0 !important;
    transform: none !important;
    zoom: 1 !important;
  }
}

@media screen and (max-width: 860px) {
  .ebook {
    padding: 18px 10px;
    gap: 18px;
  }
}

@page {
  size: A4;
  margin: 0;
}

@media print {
  html,
  body {
    width: var(--ebook-page-width);
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .ebook {
    display: block !important;
    width: var(--ebook-page-width) !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
  }

  .ebook-page {
    width: var(--ebook-page-width) !important;
    min-width: var(--ebook-page-width) !important;
    max-width: var(--ebook-page-width) !important;
    height: var(--ebook-page-height) !important;
    min-height: var(--ebook-page-height) !important;
    max-height: var(--ebook-page-height) !important;
    margin: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
    break-after: page !important;
    page-break-after: always !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .ebook-page:last-child {
    break-after: auto !important;
    page-break-after: auto !important;
  }

  .ebook-page-frame,
  .ebook-page-scale {
    display: contents !important;
    width: auto !important;
    height: auto !important;
    transform: none !important;
  }

  :where(.ebook-page) {
    padding: var(--ebook-page-padding);
  }

  :where(.ebook-page img) {
    object-fit: contain;
  }

  .ebook-cover-page.ebook-full-bleed img,
  .ebook-page[data-ebook-full-bleed="true"] img,
  .ebook-page .ebook-background-image {
    object-fit: cover;
  }

  .web-only,
  [data-web-only],
  .chapter-nav,
  .chapter-nav-links,
  #chapterNav,
  #chapter-nav,
  .progress-bar-container,
  .progress-bar-wrap,
  .progress-bar-wrapper,
  #progressBar,
  #progress-bar,
  .keyboard-hint,
  #keyboardHint,
  .cover-scroll-hint,
  .cover-cta,
  .cover-btn,
  .back-to-top,
  [class*="back-to-top"] {
    display: none !important;
  }
}
/* VIBE_OTTER_EBOOK_PAGE_STYLES_END */
