/* ==========================================================================
   astrohead.css  (version 26)
   Shared styles for every Astrohead page: video list, video profile, news, the audio pages, UFO Radio and Ambient Tracks.
   Lives in /css/. Image paths below are relative to this file, so they start with ../images/
   Pages load it as css/astrohead.css?v=26. Raise the number whenever this file changes, so phones fetch the new copy.

   Order: tokens, base, shared bits, list page, filters, profile page, news page, audio page, UFO Radio page, Ambient Tracks page, Predictions page, legacy,
   then ONE desktop block (561px and up), ONE 560px block, ONE 380px block.
   Never put media rules anywhere else. Phone and small phone rules go in their blocks at the end.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;
  --ink: #eef2f8;
  --muted: #aab4c3;
  --orange: #f4a34a;
  --blue: #91cbee;
  --line: rgba(214, 226, 255, .17);
  --hover-gold: rgba(218, 166, 56, .09); /* whole listing hover on the list and news pages */
  --bg: #101827;
  --logo-gap: 18px; /* space between logo and header text; tune here */
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg); font-family: Arial, Helvetica, sans-serif; }
/* Fixed background layer. Works on iOS Safari, where background-attachment: fixed does not. */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: url("../images/Astrohead_BG.jpg") center / cover no-repeat; }

