/* Custom styles for Graph Equilibrium Radiative Transfer book */

/* Center the entire book layout */
.quarto-container {
  max-width: 1400px;
  margin: 0 auto;
}

/* Center the navbar/header */
.navbar-container {
  max-width: 1400px;
  margin: 0 auto;
}

/* Target only the Published metadata by being more specific about the container */
.quarto-title-meta > div:nth-child(2) .quarto-title-meta-heading {
  visibility: hidden;
  position: relative;
}

.quarto-title-meta > div:nth-child(2) .quarto-title-meta-heading:after {
  visibility: visible;
  position: absolute;
  top: 0;
  left: 0;
  content: "LAST UPDATED";
}

/* Quote box styling */
.quote-box {
  border-left: 4px solid #007acc;
  background-color: #f8f9fa;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 0 4px 4px 0;
  font-style: italic;
}

.quote-box strong {
  font-style: normal;
  color: #007acc;
}

/* Counters for theorem environments - reset per chapter */
body {
  counter-reset: theorem definition lemma proposition corollary;
}

/* Extract chapter number from page title and store as CSS variable */
/* This will be set by JavaScript below */

/* Theorem environments */
.theorem {
  counter-increment: theorem;
  border-left: 4px solid #007acc;
  background-color: #f8f9fa;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 0 4px 4px 0;
}

.theorem::before {
  content: "Theorem " var(--chapter-number, "") counter(theorem) ". ";
  font-weight: bold;
  color: #007acc;
  display: block;
  margin-bottom: 0.5rem;
}

.theorem[data-title]::before {
  content: "Theorem " var(--chapter-number, "") counter(theorem) " (" attr(data-title) "). ";
}

/* Proof environment */
.proof {
  border-left: 4px solid #28a745;
  background-color: #f8fff9;
  padding: 1rem;
  margin: 1rem 0 1.5rem 0;
  border-radius: 0 4px 4px 0;
}

.proof::before {
  content: "Proof. ";
  font-weight: bold;
  font-style: italic;
  color: #28a745;
}

.proof::after {
  content: " ■";  /* Black square instead of ∎ */
  float: right;
  font-weight: bold;
  color: #000000;  /* Pure black */
}

/* Definition boxes */
.definition {
  counter-increment: definition;
  border-left: 4px solid #6f42c1;
  background-color: #faf8ff;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 0 4px 4px 0;
}

.definition::before {
  content: "Definition " var(--chapter-number, "") counter(definition) ". ";
  font-weight: bold;
  color: #6f42c1;
  display: block;
  margin-bottom: 0.5rem;
}

.definition[data-title]::before {
  content: "Definition " var(--chapter-number, "") counter(definition) " (" attr(data-title) "). ";
}

/* Lemma environment */
.lemma {
  counter-increment: lemma;
  border-left: 4px solid #007acc;
  background-color: #f8f9fa;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 0 4px 4px 0;
}

.lemma::before {
  content: "Lemma " var(--chapter-number, "") counter(lemma) ". ";
  font-weight: bold;
  color: #007acc;
  display: block;
  margin-bottom: 0.5rem;
}

.lemma[data-title]::before {
  content: "Lemma " var(--chapter-number, "") counter(lemma) " (" attr(data-title) "). ";
}

/* Proposition environment */
.proposition {
  counter-increment: proposition;
  border-left: 4px solid #007acc;
  background-color: #f8f9fa;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 0 4px 4px 0;
}

.proposition::before {
  content: "Proposition " var(--chapter-number, "") counter(proposition) ". ";
  font-weight: bold;
  color: #007acc;
  display: block;
  margin-bottom: 0.5rem;
}

.proposition[data-title]::before {
  content: "Proposition " var(--chapter-number, "") counter(proposition) " (" attr(data-title) "). ";
}

/* Corollary environment */
.corollary {
  counter-increment: corollary;
  border-left: 4px solid #007acc;
  background-color: #f8f9fa;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 0 4px 4px 0;
}

.corollary::before {
  content: "Corollary " var(--chapter-number, "") counter(corollary) ". ";
  font-weight: bold;
  color: #007acc;
  display: block;
  margin-bottom: 0.5rem;
}

.corollary[data-title]::before {
  content: "Corollary " var(--chapter-number, "") counter(corollary) " (" attr(data-title) "). ";
}

/* Example boxes */
.example {
  border-left: 4px solid #fd7e14;
  background-color: #fff8f0;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 0 4px 4px 0;
}

.example::before {
  content: "Example. ";
  font-weight: bold;
  color: #fd7e14;
  display: block;
  margin-bottom: 0.5rem;
}

.example[data-title]::before {
  content: "Example (" attr(data-title) "). ";
}

/* Code styling */
.sourceCode {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
}

/* Equation numbering */
.eq-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Table styling */
.table {
  margin: 1rem 0;
}

/* Figure captions */
.figure-caption {
  font-style: italic;
  color: #6c757d;
  text-align: center;
  margin-top: 0.5rem;
}