/* ==========================================================================
 * TERMINAL THEME v2 FOR BLOT
 *
 * Retro terminal-inspired theme with green-on-black dark mode and cream
 * light mode. Monospace for UI; Georgia serif for blog post prose.
 *
 * Color scheme managed via CSS custom properties (--color-*).
 * Light/dark mode toggled via .light-mode class on html/body.
 * ========================================================================== */


/* --------------------------------------------------------------------------
 * CSS CUSTOM PROPERTIES
 *
 * All theme colors defined here. The anti-flash inline styles in each
 * template's <head> duplicate --color-bg and --color-text as raw hex
 * values to prevent a flash during stylesheet load. If you change these
 * base colors, update the inline styles in all 5 HTML templates too
 * (search for "Anti-flash" in the templates).
 * -------------------------------------------------------------------------- */

:root {
  --color-bg: #0a0a0a;
  --color-text: #33ff33;
  --color-border: rgba(51, 255, 51, 0.2);
  --color-border-strong: rgba(51, 255, 51, 0.3);
  --color-border-subtle: rgba(51, 255, 51, 0.1);
  --color-border-faint: rgba(51, 255, 51, 0.15);
  --color-border-accent: rgba(51, 255, 51, 0.5);
  --color-border-dashed: rgba(51, 255, 51, 0.4);
  --color-code-bg: rgba(51, 255, 51, 0.1);
  --color-pre-bg: rgba(51, 255, 51, 0.05);
  --color-hover-bg: rgba(51, 255, 51, 0.1);
  --color-accent: #ffbf00;
  --text-glow: 0 0 10px rgba(51, 255, 51, 0.5);
}

html.light-mode,
body.light-mode {
  --color-bg: #f5f5eb;
  --color-text: #1a1a1a;
  --color-border: rgba(0, 0, 0, 0.15);
  --color-border-strong: rgba(0, 0, 0, 0.2);
  --color-border-subtle: rgba(0, 0, 0, 0.1);
  --color-border-faint: rgba(0, 0, 0, 0.1);
  --color-border-accent: rgba(0, 0, 0, 0.3);
  --color-border-dashed: rgba(0, 0, 0, 0.3);
  --color-code-bg: rgba(0, 0, 0, 0.08);
  --color-pre-bg: rgba(0, 0, 0, 0.05);
  --color-hover-bg: rgba(0, 0, 0, 0.05);
  --color-accent: #228b22;
  --text-glow: none;
}


/* --------------------------------------------------------------------------
 * RESET & BASE
 * -------------------------------------------------------------------------- */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background-color: var(--color-bg);
}

body {
  font-family: 'Courier New', Courier, monospace;
  min-height: 100vh;
  color: var(--color-text);
}


/* --------------------------------------------------------------------------
 * SKIP LINK (accessibility)
 * -------------------------------------------------------------------------- */

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-bg);
  color: var(--color-text);
  padding: 8px;
  z-index: 100;
  transition: top 0.15s;
}

.skip-link:focus {
  top: 0;
}


/* --------------------------------------------------------------------------
 * HEADER & NAVIGATION
 *
 * Navigation is hardcoded in HTML templates (not dynamic via Blot).
 * Each nav link gets a > prefix via ::before. Home link (~) is exempt.
 * -------------------------------------------------------------------------- */

.header {
  padding: 20px;
  border-bottom: 1px solid var(--color-border);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
}

.nav a {
  display: inline-block;
  margin-right: 20px;
  text-decoration: none;
  color: inherit;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.nav a:hover {
  opacity: 1;
}

.nav a::before {
  content: '>';
  margin-right: 5px;
  opacity: 0.5;
}

.nav a.home {
  font-size: 1.4em;
  line-height: 1;
}

.nav a.home::before {
  content: none;
}


/* --------------------------------------------------------------------------
 * THEME TOGGLE BUTTON
 * -------------------------------------------------------------------------- */

.nav .toggle-button {
  display: inline-block;
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: inherit;
  font-family: inherit;
  font-size: 1em;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.nav .toggle-button:hover {
  opacity: 1;
}


/* --------------------------------------------------------------------------
 * CONTAINER
 * -------------------------------------------------------------------------- */

.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 40px 20px;
}


/* --------------------------------------------------------------------------
 * ENTRY / POST STYLES
 *
 * Used for both blog posts and pages. The .entry class wraps all content.
 * Tag-based classes (e.g., .tag-posts) enable per-type styling.
 * -------------------------------------------------------------------------- */

.entry {
  margin-bottom: 60px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--color-border);
}

