/*
 * The new room's header (round two, Dec 2, 2026; docs/room2-round2.md rules 13 and 20; room2-shell.js
 * mounts it). Loaded after room2.css, so these win over its `.r2-top` rules.
 *   wide:   [picture] topic / dates ........ [play] [Latest Week Month Quarter Year]
 *   narrow: [picture] topic / dates
 *           [Latest Week Month Quarter Year]   (play is not here: it is in R2.el.playSlot, in the reading)
 * Also the play slot's fallback place and the "Hold Ctrl and scroll to zoom" line (rule 6).
 */

/* ---------- the picture beside the topic's name ---------- */
.r2 .r2-top-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.r2 .r2-top-words { flex: 1 1 auto; min-width: 0; }
.r2-top-art {
  flex: none; display: block; position: relative;
  height: 52px; width: min(22vw, calc(52px * var(--art, 1.5))); max-width: 110px;
}
.r2-top-art .r2-art { display: block; width: 100%; height: 100%; opacity: 0.8; }

/* ---------- the five span words ---------- */
.r2 .r2-spans button { white-space: nowrap; }

/* a wide room without the width for one row: the words under the name, play beside the name */
@media (min-width: 700px) and (max-width: 979.98px) {
  .r2 .r2-top { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "head play" "spans spans"; gap: 2px 14px; }
  .r2 .r2-spans button { flex: 0 0 auto; padding: 0 14px; }
}

/* narrow: two rows, the small picture with the name and the dates, then the five words; no play here */
@media (max-width: 699.98px) {
  .r2 .r2-top { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "spans"; padding-top: 6px; }
  .r2-top-art { height: 40px; width: min(20vw, calc(40px * var(--art, 1.5))); max-width: 68px; }
  .r2 .r2-spans button { flex: 1 1 0; min-width: 0; padding: 0 2px; }
}
@media (max-width: 359.98px) {
  .r2 .r2-spans { gap: 0; }
  .r2 .r2-spans button { font-size: 14px; padding: 0 1px; }
  .r2-top-art { max-width: 52px; }
}

/* ---------- play's button outside the header (narrow) ---------- */
.r2-play-slot:empty, .r2-play-slot.r2-off, .r2.r2-playing .r2-play-slot { display: none; }
/* until the reading places the slot in its panel, it sits just above the reading */
.r2-body > .r2-play-slot { padding: 12px var(--pad, 16px) 4px; }

/* ---------- "Hold Ctrl and scroll to zoom" ---------- */
.r2-zoomhint {
  position: absolute; left: 50%; bottom: 40px; z-index: 4;
  transform: translateX(-50%);
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  font-size: 13px; line-height: 1.2; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity .35s ease;
}
.r2-zoomhint.r2-on { opacity: 1; }
@media (hover: none) { .r2-zoomhint { display: none; } }
@media (prefers-reduced-motion: reduce) { .r2-zoomhint { transition: none; } }

/* ---------- the site's header and footer around the room, on a wide screen (Dec 3, Mony) ----------
   The header's content keeps the room's own edges: the logo over the topic's picture, the nav and the
   switch ending where the reading panel ends. The footer is one quiet line under the room, which is sized
   to the rest (room2-shell.js size()), so the page does not scroll. Room 2 pages only (html.room2). */
@media (min-width: 700px) {
  html.room2 .site-head .wrap { max-width: none; padding-left: 12px; padding-right: 18px; }
  html.room2 .foot {
    max-width: none; display: flex; flex-wrap: nowrap; align-items: center; gap: 0 18px;
    padding: 0 18px 0 12px; height: 30px; overflow: hidden; white-space: nowrap; font-size: 12px;
  }
  html.room2 .foot p + p { margin-top: 0; }
  html.room2 .foot a { padding: 0; }
}
