/* css styles */
.listing-title {
  text-transform: capitalize;
}

/* Fix color contrast for title block metadata */
.quarto-title-meta-heading,
.quarto-title-meta .date {
  color: #333;
}

html[data-bs-theme="dark"] .quarto-title-meta-heading,
html[data-bs-theme="dark"] .quarto-title-meta .date {
  color: #ddd;
}

/* Fix color contrast for listing form-select elements */
.form-select {
  color: #333;
  background-color: #fff;
}

html[data-bs-theme="dark"] .form-select {
  color: #ddd;
  background-color: #2b2b2b;
}

/* Fix color contrast for software listing titles */
.listing-title strong {
  color: #212529;
}

html[data-bs-theme="dark"] .listing-title strong {
  color: #e9ecef;
}

/* Software and app listing cards */
.software-image-box {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.software-image-box img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.software-title {
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  line-height: 1.2;
  margin-bottom: 0.35rem;
}

/* Photo Album Carousel */
.photo-album {
  margin: 2rem 0;
  overflow: hidden;
}

.photo-album-container {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  gap: 1.5rem;
  padding: 1rem 0;
  scrollbar-width: thin;
  scrollbar-color: #888 #f1f1f1;
}

.photo-album-container::-webkit-scrollbar {
  height: 8px;
}

.photo-album-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.photo-album-container::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.photo-album-container::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.photo-item {
  flex: 0 0 auto;
  width: 400px;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
}

.photo-item img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.photo-item img:hover {
  transform: scale(1.02);
}

.photo-caption {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  color: #555;
  text-align: center;
  line-height: 1.4;
}

/* Dark mode styles */
html[data-bs-theme="dark"] .photo-album-container {
  scrollbar-color: #666 #2b2b2b;
}

html[data-bs-theme="dark"] .photo-album-container::-webkit-scrollbar-track {
  background: #2b2b2b;
}

html[data-bs-theme="dark"] .photo-album-container::-webkit-scrollbar-thumb {
  background: #666;
}

html[data-bs-theme="dark"] .photo-album-container::-webkit-scrollbar-thumb:hover {
  background: #888;
}

html[data-bs-theme="dark"] .photo-item img {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

html[data-bs-theme="dark"] .photo-caption {
  color: #aaa;
}

@media (max-width: 768px) {
  .photo-item {
    width: 300px;
  }
  
  .photo-item img {
    height: 225px;
  }
}

@media (max-width: 480px) {
  .photo-item {
    width: 250px;
  }
  
  .photo-item img {
    height: 190px;
  }
  
  .photo-caption {
    font-size: 0.85rem;
  }
}

/* Citation-style publications list */
.publication-index {
  margin-top: 2rem;
}

.publication-index-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.publication-list-note,
.publication-notation {
  color: #555;
}

.publication-notation {
  max-width: 22rem;
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
}

.publication-year-section + .publication-year-section {
  margin-top: 2rem;
}

.publication-year-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 0.5rem;
  margin-bottom: 0;
}

.publication-year-heading small {
  color: #6c757d;
  font-size: 0.85rem;
  font-weight: 400;
}

.publication-entry {
  padding: 1.25rem 0;
  border-bottom: 1px solid #dee2e6;
}

.publication-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.publication-title {
  flex: 1;
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.4;
}

.publication-title-row .publication-badge {
  align-self: flex-start;
  margin-left: auto;
}

.publication-title a {
  color: inherit;
  text-decoration: none;
}

.publication-title a:hover {
  color: var(--bs-link-color);
  text-decoration: underline;
}

.publication-authors {
  margin: 0.5rem 0;
}

.publication-meta,
.publication-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.92rem;
}

.publication-journal {
  font-style: italic;
}

.publication-links {
  margin-top: 0.6rem;
}

.publication-abstract {
  margin-top: 0.75rem;
  font-size: 0.92rem;
}

.publication-abstract summary {
  width: fit-content;
  color: var(--bs-link-color);
  cursor: pointer;
}

.publication-abstract p {
  margin: 0.6rem 0 0;
}

.publication-badge {
  flex: 0 0 auto;
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #e9ecef;
  color: #343a40;
  font-size: 0.75rem;
  line-height: 1.4;
}

.publication-badge--preprint {
  background: #fff3cd;
  color: #664d03;
}

html[data-bs-theme="dark"] .publication-list-note,
html[data-bs-theme="dark"] .publication-notation {
  color: #aaa;
}

html[data-bs-theme="dark"] .publication-year-heading,
html[data-bs-theme="dark"] .publication-entry {
  border-color: #495057;
}

html[data-bs-theme="dark"] .publication-year-heading small {
  color: #adb5bd;
}

html[data-bs-theme="dark"] .publication-badge {
  background: #343a40;
  color: #e9ecef;
}

html[data-bs-theme="dark"] .publication-badge--preprint {
  background: #664d03;
  color: #fff3cd;
}

@media (max-width: 600px) {
  .publication-index-heading,
  .publication-title-row {
    flex-direction: column;
    gap: 0.5rem;
  }

  .publication-title-row .publication-badge {
    align-self: flex-end;
  }
}
