/* Dartmouth Green custom styling for Quarto light and dark themes */

:root,
body.quarto-light {
  --bg-color: #ffffff;
  --text-color: #070000;
  --heading-color: #222222;
  --heading-2-color: #393939;
  --heading-3-color: #494949;
  --link-color: #00693e;
  --link-hover-color: #004f2d;
  --border-color: #00693e;
  --header-bg: #f4f4f4;
  --header-border: #d8d8d8;
  --navbar-bg: #f8faf9;
  --focus-ring-color: #00693e;
}

body.quarto-dark {
  --bg-color: #1a1a1a;
  --text-color: #e0e0e0;
  --heading-color: #f0f0f0;
  --heading-2-color: #d0d0d0;
  --heading-3-color: #c0c0c0;
  --link-color: #66a58b;
  --link-hover-color: #99c3b1;
  --border-color: #338764;
  --header-bg: #252525;
  --header-border: #404040;
  --navbar-bg: #141414;
  --focus-ring-color: #66a58b;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Top-right theme toggle styling (no navbar) */
.quarto-color-scheme-toggle {
  color: var(--text-color) !important;
}

.quarto-color-scheme-toggle:hover {
  color: var(--link-color) !important;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  color: var(--heading-color);
  font-weight: 500;
}

h2 {
  font-size: 1.35rem;
  color: var(--heading-2-color);
  border-bottom: none;
  margin-top: 1.6rem;
  margin-bottom: 0.9rem;
}

/* Highlighted terms */
.accent-text {
  color: var(--link-color);
  font-weight: 500;
}

/* Main content links */
main a:not(.about-link):not(.anchorjs-link) {
  color: var(--text-color);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

main a:not(.about-link):not(.anchorjs-link):hover {
  color: var(--link-color);
}

/* Trestles about column styling */
div.quarto-about-trestles .about-entity {
  padding-top: 0.5rem;
}

@media (min-width: 992px) {
  div.quarto-about-trestles .about-entity {
    flex: 0 0 32%;
  }
}

div.quarto-about-trestles .about-entity .about-image {
  border-radius: 8px;
}

div.quarto-about-trestles .about-entity .about-links {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  width: auto !important;
  gap: 0.5rem;
  padding-bottom: 1rem;
}

div.quarto-about-trestles .about-entity .about-link {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  min-width: 36px;
  height: 36px;
  border: 1px solid var(--border-color) !important;
  border-radius: 5px !important;
  color: var(--text-color) !important;
  text-decoration: none !important;
  padding: 0.35rem 0.65rem !important;
  font-size: 0.9rem !important;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

div.quarto-about-trestles .about-entity .about-link:hover {
  background-color: var(--header-bg) !important;
  color: var(--link-color) !important;
}

div.quarto-about-trestles .about-contents {
  border-left-color: var(--border-color);
}

/* Horizontal rules */
main hr {
  border: 0;
  background: var(--border-color);
  height: 1px;
  opacity: 1;
  margin: 1.5rem 0;
}

/* Arrow bullet lists */
.arrow-list ul,
ul.arrow-list {
  list-style: none;
  padding-left: 0;
}

.arrow-list ul > li,
ul.arrow-list > li {
  padding-left: 1.5em;
  position: relative;
  margin-bottom: 0.9em;
}

.arrow-list ul > li::before,
ul.arrow-list > li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--link-color);
  font-weight: bold;
}

.paper-meta {
  font-size: 10pt;
}

/* Collapsible abstracts using native <details> */
details.abstract-collapse {
  display: inline;
}

details.abstract-collapse summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  padding: 1px 8px;
  border: 1px solid var(--header-border);
  border-radius: 4px;
  background-color: transparent;
  color: var(--text-color);
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

details.abstract-collapse summary::-webkit-details-marker {
  display: none;
}

details.abstract-collapse summary::after {
  content: "";
  width: 5px;
  height: 5px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.15s ease;
}

details.abstract-collapse[open] summary,
details.abstract-collapse summary:hover {
  background-color: var(--header-bg);
  border-color: var(--heading-3-color);
}

details.abstract-collapse[open] summary::after {
  transform: translateY(1px) rotate(225deg);
}

details.abstract-collapse .abstract-text {
  display: block;
  font-size: 13.5px;
  text-align: justify;
  margin-top: 8px;
  margin-left: 16px;
  margin-bottom: 8px;
  line-height: 1.5;
}

/* News box styling (preserved for future announcements) */
.news-box {
  background-color: var(--header-bg);
  border-left: 3px solid var(--link-color);
  padding: 10px 12px;
  margin: 15px 0;
  font-size: 14px;
  border-radius: 3px;
}

.news-box i {
  color: var(--link-color);
  margin-right: 8px;
}

/* Accessible focus outlines */
a:focus-visible,
summary:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus-ring-color);
  outline-offset: 3px;
}
