:is(#experience, #news, #publications) { background: #fff; }

:is(#experience, #news, #publications) .travel {
  --bg: #fff;
  --text: #1d1d1f;
  --travel-muted: #6e6e73;
  --travel-link: #0066cc;
  --travel-count: #6e6e73;
  --travel-tile: #f5f5f7;
  --travel-shadow: 0 4px 24px rgb(0 0 0 / 6%);
  color: var(--text);
}

:is(#experience, #news, #publications, #awards) .travel {
  --work-card-shadow: 0 2px 5px rgb(0 0 0 / 8%), 0 7px 14px -3px rgb(0 0 0 / 16%);
}

.news-rail {
  --news-card-width: min(82%, clamp(260px, 26vw, 340px));
  --news-gap: 12px;
  display: flex;
  align-items: flex-start;
  gap: var(--news-gap);
  margin-top: 24px;
  padding: 4px 4px 14px;
  overflow-x: auto;
  overflow-anchor: none;
  scrollbar-width: none; /* Hide scrollbar without disabling horizontal scrolling. */
}
.news-rail::-webkit-scrollbar { display: none; }
.news-rail:not(:empty)::after {
  flex: 0 0 max(0px, calc(100% - var(--news-card-width) - var(--news-gap)));
  content: "";
}
.news-rail:empty { display: none; }

.news-card {
  display: flex;
  flex: 0 0 var(--news-card-width);
  flex-direction: column;
  min-width: 0;
  text-align: start;
  border: 1px solid #dddde2;
  border-radius: 16px;
  background: var(--travel-tile);
}
.news-card-photo {
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 10;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  border-radius: 14px;
}
.news-card-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

:is(.news-card-photo, .publication-cover, .award-card-cover) img {
  transition: transform 250ms ease;
}

@media (hover: hover) {
  :is(.news-card-photo, .publication-cover, .award-card-cover):hover img { transform: scale(1.035); }
}
.news-card-copy { min-height: var(--news-visible-copy-height, 0px); }
.news-card-copy-content { padding: 11px 12px 10px; }

.news-card-date {
  display: block;
  color: var(--travel-muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
.news-card h3 {
  margin: 5px 0 0;
  font-size: clamp(17px, 1.4vw, 20px);
  font-weight: 600;
  line-height: 1.2;
}
a.news-card-title { color: inherit; text-decoration: none; }
a.news-card-title:hover { text-decoration: underline; }
.news-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}
:is(#experience, #news) .news-card-links { margin-top: 6px; font-size: 14px; }
.news-card-links:empty { display: none; }
.news-card-links a { color: var(--travel-link); text-decoration: none; }
.news-card-links a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  :is(.news-card-photo, .publication-cover, .award-card-cover) img { transition: none; }
}


.news-card-photo:focus-visible {
  outline: 2px solid #1d1d1f;
  outline-offset: -3px;
}

.news-photo-dialog {
  overflow: visible;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  padding: 0;
  border: 0;
  background: transparent;
}
.news-photo-dialog::backdrop { background: rgb(0 0 0 / 78%); }
.news-photo-dialog img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 32px);
  object-fit: contain;
  border-radius: 12px;
}
.news-photo-dialog form {
  position: absolute;
  inset: 8px 8px auto auto;
}
.news-photo-dialog button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #1d1d1f;
  color: #fff;
  font: 26px/1 system-ui, sans-serif;
  cursor: pointer;
}
.news-photo-dialog button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

#experience-status { margin: 18px 0 12px; font-size: 14px; color: var(--travel-muted); }
#experience-status:empty { display: none; }

:is(#experience, #news, #awards) .news-rail {
  --news-gap: 20px;
  padding-block: 10px 22px;
  padding-inline: 0;
}

#experience .news-rail {
  --news-card-width: min(83%, clamp(286px, 28vw, 376px));
  align-items: stretch;
  margin-inline: -16px;
  padding: 16px 16px 28px;
}

:is(#experience, #news, #awards) .news-card { border: 0; }

:is(#experience, #news, #awards) .news-card:not(.experience-placeholder) {
  box-shadow: var(--work-card-shadow);
}

#experience .experience-card {
  --experience-title-gap: 16px;
  --experience-copy-padding: clamp(20px, 3vw, 30px);
  --experience-motion: 300ms cubic-bezier(0, 0, 0.5, 1);
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  text-align: center;
}

