:root {
  --yale: darkslategray;
  --yaledarkgrey: darkslategray;
  --yalelightgrey: whitesmoke;
  --yalelightblue: lightsteelblue;
  --yaleblue: lightsteelblue;
  --yaleyellow: lightsteelblue;
  --yaleorange: lightsteelblue;
  --card-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --card-shadow-active: 0 4px 8px rgba(0, 0, 0, 0.2);
  --card-offset: 25px;
  --font-size: 18px;
  --margin-gap: 24px;
  --margin-width: 260px;
  --post-citation-margin-top: calc(var(--spacing-unit) * 3);
  --post-citation-border: rgba(47, 79, 79, 0.2);
  --post-citation-card-bg: rgba(245, 245, 245, 0.7);
  --post-citation-header-bg: var(--yalelightblue);
  --post-citation-divider: rgba(47, 79, 79, 0.12);
  --post-nav-color: var(--yale);
}

/* Base styles */
body {
  font-weight: 300;
  line-height: 1.6;
}

/* Typography */
h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.2;
}

h2 {
  font-family: "Source Sans 3";
  font-size: 2.5rem;
  font-weight: 200;
  margin-top: calc(var(--spacing-unit) * 3);
  margin-bottom: calc(var(--spacing-unit) * 2);
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
  padding-bottom: var(--spacing-unit);
}

h3 {
  font-family: "Source Sans 3";
  font-size: 1.25rem;
  margin-top: calc(var(--spacing-unit) * 2);
  margin-bottom: var(--spacing-unit);
  font-weight: 700;
  color: var(--yaledarkgrey);
}

h4 {
  font-family: "Source Sans 3";
  font-size: 1.75rem;
  margin-top: calc(var(--spacing-unit) * 2);
  margin-bottom: var(--spacing-unit);
  font-weight: 200;
  color: var(--yaledarkgrey);
}

p a {
  color: var(--yaleorange);
  text-decoration: none;
}

/* Post header */
.post-header {
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.meta {
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.kwote {
  font-family: "Source Code Pro";
  font-size: 0.9rem;
}

.highlight {
  background-color: var(--yaleyellow);
}

/* Image styles */
section .image-container {
  margin: calc(var(--spacing-unit) * 3) 0;
}

#image-blocks .image-container {
  margin: 0;
}

img {
  max-width: 100%;
  border-radius: 10px;
  display: block;
}

.image-caption {
  font-family: "Source Sans 3";
  font-size: 1rem;
  font-weight: 400;
  margin-top: var(--spacing-unit);
  color: var(--yale);
}

.image-caption .kwote {
  font-size: 0.8rem;
}

.image-caption a {
  text-decoration: none;
  color: var(--yaleorange);
}

/* Rankings list */
.rankings-list {
  list-style-type: none;
  padding-left: 0;
}

.ranking-item {
  margin-bottom: var(--spacing-unit);
  border-radius: 10px;
  transition: all 0.2s ease;
  font-family: "Source Code Pro";
  font-weight: 400;
  cursor: pointer;
  color: var(--warm-white);
}

#winner {
  color: var(--warm-black);
}

.ranking-header {
  padding: var(--spacing-unit);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ranking-details {
  display: none;
  padding: var(--spacing-unit);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 0.9rem;
}

.ranking-details p {
  font-family: "Source Code Pro";
}

.ranking-details p a {
  text-decoration: none;
  color: var(--yalelightblue);
}

.ranking-details p .green {
  color: var(--yaleyellow);
}

.ranking-item.expanded .ranking-details {
  display: block;
}

.model-name {
  font-weight: 500;
}

.image-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1rem 0;
}

.nav-button {
  padding: 0.5rem 1rem;
  background: none;
  border: 1px solid var(--warm-black);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-button:hover {
  scale: 1.05;
}

.appendix-block {
  display: none; /* Hide all blocks by default */
}

.appendix-block.active {
  display: block; /* Show only active block */
}

.appendix-block {
  margin: calc(var(--spacing-unit) * 2) 0;
  padding: calc(var(--spacing-unit) * 0.5) calc(var(--spacing-unit) * 2)
    calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 2);
  background: var(--yale);
  border-radius: 10px;
  color: var(--warm-white);
}

.caption-stack {
  position: relative;
  min-height: calc(var(--card-offset) * 9 + 100px);
  margin: calc(var(--spacing-unit) * 2) 0;
}

