/* =====================================================================
   BANGBOWBING OS — MEDIA (radio / projects / gallery / posts) styles
   Lifted out of os/os.css byte-for-byte by the v3 scene phase (ledger item 33's
   css split, kept under the item 44-47 game frame) so phase-2 app workers edit
   disjoint files. Shell, the shared app kit, the emote/rarity tokens and the
   lightbox stay in os.css; this file owns Radio, Projects, Gallery and Posts.
   Linked from desktop.html AFTER os.css — same cascade order for ties.
   ===================================================================== */

/* =====================================================================
   RADIO
   ===================================================================== */
.radio { display: grid; grid-template-rows: auto 1fr auto; height: 100%; background: var(--screen); }
.radio-now {
  display: flex;
  gap: 12px;
  padding: 13px;
  border-bottom: 1px solid var(--screen-rim);
}
.radio-cover {
  width: 72px;
  height: 72px;
  object-fit: cover;
  flex: 0 0 auto;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 4px 12px rgba(0, 0, 0, 0.5);
  filter: saturate(1.15);
}
.radio-title { font-family: var(--font-ui); font-weight: 700; font-size: 14px; color: #fff; }
.radio-artist { font-size: 12.5px; color: var(--screen-dim); margin-top: 4px; }
.radio-eq { display: flex; gap: 3px; align-items: flex-end; height: 16px; margin-top: 10px; }
.radio-eq i { width: 4px; border-radius: 2px; background: var(--aqua-lt); height: 4px; }
.radio.playing .radio-eq i { animation: eq 0.9s steps(6) infinite; }
.radio-eq i:nth-child(2) { animation-delay: 0.12s; background: var(--candy); }
.radio-eq i:nth-child(3) { animation-delay: 0.24s; }
.radio-eq i:nth-child(4) { animation-delay: 0.06s; background: var(--tang); }
.radio-eq i:nth-child(5) { animation-delay: 0.3s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 16px; } }
.radio-list { overflow: auto; margin: 0; padding: 6px; list-style: none; }
.radio-list li { margin-bottom: 2px; }
.radio-list button {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 9px 11px;
  background: none;
  border: 0;
  border-radius: 9px;
  text-align: left;
  color: var(--screen-dim);
  font-size: 13px;
}
.radio-list button:hover { background: rgba(255, 95, 200, 0.18); color: #fff; }
.radio-list li.on button {
  background: linear-gradient(180deg, rgba(127, 227, 255, 0.22), rgba(46, 155, 255, 0.14));
  color: #fff;
}
.radio-list .n { font-family: var(--font-pixel); font-size: 9px; color: var(--aqua-lt); }
.radio-list .ph { margin-left: auto; font-family: var(--font-pixel); font-size: 8px; color: var(--tang); }
.radio-ctl {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--metal);
  border-top: 1px solid rgba(255, 255, 255, 0.7);
}

/* =====================================================================
   PROJECTS — film index with speed-ramp hovers (item 12)
   ===================================================================== */
.pj {
  position: relative;
  min-height: 100%;
  height: 100%;
  overflow: auto;
  background: #0c0a12;
}
.pj-list {
  position: relative;
  z-index: 2;
  list-style: none;
  margin: 0;
  padding: 5% 6%;
  width: 100%;
}
.pj-list li { padding: 0.9vh 0; }
.pj-tile { position: relative; }
.pj-vid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 0.55s ease;
  pointer-events: none;
}
.pj-vid.on { opacity: 0.6; }
.pj-tile-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(12, 10, 18, 0.88) 100%);
}
.pj-row {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: baseline;
  gap: 16px;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  text-align: left;
  text-decoration: none;
  transition: opacity 0.35s ease, filter 0.35s ease, transform 0.35s ease;
}
.pj-num { font-family: var(--font-pixel); font-size: 10px; color: var(--aqua-lt); min-width: 28px; }
.pj-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(21px, 4.4vw, 54px);
  line-height: 1.06;
  letter-spacing: 0.005em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.62);
  transition: color 0.3s ease, -webkit-text-stroke-color 0.3s ease, text-shadow 0.3s ease;
}
.pj-meta {
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--screen-dim);
  white-space: nowrap;
}
.pj.focusing .pj-row { opacity: 0.3; filter: blur(1.5px); }
.pj.focusing .pj-list li.hot .pj-row { opacity: 1; filter: none; transform: translateX(10px); }
.pj-list li.hot .pj-title {
  color: #fff;
  -webkit-text-stroke-color: transparent;
  text-shadow: 0 0 26px rgba(255, 95, 200, 0.8);
}
.pj-list li.hot .pj-meta { color: var(--candy); }
.pj-foot {
  position: sticky;
  left: 0;
  bottom: 0;
  z-index: 2;
  padding: 10px 6%;
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--screen-dim);
  background: linear-gradient(0deg, rgba(12, 10, 18, 0.92), transparent);
}
@media (hover: none) {
  .pj-list li.hot .pj-meta::after { content: " · TAP AGAIN"; color: #fff; }
}

/* >=720px panel width (item 38): 2x2 film tiles, each tile carrying its
   own preview video instead of one full-bleed background layer. */
.pj { container-type: inline-size; container-name: pj; }
@container pj (min-width: 720px) {
  .pj-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
  }
  .pj-list li { padding: 0; }
  .pj-tile {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 10px;
    background: #15121e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
  }
  .pj-tile.hot { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--candy), 0 14px 30px rgba(0, 0, 0, 0.55); }
  .pj.focusing .pj-tile:not(.hot) { opacity: 0.55; filter: blur(0.5px); }
  .pj.focusing .pj-list li.hot .pj-row { transform: none; }
  .pj-row {
    height: 100%;
    align-items: flex-end;
    flex-wrap: wrap;
    padding: 12px 14px;
  }
  .pj-title { font-size: clamp(16px, 2vw, 24px); color: #fff; -webkit-text-stroke: 0; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7); }
  .pj-list li.hot .pj-title { text-shadow: 0 0 20px rgba(255, 95, 200, 0.8); }
  /* an odd tile out (3 films, 2 columns) reads better full-width than half-empty */
  .pj-list li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .pj-list li:last-child:nth-child(odd) .pj-tile { aspect-ratio: 32 / 9; }
  .pj-foot { position: static; background: none; padding: 4px 16px 12px; }
}

