@font-face {
  font-family: 'PT Serif';
  src: url('/tmp/fonts/PTSerif-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'PT Serif';
  src: url('/tmp/fonts/PTSerif-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'PT Serif';
  src: url('/tmp/fonts/PTSerif-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
}

@font-face {
  font-family: 'PT Serif';
  src: url('/tmp/fonts/PTSerif-BoldItalic.ttf') format('truetype');
  font-weight: 700;
  font-style: italic;
}

.pt-serif-regular {
  font-family: "PT Serif", serif;
  font-weight: 400;
  font-style: normal;
}

.pt-serif-bold {
  font-family: "PT Serif", serif;
  font-weight: 700;
  font-style: normal;
}

.pt-serif-regular-italic {
  font-family: "PT Serif", serif;
  font-weight: 400;
  font-style: italic;
}

.pt-serif-bold-italic {
  font-family: "PT Serif", serif;
  font-weight: 700;
  font-style: italic;
}





@page {
  margin: 2cm 2cm 3cm 2cm;
  size: 148mm 210mm;
}

@page :left {
  @bottom-left {
    content: counter(page);
    position: absolute;
    z-index: -1;
  }
  @bottom-right {
    content: string(heading);
    position: absolute;
    z-index: -1;
  }
}

@page :right {
  @bottom-left {
    content: string(heading);
    position: absolute;
    z-index: -1;
  }
  @bottom-right {
    content: counter(page);
    position: absolute;
    z-index: -1;
  }
}

@page full {
  @bottom-right {
    content: none;
  }

  @bottom-left {
    content: none;
  }

  background: black;
  margin: 0;
}

@page :blank {
  @bottom-right {
    content: none;
  }

  @bottom-left {
    content: none;
  }
}

@page clean {
  @bottom-right {
    content: none;
  }

  @bottom-left {
    content: none;
  }
}

html {
  counter-reset: h2-counter;
  font-size: 10pt;
}
body {
  margin: 0;
}

p {
  line-height: 2;
  text-align: justify;
}
img {
  display: block;
  margin: 2em auto;
  max-width: 70%;
}


#contents {
  border-bottom: 1px dashed rgb(100,000,100);
  h2 {
    font-family: "PT Serif", serif;
    font-weight: 400;
    font-style: normal;
  }
  padding-top: 5px;
}

.chapter-title {
  counter-increment: h2-counter;
  display: flex;
  flex-direction: column;
  font-size: 3em;
  height: 6cm;
  justify-content: flex-end;
  margin: 0;
  string-set: heading content();
  text-align: center;

  font-family: "PT Serif", serif;
  font-weight: 700;
  font-style: normal !important;
  font-size: 36px !important; /* Uniform size */
  margin-bottom: 20px; /* Space below the heading */
  border-bottom: 2px solid rgb(100, 100, 100); /* Black line */
  padding-bottom: 10px; /* Space between text and line */
}


p {
  font-size: 16px !important; /* Standardize paragraph size */
  line-height: 1.6 !important; /* Improve readability */
  margin: 10px 0 !important; /* Space between paragraphs */
}

.chapter-title::before {
  content: "Chapter " counter(h2-counter) " ";
  display: block;
  font-size: 1.2rem;
  font-weight: normal;
  line-height: 1;
}

section {
  break-after: right;
}



#contents {
  page: clean;
}
#contents p {
  font-size: 2em;
}
#contents ul {
  display: block;
  margin: 1em 0;
  padding: 0;
}
#contents li {
  display: block;
}
#contents a {
  color: inherit;
  text-decoration: none;
}
#contents a::before {
  content: target-counter(attr(href), h2-counter) '. ' target-text(attr(href));
  width: 100%;
}
#contents a::after {
  content: target-counter(attr(href), page);
  text-align: end;
}

