/* -------------------------------------------------------------------------
   BOOK PRINT OBSIDIAN PLUGIN — 6 × 9 PHYSICAL TRADE BOOK STYLESHEET
   Trim Size: 6 × 9 inches (152.4 × 228.6 mm)
   Typeface: Libre Caslon Text
   ------------------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Libre+Caslon+Text:ital,wght@0,400;0,700;1,400&display=swap');

@media print {
  @page {
    size: 6in 9in;
    margin-top: 0.75in;
    margin-bottom: 0.75in;
    margin-inside: 0.85in;  /* Inside Gutter */
    margin-outside: 0.65in; /* Outside margin */
  }

  @page :left {
    margin-left: 0.65in;
    margin-right: 0.85in;
  }

  @page :right {
    margin-left: 0.85in;
    margin-right: 0.65in;
  }
}

.book-interior {
  font-family: "Libre Caslon Text", "Georgia", "Times New Roman", serif;
  font-size: 12pt;
  line-height: 1.38;
  color: #000000;
  background-color: #ffffff;
  box-sizing: border-box;
  width: 100%;
}

/* Page Break Utility */
.book-page-break {
  break-before: page;
  page-break-before: always;
}

/* Typography Hierarchy */
.book-h1 {
  break-before: page;
  page-break-before: always;
  font-family: "Libre Caslon Text", serif;
  font-size: 24pt;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 1.5in;
  margin-bottom: 0.4in;
  text-align: center;
  text-transform: none;
}

.book-h2 {
  font-family: "Libre Caslon Text", serif;
  font-size: 18pt;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 0.35in;
  margin-bottom: 0.2in;
}

.book-h3 {
  font-family: "Libre Caslon Text", serif;
  font-size: 14pt;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 0.25in;
  margin-bottom: 0.15in;
}

.book-h4 {
  font-family: "Libre Caslon Text", serif;
  font-size: 12pt;
  font-weight: 700;
  line-height: 1.35;
  margin-top: 0.2in;
  margin-bottom: 0.1in;
}

/* Paragraphs & Indentation */
.book-main-content p {
  margin-top: 0;
  margin-bottom: 0;
  text-indent: 1.5em;
  text-align: justify;
  hyphens: auto;
  orphans: 2;
  widows: 2;
}

/* First paragraph after heading has no indent */
.book-h1 + p,
.book-h2 + p,
.book-h3 + p,
.book-h4 + p,
.book-page-break + p,
.book-title-page + p,
.book-copyright-page + p,
blockquote + p {
  text-indent: 0 !important;
}

/* Blockquotes */
blockquote {
  font-style: italic;
  font-size: 11pt;
  line-height: 1.35;
  margin-top: 0.2in;
  margin-bottom: 0.2in;
  margin-left: 0.4in;
  margin-right: 0.4in;
}

blockquote p {
  text-indent: 0;
  text-align: left;
}

/* Lists */
ul, ol {
  margin-top: 0.15in;
  margin-bottom: 0.15in;
  padding-left: 0.4in;
}

li {
  margin-bottom: 0.05in;
}

/* Images */
.book-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0.2in auto;
  page-break-inside: avoid;
  break-inside: avoid;
}

/* Code Blocks */
pre, code {
  font-family: "Courier New", Courier, monospace;
  font-size: 10pt;
  background-color: #f8f8f8;
}

pre {
  padding: 0.15in;
  border: 1px solid #e0e0e0;
  white-space: pre-wrap;
  word-wrap: break-word;
  page-break-inside: avoid;
  break-inside: avoid;
  margin: 0.2in 0;
}

/* Horizontal Rule */
.book-hr {
  border: none;
  border-top: 1px solid #000000;
  margin: 0.3in auto;
  width: 40%;
}

/* Title Page Layout */
.book-title-page {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-top: 1.5in;
}

.book-main-title {
  font-size: 32pt;
  font-weight: 700;
  margin-bottom: 0.2in;
  line-height: 1.15;
}

.book-main-subtitle {
  font-size: 18pt;
  font-weight: 400;
  font-style: italic;
  margin-bottom: 2in;
  color: #333333;
}

.book-author-name {
  font-size: 16pt;
  font-weight: 700;
  margin-top: auto;
  margin-bottom: 0.1in;
  text-indent: 0;
}

.book-imprint-name {
  font-size: 12pt;
  font-style: italic;
  color: #666666;
  text-indent: 0;
}

/* Copyright Page Layout */
.book-copyright-page {
  font-size: 9.5pt;
  line-height: 1.4;
  padding-top: 4in;
  color: #222222;
}

.book-copyright-page p {
  text-indent: 0;
  text-align: left;
  margin-bottom: 0.15in;
}