.experience-card-copy {
  flex: 1;
  padding: var(--experience-copy-padding);
  padding-block-end: calc(var(--experience-copy-padding) + 6px);
}

.experience-card-copy:has(+ .experience-card-cover) {
  /* Preserve the original card height: 75% minus the cover's 70.710678% height. */
  padding-block-end: calc(var(--experience-copy-padding) + 4.289322% - 6px);
}

#experience .experience-card h3 {
  margin: var(--experience-title-gap) 0 0;
  line-height: 1.35;
}

.experience-university { margin: 8px 0 0; }

.experience-university,
#experience .experience-details-content h4 {
  font-size: 17px;
  line-height: 22px;
}

@media (max-width: 734px) {
  .experience-university,
  #experience .experience-details-content h4 { font-size: 14px; }
}

.experience-university strong { font-weight: 600; }
#experience .experience-details-content h4 { font-weight: 700; }

.experience-card-cover {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1.41421356237 / 1;
}

.experience-card-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.experience-card-link {
  display: flex;
  flex: 1;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

.experience-details-label { margin-top: var(--experience-title-gap); }

@media (hover: hover) {
  #experience .experience-card:has(.experience-details-toggle):hover {
    z-index: 1;
    box-shadow: 0 8px 16px rgb(0 0 0 / 8%);
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  #experience .experience-card {
    transform: scale(1);
    transition: transform var(--experience-motion), box-shadow var(--experience-motion);
  }

  #experience .experience-card:has(.experience-details-toggle):hover {
    transform: scale(var(--experience-hover-scale, 1.02));
  }
}

#experience .experience-card:has(.experience-details-toggle) { cursor: pointer; }

#experience .experience-details-label {
  position: relative;
  color: transparent;
}

#experience .experience-details-toggle {
  position: absolute;
  z-index: 2;
  top: calc(50% + 8px);
  left: 50%;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  background: #e7e7eb;
  color: #68686b;
  cursor: pointer;
}

#experience .experience-details-icon {
  display: grid;
  place-items: center;
}

#experience .experience-details-icon::before,
#experience .experience-details-icon::after {
  grid-area: 1 / 1;
  width: 16px;
  height: 3px;
  border-radius: 3px;
  background: currentColor;
  content: "";
}

#experience .experience-details-icon::after { transform: rotate(90deg); }

#experience .experience-details-toggle:focus-visible {
  outline: 2px solid var(--travel-link);
  outline-offset: 3px;
}

@media (hover: hover) {
  #experience .experience-details-toggle:hover {
    background: #dddde2;
    color: #333336;
  }
}

#experience .experience-details-toggle:active { scale: .94; }

#experience .experience-card[data-details-open] .experience-details-label { position: static; }

#experience .experience-card[data-details-open] .experience-details-toggle {
  inset: auto 14px 14px auto;
  transform: none;
}

#experience .experience-details-toggle[aria-expanded="true"] .experience-details-icon {
  transform: rotate(45deg);
}

#experience .experience-card-summary[inert],
#experience .experience-card-cover[inert] { opacity: 0; }

#experience .experience-details-panel {
  position: absolute;
  z-index: 1;
  inset: 0 0 54px;
  display: flex;
  flex-direction: column;
  padding: var(--experience-copy-padding);
  padding-block-end: 0;
  text-align: start;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

#experience .experience-details-panel:not([inert]) {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#experience .experience-details-content {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-block: 0 4px;
}

#experience .experience-details-content > :not([hidden]) ~ :not([hidden]) { margin-block-start: 30px; }
#experience .experience-details-content h4 { margin: 0 0 7px; }
#experience .experience-details-research p { margin: 0; line-height: 1.4; overflow-wrap: anywhere; }
#experience :is(.experience-details-fields, .experience-details-links) {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
#experience .experience-details-panel a { color: var(--travel-link); }

@media (prefers-reduced-motion: no-preference) {
  #experience :is(.experience-card-summary, .experience-card-cover) { transition: opacity var(--experience-motion); }
  #experience .experience-details-panel { transition: opacity var(--experience-motion), transform var(--experience-motion); }
  #experience .experience-details-toggle { transition: background-color 160ms, color 160ms, scale 160ms; }
  #experience .experience-details-icon { transition: transform var(--experience-motion); }
}

.experience-placeholder { aspect-ratio: 16 / 10; }

#experience[data-category="work"] #experience-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

