/* project harmonique — the sessions list and its "where to listen" rows.
   Split from styles.css, which owns the palette (the --* custom properties
   used here), type and page layout. */

/* ---- sessions -------------------------------------------------------- */

/* Rendered by the Worker from the RSS feed. Each session is a <details>: the
   whole row (art, title, notes) is the summary, and opening it shows where to
   listen. */
.sessions__list {
  list-style: none;
  margin: 0 0 var(--step);
  padding: 0 0 0 2.75ch;
}

.session + .session {
  margin-top: 1.5rem;
}

/* Linked to as /#session-001: land with breathing room above, not flush
   against the top edge. */
.session {
  scroll-margin-top: 2rem;
}

/* The summary is the row. Its default disclosure triangle goes — the "listen"
   cue below says what opening it does. */
.session__head {
  display: block;
  list-style: none;
  cursor: pointer;
  border-radius: 2px;
}

.session__head::-webkit-details-marker {
  display: none;
}

/* Green ring, matching every other focusable control on the page. */
.session__head:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px var(--green);
}

/* Cover art to the left, text column to the right. `min-width: 0` lets the
   text wrap rather than pushing the grid wider than the terminal. */
.session--thumb .session__head {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.session__thumb {
  display: block;
  line-height: 0;
}

.session__thumb img {
  display: block;
  width: 6rem;
  height: 6rem;
  object-fit: cover;
  border: 1px solid rgb(241 6 227 / 35%);
  border-radius: 2px;
  background: var(--sel); /* holds the square while the image loads */
  transition: border-color 140ms ease;
}

/* The thumbnail is the top of the row, so the title's first line sits level
   with it rather than half a line low. */
.session--thumb .session__body {
  margin-top: -0.3em;
}

.session__body {
  display: block;
}

.session__title {
  font-weight: 600;
}

.session__num {
  color: var(--pink);
}

/* Kept whole, so a narrow screen drops it to its own row rather than splitting
   the date from the duration. */
.session__meta {
  display: inline-block;
  margin-left: 1ch;
  color: var(--dim);
  white-space: nowrap;
}

/* The affordance: says the row opens, and which way it is. */
.session__toggle {
  display: inline-block;
  margin-left: 1ch;
  color: var(--green);
  white-space: nowrap;
}

.session__toggle::before {
  content: "\25B8\00A0"; /* ▸ */
}

.session__details[open] .session__toggle::before {
  content: "\25BE\00A0"; /* ▾ */
}

/* The guest, as a subtitle under the title line. */
.session__guest {
  display: block;
  color: var(--dim);
}

.session__summary {
  display: block;
  margin-top: 0.15rem;
  text-wrap: pretty;
}

.session__head:hover .session__topic {
  color: var(--green);
}

.session__head:hover .session__thumb img,
.session__details[open] .session__thumb img {
  border-color: var(--green);
}

/* ---- where to listen ---- */

/* Sits under the text column, so it lines up with the title above it. The
   label holds its own column, so platforms that wrap stay aligned after it
   rather than sliding back underneath. */
.session__listen {
  display: flex;
  align-items: baseline;
  gap: 0 1ch;
  margin: 0.6rem 0 0;
  line-height: 2;
}

.session__platforms {
  flex: 0 1 auto;
  min-width: 0;
}

.session--thumb .session__listen {
  padding-left: calc(6rem + 1.25rem);
}

.session__listen-label {
  flex: none;
  color: var(--dim);
}

/* Separators drawn here, not in the markup. Each trails its link, so a
   wrapped row ends on a dot instead of starting with one. */
.platform {
  color: var(--text);
  text-decoration: none;
  border-radius: 2px;
  white-space: nowrap;
}

.platform:has(+ .platform)::after,
.platform:has(+ .platforms__more)::after {
  content: "\00B7"; /* · */
  display: inline-block;
  margin: 0 0.9ch;
  color: var(--dim);
}

.platform:hover,
.platform:focus-visible {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.platform:focus-visible,
.session__anchor:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px var(--green);
}

/* The rest of the platforms, under "more": a small menu that drops below
   the toggle, one platform per line and no separators. */
.platforms__more {
  position: relative;
  display: inline-block;
}

.platforms__toggle {
  list-style: none;
  cursor: pointer;
  color: var(--text);
  border-radius: 2px;
  white-space: nowrap;
}

.platforms__toggle::-webkit-details-marker {
  display: none;
}

.platforms__toggle::after {
  content: "\00A0\25B8"; /* ▸ */
  color: var(--dim);
}

.platforms__more[open] .platforms__toggle::after {
  content: "\00A0\25BE"; /* ▾ */
}

.platforms__toggle:hover,
.platforms__toggle:focus-visible,
.platforms__more[open] .platforms__toggle {
  color: var(--green);
}

.platforms__toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px var(--green);
}

.platforms__menu {
  position: absolute;
  top: 100%;
  left: -1ch;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: 0.25rem 1ch;
  background: var(--bg);
  border: 1px solid var(--dim);
  border-radius: 2px;
}

.platforms__menu .platform::after {
  content: none;
}

/* Brief confirmation after the feed address is copied. */
.platform.is-copied {
  color: var(--green);
}

.session__anchor {
  margin-left: 1.5ch;
  color: var(--dim);
  text-decoration: none;
  border-radius: 2px;
}

.session__anchor:hover {
  color: var(--green);
}

/* The session a link pointed at: its number takes the cursor's green, the
   same signal the page uses for "you are here". */
.session:target .session__num {
  color: var(--green);
}

/* ---- small screens --------------------------------------------------- */

@media (max-width: 30rem) {
  /* Smaller cover art, so the text column keeps a readable measure. */
  .session--thumb .session__head {
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 1rem;
  }

  .session__thumb img {
    width: 4.5rem;
    height: 4.5rem;
  }

  /* Too narrow to indent under the text column; the row takes the full width
     and wraps, each platform a comfortable tap target. */
  .session--thumb .session__listen {
    padding-left: 0;
  }

  .platform {
    display: inline-block;
    padding: 0.35rem 0;
  }
}