.entry:last-child {
  border-bottom: none;
}

.entry h1,
.entry-title {
  font-size: 1.6em;
  font-weight: normal;
  margin-bottom: 15px;
  letter-spacing: 0.05em;
}

.entry-title a {
  color: inherit;
  text-decoration: none;
}

.entry-title a:hover {
  text-decoration: underline;
}

.entry-title::before {
  content: '>';
  margin-right: 10px;
  opacity: 0.5;
}

.date,
.entry-date {
  font-size: 0.85em;
  opacity: 0.5;
  margin-bottom: 20px;
}

.entry-body,
.body {
  line-height: 1.7;
}


/* --------------------------------------------------------------------------
 * GEORGIA FONT — BLOG POSTS ONLY
 *
 * Blog posts (tagged "posts") use Georgia serif for prose readability.
 * Targets both .entry.tag-posts on entry pages and body.viewing-tag-posts
 * on tag listing pages. Both "posts" and "Posts" handled for Blot's
 * case variations.
 *
 * Code blocks always stay monospace (see code rule below).
 * -------------------------------------------------------------------------- */

.entry.tag-posts .entry-body,
.entry.tag-Posts .entry-body,
body.viewing-tag-posts .entry-body,
body.viewing-tag-Posts .entry-body {
  font-family: Georgia, 'Times New Roman', serif;
}

.entry.tag-posts .entry-body p,
.entry.tag-posts .entry-body li,
.entry.tag-posts .entry-body blockquote,
.entry.tag-posts .entry-body h1,
.entry.tag-posts .entry-body h2,
.entry.tag-posts .entry-body h3,
.entry.tag-posts .entry-body h4,
.entry.tag-Posts .entry-body p,
.entry.tag-Posts .entry-body li,
.entry.tag-Posts .entry-body blockquote,
.entry.tag-Posts .entry-body h1,
.entry.tag-Posts .entry-body h2,
.entry.tag-Posts .entry-body h3,
.entry.tag-Posts .entry-body h4,
body.viewing-tag-posts .entry-body p,
body.viewing-tag-posts .entry-body li,
body.viewing-tag-posts .entry-body blockquote,
body.viewing-tag-posts .entry-body h1,
body.viewing-tag-posts .entry-body h2,
body.viewing-tag-posts .entry-body h3,
body.viewing-tag-posts .entry-body h4,
body.viewing-tag-Posts .entry-body p,
body.viewing-tag-Posts .entry-body li,
body.viewing-tag-Posts .entry-body blockquote,
body.viewing-tag-Posts .entry-body h1,
body.viewing-tag-Posts .entry-body h2,
body.viewing-tag-Posts .entry-body h3,
body.viewing-tag-Posts .entry-body h4 {
  font-family: Georgia, 'Times New Roman', serif;
}

/* Remove terminal ## prefix from blog post headings */
.entry.tag-posts .entry-body h1::before,
.entry.tag-posts .entry-body h2::before,
.entry.tag-posts .entry-body h3::before,
.entry.tag-Posts .entry-body h1::before,
.entry.tag-Posts .entry-body h2::before,
.entry.tag-Posts .entry-body h3::before,
body.viewing-tag-posts .entry-body h1::before,
body.viewing-tag-posts .entry-body h2::before,
body.viewing-tag-posts .entry-body h3::before,
body.viewing-tag-Posts .entry-body h1::before,
body.viewing-tag-Posts .entry-body h2::before,
body.viewing-tag-Posts .entry-body h3::before {
  content: none;
}