/* ---------- Page frame, shell, header, footer ---------- */
.page-frame { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: 20px 0 12px; }
.shell { flex: 1 0 auto; width: min(960px, calc(100% - 36px)); margin: 0 auto; border: 1px solid var(--line); border-radius: 20px; background: rgba(10, 16, 27, .88); box-shadow: 0 18px 55px rgba(0, 0, 0, .36); overflow: hidden; }
header { display: flex; align-items: flex-start; justify-content: flex-start; gap: var(--logo-gap); padding: 19px 4px 12px 14px; }
/* width and height auto so the box hugs the artwork: no invisible letterbox space to the right of the logo */
.logo { display: block; width: auto; height: auto; max-width: 150px; max-height: 68px; }
.intro { min-width: 0; }
.eyebrow { margin: 0 0 4px; color: var(--blue); font-size: 11px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
h1 { margin: 0; color: var(--orange); font-size: clamp(21px, 3vw, 27px); line-height: 1.25; white-space: nowrap; }
.subhead { margin: 5px 0 0; color: #fff; font-size: 13px; }
/* Optional icon at the right end of the header, a bookend to the logo. Add <img class="head-icon"> as the last item in header. */
.head-icon { flex: none; width: 56px; height: 56px; margin-left: auto; margin-right: 10px; object-fit: contain; }
header:has(.head-icon) { align-items: center; }
main { padding: 10px 22px 20px; }
.site-footer { margin-top: auto; padding: 7px 12px 0; color: rgba(231, 237, 247, .78); font-size: 11px; text-align: center; }

/* ---------- Shared bits ---------- */
.field { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; outline: none; color: var(--ink); background: rgba(255, 255, 255, .07); font: inherit; }
.field:focus { border-color: rgba(132, 200, 237, .75); box-shadow: 0 0 0 3px rgba(132, 200, 237, .12); }
.field::placeholder { color: #929bad; }
.listhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 2px 7px; border-bottom: 1px solid var(--line); }
.listhead h2 { margin: 0; font-size: 13px; font-weight: 700; }
.count { color: var(--muted); font-size: 11px; }
.empty { padding: 28px 8px; text-align: center; color: var(--muted); font-size: 13px; }
.nw { white-space: nowrap; } /* keeps a star attached to the last word of a wrapped title */
.more { display: grid; justify-items: center; gap: 6px; padding: 18px 0 4px; color: var(--muted); font-size: 12px; }
.more[hidden] { display: none; }
.more-button { padding: 9px 22px; border: 1px solid rgba(145, 203, 238, .4); border-radius: 999px; color: #c7e5f7; background: rgba(145, 203, 238, .09); font: inherit; font-size: 13px; cursor: pointer; }
.more-button:hover { border-color: rgba(145, 203, 238, .8); color: #fff; }
.more-button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ==========================================================================
   LIST PAGE: rows
   ========================================================================== */
.rows { display: grid; align-content: start; }
.video-row { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 16px; align-items: start; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.video-row-link { color: inherit; text-decoration: none; border-radius: 6px; transition: background-color 150ms ease; }
.video-row-link:hover, .video-row-link:focus-visible { background-color: var(--hover-gold); }
.video-row-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.video-preview { position: relative; display: block; width: 132px; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid rgba(214, 226, 255, .18); border-radius: 8px; background: #111a29; margin-top: 5px; }
.video-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-row-link:hover .video-preview, .video-row-link:focus-visible .video-preview { border-color: rgba(132, 200, 237, .75); }
.video-copy { min-width: 0; }
/* Title on the left, publish date at the top right. On a phone the date moves to the meta line instead. */
.video-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.video-title { display: block; margin: 0; font-size: 16px; line-height: 1.35; transition: color 150ms ease; }
.video-head .video-title { flex: 1 1 auto; min-width: 0; }
.video-row-link .video-title:hover { color: var(--orange); }
.video-star { margin-left: 6px; color: var(--orange); font-size: .8em; vertical-align: 1px; }
.video-date { color: var(--muted); white-space: nowrap; }
.video-date-top { flex: 0 0 auto; font-size: 12px; }
.video-date-meta { display: none; margin-left: auto; }
.video-meta { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 6px; color: var(--muted); font-size: 12px; }
.video-category { color: var(--blue); }
.video-topics { color: var(--muted); }
.video-description { display: block; margin: 8px 0 0; color: #c2ccda; font-size: 12px; line-height: 1.5; }

/* ==========================================================================
   LIST PAGE: group and topic filters
   ========================================================================== */
/* minmax(0, 1fr) and min-width: 0 stop the swipeable topic row from stretching the page wider than the screen */
.filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 16px; }
.filter-top { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 10px; align-items: center; }
.filter-top, .filter-box, .search-wrap { min-width: 0; }
.filter-box { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .03); }
.filter-box.inline { display: flex; gap: 8px 10px; align-items: flex-start; }
#groupBox { align-items: center; min-height: 42px; padding-top: 6px; padding-bottom: 6px; }
.filter-label { flex: 0 0 auto; margin: 0; color: var(--blue); font-size: 12px; font-weight: 700; white-space: nowrap; }
#topicBox .filter-label { padding-top: 3px; }
/* Slow fading blink on the group prompt: one full cycle every 3.6 seconds */
.blink { animation: blink 3.6s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: .2; } 45%, 55% { opacity: 1; } }
@keyframes blink-text { 0%, 100% { color: rgba(145, 203, 238, .25); } 45%, 55% { color: var(--blue); } } /* phone version: fades the text only, not the label's backing */
@media (prefers-reduced-motion: reduce) { .blink { animation: none !important; } }
.chips { display: flex; flex-wrap: wrap; flex: 1 1 0; min-width: 0; gap: 6px; }
.chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 11px; border: 1px solid rgba(145, 203, 238, .28); border-radius: 999px; color: #c7e5f7; background: rgba(145, 203, 238, .07); font: inherit; font-size: 12px; cursor: pointer; }
.chip .n { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.chip:hover:not(:disabled) { border-color: rgba(145, 203, 238, .7); }
.chip:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.chip[aria-pressed="true"], .chip[aria-pressed="true"]:hover:not(:disabled) { border-color: var(--orange); color: #fff; background: rgba(244, 163, 74, .18); } /* stays orange even with the pointer over it */
.chip[aria-pressed="true"] .n { color: #f6d3a8; }
.chip:disabled { opacity: .35; cursor: default; }
.chip[hidden] { display: none; }
.chip .star { color: var(--orange); font-size: .95em; } /* the Astro Picks chip */
/* Topic chips run one size smaller than group chips. They sit in ONE row that scrolls sideways: swipe on a phone, mouse wheel,
   drag or trackpad on a PC. The scripts add fade-left and fade-right when there is more to scroll to on that side. */
#topicBox { align-items: center; }
#topicChips { flex-wrap: nowrap; overflow-x: auto; gap: 5px; padding-right: 28px; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
#topicChips::-webkit-scrollbar { display: none; }
#topicChips .chip { flex: 0 0 auto; padding: 3px 9px; font-size: 11px; white-space: nowrap; }
#topicChips .chip .n { font-size: 9px; }
#topicChips.fade-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
#topicChips.fade-left { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 20px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 20px), transparent); }
#topicChips.fade-left.fade-right { -webkit-mask-image: linear-gradient(to right, transparent, #000 20px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, transparent, #000 20px, #000 calc(100% - 28px), transparent); }

/* ==========================================================================
   PROFILE PAGE
   ========================================================================== */
.profile-main { padding-bottom: 24px; }
.status { color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 16px; color: var(--blue); font-size: 13px; text-decoration: none; }
.back:hover, .back:focus-visible { color: #fff; text-decoration: underline; }
.missing { padding: 26px 8px; text-align: center; }
.missing h2 { margin: 0 0 10px; color: var(--orange); font-size: 20px; }

.profile-cards { display: grid; gap: 15px; }
.perspectives-card { padding: 20px; border: 1px solid rgba(244, 163, 74, .34); border-radius: 14px; background: linear-gradient(135deg, rgba(244, 163, 74, .09), rgba(255, 255, 255, .035) 62%); }
/* The video title in the card is white, so it does not compete with the orange topic line in the header */
.perspectives-card h2 { margin: 0 0 15px; color: #fff; font-size: 19px; line-height: 1.3; }
.perspectives-title { margin-bottom: 13px; }
.title-star { margin-left: 8px; color: var(--orange); font-size: .8em; vertical-align: 1px; }

/* Media area: left column (audio) and right column (video) */
.profile-media-split { display: grid; grid-template-columns: minmax(0, 1fr) 460px; align-items: start; gap: 20px; }
.profile-media-left { display: grid; align-content: start; gap: 13px; min-width: 0; }
.profile-media-right { width: 460px; max-width: 100%; }
.player-wrap { width: min(100%, 720px); margin: 0 auto; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid rgba(214, 226, 255, .18); border-radius: 10px; background: #000; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.player-wrap iframe { display: block; width: 100%; height: 100%; border: 0; }
.profile-media-right .player-wrap { width: 100%; margin: 6px 0 0; }
.profile-category-line { display: flex; align-items: baseline; gap: 5px; min-width: 0; margin: 0 0 5px; line-height: 1.4; white-space: nowrap; }
.profile-category-line strong { flex: 0 0 auto; color: var(--blue); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.profile-category-line span { overflow: hidden; color: #fff; font-size: 12px; text-overflow: ellipsis; }

/* Text fields */
.perspectives-field { min-width: 0; }
.perspectives-lower { margin-top: 13px; }
.perspectives-label { margin: 0 0 5px; color: var(--blue); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.perspectives-value { margin: 0; color: #e6ebf2; font-size: 13px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.perspectives-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.perspectives-tag { padding: 3px 6px; border: 1px solid rgba(145, 203, 238, .24); border-radius: 999px; color: #c7e5f7; background: rgba(145, 203, 238, .07); font-size: 9px; }
/* Tags sit on one row with the label. A long list wraps underneath the first tag, not under the word Tags. */
.perspectives-tags-field { display: flex; align-items: baseline; gap: 8px; }
.perspectives-tags-field .perspectives-label { flex: 0 0 auto; margin: 0; }
.perspectives-tags-field .perspectives-tags { flex: 1 1 0; min-width: 0; }
/* Format, published date and flags under the summary. These lines may wrap on small screens. */
.profile-details { margin-top: 12px; display: grid; gap: 4px; }
.profile-detail { white-space: normal; flex-wrap: wrap; margin: 0; }
.profile-detail span { overflow: visible; text-overflow: clip; }

/* Audio player (also used compact on the news page) */
.perspectives-audio-player { position: relative; display: flex; align-items: center; gap: 4px; width: min(100%, 300px); min-height: 34px; color: var(--ink); }
.perspectives-audio-player audio { display: none; }
.audio-control { display: inline-grid; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; padding: 0; border: 1px solid rgba(214, 226, 255, .2); border-radius: 50%; color: var(--ink); background: rgba(255, 255, 255, .07); cursor: pointer; }
.audio-control:hover, .audio-control:focus-visible { border-color: var(--blue); outline: none; background: rgba(145, 203, 238, .14); }
.audio-play { width: 24px; height: 24px; color: var(--blue); border-color: var(--blue); background: rgba(10, 16, 27, .9); }
.audio-play:hover, .audio-play:focus-visible { background: rgba(145, 203, 238, .16); }
.audio-time { flex: 0 0 auto; margin-right: -4px; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.audio-progress { flex: 0 1 16.667%; width: 16.667%; min-width: 36px; height: 4px; margin: 0; accent-color: var(--orange); cursor: pointer; }
.audio-progress::-webkit-slider-thumb { transform: scale(.85); }
.audio-progress::-moz-range-thumb { transform: scale(.85); }
.audio-menu-wrap { position: relative; flex: 0 0 auto; }
/* Must stay AFTER .audio-control so it wins without !important */
.audio-menu-toggle,
.audio-menu-toggle:hover,
.audio-menu-toggle:focus,
.audio-menu-toggle:focus-visible,
.audio-menu-toggle:active { border: 0; border-radius: 0; outline: none; background: transparent; box-shadow: none; }
.audio-menu { position: absolute; z-index: 2; right: 0; bottom: calc(100% + 6px); min-width: 126px; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: #172235; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.audio-menu[hidden] { display: none; }
.audio-speed { display: block; width: 100%; padding: 7px 9px; border: 0; border-radius: 5px; color: var(--ink); background: transparent; text-align: left; font: inherit; font-size: 12px; cursor: pointer; }
.audio-speed:hover, .audio-speed:focus-visible { outline: none; background: rgba(145, 203, 238, .14); }
.audio-speed[aria-checked="true"] { color: var(--orange); }
.audio-speed-label { margin-left: 8px; color: var(--muted); font-size: 10px; }
.audio-na { color: var(--muted); font-size: 12px; }

/* ==========================================================================
   PLAY MARKS: the play and pause pictures, taken from the Astrohead logo
   The shapes are vector drawings used as masks, so the color is just the button's text color: blue for play,
   white for pause, and orange on the audio page row that is playing. The text symbols the scripts put in the
   buttons are hidden and kept for screen readers.
   To use PNG pictures instead, add the class marks-png to <body> (the switch is in scripts/site-header.js).
   The PNG files are in /images/. They are fixed in blue and white, so the orange row stays blue.
   Files for editing the shapes: images/play-mark.svg and images/play-wedge.svg.
   ========================================================================== */
:root {
  --mark-wedge: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 175 156'%3E%3Cpath d='M173.0,85.5 23.0,155.5 21.7,154.0 19.0,149.0 11.5,131.0 10.0,128.0 8.8,128.0 9.7,127.0 9.5,125.0 7.5,119.0 5.8,118.0 6.8,117.0 6.0,114.0 4.9,114.0 5.8,113.0 4.5,105.0 3.0,104.0 3.7,103.0 3.5,99.0 1.9,98.0 3.0,97.0 1.7,85.0 2.1,67.0 2.0,66.1 1.0,67.0 0.9,66.0 2.5,65.0 3.0,58.0 1.8,57.0 3.5,56.0 3.7,52.0 3.0,51.0 4.5,49.0 4.7,47.0 3.8,45.0 5.0,46.0 5.5,45.0 5.7,42.0 4.8,41.0 6.5,40.0 6.8,38.0 5.9,37.0 7.0,37.0 9.5,30.0 8.8,27.0 10.0,27.0 16.5,12.0 15.9,10.0 17.0,10.0 17.5,9.0 16.9,8.0 18.5,7.0 17.9,6.0 19.0,6.0 22.0,0.6 24.0,0.7 44.0,10.5 46.0,10.0 46.0,11.0 59.0,17.5 61.0,17.7 91.0,32.5 93.0,32.0 93.0,33.0 106.0,39.5 173.5,71.0 174.3,81.0Z'/%3E%3C/svg%3E");  /* the triangle from the logo */
  --mark-full: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 406 357'%3E%3Cpath d='M42.0,356.4 39.6,355.0 27.7,328.0 12.7,283.0 12.4,281.0 14.0,279.7 27.0,274.5 27.5,273.0 18.7,258.0 8.8,233.0 2.7,207.0 0.5,179.0 1.7,155.0 5.7,131.0 14.5,104.0 24.7,84.0 24.0,82.5 11.8,77.0 23.8,38.0 40.0,0.6 96.0,27.5 113.0,34.3 155.0,55.5 164.0,59.5 166.0,59.0 175.2,65.0 162.5,95.0 157.5,113.0 158.0,116.0 155.5,120.0 152.0,141.0 97.0,115.5 89.5,132.0 84.5,148.0 81.5,170.0 81.5,187.0 83.1,188.0 81.5,189.0 83.5,203.0 89.5,225.0 96.5,241.0 98.0,241.5 106.0,236.7 152.0,217.7 152.5,222.0 154.1,223.0 153.5,228.0 155.0,229.0 154.5,233.0 156.2,234.0 155.5,238.0 157.1,239.0 156.5,243.0 160.5,258.0 174.4,293.0ZM404.0,186.5 254.0,256.5 252.7,255.0 250.0,250.0 242.5,232.0 241.0,229.0 239.8,229.0 240.7,228.0 240.5,226.0 238.5,220.0 236.8,219.0 237.8,218.0 237.0,215.0 235.9,215.0 236.8,214.0 235.5,206.0 234.0,205.0 234.7,204.0 234.5,200.0 232.9,199.0 234.0,198.0 232.7,186.0 233.1,168.0 233.0,167.1 232.0,168.0 231.9,167.0 233.5,166.0 234.0,159.0 232.8,158.0 234.5,157.0 234.7,153.0 234.0,152.0 235.5,150.0 235.7,148.0 234.8,146.0 236.0,147.0 236.5,146.0 236.7,143.0 235.8,142.0 237.5,141.0 237.8,139.0 236.9,138.0 238.0,138.0 240.5,131.0 239.8,128.0 241.0,128.0 247.5,113.0 246.9,111.0 248.0,111.0 248.5,110.0 247.9,109.0 249.5,108.0 248.9,107.0 250.0,107.0 253.0,101.6 255.0,101.7 275.0,111.5 277.0,111.0 277.0,112.0 290.0,118.5 292.0,118.7 322.0,133.5 324.0,133.0 324.0,134.0 337.0,140.5 404.5,172.0 405.3,182.0Z'/%3E%3C/svg%3E");  /* the logo mark: a curved band and the triangle */
  --mark-pause: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M0,0H6.4V16H0ZM9.6,0H16V16H9.6Z'/%3E%3C/svg%3E");  /* two bars */
  --png-wedge: url("../images/play-wedge.png");
  --png-full: url("../images/play-mark.png");
  --png-pause: url("../images/play-pause.png");
}
.audio-play, .track-play, .now-btn.main { position: relative; font-size: 0; }
.audio-play::before, .track-play::before, .now-btn.main::before { content: ""; position: absolute; left: 50%; top: 50%; width: var(--mark-w, 12px); height: var(--mark-h, 12px); transform: translate(calc(-50% + var(--mark-nudge, 0px)), -50%); background-color: currentColor; -webkit-mask: var(--mark) center / contain no-repeat; mask: var(--mark) center / contain no-repeat; }
/* sizes: the triangle on the small buttons and the full mark on the big one. Pause is two bars everywhere. */
.audio-play { --mark: var(--mark-wedge); --png: var(--png-wedge); --mark-w: 11px; --mark-h: 10px; --mark-nudge: 1px; }
.track-play { --mark: var(--mark-wedge); --png: var(--png-wedge); --mark-w: 12px; --mark-h: 11px; --mark-nudge: 1px; }
.now-btn.main { --mark: var(--mark-full); --png: var(--png-full); --mark-w: 27px; --mark-h: 24px; --mark-nudge: 2px; } /* the band is heavier on the left, so the mark is nudged right to look centered */
.audio-play[title="Pause"], .track-play[data-state="pause"], .now-btn.main[data-state="pause"] { --mark: var(--mark-pause); --png: var(--png-pause); --mark-nudge: 0px; }
.audio-play[title="Pause"] { --mark-w: 9px; --mark-h: 9px; color: #fff; }
.track-play[data-state="pause"] { --mark-w: 10px; --mark-h: 10px; }
.now-btn.main[data-state="pause"] { --mark-w: 16px; --mark-h: 16px; color: #fff; }
/* PNG pictures, when marks-png is on <body> */
.marks-png .audio-play::before, .marks-png .track-play::before, .marks-png .now-btn.main::before { background: var(--png) center / contain no-repeat; -webkit-mask: none; mask: none; }

/* ==========================================================================
   NEWS PAGE (news-reviews.html): thumbnail left, title and summary middle, audio right
   ========================================================================== */
.news-list { display: grid; align-content: start; }
.news-item { display: grid; grid-template-columns: 112px minmax(0, 1fr) 122px; gap: 20px; align-items: start; padding: 10px 4px; border-bottom: 1px solid var(--line); border-radius: 6px; transition: background-color 150ms ease; }
.news-item:hover { background-color: var(--hover-gold); }
.news-label { margin: 0 0 6px; color: var(--blue); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; }
.news-thumb { display: block; width: 112px; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid rgba(214, 226, 255, .18); border-radius: 7px; background: #111a29; }
.news-thumb:hover, .news-thumb:focus-visible { border-color: rgba(132, 200, 237, .75); }
.news-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.news-text { min-width: 0; }
/* Title on the left, date far right on the same line. On a phone the date drops under the title. */
.news-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.news-title { display: block; margin: 0; color: #fff; font-size: 16px; line-height: 1.35; text-decoration: none; }
.news-head .news-title { flex: 1 1 auto; min-width: 0; }
.news-title:hover, .news-title:focus-visible { color: var(--orange); }
.news-date { flex: 0 0 auto; color: var(--muted); font-size: 12px; white-space: nowrap; } /* same size as the date on the video list */
.news-summary { margin: 5px 0 0; color: #d5dce8; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.news-audio { min-width: 0; }
/* Compact audio player for the news rows */
.news-item .perspectives-audio-player { width: 105px; gap: 3px; }
.news-item .audio-progress { flex: 1 1 20px; width: auto; min-width: 20px; }
.news-item .audio-time { font-size: 9px; }
.news-item .audio-menu-toggle { width: 18px; }

/* ==========================================================================
   AUDIO PAGE (audio-mind.html): category menu, play all, listing with play buttons, now playing bar
   ========================================================================== */
/* Category menu and search side by side */
.audio-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 8px; }
.audio-controls .field { height: 38px; }
.audio-controls select.field { cursor: pointer; }
.audio-controls select.field option { background: var(--bg); color: var(--ink); }

/* Play all, shuffle and the count on one line */
.audio-actions { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; }
.action { height: 32px; padding: 0 14px; border: 1px solid rgba(145, 203, 238, .35); border-radius: 999px; color: #c7e5f7; background: rgba(145, 203, 238, .08); font: inherit; font-size: 12px; cursor: pointer; }
.action:hover:not(:disabled) { border-color: rgba(145, 203, 238, .8); color: #fff; }
.action:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.action:disabled { opacity: .4; cursor: default; }
.action[aria-pressed="true"], .action[aria-pressed="true"]:hover:not(:disabled) { border-color: var(--orange); color: #fff; background: rgba(244, 163, 74, .18); } /* switched on, orange even when the pointer is over it */
.audio-actions .count { margin-left: auto; white-space: nowrap; }

/* The listing: play button, title and a one sentence description beside it */
.cat-head { padding: 12px 4px 4px; color: var(--blue); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.track-row { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; align-items: center; width: 100%; padding: 9px 4px; border: 0; border-bottom: 1px solid var(--line); border-radius: 6px; color: inherit; background: transparent; font: inherit; text-align: left; cursor: pointer; transition: background-color 150ms ease; }
.track-row:hover, .track-row:focus-visible { background-color: var(--hover-gold); outline: none; }
.track-play { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; color: var(--blue); } /* the symbol inside is drawn by PLAY MARKS */
.track-row.current .track-play { border-color: var(--orange); color: var(--orange); background: rgba(244, 163, 74, .12); }
.track-copy { min-width: 0; }
.track-title { display: block; overflow: hidden; font-size: 14px; font-weight: 700; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; transition: color 150ms ease; }
.track-row:hover .track-title, .track-row.current .track-title { color: var(--orange); }
.track-desc { display: -webkit-box; margin-top: 2px; overflow: hidden; color: #c2ccda; font-size: 12px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }

/* Now playing bar, fixed at the bottom of the screen once something plays */
.nowbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 8px 12px; border-top: 1px solid rgba(145, 203, 238, .4); background: rgba(110, 185, 235, .2); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); }
.nowbar[hidden] { display: none; }
.nowbar-inner { display: flex; align-items: center; gap: 10px; width: min(960px, 100%); margin: 0 auto; }
.now-btn { display: grid; flex: none; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid rgba(214, 226, 255, .35); border-radius: 50%; color: var(--ink); background: rgba(255, 255, 255, .07); font-size: 14px; cursor: pointer; }
.now-btn:hover, .now-btn:focus-visible { border-color: var(--blue); outline: none; }
.now-btn.main { width: 44px; height: 44px; border-color: var(--blue); color: var(--blue); background: rgba(10, 16, 27, .85); }
.now-text { flex: 1; min-width: 0; }
.now-title, .now-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-title { font-size: 13px; font-weight: 700; }
.now-sub { margin-top: 1px; color: var(--muted); font-size: 11px; }
.audio-page.has-now .page-frame { padding-bottom: 84px; } /* keeps the footer clear of the bar */

/* Category chips row (audio-mind.html): a slim chip row on the left and a narrow search box on the right */
.audio-page .filters { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.audio-page .filters .filter-box { flex: 1 1 0; min-width: 0; padding: 4px 8px; border-radius: 8px; }
.audio-page .filters .search-wrap { flex: 0 0 150px; }
.audio-page .filters .field { height: 32px; padding: 0 9px; font-size: 12px; }
.audio-page #topicChips .chip { padding: 2px 8px; font-size: 10.5px; }
.audio-page #topicChips .chip .n { font-size: 8.5px; }

/* Event log for finding out why playback stopped. Only shows when ?debug is added to the page address. */
.debuglog { position: fixed; top: 4px; left: 4px; z-index: 20; max-width: calc(100% - 8px); max-height: 38vh; margin: 0; padding: 6px 8px; overflow: hidden; border-radius: 6px; color: #9fe8d0; background: rgba(0, 0, 0, .75); font: 10px/1.35 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; pointer-events: none; }

/* ==========================================================================
   UFO RADIO PAGE (ufo-radio.html): the player card and the story rows
   The page frame, shell width, header, search fields, list heading and footer come from the shared parts above.
   Rules here start with .ufo-page so they cannot touch any other page.
   ========================================================================== */
/* Layout: the page scrolls with the browser, like every other page. The story list is not a box of its own. */
.ufo-page .footnote, .ambient-page .footnote { margin: 12px 2px 0; color: #8994a8; font-size: 10px; text-align: center; }

/* The player card */
.ufo-page .player { position: relative; flex: none; margin: 12px 0 17px; padding: 14px 16px 13px; border: 1px solid rgba(145, 203, 238, .27); border-radius: 14px; background: linear-gradient(115deg, rgba(22, 43, 61, .75), rgba(12, 20, 33, .75)); box-shadow: inset 0 1px rgba(255, 255, 255, .045); }
.ufo-page .player-layout { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 0 14px; }
.ufo-page .player-layout.has-avatar { grid-template-columns: minmax(0, 1fr) 56px; } /* the picture column only exists when a story has a talking head */
.ufo-page .talking-head { display: block; grid-column: 2; grid-row: 1; width: 56px; height: 56px; object-fit: cover; border-radius: 9px; background: #000; }
.ufo-page .talking-head[hidden] { display: none; }
.ufo-page .player-content { display: contents; }
.ufo-page .player-top { grid-column: 1; grid-row: 1; min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ufo-page .player-label { color: var(--blue); font-size: 9px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.ufo-page .player h2 { margin: 2px 0 5px; font-size: 17px; line-height: 1.25; letter-spacing: -.02em; }
.ufo-page .description { grid-column: 1 / -1; width: 100%; margin: 0 0 10px; color: #bdc7d6; font-size: 12px; line-height: 1.55; }
.ufo-page .audio { display: block; grid-column: 1 / -1; width: 100%; height: 38px; filter: invert(.88) hue-rotate(165deg) saturate(.65); }

/* The story rows. The Ambient Tracks page uses these same row rules. */
.ufo-page .track, .ambient-page .track { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 11px; align-items: center; width: 100%; padding: 11px 4px; border: 0; border-bottom: 1px solid var(--line); color: inherit; background: transparent; font: inherit; text-align: left; cursor: pointer; transition: background-color 150ms ease; }
.ufo-page .track:hover, .ufo-page .track:focus-visible, .ambient-page .track:hover, .ambient-page .track:focus-visible { background-color: var(--hover-gold); outline: none; }
.ufo-page .trackcopy, .ambient-page .trackcopy { min-width: 0; }
.ufo-page .tracktitle, .ambient-page .tracktitle { display: block; overflow: hidden; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; transition: color 150ms ease; }
.ufo-page .track:hover .tracktitle, .ufo-page .track.active .tracktitle, .ambient-page .track:hover .tracktitle, .ambient-page .track.active .tracktitle { color: var(--orange); }
.ufo-page .meta, .ambient-page .meta { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 3px; color: var(--muted); font-size: 10px; }
.ufo-page .tagline, .ambient-page .tagline { max-width: 420px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.ufo-page .duration, .ambient-page .duration { align-self: center; color: #d1d9e4; font-size: 10px; white-space: nowrap; }
/* The play symbol in each row is the logo triangle, drawn the same way as on the other audio pages (see PLAY MARKS) */
.ufo-page .playicon, .ambient-page .playicon { position: relative; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; color: var(--blue); font-size: 0; --mark: var(--mark-wedge); --png: var(--png-wedge); --mark-w: 12px; --mark-h: 11px; --mark-nudge: 1px; }
.ufo-page .playicon::before, .ambient-page .playicon::before { content: ""; position: absolute; left: 50%; top: 50%; width: var(--mark-w); height: var(--mark-h); transform: translate(calc(-50% + var(--mark-nudge)), -50%); background-color: currentColor; -webkit-mask: var(--mark) center / contain no-repeat; mask: var(--mark) center / contain no-repeat; }
body.marks-png.ufo-page .playicon::before, body.marks-png.ambient-page .playicon::before { background: var(--png) center / contain no-repeat; -webkit-mask: none; mask: none; }
.ufo-page .track.active .playicon, .ambient-page .track.active .playicon { border-color: var(--orange); color: var(--orange); background: rgba(244, 163, 74, .12); }

/* ==========================================================================
   AMBIENT TRACKS PAGE (ambient-tracks.html): a plain list of looping sounds, each row its own play and pause button
   The rows use the story row rules in the UFO Radio section above. Only what is different is here.
   Rules start with .ambient-page so they cannot touch any other page.
   ========================================================================== */
.ambient-page .listhead { margin-top: 16px; } /* the player card used to sit between the search fields and the list */
.ambient-page .duration { font-size: 20px; } /* the infinity sign that shows a sound loops */
/* The play symbol turns into the pause bars while that sound is playing */
.ambient-page .track.playing .playicon { --mark: var(--mark-pause); --png: var(--png-pause); --mark-w: 10px; --mark-h: 10px; --mark-nudge: 0px; }

/* ==========================================================================
   LEGACY: used only by the retired five group pages (yt-list-*.html). Delete once those are removed.
   ========================================================================== */
.searchrow { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(0, 1.4fr); gap: 10px; margin-bottom: 16px; }
select.field { cursor: pointer; }
select.field option { background: var(--bg); color: var(--ink); }

/* ---------- Predictions page ---------- */
.pred-list { display: grid; align-content: start; }
.pred-item { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 7px; align-items: baseline; padding: 4px 4px; border-bottom: 1px solid var(--line); border-radius: 6px; transition: background-color 150ms ease; }
.pred-item:hover { background-color: var(--hover-gold); }
.pred-when { color: var(--blue); font-size: 11px; font-weight: 400; line-height: 1.4; white-space: nowrap; }
.pred-text { margin: 0; color: #fff; font-size: 12px; line-height: 1.4; }
.pred-by { color: var(--muted); font-size: 11px; white-space: nowrap; }

/* ==========================================================================
   DESKTOP ONLY (561px and up)
   ========================================================================== */
@media (min-width: 561px) {
  /* Profile card becomes a two-column grid. The summary row takes the spare height so the summary sits right under the audio player. */
  .perspectives-card { display: grid; grid-template-columns: minmax(0, 1fr) 460px; grid-template-rows: auto auto 1fr auto; column-gap: 20px; align-items: start; }
  .perspectives-title { grid-column: 1 / -1; }
  .profile-media-split { display: contents; }
  .profile-media-left { grid-column: 1; grid-row: 2; }
  .profile-media-right { grid-column: 2; grid-row: 2 / span 2; }
  .perspectives-summary-field { grid-column: 1; grid-row: 3; margin-top: 13px; }
  .perspectives-tags-field { grid-column: 1 / -1; }
  /* Lifts the Watch the full video line 2px so it lines up with the audio label on the left. Visual shift only, so the embed does not move. */
  .profile-media-right .profile-category-line { position: relative; top: -2px; }
}

/* ==========================================================================
   PHONE (560px and down). One block only. Never paste desktop rules in here.
   ========================================================================== */
@media (max-width: 560px) {
  /* shared */
  /* predictions page */
  .pred-item { grid-template-columns: 72px minmax(0, 1fr); gap: 4px; padding: 3px 2px; }
  .pred-when { font-size: 10px; line-height: 1.5; }
  .pred-text { font-size: 11px; line-height: 1.5; }
  .pred-by { font-size: 10px; }
  .page-frame { padding: 15px 0 8px; }
  .shell { width: calc(100% - 30px); border-radius: 16px; }
  /* One line header: small logo, the title and the optional icon. The blue and white lines are hidden. A long title wraps to two lines. */
  header { --logo-gap: 10px; align-items: center; padding: 8px 12px; }
  .logo { max-width: 88px; max-height: 30px; }
  .intro { flex: 1; min-width: 0; }
  .eyebrow, .subhead { display: none; }
  h1 { font-size: 15px; line-height: 1.2; white-space: normal; }
  .head-icon { width: 30px; height: 30px; margin-right: 0; }
  main { padding: 8px 14px 14px; }
  .profile-main { padding-bottom: 18px; }
  .field { height: 36px; padding: 0 10px; font-size: 12px; }

  /* list rows */
  .video-row { grid-template-columns: 82px minmax(0, 1fr); gap: 12px; padding: 11px 2px; }
  .video-preview { width: 82px; }
  .video-title { font-size: 14px; }
  .video-meta, .video-description { font-size: 10px; }
  .video-date-top { display: none; }
  /* Group on the left and the date at the far right of one line, then the topics on a single line below */
  .video-meta { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "group date" "topics topics"; gap: 2px 10px; }
  .video-category { grid-area: group; }
  .video-date-meta { display: block; grid-area: date; justify-self: end; margin-left: 0; }
  .video-topics { grid-area: topics; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* list filters */
  .filters { gap: 8px; margin-bottom: 10px; }
  .filter-top { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .filter-box { padding: 7px 10px; }
  /* Choose Group sits at the upper left of the box, on its top border like a legend. The four chips go underneath across the full width. */
  #groupBox { position: relative; align-items: center; min-height: 0; padding: 10px 10px 7px; }
  /* The backing hides the border behind the label: the top half matches the page, the bottom half matches the inside of the box */
  #groupBox .filter-label { position: absolute; top: -8px; left: 0; padding: 0 6px; line-height: 16px; background: linear-gradient(to bottom, #0b111d 50%, #131924 50%); animation-name: blink-text; }
  #groupChips { flex: 0 0 auto; width: 100%; gap: 5px; }
  #groupChips .chip { padding: 3px 8px; font-size: 10.5px; }
  /* topics: smaller chips (the row itself scrolls on every screen, see the filters section) */
  #topicChips .chip { padding: 3px 7px; font-size: 9.5px; }
  #topicChips .chip .n { font-size: 8px; }

  /* profile */
  .perspectives-card { padding: 15px; border-radius: 11px; }
  .perspectives-card h2 { font-size: 17px; }
  .perspectives-title { margin-bottom: 11px; }
  .profile-media-split { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .profile-media-right { width: min(100%, 460px); }
  .perspectives-audio-player { width: min(100%, 280px); }
  .player-wrap { width: 100%; border-radius: 8px; }

  /* news rows: thumbnail and title on top, the date under the thumbnail and a play button at the right end of that line.
     The summary runs the full width underneath. The labels, seek bar, time and speed menu are left out on a phone. */
  .news-item { grid-template-columns: 96px minmax(0, 1fr) auto; grid-template-areas: "thumb title title" "date date audio" "summary summary summary"; gap: 4px 12px; padding: 8px 2px; }
  .news-text, .news-head { display: contents; } /* so the title, date and summary can each take their own place in the grid */
  .news-thumb-wrap { grid-area: thumb; }
  .news-label { display: none; }
  .news-thumb { width: 96px; }
  .news-title { grid-area: title; font-size: 14px; }
  .news-date { grid-area: date; align-self: center; justify-self: start; font-size: 12px; }
  .news-audio { grid-area: audio; align-self: center; justify-self: end; }
  .news-summary { grid-area: summary; margin-top: 4px; font-size: 12px; }
  .news-item .perspectives-audio-player { width: auto; min-height: 0; }
  .news-item .audio-progress, .news-item .audio-time, .news-item .audio-menu-wrap { display: none; }
  /* The plain play button has no circle. It uses the same logo marks as everywhere else (see PLAY MARKS), a little larger. */
  .news-item .audio-play, .news-item .audio-play:hover, .news-item .audio-play:focus-visible { position: relative; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 0; background: transparent; --mark-w: 19px; --mark-h: 17px; --mark-nudge: 1px; }
  .news-item .audio-play[title="Pause"] { --mark-w: 15px; --mark-h: 15px; --mark-nudge: 0px; }
  .news-item .audio-play::after { content: ""; position: absolute; inset: -10px; } /* a larger tap area around the button */
  .news-item .audio-na { font-size: 10px; }

  /* audio page */
  .audio-controls .field { height: 36px; }
  .audio-page .filters .search-wrap { flex-basis: 104px; }
  .audio-page .filters .field { height: 30px; padding: 0 8px; font-size: 11px; }
  .audio-page #topicChips .chip { padding: 2px 7px; font-size: 10px; }
  .audio-actions { margin-top: 8px; }
  .action { height: 30px; padding: 0 12px; font-size: 11px; }
  .track-row { grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 8px 2px; }
  .track-play { width: 30px; height: 30px; }
  .track-title { font-size: 13px; }
  .track-desc { font-size: 11px; }
  .nowbar { padding-left: 10px; padding-right: 10px; }

  /* UFO Radio page */
  .ufo-page .player { margin: 10px 0 14px; padding: 12px; }
  .ufo-page .player h2 { font-size: 16px; }
  .ufo-page .description { font-size: 11px; }
  .ufo-page .track, .ambient-page .track { grid-template-columns: 33px minmax(0, 1fr) auto; gap: 8px; padding: 10px 2px; }
  .ufo-page .playicon, .ambient-page .playicon { width: 30px; height: 30px; }
  .ufo-page .tracktitle, .ambient-page .tracktitle { font-size: 12px; }
  .ufo-page .meta, .ambient-page .meta { font-size: 9px; }
  .ufo-page .tagline, .ambient-page .tagline { max-width: 65vw; font-size: 9px; }
  .ufo-page .duration, .ambient-page .duration { font-size: 9px; }
  .ambient-page .duration { font-size: 18px; }

  /* legacy group pages */
  .searchrow { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 7px; }
}

/* ==========================================================================
   SMALL PHONE (380px and down). One block only.
   ========================================================================== */
@media (max-width: 380px) {
  h1 { font-size: 14px; }
  .field { height: 34px; }

  .video-row { grid-template-columns: 61px minmax(0, 1fr); gap: 9px; }
  .video-preview { width: 61px; }
  #groupChips { gap: 4px; }
  #groupChips .chip { padding: 3px 6px; }
  .video-title { font-size: 12px; }

  .perspectives-card { padding: 12px; }

  .ufo-page .track, .ambient-page .track { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 6px; }

  /* legacy group pages */
  .searchrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); }
}
