/* Work together: what this hub adds to /assets/hub.css and /assets/product/replay.css. */

/* The frame's access badge and Share button follow the story (collab.js sets data-access and data-on). */
.rp-share[data-on] { box-shadow: 0 0 0 3px #f0cd7f }
.replay[data-access^="Unlisted"] .rp-title em { border-color: #c98f78; background: #fbe3d8 }
.stage-title em.open { border-color: #c98f78; background: #fbe3d8 }

/* A replay inside a card that is one big link: its buttons stay in reach, above the link. */
.hub-card-media > .replay { width: 100% }
.hub-card .rp-controls { position: relative; z-index: 1 }
/* A card whose canvas takes the height its row gives it. */
.hub-card.fill .hub-card-media { flex: 1; display: grid; align-items: center }
.hub-card-copy .plan-chips { display: flex; flex-wrap: wrap; gap: .4rem }
/* The line under a still slate that says what is staged. */
.stage.mini .stage-foot { padding: .45rem .6rem .5rem }
.hub-split .hub-more, .hub-statement .hub-more { display: inline-block; margin-top: 1.4rem; font-weight: 600 }
.hub-statement .hub-more { margin-top: clamp(1.6rem,3vw,2.6rem) }
.hub-split .plan-chip { margin-top: 1.2rem }
.hub-split > div > .plan-chip:first-child { margin: 0 0 1rem }

/* The live demo: three engines in one frame. A poster holds the box until the visitor starts it. */
.screens { max-width: 1180px; margin: 0 auto; overflow: hidden; border: 1px solid #4d6759; border-radius: 10px; background: #fffdf4; color: var(--ink); box-shadow: 0 24px 44px -28px #0009 }
.screens-box { position: relative; aspect-ratio: 16 / 8.4 }
.screens-box > iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0 }
.screens-poster { position: absolute; inset: 0; display: grid; place-items: center }
.screens-poster .stage-body { position: absolute; inset: 0; aspect-ratio: auto }
.screens-poster .stage-body [inert] { opacity: .5 }
.screens-who { position: absolute; inset: .8rem .9rem auto; display: flex; flex-wrap: wrap; gap: .4rem .5rem; margin: 0; font: 600 .78rem/1.3 "Helvetica Neue",Arial,sans-serif }
.screens-who span { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .65rem; border: 1px solid #cfd5c4; border-radius: 99px; background: #fffdf4 }
.screens-who span::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: #285b46 }
.screens-who span:nth-child(2)::before { background: #aa4629 }
.screens-who span:nth-child(3)::before { background: #286397 }
.screens-poster .button { position: relative; padding: .95rem 1.4rem; font-size: 1.05rem; box-shadow: 0 0 0 6px #fffdf4cc }
.hub-section[data-tone="ink"] .screens-poster .button { background: var(--ink); border-color: var(--ink); color: #fff }
.hub-section[data-tone="ink"] .screens-poster .button:hover { background: #375548 }
.screens figcaption { margin: 0; padding: .6rem .9rem .65rem; border-top: 1px solid #cfd5c4; color: #5a6a5e; font: 500 .75rem/1.4 ui-monospace,Menlo,monospace }
.screens + .hub-steps { max-width: 1180px; margin: clamp(1.8rem,3.4vw,3.2rem) auto 0 }

/* Access levels on the sharing page: three columns of who can do what. */
.access { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: clamp(12px,1.4vw,22px); margin: 0; padding: 0; list-style: none }
.access li { padding: clamp(16px,1.7vw,26px); border: 1px solid var(--s-line); border-radius: 14px; background: var(--s-card) }
.access li span { display: block; margin: .5rem 0 .7rem; font: 600 .78rem/1.5 ui-monospace,Menlo,monospace }
.access li p { color: var(--s-soft); font-size: .95rem }

@media (max-width: 800px) {
  .screens-box { aspect-ratio: 356 / 720 }
  .access { grid-template-columns: minmax(0,1fr) }
}

/* Replay proportions per place. A figure under 720px wide uses the narrow ratio (docs/replay.md), and a phone needs a
   taller canvas than a desktop card does for the notes to stay readable. One scene means no row of step chips. */
#card-live, #card-huddle, #walk, .replay.one { --rp-controls-tall: calc(4rem + 1px) }
#video-huddle { --rp-ratio: 16 / 9; --rp-ratio-narrow: 16 / 9 }
#card-live { --rp-ratio: 16 / 9; --rp-ratio-narrow: 16 / 9 }
#card-huddle { --rp-ratio: 2 / 1; --rp-ratio-narrow: 2 / 1 }
#walk { --rp-ratio: 16 / 9; --rp-ratio-narrow: 16 / 9 }
/* The presence card's canvas is as tall as its row on a wide page and no taller than its drawing on a phone. */
.stage.mini .stage-body.presence { aspect-ratio: 1 / 1 }
@media (min-width: 801px) {
  .hub-card.fill .hub-card-media { align-items: stretch }
  .hub-card.fill .stage.mini { display: flex; flex-direction: column }
  .hub-card.fill .stage.mini .stage-body.presence { flex: 1; aspect-ratio: auto; min-height: 300px }
}
@media (max-width: 800px) {
  .stage.mini .stage-body.presence { aspect-ratio: 4 / 3 }
  #card-live { --rp-ratio-narrow: 4 / 3 }
  #card-huddle, #walk, #video-huddle, #standup, #offsite { --rp-ratio-narrow: 5 / 4 }
}

/* hub.css styles every paragraph in a split or a tab panel as body copy. A replay's own lines are not body copy. */
:is(.hub-split, .hub-tabpanel) .replay p:not(.kicker):not(.plan-chip) { max-width: none; margin-top: 0; color: inherit }
:is(.hub-split, .hub-tabpanel) .replay p.rp-label:not(.kicker):not(.plan-chip) { color: var(--rp-soft) }
.hub-actions .plan-chips { display: flex; flex-wrap: wrap; gap: .4rem }

/* ---- The Share dialog, staged over the sharing page's replay (share.js). A picture of the app's dialog, not a control. ---- */
.sh-dialog { position: absolute; inset: .5rem .6rem .5rem auto; z-index: 2; display: flex; flex-direction: column; gap: .4rem; width: min(21rem, 52%); padding: .7rem .75rem; overflow: hidden; border: 1px solid #b9c2b3; border-radius: 8px; background: #fff; box-shadow: 0 18px 36px -18px #000a; color: var(--ink); font: 500 .75rem/1.3 "Helvetica Neue",Arial,sans-serif; pointer-events: none }
.sh-dialog[hidden] { display: none }
.replay[data-dialog] .rp-board::after { content: ""; position: absolute; inset: 0; z-index: 1; background: #17281f2e }
.sh-title { font: 700 1rem/1.1 "Archivo Narrow","Arial Narrow",sans-serif }
.sh-invite, .sh-body { display: grid; justify-items: start; gap: .35rem }
.sh-row { border: 1px solid #d5dacd; border-radius: 6px }
.sh-row[data-current] { border: 2px solid #285b46 }
.sh-row-head { display: grid; grid-template-columns: 1fr auto; gap: 0 .5rem; padding: .35rem .5rem }
.sh-row-head small { grid-column: 1; color: #5a6a5e; font: 400 .75rem/1.35 "Helvetica Neue",Arial,sans-serif }
.sh-chev { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-style: normal; color: #5a6a5e }
.sh-row .sh-body { padding: 0 .5rem .45rem }
.sh-button { padding: .28rem .6rem; border: 1px solid #285b46; border-radius: 4px; color: #285b46; font-weight: 600 }
.sh-button.primary { background: #285b46; color: #fff }
.sh-button[data-on] { box-shadow: 0 0 0 3px #f0cd7f }
.sh-select { padding: .1rem .4rem; border: 1px solid #b9c2b3; border-radius: 4px }
.sh-link { width: 100%; padding: .25rem .4rem; overflow: hidden; border: 1px solid #c3cabb; border-radius: 4px; font: 500 .75rem/1.3 ui-monospace,Menlo,monospace; text-overflow: ellipsis; white-space: nowrap }
.sh-status { color: #2f6b4b; font-weight: 600 }
.sh-actions { display: flex; justify-content: flex-end; margin-top: auto }
@media (prefers-reduced-motion: no-preference) { .sh-dialog:not([hidden]) { animation: sh-in .22s ease-out both } }
@keyframes sh-in { from { opacity: 0; transform: translateY(6px) } }
/* A small stage: the dialog fills the canvas, as the app's dialog fills a phone, and keeps only the rows' names. */
@container replay (max-width: 719px) {
  .sh-dialog { inset: .4rem; width: auto; gap: .3rem; padding: .5rem .6rem }
  .sh-row-head small, .sh-actions { display: none }
  .sh-row-head { padding: .25rem .45rem }
  .sh-row[data-open] .sh-row-head small { display: block }
}

/* The Share dialog on a private team slate, drawn in the teams section of the sharing page. */
.sh-team { max-width: 34rem; margin: 0 0 0 auto; overflow: hidden; border: 1px solid var(--s-line,#b9c2b3); border-radius: 12px; background: #eceae0; box-shadow: 0 24px 44px -30px #0008 }
.sh-team-box { display: grid; gap: .45rem; margin: clamp(.8rem,2vw,1.4rem); padding: .9rem 1rem; border: 1px solid #b9c2b3; border-radius: 8px; background: #fff; color: var(--ink); font: 500 .82rem/1.3 "Helvetica Neue",Arial,sans-serif }
.sh-team .sh-title { font-size: 1.1rem }
.sh-members { width: calc(100% - 1rem); margin: 0 .5rem .5rem; border-collapse: collapse }
.sh-members tr:nth-child(even) { background: #f4f3ec }
.sh-members th { padding: .4rem .5rem; font-weight: 600; text-align: left; white-space: nowrap }
.sh-members td { display: flex; flex-wrap: wrap; gap: .2rem .7rem; padding: .4rem .5rem }
.sh-members td span { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap }
.sh-members td span::before { content: ""; width: .7rem; height: .7rem; border: 2px solid #8a958c; border-radius: 50% }
.sh-members td span[data-on]::before { border-color: #8d3a73; background: radial-gradient(#8d3a73 45%, #fff 50%) }
.sh-members td.sh-admin { color: #285b46 }
.sh-team figcaption { margin: 0; padding: .6rem .9rem .65rem; border-top: 1px solid #cfd5c4; background: #fffdf4; color: #5a6a5e; font: 500 .75rem/1.4 ui-monospace,Menlo,monospace }
@media (max-width: 800px) { .sh-team { margin: 0 } .sh-members td { gap: .2rem .55rem } }

/* The video huddle example: cameras start off, as in the app. A tile shows its figure only once that person's
   camera is on (collab.js sets data-cam on the figure). */
#video-huddle .rp-face svg { opacity: 0; transition: opacity .3s }
#video-huddle[data-cam~="mara"] .rp-tile[data-who="mara"] .rp-face svg,
#video-huddle[data-cam~="dev"] .rp-tile[data-who="dev"] .rp-face svg { opacity: 1 }
@media (prefers-reduced-motion: reduce) { #video-huddle .rp-face svg { transition: none } }