.caption-card {
  background: var(--warm-white);
  border-radius: 10px;
  padding: var(--spacing-unit);
  cursor: pointer;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.caption-card .model-name {
  font-family: "Source Code Pro";
  font-size: 0.8rem;
  font-weight: 500;
}

.caption-card .caption-text {
  font-family: "Source Code Pro";
  font-size: 0.8rem;
  line-height: 1.5;
  margin-top: 0.5rem;
  display: none; /* Hidden by default */
}

.caption-card.expanded .caption-text {
  display: block; /* Show when expanded */
}

.caption-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.caption-card .model-name {
  font-family: "Source Code Pro";
  font-size: 0.8rem;
  font-weight: 500;
}

.caption-card .strength {
  font-family: "Source Code Pro";
  font-size: 0.8rem;
  font-weight: 400;
  opacity: 0.8;
}

.nav-container {
  text-align: center;
  margin: 2rem 0;
}

.image-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.image-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  font-family: "Source Code Pro";
  font-weight: 500;
  margin: 0 0 calc(var(--spacing-unit) * 0.5) 0;
  padding: 0 calc(var(--spacing-unit) * 0.5);
}

.image-section {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 0 2rem 0;
}

.nav-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--warm-white);
  font-size: 2rem;
  font-weight: 100;
}

.nav-button.prev {
  left: 0.5rem;
}

.nav-button.next {
  right: 0.5rem;
}

.image-container {
  flex: 1;
  margin: 0 3rem;
}

/* Footnote styles */
.footnote-ref {
  font-size: 0.8em;
  vertical-align: super;
  color: var(--yale);
  cursor: pointer;
}

.footnote-box {
  margin: var(--spacing-unit) 0;
  border: 1px solid var(--yale);
  border-radius: 8px;
  overflow: hidden;
}

.footnote-header {
  display: flex;
  align-items: center;
  padding: calc(var(--spacing-unit) * 0.75);
  cursor: pointer;
  background-color: var(--yalelightgrey);
}

.footnote-marker {
  font-size: 1.2em;
  color: var(--yale);
  margin-right: calc(var(--spacing-unit) * 0.75);
}

.footnote-title {
  flex-grow: 1;
  font-family: "Source Sans 3";
  color: var(--yale);
}

.footnote-chevron {
  transition: transform 0.3s ease;
  color: var(--yale);
}

.footnote-box.expanded .footnote-chevron {
  transform: rotate(180deg);
}

.footnote-content {
  height: 0;
  overflow: hidden;
  transition: height 0.3s ease-out;
  padding: 0 calc(var(--spacing-unit) * 0.75);
  border-top: 1px solid rgba(151, 141, 133, 0.2);
  font-family: "Source Sans 3";
}

.footnote-box.expanded .footnote-content {
  height: auto;
  padding: calc(var(--spacing-unit) * 0.75);
}

.post-toc-link-detail {
  padding-left: 2rem;
}
/* Responsive styles */
@media (max-width: 800px) {
  .post-back-to-top {
    left: 0.75rem;
    bottom: 0.75rem;
  }

  .post-margin-toc-inner {
    padding: 0.85rem 0.9rem;
  }

  :root {
    --card-offset: 20px;
    --max-width: 600px;
  }

  .container {
    padding: 0 16px;
  }

  h1.title {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 2rem;
  }

  h3 {
    font-size: 1.125rem;
  }

  h4 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  :root {
    --spacing-unit: 0.8rem;
    --card-offset: 15px;
    --max-width: 400px;
  }

  h1.title {
    font-size: 1.5rem;
  }

  .headerblock .site-header {
    gap: 16px;
  }
}

.footerblock {
  width: 100%;
  background-color: var(--yale);
  color: var(--warm-white);
  padding: calc(var(--spacing-unit) * 2) 0;
  margin-top: calc(var(--spacing-unit) * 4); /* Space from main content */
}

.footerblock .container {
  margin: 0 auto;
  padding: 0 16px;
}

.footerblock .container a {
  text-decoration: none;
  color: var(--warm-white);
}

.copyright {
  font-family: "Source Sans 3";
  font-size: 0.9rem;
  font-weight: 200;
  letter-spacing: 4px;
  text-align: center;
  margin-top: calc(var(--spacing-unit) * 2);
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.socialIcons {
  margin-top: calc(var(--spacing-unit) * 2);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

/* d3 styles */

figure {
  margin: 2rem 0;
}

#confidence-intervals {
  width: 100%;
  max-width: var(--max-width);
  margin: calc(var(--spacing-unit) * 2) auto;
  background-color: var(--warm-white);
  border-radius: 10px;
}

.plot-title {
  font-size: 1.25rem;
  font-family: "Source Sans 3";
  fill: var(--yaledarkgrey);
}

.tick text,
.model-label,
.axis-label {
  font-size: 1.25rem;
  font-family: "Source Sans 3";
  fill: var(--yaledarkgrey);
}

.tick line {
  stroke: var(--yalelightgrey);
}

.ci {
  stroke: var(--yale);
  stroke-width: 1;
}

.mean {
  fill: var(--yaleorange);
}
.domain {
  stroke: var(--yalelightgrey);
  stroke-width: 1;
}

@media (max-width: 800px) {
  .plot-title {
    font-size: 1rem;
  }

  .tick text,
  .model-label,
  .axis-label {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .plot-title {
    font-size: 0.75rem;
  }

  .tick text,
  .model-label,
  .axis-label {
    font-size: 0.67rem;
  }
}