/* --------------------------------------------------------------------------
 * PAGE-SPECIFIC ELEMENTS
 * Used in static pages (social, software, landing). Explicitly monospace.
 * -------------------------------------------------------------------------- */

.section,
.section-label,
.link,
.link-title,
.link-desc,
.prompt {
  font-family: 'Courier New', Courier, monospace;
}


/* --------------------------------------------------------------------------
 * ENTRY BODY TYPOGRAPHY
 * -------------------------------------------------------------------------- */

.entry-body h1,
.entry-body h2,
.entry-body h3,
.body h1,
.body h2,
.body h3 {
  font-weight: normal;
  margin: 30px 0 15px 0;
  letter-spacing: 0.05em;
}

/* Terminal-style ## prefix for headings (removed on blog posts above) */
.entry-body h1::before,
.entry-body h2::before,
.entry-body h3::before,
.body h1::before,
.body h2::before,
.body h3::before {
  content: '## ';
  opacity: 0.5;
}

.entry-body p,
.body p {
  margin-bottom: 1.2em;
}

.entry-body a,
.body a {
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
}

.entry-body a:hover,
.body a:hover {
  text-decoration-style: solid;
}

.entry-body img,
.body img {
  max-width: 100%;
  height: auto;
  margin: 20px 0;
  border: 1px solid var(--color-border-strong);
}

/* YouTube/video embeds — Blot wraps them in .videoContainer with
   padding-bottom:56.25% (16:9). Make the container fill the column and
   pin the iframe to it. */
.entry-body .videoContainer,
.body .videoContainer {
  position: relative;
  width: 100%;
  height: 0;
  margin: 20px 0;
}

.entry-body .videoContainer iframe,
.body .videoContainer iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 1px solid var(--color-border-strong);
}

.entry-body blockquote,
.body blockquote {
  border-left: 2px solid var(--color-border-accent);
  padding-left: 20px;
  margin: 20px 0;
  opacity: 0.8;
}

/* Always monospace for code, even inside Georgia blog post prose */
.entry-body code,
.body code {
  background: var(--color-code-bg);
  padding: 2px 6px;
  font-family: 'Courier New', Courier, monospace;
}

.entry-body pre,
.body pre {
  background: var(--color-pre-bg);
  padding: 15px;
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--color-border);
}

.entry-body ul,
.entry-body ol,
.body ul,
.body ol {
  margin: 15px 0;
  padding-left: 25px;
}

.entry-body li,
.body li {
  margin-bottom: 8px;
}

/* Hide duplicate h1 in entry-body (title already shown in header) */
.entry-body > h1:first-child {
  display: none;
}

.entry-body hr {
  border: none;
  border-top: 1px dashed var(--color-border-dashed);
  margin: 1.5em 0;
}


/* --------------------------------------------------------------------------
 * PAGINATION (server-side, used by entries.html)
 *
 * [PREV] and [NEXT] links with real URLs. No > prefix.
 * -------------------------------------------------------------------------- */

