/* === PAGE STRUCTURE === */
body {
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  background-color: #fafafa;
  color: #222;
  line-height: 1.6;
  font-size: 16px;
  margin: 0;
  padding: 0;
}

.main-content, .content, .quarto-document-content {
  max-width: 1200px;
  margin: auto;
  background: #fff;
  padding: 2.5rem 4rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border-radius: 10px;
}

/* === HEADINGS === */
h1, h2, h3, h4 {
  font-family: "Poppins", "Segoe UI", sans-serif;
  color: #004c7f;
  line-height: 1.3;
  margin-top: 1.5em;
  margin-bottom: 0.6em;
}

h1 {
  font-size: 1.8em;
  border-bottom: 2px solid #e5e5e5;
  padding-bottom: 0.3em;
}

h2 {
  font-size: 1.5em;
  color: #005a9c;
}

h3 {
  font-size: 1.25em;
  color: #006ba6;
}

/* === TOC STYLING === */
#TOC {
  background: #f2f7fa;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  padding: 1rem;
  font-size: 0.95em;
}

#TOC a {
  text-decoration: none;
  color: #004c7f;
}

#TOC a:hover {
  text-decoration: underline;
}

/* === TABLES === */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.2em 0;
}

table th {
  background-color: #e7f1fa;
  color: #004c7f;
  font-weight: 600;
  text-align: left;
  padding: 8px;
}

table td {
  border-bottom: 1px solid #eee;
  padding: 8px;
}

caption {
  caption-side: top;
  font-weight: bold;
  text-align: left;
  color: #004c7f;
  margin-bottom: 0.5rem;
}

/* === CODE BLOCKS === */
pre, code {
  background-color: #f8f9fa;
  border-radius: 6px;
  padding: 0.5rem;
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 0.9em;
}

.sourceCode {
  border-left: 3px solid #007acc;
  padding-left: 10px;
  margin-bottom: 1rem;
}

/* === FIGURES & IMAGES === */
figure, img {
  display: block;
  margin: 1.5rem auto;
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0,0,0,0.05);
}

figcaption {
  text-align: center;
  font-size: 0.9em;
  color: #666;
  margin-top: 0.4rem;
}

/* === FOOTER & HEADER === */
header, footer {
  width: 100%;
  text-align: center;
  color: #666;
  font-size: 0.9em;
  margin: 1.5rem 0;
}

/* === TOGGLE BUTTON === */
details summary {
  cursor: pointer;
  font-weight: bold;
  color: #004c7f;
}

/* === RESPONSIVE ADJUSTMENTS === */
@media (max-width: 900px) {
  .main-content, .content, .quarto-document-content {
    padding: 1.5rem 2rem;
  }

  h1 { font-size: 1.6em; }
  h2 { font-size: 1.3em; }
}

/* Table styling */
.panel-tabset {
  margin-top: 1.2rem;
  border: 1px solid #dce4ec;
  border-radius: 6px;
  background-color: #f9fbfd;
  padding: 0.8rem 1rem;
}

.nav-tabs > li > a {
  color: #004c7f;
  font-weight: 600;
}

.nav-tabs > li.active > a {
  background-color: #e7f1fa;
  border-color: #d0e2f2;
}

/* Fix overlap title */
body {
  padding-top: 70px;
}

/* Extra space the title block */
.quarto-title-block {
  padding-top: 0.5rem;
}

body {
  padding-top: 4.25rem;
}

@media (max-width: 992px) {
  body {
    padding-top: 5.25rem;
  }
}