/* General Styles for EPUB */
html {
  line-height: 1.2;
  font-family: 'Times New Roman', Times, serif;
  color: #1a1a1a;
}
p {
  text-indent: 0;
  margin: 1em 0;
  widows: 2;
  orphans: 2;
  text-align: justify;
  -epub-hyphens: auto;
  -webkit-hyphens: auto;
  -moz-hyphens: auto;
  hyphens: auto;
}
ol, ul { margin: 1em 0 0 1.7em; }
li > ol, li > ul { margin-top: 0; }
blockquote { margin: 1em 0 1em 1.7em; orphans: 2; widows: 2; }
blockquote > p:first-child {
  page-break-after: avoid;
  -webkit-column-break-after: avoid;
  -webkit-region-break-after: avoid;
}
code {
  font-family: Menlo, Monaco, 'Lucida Console', Consolas, monospace;
  font-size: 85%;
  margin: 0;
  hyphens: manual;
  white-space: pre-wrap;
}
pre { margin: 1em 0; }
pre code { padding: 0; overflow: visible; }
hr {
  background-color: #1a1a1a;
  border: none;
  height: 1px;
  margin: 1em 0;
}
table {
  margin: 1em 0;
  border-collapse: collapse;
  width: 100%;
}
table caption { margin-bottom: 0.75em; }
tbody {
  margin-top: 0.5em;
  border-top: 1px solid #1a1a1a;
  border-bottom: 1px solid #1a1a1a;
}
th, td { padding: 0.25em 0.5em; }
th { border-top: 1px solid #1a1a1a; }
header { margin-bottom: 4em; text-align: center; }
span.smallcaps { font-variant: small-caps; }
.display.math { display: block; text-align: center; margin: 0.5rem auto; }
a.footnote-ref { vertical-align: super; }
em, em em em, em em em em em { font-style: italic; }
em em, em em em em { font-style: normal; }
q { quotes: \"“\" \"”\" \"‘\" \"’\"; }

/* Images and captions */

img {
  width: 100%;
}
figure {
  margin: 1.5em auto;
  text-align: center;
}
figure img {
  display: block;
  margin: 0 auto;
}
figcaption {
  margin-top: 0.5em;
  font-size: 0.9em;
  font-style: italic;
  color: #666;
  text-align: center;
}

/* Headings */

h1 {
  /* margin: 3em 0 0 0; */
  font-size: 2em;
  line-height: 150%;
}
h2 {
  /* margin: 1.5em 0 0 0; */
  font-size: 1.5em;
  line-height: 135%;
}
h3 { margin: 1.3em 0 0 0; font-size: 1.3em; }
h4 { margin: 1.2em 0 0 0; font-size: 1.2em; }
h5 { margin: 1.1em 0 0 0; font-size: 1.1em; }
h6 { font-size: 1em; }
h1, h2, h3, h4, h5, h6 {
  text-indent: 0;
  text-align: left;
  font-weight: bold;
}

/* Title Page Styling */
section.titlepage {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  page-break-after: always;
  padding: 2em;
  box-sizing: border-box;
  overflow: hidden;
}

section.titlepage > * {
  max-width: 100%;
}

section.titlepage h1.main,
section.titlepage h1.subtitle,
section.titlepage h1.edition {
  text-align: center;
  width: 100%;
  margin: 0;
  padding: 0;
  line-height: 1.2;
}

section.titlepage h1.main {
  font-size: 2em;
  font-weight: bold;
  margin-top: 2em;
  margin-bottom: 0.5em;
  text-decoration: underline;
}

section.titlepage h1.subtitle {
  font-size: 1em;
  margin-bottom: 1em;
}

section.titlepage h1.edition {
  font-size: 0.8em;
  font-weight: normal;
  margin-bottom: auto;
}

section.titlepage p.author {
  text-align: right;
  font-size: 1.1em;
  font-weight: normal;
  margin: 0 0 0.2em 0;
  padding: 0;
}

section.titlepage p.publisher {
  text-align: right;
  font-size: 1.1em;
  font-style: italic; 
  margin: 0 0 0.2em 0;
  padding: 0;
}

section.titlepage div.rights {
  text-align: right;
  font-size: 1.1em;
  font-style: italic;
  margin: 0 0 0.2em 0;
  padding: 0;
}

section.titlepage p.date,
section.titlepage p.author {
  display: none
}

/* Chapter dates styling */
.chapter-dates {
  display: block;                 /* force block so breaks are honored */
  margin: 2em 0;
  page-break-after: always;       /* EPUB 2/3 */
}

/* Ensure inner paragraph doesn't override alignment */
.chapter-dates p {
  text-align: right;
  font-size: 0.85em;
  font-style: italic; 
  margin: 0; /* tighter spacing since container already has margins */
}

/* Thematic blocks (EPUB-safe): situation, abstract, quote, note, rule, details, music, define
   - Background color with left border
   - Caption as h6 heading with matching color
   - Clean visual separation
*/
.situation, .abstract, .quote, .note, .rule, .details, .music, .define {
  margin: 1.5em 0;
  padding: 1em;
  background-color: #f9f9f9;
  border-left: 4px solid #bbb;
}

/* Caption heading (h6) inside blocks */
.situation h6.block-caption,
.abstract h6.block-caption,
.quote h6.block-caption,
.note h6.block-caption,
.rule h6.block-caption,
.details h6.block-caption,
.music h6.block-caption,
.define h6.block-caption {
  margin: 0 0 0.5em 0;
  padding: 0;
  font-size: 1em;
  font-weight: bold;
  text-align: left;
}

/* Remove heading level styling inside blocks */
.situation h6, .abstract h6, .quote h6, .note h6, .rule h6, .details h6, .music h6, .define h6 {
  margin: 0 0 0.5em 0;
  font-weight: bold;
  font-size: 1em;
}

/* --- Type-specific colors --- */

/* situation: teal */
.situation { border-left-color: rgb(0, 121, 107); }
.situation h6.block-caption { color: rgb(0, 121, 107); }

/* abstract: light blue */
.abstract { border-left-color: rgb(2, 136, 209); }
.abstract h6.block-caption { color: rgb(2, 136, 209); }

/* quote: grey and italic content */
.quote { 
  border-left-color: #9e9e9e;
  font-style: italic;
}
.quote h6.block-caption { color: #9e9e9e; font-style: normal; }

/* note: blue (Material blue A200) */
.note { border-left-color: rgb(68, 138, 255); }
.note h6.block-caption { color: rgb(68, 138, 255); }

/* rule: green */
.rule { border-left-color: rgb(0, 200, 83); }
.rule h6.block-caption { color: rgb(0, 200, 83); }

/* details: deep purple */
.details { border-left-color: rgb(103, 58, 183); }
.details h6.block-caption { color: rgb(103, 58, 183); }

/* music: red */
.music { border-left-color: rgb(194, 29, 29); }
.music h6.block-caption { color: rgb(194, 29, 29); }

/* define: green (like success) */
.define { border-left-color: rgb(0, 200, 83); }
.define h6.block-caption { color: rgb(0, 200, 83); }

/* Author signature: right-aligned, italic, spaced from text */
.author {
  display: block;
  text-align: right;
  font-style: italic;
  margin-top: 0.5em;
}

/* Keep link accent for anchors with class author (Apple Books/WebKit + fallbacks) */
a.author {
  display: block;            /* align like block signature when applied to <a> */
  text-align: right;
  font-style: italic;
  text-decoration: underline; /* ensure link look if reader suppresses default */
  color: #0645AD !important; /* force blue link color */
}
a.author:visited { 
  color: #0B0080 !important; /* force visited link color */
}