.outro {
  border-radius: 50% 50% 0 0 / 15mm 15mm 0 0;
  display: block;
  height: 90mm;
  left: -30mm;
  max-width: none;
  object-fit: cover;
  position: absolute;
  top: 120mm;
  width: 168mm;
  z-index: -1;
}

.fullpage {
  page: full;
}
.fullpage img {
  bottom: 0;
  height: 210mm;
  left: 0;
  margin: 0;
  max-width: none;
  object-fit: cover;
  position: absolute;
  width: 148mm;
  z-index: 1;
}
.fullpage:last-child {
  break-before: left;
}

a {
  font-size: 0.9rem;
  color: #3182ce;
  text-decoration: none;
  display: inline-block;
  margin-top: 1rem;
  
  /* Cross-browser transition */
  -webkit-transition: all 0.2s ease;
  -moz-transition: all 0.2s ease;
  -o-transition: all 0.2s ease;
  transition: all 0.2s ease;
}

a:hover {
  text-decoration: underline;
  color: #2c5282;
}


/* Container centering for older browsers */
#author-container {
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%); /* Old WebKit */
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 400px;
  text-align: center;
  }
  
  #author-about {
  padding: 20px;
  /* Fallback for older browsers */
  display: block;
  margin: 0 auto;
  }
  
  #author-profile-picture {
  width: 200px;
  height: 200px;
  -webkit-border-radius: 100px; /* Old WebKit */
  border-radius: 100px;
  margin: 0 auto 20px auto;
  display: block;
  }
  
  #author-name {
  font-size: 24px;
  font-weight: bold;
  margin: 0 0 10px 0;
  padding: 0;
  }
  
  #author-link {
  color: #1a202c;
  text-decoration: none;
  }
  
  #author-link:hover {
  color: #4a5568;
  text-decoration: underline;
  }
  
  #author-divider {
  width: 60px;
  height: 2px;
  background-color: #d1d5db;
  border: none;
  margin: 0 auto 20px auto;
  }
  
  #author-bio {
  color: #4b5563;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  }

#copyright-container {
    max-width: 600px;
    margin: 60px auto;
    text-align: center !important;
    font-family: Georgia, serif !important;
    line-height: 1.6 !important;
    color: #333 !important;
}

#copyright-notice {
    font-size: 24px;
    margin-bottom: 4px;
    border-bottom: 1px solid #333;
    padding-bottom: 8px;
    color: #1a1a1a;
}

#copyright-title {
    font-size: 28px;
    margin: 24px 0 4px 0;
    color: #1a1a1a;
}

#copyright-author {
    font-size: 18px;
    margin: 0 0 32px 0;
    color: #444;
    text-align: center;
}

#copyright-license-image {
    margin: 20px 0;
    width: 88px;
    height: 31px;

    display: block;
    margin-left: auto;
    margin-right: auto;
}

#copyright-copyright {
    font-size: 16px;
    margin: 16px 0;
    text-align: center;

}

#copyright-rights {
    font-size: 14px;
    color: #666;
    margin: 8px 0;
    text-align: center;

}

#copyright-printing {
    font-size: 14px;
    color: #666;
    margin: 8px 0;
    text-align: center;

}

#copyright-separator {
  width: 100%;
  max-width: 400px;
  height: 1px;
  background: #e2e8f0;
  position: relative;
  margin: 2rem 1rem;
  
  /* Gradient fallback */
  background: -webkit-gradient(linear, left top, right top, from(transparent), color-stop(#718096), to(transparent));
  background: -webkit-linear-gradient(left, transparent, #718096, transparent);
  background: -moz-linear-gradient(left, transparent, #718096, transparent);
  background: -o-linear-gradient(left, transparent, #718096, transparent);
  background: linear-gradient(to right, transparent, #718096, transparent);
}

#copyright-ex-libris {
  font-size: 1.5rem;
  font-style: italic;
  color: #4a5568;
  margin: 2rem 0;
  text-align: center;
}

#copyright-link { 
  font-size: 14px;
}
