/* Signal look, speakers page (loads after assets/css/speakers.css and look.css). Contract: theme/LOOK-SIGNAL.md.
   Markup is parts/spk-grid.php and parts/spk-committee.php, untouched: every hook of assets/js/speaker-modal.js stays. */

/* ---- Hue per group. The sections carry an inline --spk-acc; it is re-pointed on their children. ---- */
.spk-page .section > * { --hue: var(--violet); --hue-ink: var(--sg-violet-ink); --tint: var(--violet-tint); --spk-acc: var(--hue); }
.spk-page #keynote > * { --hue: var(--amber); --hue-ink: var(--sg-amber-ink); --tint: var(--amber-tint); }
.spk-page #oral > * { --hue: var(--violet); --hue-ink: var(--sg-violet-ink); --tint: var(--violet-tint); }
.spk-page #poster > * { --hue: var(--teal); --hue-ink: var(--sg-teal-ink); --tint: var(--teal-tint); }
.spk-page #committee > * { --hue: var(--blue); --hue-ink: var(--blue); --tint: var(--blue-tint); }
.spk-page .section .head::before { background: var(--hue); }

/* ---- Speaker tiles ---- */
.spk-page .spk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 16px; margin-top: 32px; }
.spk-page .spk {
  display: flex; flex-direction: column; min-width: 0; padding: 0; overflow: hidden; isolation: isolate; text-align: left;
  background: var(--bg); border: 1px solid var(--sg-line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  transition: opacity .8s var(--spring), filter .8s var(--spring), transform .8s var(--spring), box-shadow .35s var(--sg-ease), border-color .35s var(--sg-ease);
}
.spk-page .spk.is-visible:hover, .spk-page .spk:hover {
  transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--hue) 55%, transparent);
}
.spk-page .spk:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
/* The portrait: a rectangle; with no picture, the head-and-shoulders silhouette in the group's hue (the .sg-avatar recipe). */
.spk-page .spk__avatar {
  position: relative; overflow: hidden; flex: none; width: auto; height: auto; margin: 0; padding: 0; border-radius: 0; box-shadow: none;
  aspect-ratio: 4 / 3.4;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Ccircle cx='60' cy='44' r='23' fill='%23fff' fill-opacity='.62'/%3E%3Cpath d='M14 120c1.5-27 21-45 46-45s44.5 18 46 45z' fill='%23fff' fill-opacity='.62'/%3E%3C/svg%3E") center bottom / auto 86% no-repeat,
    radial-gradient(120% 90% at 30% 10%, color-mix(in srgb, var(--hue) 30%, #fff), color-mix(in srgb, var(--hue) 62%, #fff));
}
.spk-page .spk__avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.spk-page .spk__badge {
  top: 12px; left: 12px; right: auto; z-index: 1; display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px;
  background: #fff; color: var(--hue-ink); font: 700 12px/1 var(--sans); letter-spacing: .06em; box-shadow: var(--shadow-sm);
}
.spk-page .spk__badge--key { background: var(--hue-ink); color: #fff; }
.spk-page .spk__name { margin: 0; padding: 16px 18px 0; font: 700 17px/1.25 var(--serif); letter-spacing: -.01em; color: var(--ink); overflow-wrap: anywhere; }
.spk-page .spk__aff { margin: 0; padding: 4px 18px 0; color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }
.spk-page .spk__foot { margin: 10px 18px 18px; height: 20px; }
.spk-page .spk__loc, .spk-page .spk__cue { text-align: left; justify-content: flex-start; font: 600 12px/1.6 var(--sans); letter-spacing: .06em; color: var(--hue-ink); }

/* Keynotes lead: one large tile, the next three beside it as wide tiles, any more in a row of three below. */
.spk-page #keynote .spk-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.spk-page #keynote .spk { grid-column: span 6; }
.spk-page #keynote .spk:nth-child(n+5) { grid-column: span 4; }
.spk-page #keynote .spk:first-child:nth-last-child(n+4) { grid-column: 1 / 8; grid-row: span 3; }
.spk-page #keynote .spk:first-child:nth-last-child(n+4) .spk__avatar { aspect-ratio: auto; flex: 1; min-height: 320px; }
.spk-page #keynote .spk:first-child:nth-last-child(n+4) .spk__name { padding: 22px 28px 0; font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.spk-page #keynote .spk:first-child:nth-last-child(n+4) .spk__aff { padding: 6px 28px 0; font-size: 16px; }
.spk-page #keynote .spk:first-child:nth-last-child(n+4) .spk__foot { margin: 12px 28px 24px; }
.spk-page #keynote .spk:first-child:nth-last-child(n+4) ~ .spk:nth-child(-n+4),
.spk-page #poster .spk {
  grid-column: 8 / 13; display: grid; grid-template-columns: minmax(104px, 38%) minmax(0, 1fr); grid-template-rows: 1fr auto auto auto 1fr;
}
.spk-page #keynote .spk:first-child:nth-last-child(n+4) ~ .spk:nth-child(-n+4) .spk__avatar,
.spk-page #poster .spk__avatar { grid-column: 1; grid-row: 1 / -1; aspect-ratio: auto; min-height: 140px; }
.spk-page #keynote .spk:first-child:nth-last-child(n+4) ~ .spk:nth-child(-n+4) :is(.spk__name, .spk__aff, .spk__foot),
.spk-page #poster .spk :is(.spk__name, .spk__aff, .spk__foot) { grid-column: 2; }
.spk-page #keynote .spk:first-child:nth-last-child(n+4) ~ .spk:nth-child(-n+4) .spk__name,
.spk-page #poster .spk__name { grid-row: 2; padding-top: 0; }
.spk-page #keynote .spk:first-child:nth-last-child(n+4) ~ .spk:nth-child(-n+4) .spk__aff,
.spk-page #poster .spk__aff { grid-row: 3; }
.spk-page #keynote .spk:first-child:nth-last-child(n+4) ~ .spk:nth-child(-n+4) .spk__foot,
.spk-page #poster .spk__foot { grid-row: 4; margin-bottom: 0; }
.spk-page #keynote .spk:first-child:nth-last-child(n+4) ~ .spk:nth-child(-n+4) .spk__name { font-size: 19px; font-weight: 800; }

/* Posters: the compact wide tile, as many per row as fit */
.spk-page #poster .spk-grid { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.spk-page #poster .spk { grid-column: auto; grid-template-columns: 112px minmax(0, 1fr); }
.spk-page #poster .spk__avatar { min-height: 128px; background-size: auto 80%, auto; }

/* ---- Committee: compact tiles, a small silhouette, the role as an ink-blue chip ---- */
.spk-page .cmte-group, .spk-page .cmte-group:first-of-type { margin-top: 32px; }
.spk-page .cmte-group__h {
  display: flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 0; border: 0; text-align: left;
  font: 600 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--blue);
}
.spk-page .cmte-group__h::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: currentColor; flex: none; }
.spk-page .cmte-grid { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.spk-page .cmte {
  gap: 14px; align-items: center; padding: 14px 16px; isolation: isolate;
  border: 1px solid var(--sg-line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  transition: opacity .8s var(--spring), filter .8s var(--spring), transform .8s var(--spring), box-shadow .35s var(--sg-ease), border-color .35s var(--sg-ease);
}
.spk-page .cmte:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--hue) 55%, transparent); }
.spk-page .cmte__photo {
  position: relative; width: 56px; height: 56px; border-radius: 16px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Ccircle cx='60' cy='44' r='23' fill='%23fff' fill-opacity='.62'/%3E%3Cpath d='M14 120c1.5-27 21-45 46-45s44.5 18 46 45z' fill='%23fff' fill-opacity='.62'/%3E%3C/svg%3E") center bottom / 86% 86% no-repeat,
    radial-gradient(120% 90% at 30% 10%, color-mix(in srgb, var(--hue) 30%, #fff), color-mix(in srgb, var(--hue) 62%, #fff));
}
.spk-page .cmte__info { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.spk-page .cmte__name { margin: 0; font: 700 16px/1.25 var(--serif); letter-spacing: -.01em; overflow-wrap: anywhere; }
.spk-page .cmte__role {
  display: inline-flex; align-items: center; min-height: 24px; margin: 2px 0; padding: 3px 10px; border-radius: 12px;
  background: var(--blue-tint); color: var(--blue); font: 600 12.5px/1.2 var(--sans);
}
.spk-page .cmte__aff { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.spk-page .cmte__loc { margin: 0; color: var(--ink-2); font-size: 13px; }

/* ---- The biography dialog takes the hue of the group it opens from ---- */
.spk-page .smodal__badge { background: var(--tint); color: var(--hue-ink); }
.spk-page .smodal__loc { color: var(--hue-ink); }
.spk-page .smodal__photo { background-color: var(--tint); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hue) 18%, transparent); }
.spk-page .smodal__photo:empty {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Ccircle cx='60' cy='44' r='23' fill='%23fff' fill-opacity='.62'/%3E%3Cpath d='M14 120c1.5-27 21-45 46-45s44.5 18 46 45z' fill='%23fff' fill-opacity='.62'/%3E%3C/svg%3E") center bottom / 72% 86% no-repeat,
    radial-gradient(120% 90% at 30% 10%, color-mix(in srgb, var(--hue) 30%, #fff), color-mix(in srgb, var(--hue) 62%, #fff));
}
.spk-page .smodal__talk { background: color-mix(in srgb, var(--tint) 60%, #fff); border-color: color-mix(in srgb, var(--hue) 22%, transparent); }
.spk-page .smodal__talk-lab { font: 600 12px/1 var(--sans); letter-spacing: .12em; color: var(--hue-ink); }
.spk-page .smodal__talk-title { font: 700 17px/1.35 var(--serif); letter-spacing: -.01em; }

/* ---- Tablet: the leading keynote goes wide, the others sit three across ---- */
@media (max-width: 900px) {
  .spk-page #keynote .spk-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .spk-page #keynote .spk, .spk-page #keynote .spk:nth-child(n+5) { grid-column: span 3; }
  .spk-page #keynote .spk:first-child:nth-last-child(n+4) { grid-column: 1 / -1; grid-row: auto; }
  .spk-page #keynote .spk:first-child:nth-last-child(n+4) .spk__avatar { flex: none; min-height: 0; aspect-ratio: 16 / 9; }
  .spk-page #keynote .spk:first-child:nth-last-child(n+4) ~ .spk:nth-child(-n+4) { grid-column: span 2; display: flex; }
  .spk-page #keynote .spk:first-child:nth-last-child(n+4) ~ .spk:nth-child(-n+4) .spk__avatar { min-height: 0; aspect-ratio: 4 / 3.4; }
  .spk-page #keynote .spk:first-child:nth-last-child(n+4) ~ .spk:nth-child(-n+4) .spk__name { padding-top: 16px; font-size: 17px; }
  .spk-page #keynote .spk:first-child:nth-last-child(n+4) ~ .spk:nth-child(-n+4) .spk__foot { margin-bottom: 18px; }
}

/* ---- Phone ---- */
@media (max-width: 640px) {
  .spk-page .spk-grid { grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 12px; }
  .spk-page #keynote .spk:first-child:nth-last-child(n+4) .spk__name { padding: 18px 20px 0; font-size: 24px; }
  .spk-page #keynote .spk:first-child:nth-last-child(n+4) .spk__aff { padding: 4px 20px 0; }
  .spk-page #keynote .spk:first-child:nth-last-child(n+4) .spk__foot { margin: 10px 20px 20px; }
  .spk-page #keynote .spk:first-child:nth-last-child(n+4) .spk__avatar { aspect-ratio: 4 / 3; }
  .spk-page #keynote .spk, .spk-page #keynote .spk:nth-child(n+5),
  .spk-page #keynote .spk:first-child:nth-last-child(n+4) ~ .spk:nth-child(-n+4) {
    grid-column: 1 / -1; display: grid; grid-template-columns: 112px minmax(0, 1fr); grid-template-rows: 1fr auto auto auto 1fr;
  }
  .spk-page #keynote .spk:first-child:nth-last-child(n+4) { display: flex; }
  .spk-page #keynote .spk:not(:first-child:nth-last-child(n+4)) .spk__avatar { grid-column: 1; grid-row: 1 / -1; aspect-ratio: auto; min-height: 128px; }
  .spk-page #keynote .spk:not(:first-child:nth-last-child(n+4)) :is(.spk__name, .spk__aff, .spk__foot) { grid-column: 2; }
  .spk-page #keynote .spk:not(:first-child:nth-last-child(n+4)) .spk__name { grid-row: 2; padding-top: 0; font-size: 17px; }
  .spk-page #keynote .spk:not(:first-child:nth-last-child(n+4)) .spk__aff { grid-row: 3; }
  .spk-page #keynote .spk:not(:first-child:nth-last-child(n+4)) .spk__foot { grid-row: 4; margin-bottom: 0; }
  .spk-page .spk__name { padding: 14px 14px 0; font-size: 16px; }
  .spk-page .spk__aff { padding: 4px 14px 0; }
  .spk-page .spk__foot { margin: 8px 14px 14px; }
  .spk-page .cmte-grid { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .spk-page .spk, .spk-page .cmte { transition: none; }
  .spk-page .spk:hover, .spk-page .spk.is-visible:hover, .spk-page .cmte:hover { transform: none; }
}