/* --- gallery ------------------------------------------------------ */
.gallery { min-height: 100%; container-type: inline-size; container-name: gallery; }
.gal-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
/* >=720px panel width (item 38): masonry-style 4-across */
@container gallery (min-width: 720px) {
  .gal-grid { grid-template-columns: repeat(4, 1fr); }
}
.gal-tile {
  position: relative;
  display: grid;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 11px;
  background: linear-gradient(180deg, #2b2d51, var(--screen-2));
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  text-align: left;
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease);
}
.gal-tile:hover { transform: translateY(-2px); border-color: rgba(255, 95, 200, 0.75); }
.gal-art { display: block; width: 100%; height: 118px; object-fit: cover; background: #0a0b16; }
.gal-art.empty { display: grid; place-items: center; font-size: 26px; color: rgba(255, 255, 255, 0.3); }
.gal-play {
  position: absolute;
  top: 44px;
  left: 50%;
  width: 34px;
  height: 34px;
  margin-left: -17px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 13px;
  color: #10122a;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(210, 220, 240, 0.8));
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}
.gal-cap { display: grid; gap: 2px; padding: 7px 9px 9px; }
.gal-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gal-when { font-size: 10.5px; color: var(--screen-dim); }
.gal-foot { display: grid; gap: 10px; justify-items: start; padding-top: 4px; }

/* --- posts -------------------------------------------------------- */
.posts { min-height: 100%; }
.post-cols { display: contents; }
.post-read { display: none; }
.postrow { display: flex; gap: 14px; align-items: flex-start; }
.postrow-compact {
  width: 100%;
  padding: 8px;
  border-radius: 9px;
  background: none;
  border: 1px solid transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.postrow-compact:hover { background: rgba(255, 255, 255, 0.05); }
.postrow-compact.is-sel { background: linear-gradient(180deg, #262848, var(--screen-2)); border-color: var(--aqua-lt); }
.postrow-compact .post-main { min-width: 0; }
.postrow-compact h3 { margin: 0; font-size: 13.5px; }

/* >=720px panel width (item 38): list on the left, reading pane on the
   right. .win-body has no width hook (see os/wm.js), so os/apps/bulletin.js
   measures its own root with a ResizeObserver and toggles .is-wide — plain
   class selectors here, not a container query. */
.posts.is-wide .post-cols {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.posts.is-wide .post-feed { display: grid; gap: 2px; }
.posts.is-wide .post-read {
  display: block;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #1f2140, var(--screen-2));
  border: 1px solid rgba(255, 255, 255, 0.09);
  max-height: 100%;
}
.posts.is-wide .post-read .postrow { gap: 16px; }
.post-date {
  flex: 0 0 auto;
  display: grid;
  justify-items: center;
  gap: 1px;
  width: 52px;
  padding: 7px 0;
  border-radius: 9px;
  background: linear-gradient(180deg, #32355a, var(--screen-3));
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.post-date strong { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: #fff; line-height: 1; }
.post-date span { font-family: var(--font-pixel); font-size: 8px; letter-spacing: 0.12em; color: var(--aqua-lt); }
.post-date .yr { color: var(--screen-dim); }
.post-main { min-width: 0; display: grid; gap: 5px; }
.post-when { font-size: 11px; color: var(--screen-dim); }
.post-body { display: grid; gap: 7px; }
.post-body p { margin: 0; font-size: 13px; line-height: 1.62; color: var(--screen-dim); }
.post-media { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.post-thumbbtn { position: relative; padding: 0; background: none; border: 0; border-radius: 9px; overflow: hidden; }
.post-thumb {
  display: block;
  width: 96px;
  height: 68px;
  object-fit: cover;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #0a0b16;
}
.post-thumb.empty { display: grid; place-items: center; font-size: 20px; color: rgba(255, 255, 255, 0.3); }
.post-thumbbtn .gal-play { top: 17px; width: 28px; height: 28px; margin-left: -14px; }
.post-foot { display: grid; gap: 10px; justify-items: start; }

/* --- narrow windows / phones -------------------------------------- */
@media (max-width: 759px) {
  .gal-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .postrow { gap: 10px; }
  .post-date { width: 44px; }
}
