/* Entry lists and detail views (research, software, journal), interest tags
   and the filter bar, thumbnails, the research-interests tabs and hover info
   cards. */

/* Entry list view styles (research, software, journal) */
.entry-list {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
}

.entry-list-item {
  padding: 20px;
  margin-bottom: 15px;
  /* Tinted and lightly blurred so the background shows through without
     its lines cutting across the text */
  background: rgba(12, 10, 18, 0.5);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.entry-list-item:hover {
  background: rgba(40, 34, 56, 0.6);
  border-left-color: #1976D2;
  transform: translateX(5px);
}

.entry-list-item h3 {
  margin: 0;
  color: #E0F2F1;
  font-family: monospace;
  font-size: 20px;
}

.entry-list-item .entry-meta {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.72);
  font-family: monospace;
  font-size: 14px;
}

/* Filtered-out entries; more specific than the flex layout below, which
   would otherwise override the hidden attribute */
.entry-list .entry-list-item[hidden] {
  display: none;
}

/* Interest tags. Each chip gets its color from --chip-color, set inline
   from the interests table in the section's JSON. */
.entry-interests {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.interest-chip {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid var(--chip-color);
  border-radius: 999px;
  background: color-mix(in srgb, var(--chip-color) 22%, transparent);
  color: #F3F1F8;
  font-family: monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
}

/* On the white detail card, tint toward white and use dark text */
.card .entry-interests {
  margin: 0 0 14px;
}

.card .interest-chip {
  background: color-mix(in srgb, var(--chip-color) 20%, white);
  color: #2b2b2b;
}

/* Research detail card: centered title and tags, a large image, then the
   body. Sets its own color and weight over the global h2 rule, which is
   white for the nav. */
.entry-detail-card .entry-detail-title {
  margin: 6px 0 12px;
  text-align: center;
  color: #1a1a1a;
  font-family: monospace;
  font-size: 24px;
  font-weight: bold;
  line-height: 1.35;
}

.entry-detail-card .entry-interests {
  justify-content: center;
  margin: 0 0 22px;
}

.entry-detail-images {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin: 0 0 24px;
}

.entry-detail-images img {
  max-width: 100%;
  max-height: 460px;
  object-fit: contain;
  border-radius: 8px;
}

/* Filter bar above the list, aligned with it */
.interest-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto 18px;
}

.interest-filter-button {
  --chip-color: #9e9e9e;
  padding: 6px 14px;
  border: 1px solid color-mix(in srgb, var(--chip-color) 70%, transparent);
  border-radius: 999px;
  background: rgba(12, 10, 18, 0.5);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  color: #E0F2F1;
  font-family: monospace;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.interest-filter-button:hover {
  background: color-mix(in srgb, var(--chip-color) 20%, rgba(12, 10, 18, 0.6));
}

.interest-filter-button[aria-pressed="true"] {
  border-color: var(--chip-color);
  background: color-mix(in srgb, var(--chip-color) 45%, rgba(12, 10, 18, 0.6));
  color: #fff;
}

.interest-filter-button:focus-visible {
  outline: 2px solid var(--chip-color);
  outline-offset: 2px;
}

.interest-count {
  margin-left: 4px;
  opacity: 0.7;
}

/* Thumbnail beside the title; figures differ in shape, so each is shown
   whole on a white frame of the same size */
.entry-list-item.has-thumbnail {
  display: flex;
  align-items: center;
  gap: 20px;
}

.entry-thumbnail {
  flex-shrink: 0;
  width: 208px;
  height: 144px;
  padding: 4px;
  object-fit: contain;
  background: #fff;
  border-radius: 4px;
}

/* Entry detail view styles */
.entry-detail {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
}

.entry-back-button {
  display: inline-block;
  padding: 10px 20px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  color: #E0F2F1;
  font-family: monospace;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.entry-back-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #1976D2;
  transform: translateX(-5px);
}

.entry-back-button::before {
  content: '← ';
}

/* Research interest tab widget */
.research-tabs {
  margin: 8px 0 4px;
}

.research-tab-buttons {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.research-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #888;
  font-family: monospace;
  font-size: 14px;
  padding: 6px 18px;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
}

.research-tab-btn:hover {
  color: #aaa;
}

.research-tab-btn.active {
  color: #82B1FF;
  border-bottom-color: #82B1FF;
}

.research-tab-panel {
  display: none;
}

.research-tab-panel.active {
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0 4px 4px 4px;
  padding: 12px 16px;
}

/* Hover info card */
.info-hover {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted #82B1FF;
}

.info-hover .info-hover-card {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background-color: #1e1e1e;
  color: #82B1FF;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: monospace;
  font-size: 13px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 20;
}

.info-hover .info-hover-card::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1e1e1e;
}

.info-hover:hover .info-hover-card {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
