/* ============================================================
   PROJECT DETAIL — opened by "+" (Figma 25:5218, Spotify version).
   Row → 24px → [Spotify player · text column] → 24px → line

   Grid alignment: the Spotify player spans the PROJECT + ARTIST columns
   and the text starts exactly on the YEAR column, at every screen size.
   --detail-media = width of those first two columns (set per breakpoint
   next to the column widths: here and in responsive.css).
   ============================================================ */

.projects { --detail-media: calc(var(--col-w) * 2); }   /* 41% of the list column on desktop */

/* Open row: Medium weight, no line under it (the detail carries it) */
.project-row.is-open td { font-weight: var(--fw-medium); border-bottom-color: transparent; }

.project-row { cursor: pointer; }

/* "+" / "-" toggle */
.row-toggle {
  all: unset;
  padding-right: 0.75rem;        /* Figma: 12px from the edge */
  font-size: var(--fs-small);
  line-height: var(--lh-body);
  cursor: pointer;
}
.row-toggle:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* Detail row: collapsed by default, slides open */
.project-table .detail-row > td {
  padding: 0;
  border-bottom: 0;
}
.project-table .detail-row.is-open > td { border-bottom: var(--line-thin); }

.detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.detail-row.is-open .detail { grid-template-rows: 1fr; }
.detail > * { min-height: 0; overflow: hidden; }

.detail__inner {
  display: grid;
  grid-template-columns: var(--detail-media) minmax(0, 24.25rem);   /* text max 388px (Figma) */
  align-items: stretch;
  /* 16px row padding + 8px = 24px row → detail; 24px detail → line */
  padding: 0.5rem 0 1.5rem;
  font-size: var(--fs-small);
  line-height: var(--lh-body);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.detail-row.is-open .detail__inner { opacity: 1; transition-delay: 0.1s; }

/* Player: fills its columns minus the 54px gap (Figma's cover → text gap) */
.detail__inner .spotify-embed,
.detail__inner .youtube-embed { margin-right: 3.375rem; }

/* No player/video in the row (e.g. Film): description + link start on the
   left, on the PROJECT column (max 388px wide, Figma text width). */
.detail__inner:not(:has(.spotify-embed, .youtube-embed)) .detail__body {
  grid-column: 1 / -1;
  max-width: 24.25rem;
}

.detail__body {
  grid-column: 2;                   /* next to the player: starts on the 3rd column */
  display: flex;
  flex-direction: column;
  justify-content: space-between;   /* text at the top, "Spotify ↗" at the bottom */
  gap: 1.25rem;
}

.detail__text { margin: 0; }

/* "YouTube ↗": no underline at rest (Figma); on hover it turns blue like the
   other text links, the line grows from the left like the nav links, and the
   arrow nudges up-right (motion.css). */
.detail__link { font-size: var(--fs-small); align-self: flex-start; }
.detail__link span:first-child {
  text-decoration: none;
  padding-bottom: 2px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.4s var(--ease-out);
}
.detail__link:hover span:first-child,
.detail__link:focus-visible span:first-child { background-size: 100% 1px; }
.detail__link:hover { color: var(--color-accent); }

@media (prefers-reduced-motion: reduce) {
  .detail, .detail__inner { transition: none; }
}