.pagination {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.pagination a {
  color: inherit;
  text-decoration: none;
  margin-right: 20px;
}

.pagination a:hover {
  text-decoration: underline;
}

.pagination a::before {
  content: none;
}


/* --------------------------------------------------------------------------
 * TAGS
 * -------------------------------------------------------------------------- */

.tagged a {
  color: inherit;
  text-decoration: none;
  opacity: 0.6;
  margin-right: 10px;
}

.tagged a:hover {
  opacity: 1;
}

.tagged a::before {
  content: '#';
}


/* --------------------------------------------------------------------------
 * ARCHIVES
 * -------------------------------------------------------------------------- */

.archives {
  list-style: none;
  padding: 0;
}

.archives li {
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.archives a {
  color: inherit;
  text-decoration: none;
}

.archives a:hover {
  text-decoration: underline;
}


/* --------------------------------------------------------------------------
 * BLOG TAG PAGE — EXPAND/COLLAPSE TOGGLE
 *
 * .blog-toggle is a <button> styled as inline text. Shows > when collapsed
 * and a down arrow when expanded. Used by tagged.html.
 * -------------------------------------------------------------------------- */

.blog-toggle {
  cursor: pointer;
  opacity: 0.5;
  user-select: none;
  font-family: inherit;
  font-size: 1.2em;
  transition: opacity 0.15s;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

.blog-toggle:hover {
  opacity: 1;
}


/* --------------------------------------------------------------------------
 * EXPANDABLE CONTENT (blog tag page)
 * -------------------------------------------------------------------------- */

.blog-content {
  margin-top: 15px;
  margin-left: 20px;
  padding: 15px;
  border-left: 2px solid var(--color-border-strong);
}

.blog-content.collapsed {
  display: none;
}

.blog-content .entry-body {
  line-height: 1.7;
}

.blog-content .entry-body > h1:first-child {
  display: none;
}


/* --------------------------------------------------------------------------
 * TAG LISTING PAGE (/tagged/*)
 * -------------------------------------------------------------------------- */

.tag-header {
  font-size: 1.6em;
  margin-bottom: 25px;
  font-weight: normal;
  letter-spacing: 0.05em;
}

.tag-header::before {
  content: '>';
  margin-right: 10px;
  opacity: 0.5;
}

.tag-entries {
  margin-left: 2em;
}

.blog-entry-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.tag-entries .entry {
  padding: 15px 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0;
}

.tag-entries .entry:first-child {
  border-top: 1px solid var(--color-border);
}

/* No > prefix on entry titles when toggle arrow is present */
.tag-entries .entry-title::before {
  content: none;
}

.tag-entries .entry-body hr {
  border: none;
  border-top: 1px dashed var(--color-border-dashed);
  margin: 1.5em 0;
}


/* --------------------------------------------------------------------------
 * CLIENT-SIDE PAGINATION (tag page)
 * -------------------------------------------------------------------------- */

.blog-pagination {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.blog-pagination button {
  background: none;
  border: none;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  padding: 0;
  margin-right: 20px;
}

.blog-pagination button:hover {
  text-decoration: underline;
}


/* --------------------------------------------------------------------------
 * UTILITY
 * -------------------------------------------------------------------------- */

.clear {
  clear: both;
}


/* --------------------------------------------------------------------------
 * SEARCH
 * -------------------------------------------------------------------------- */

.search input {
  background: transparent;
  border: 1px solid var(--color-border-strong);
  color: inherit;
  padding: 10px;
  font-family: inherit;
  width: 100%;
  max-width: 300px;
}

.search input:focus {
  outline: none;
  border-color: currentColor;
}


/* --------------------------------------------------------------------------
 * LINKS PAGE SECTIONS (social.html, software.html)
 * -------------------------------------------------------------------------- */

.section {
  margin-bottom: 50px;
}

.section-label {
  font-size: 0.9em;
  opacity: 0.5;
  margin-bottom: 20px;
  letter-spacing: 0.2em;
}

.link {
  display: block;
  padding: 15px 0;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--color-border);
  transition: all 0.15s;
}

.link:first-of-type {
  border-top: 1px solid var(--color-border);
}

.link:hover {
  background: var(--color-hover-bg);
  padding-left: 15px;
}

.link-title {
  font-size: 1.4em;
  margin-bottom: 5px;
}

.link-desc {
  font-size: 0.85em;
  opacity: 0.6;
}

.prompt {
  opacity: 0.5;
  margin-right: 8px;
}


/* --------------------------------------------------------------------------
 * LANDING PAGE / ASCII ART
 *
 * Desktop: .ascii-art visible | Mobile (<600px): .name-text visible
 * -------------------------------------------------------------------------- */

.landing {
  min-height: 80vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ascii-art {
  white-space: pre;
  font-size: clamp(8px, 2.5vw, 16px);
  line-height: 1.2;
  text-align: left;
  text-shadow: var(--text-glow);
}

.name-text {
  display: none;
  font-family: 'Courier New', Courier, monospace;
  font-size: 2em;
  letter-spacing: 0.1em;
  text-shadow: var(--text-glow);
}

@media (max-width: 600px) {
  .ascii-art { display: none; }
  .name-text { display: block; }
}


/* --------------------------------------------------------------------------
 * FILE LISTING (ls -l style)
 *
 * Used by Pages/files.html. Auto-generated by files/_generate-listing.sh.
 * -------------------------------------------------------------------------- */

.file-listing {
  font-size: 0.95em;
  line-height: 1.8;
}

.listing-header {
  display: flex;
  padding: 8px 12px;
  margin: 0 -12px 10px -12px;
  border-bottom: 1px solid var(--color-border);
  opacity: 0.4;
  font-size: 0.85em;
}

.listing-header span:nth-child(1) { width: 70px; text-align: right; }
.listing-header span:nth-child(2) { width: 140px; margin-left: 20px; }
.listing-header span:nth-child(3) { margin-left: 20px; }

.file-row {
  display: flex;
  text-decoration: none;
  color: inherit;
  padding: 8px 12px;
  margin: 0 -12px;
  border-radius: 2px;
  transition: background-color 0.15s;
}

.file-row:hover {
  background: var(--color-hover-bg);
}

.file-size {
  width: 70px;
  text-align: right;
  opacity: 0.5;
  flex-shrink: 0;
}

.file-date {
  width: 140px;
  text-align: left;
  margin-left: 20px;
  opacity: 0.5;
  flex-shrink: 0;
}

.file-name {
  margin-left: 20px;
  flex-grow: 1;
}

.file-row:hover .file-name {
  text-decoration: underline;
}

.folder .file-name::after {
  content: '/';
  opacity: 0.5;
}


/* --------------------------------------------------------------------------
 * FILE LISTING — RESPONSIVE
 *
 * >700px: all columns | 500-700px: hide date | <500px: name only
 * -------------------------------------------------------------------------- */

@media screen and (max-width: 700px) {
  .file-listing .listing-header span:nth-child(2),
  .file-listing .file-row .file-date {
    display: none;
  }

  .file-listing .file-name {
    white-space: normal;
    word-break: break-word;
  }
}

@media screen and (max-width: 500px) {
  .file-listing .listing-header span:nth-child(1),
  .file-listing .listing-header span:nth-child(2),
  .file-listing .file-row .file-size,
  .file-listing .file-row .file-date {
    display: none;
    width: 0;
    height: 0;
    overflow: hidden;
  }

  .file-listing .listing-header {
    display: block;
  }

  .file-listing .listing-header span:nth-child(3) {
    margin-left: 0;
  }

  .file-listing .file-row {
    display: block;
    padding: 14px 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--color-border-faint);
  }

  .file-listing .file-row .file-name {
    display: block;
    margin-left: 0;
    white-space: normal;
    word-break: break-word;
    line-height: 1.5;
  }

  .file-listing .file-row + .file-row {
    margin-top: 4px;
  }
}


/* --------------------------------------------------------------------------
 * GALLERIES
 *
 * Used by Pages/galleries.html (index) and Pages/gallery-*.html (per-gallery
 * grids). Auto-generated by _regenerate.sh.
 * -------------------------------------------------------------------------- */

/* Hide the synthetic "Jan 1, 2000" date on auto-generated and section index
   Pages. The date is pinned old in front matter on the generated ones so
   they don't bubble to the top of any chronological listings; the display
   would otherwise look nonsensical. Targets the article wrapper. */
.entry:has(.galleries-list) > .entry-date,
.entry:has(.gallery-page) > .entry-date,
.entry:has(.file-listing) > .entry-date,
.entry:has(.yt-grid) > .entry-date {
  display: none;
}

/* Widen the main container on grid-heavy Pages so the grids get more
   columns on desktop. The base .container caps at 700px (good for prose);
   grid pages can use the full viewport width minus comfortable gutters. */
.container:has(.gallery-grid),
.container:has(.yt-grid) {
  max-width: 1200px;
}

.galleries-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.galleries-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.galleries-list li:first-child {
  border-top: 1px solid var(--color-border-subtle);
}

.galleries-list a {
  color: inherit;
  text-decoration: none;
  word-break: break-word;
}

.galleries-list a::before {
  content: '>';
  margin-right: 8px;
  opacity: 0.5;
}

.galleries-list a:hover {
  text-decoration: underline;
}


/* per-gallery page */

.gallery-page {
  margin: 10px 0;
}

.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.gallery-back {
  color: inherit;
  text-decoration: none;
  opacity: 0.6;
}

.gallery-back:hover {
  opacity: 1;
  text-decoration: underline;
}

.gallery-sort {
  font-size: 0.9em;
  opacity: 0.8;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.gallery-sort select {
  background: transparent;
  color: inherit;
  border: 1px solid var(--color-border-strong);
  font-family: inherit;
  font-size: inherit;
  padding: 4px 8px;
  cursor: pointer;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.gallery-tile {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-pre-bg);
  transition: border-color 0.15s;
  cursor: zoom-in;
}

.gallery-tile:hover {
  border-color: var(--color-border-accent);
}

.gallery-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
  border: none;
  max-width: none;
}

.gallery-empty {
  opacity: 0.5;
  font-style: italic;
  margin: 20px 0;
  grid-column: 1 / -1;
}


/* lightbox overlay */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px 60px 40px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  margin: 0 !important;
  border: none !important;
}

.lightbox-caption {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  text-align: center;
  color: #eee;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85em;
  opacity: 0.7;
  padding: 0 20px;
  word-break: break-word;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: transparent;
  border: none;
  color: #eee;
  cursor: pointer;
  opacity: 0.55;
  font-family: inherit;
  line-height: 1;
  padding: 10px 16px;
  transition: opacity 0.15s;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  opacity: 1;
}

.lightbox-close {
  top: 8px;
  right: 8px;
  font-size: 2.2em;
}

.lightbox-prev {
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3em;
}

.lightbox-next {
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3em;
}


/* --------------------------------------------------------------------------
 * YOUTUBE GRID (used by /beatles-cover-versions)
 *
 * Click-to-play "lite YouTube" pattern: tiles are <a> tags showing the
 * hqdefault thumbnail; on click the script swaps the tile for an <iframe>
 * in-place. No iframes load until a tile is clicked, so dozens of videos
 * on one page stay cheap.
 *
 * Per-cell layout:
 *   .yt-cell                column flex: tile on top, caption underneath
 *     .yt-tile              16:9 thumbnail (becomes iframe on click)
 *     .yt-caption           track + artist label (fetched from oEmbed)
 * -------------------------------------------------------------------------- */

.yt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px 12px;
  margin: 20px 0;
}

.yt-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.yt-tile {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--color-border);
  text-decoration: none;
  transition: border-color 0.15s;
}

.yt-tile:hover {
  border-color: var(--color-border-accent);
}

.yt-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
  border: none;
  max-width: none;
}

.yt-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 1.4em;
  border-radius: 50%;
  pointer-events: none;
  transition: background 0.15s, transform 0.15s;
}

.yt-tile:hover .yt-play {
  background: rgba(220, 0, 0, 0.9);
  transform: translate(-50%, -50%) scale(1.08);
}

iframe.yt-tile {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
}

.yt-caption {
  font-size: 0.85em;
  line-height: 1.3;
  opacity: 0.75;
  word-break: break-word;
}

.yt-caption:empty::before {
  /* placeholder while oEmbed is fetching */
  content: '\2026';
  opacity: 0.4;
}


/* galleries / yt responsive */

@media screen and (max-width: 500px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 6px;
  }

  .yt-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 6px;
  }

  .yt-play {
    width: 38px;
    height: 38px;
    font-size: 1.1em;
  }

  .lightbox {
    padding: 50px 10px 50px 10px;
  }
}
