/*
Theme Name: Chuck Perrin 2026
Theme URI: https://chuckperrin.com
Author: redesign
Description: Responsive retheme of chuckperrin.com. Same WordPress back end, same content model (album / song / video / poem / performance / project custom post types, Posts-to-Posts connections, phpThumb crops). Native-audio persistent player replaces jPlayer.
Version: 1.0
*/

/* ---------- tokens ---------- */
:root {
  --bg: #f5ead8;
  --surround: #dcd3c4;
  --surface: #ebddc5;
  --ink: #201e1d;
  --ink-2: #474238;
  --ink-3: #645c50;
  --rule: #dcd3c4;
  --rule-soft: #eee7db;
  --accent: #c67139;
  --accent-ink: #8c491a;
  --accent-tint: #fff2eb;
  --accent-bright: #f6a06b;
  --accent-2: #7a8a5e;
  --accent-2-ink: #56633f;
  --accent-2-tint: #f0fae1;
  --bar: #2e2b25;
  --radius: 16px;
  --radius-lg: 28px;
  --shadow-sm: 0 1px 2px rgba(46,43,37,.14);
  --shadow-md: 0 3px 10px rgba(46,43,37,.16);
  --shadow-lg: 0 12px 32px rgba(46,43,37,.22);
  --wrap: 950px;
  --font-head: "Caprasimo", Georgia, serif;
  --font-body: "Figtree", system-ui, -apple-system, sans-serif;
  --trim-left: url(assets/left-g.jpg);
  --trim-right: url(assets/right-g.jpg);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #2e2b25;
    --surround: #201e1d;
    --surface: #3b362e;
    --ink: #f9f4ed;
    --ink-2: #dcd3c4;
    --ink-3: #c0b6a5;
    --rule: #474238;
    --rule-soft: #3b362e;
    --accent: #f6a06b;
    --accent-ink: #ffc6a5;
    --accent-tint: #402310;
    --accent-2: #aebf92;
    --accent-2-ink: #ccdbb2;
    --accent-2-tint: #272e1b;
    --bar: #201e1d;
    --trim-left: url(assets/left-dark-g.jpg);
    --trim-right: url(assets/right-dark-g.jpg);
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surround);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.62;
  padding-bottom: 76px; /* clears the fixed player bar */
}
h1, h2, h3, h4, h5 { font-family: var(--font-head); font-weight: 400; line-height: 1.06; margin: 0; color: var(--ink); }
p { margin: 0 0 1em; text-wrap: pretty; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-tint); }
.screen-reader-text { position: absolute; left: -9999px; }

/* photographs settle back into the page */
.washed { filter: saturate(.6) contrast(.85) brightness(1.1) opacity(.94); }

/* ---------- desktop trim ---------- */
body::before, body::after {
  content: "";
  position: fixed;
  top: 0;
  width: 282px;
  height: 1067px;
  background-repeat: no-repeat;
  background-size: 282px 1067px;
  pointer-events: none;
  z-index: 0;
  display: none;
}
/* inner edge sits 20px under the content column; the outer edge bleeds off-screen
   on narrower desktops, which is what the artwork's extra pixels are for */
body::before { left: calc(50% - var(--wrap) / 2 - 262px); background-image: var(--trim-left); background-position: top left; }
body::after  { right: calc(50% - var(--wrap) / 2 - 262px); background-image: var(--trim-right); background-position: top right; }
@media (min-width: 1280px) {
  body::before, body::after { display: block; }
}

/* ---------- shell ---------- */
.shell {
  position: relative;
  z-index: 1;
  max-width: var(--wrap);
  margin: 0 auto;
  background: var(--bg);
  min-height: 100vh;
}
@media (min-width: 1280px) {
  .shell { margin-top: 34px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow-lg); overflow: hidden; }
}
/* last line of defence: third-party embeds can't drag the page sideways */
@media (max-width: 1279px) { .shell { overflow-x: clip; } }
.pad { padding: 0 44px; }
@media (max-width: 700px) { .pad { padding: 0 18px; } }

/* ---------- header ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 44px;
}
@media (max-width: 700px) { .site-head { padding: 14px 18px 10px; } }
.brand { display: flex; align-items: flex-end; gap: 8px; white-space: nowrap; }
.brand-name { font-family: var(--font-head); font-size: 30px; line-height: 1; color: var(--ink); }
.brand-hole { width: 15px; height: 15px; border-radius: 999px; border: 4px solid var(--accent); margin-bottom: 2px; flex: none; }
@media (max-width: 700px) {
  .brand-name { font-size: 21px; }
  .brand-hole { width: 11px; height: 11px; border-width: 3px; margin-bottom: 1px; }
}
.nav { display: flex; gap: 32px; font-size: 16px; font-weight: 600; }
.nav a { color: var(--ink-2); }
.nav a:hover, .nav .current-menu-item > a, .nav .current_page_item > a { color: var(--accent-ink); }
.nav ul { list-style: none; display: flex; gap: 32px; margin: 0; padding: 0; }
.nav-toggle {
  display: none; width: 44px; height: 44px; border: 0; background: none; cursor: pointer;
  flex-direction: column; gap: 5px; align-items: center; justify-content: center;
}
.nav-toggle span { display: block; width: 26px; height: 3px; border-radius: 2px; background: var(--accent-ink); }
@media (max-width: 860px) {
  .nav { display: none; }
  .nav-toggle { display: flex; }
}

/* mobile drawer */
.drawer {
  position: fixed; inset: 0; z-index: 60; background: var(--bar);
  height: 100dvh;
  display: flex; flex-direction: column;
  padding: 14px 20px calc(90px + env(safe-area-inset-bottom));
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  transform: translateY(-100%); transition: transform .28s ease; visibility: hidden;
}
.drawer > *, .drawer nav > * { flex: 0 0 auto; }
.drawer.open { transform: none; visibility: visible; }
.drawer-top { position: sticky; top: -14px; z-index: 1; background: var(--bar); display: flex; align-items: center; justify-content: space-between; padding: 14px 0 18px; margin-top: -14px; }
.drawer .brand-name { color: #f9f4ed; }
.drawer .brand-hole { border-color: var(--accent-bright); }
.drawer-close { background: none; border: 0; color: var(--accent-bright); font-size: 30px; line-height: 1; cursor: pointer; padding: 6px 10px; }
.drawer nav > ul { list-style: none; margin: 0; padding: 14px 0 0; display: flex; flex-direction: column; gap: 6px; }
.drawer nav > ul > li > a { font-family: var(--font-head); font-size: 34px; line-height: 1.1; color: #fff; padding: 8px 0; display: block; }
.drawer-sub { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px 0 0; }
.drawer-foot { margin-top: auto; flex-shrink: 0; padding-top: 22px; border-top: 1px solid #645c50; display: flex; gap: 22px; }
.drawer-foot a { font-size: 15px; font-weight: 600; color: #dcd3c4; }

/* ---------- type & page furniture ---------- */
.page-title { font-size: 64px; margin: 14px 0 0; }
@media (max-width: 700px) { .page-title { font-size: 40px; } }
.kicker { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.lede { color: var(--ink-3); margin-top: 10px; }
.back-link { font-size: 14px; font-weight: 700; color: var(--accent-ink); }
.section { padding: 30px 0 44px; }
.rule-top { border-top: 1px solid var(--rule); }

.btn {
  display: inline-block; border-radius: 999px; padding: 10px 22px;
  font-size: 14px; font-weight: 700; border: 2px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); color: #fff; }
.btn-outline { border-color: var(--accent); color: var(--accent-ink); padding: 8px 20px; }
.btn-outline:hover { background: var(--accent-tint); }

/* ---------- hero / postcard ---------- */
.hero { position: relative; display: flex; align-items: flex-end; min-height: 380px; background-size: cover; background-position: center; }
@media (max-width: 700px) { .hero { min-height: 230px; } }
.hero-veil { width: 100%; background: linear-gradient(transparent, rgba(32,30,29,.88)); padding: 70px 44px 30px; }
@media (max-width: 700px) { .hero-veil { padding: 40px 18px 16px; } }
.hero-veil .kicker { color: #ffc6a5; }
.hero h1 { color: #fff; font-size: 50px; margin-top: 10px; max-width: 15ch; }
@media (max-width: 700px) { .hero h1 { font-size: 26px; } }
.hero p { color: #eee7db; margin-top: 12px; max-width: 60ch; }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding-top: 24px; }
@media (max-width: 760px) { .cards { grid-template-columns: 1fr; } }
.card { display: flex; gap: 16px; align-items: center; border-radius: var(--radius-lg); padding: 16px; }
.card-song { background: var(--accent-tint); }
.card-other { background: var(--accent-2-tint); }
.card img { width: 90px; height: 90px; border-radius: 14px; object-fit: cover; flex: none; }
.card h3 { font-size: 22px; margin-top: 5px; }
.card .kicker { font-size: 12px; }
.card-song .kicker { color: var(--accent-ink); }
.card-other .kicker { color: var(--accent-2-ink); }

.home-cols { display: grid; grid-template-columns: 1.45fr 1fr; gap: 44px; padding: 34px 0 40px; }
@media (max-width: 860px) { .home-cols { grid-template-columns: 1fr; gap: 34px; } }
.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.album-grid img { aspect-ratio: 1; object-fit: cover; border-radius: 14px; box-shadow: var(--shadow-sm); width: 100%; }

.video-thumb { position: relative; display: block; border-radius: var(--radius); overflow: hidden; }
.video-thumb img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.video-thumb::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; border-radius: 999px;
  background: rgba(32,30,29,.72) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5l12 7-12 7z'/%3E%3C/svg%3E") no-repeat center / 18px;
}
.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 30px; }
@media (max-width: 860px) { .video-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .video-grid { grid-template-columns: 1fr; } }

/* ---------- listings ---------- */
.tabs { display: flex; gap: 10px; flex-wrap: wrap; padding-bottom: 10px; }
.tab { border: 2px solid var(--rule); border-radius: 999px; padding: 7px 20px; font-size: 15px; font-weight: 700; color: var(--ink-3); }
.tab:hover { background: var(--accent-tint); }
.tab.is-on { background: var(--bar); border-color: var(--bar); color: #fff; }
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

.tagbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tagpill {
  border: 2px solid var(--rule); border-radius: 999px; padding: 6px 14px;
  font-size: 14px; font-weight: 600; color: var(--ink-2); background: none; cursor: pointer;
  display: inline-flex; gap: 7px; align-items: center; font-family: inherit;
}
.tagpill:hover { background: var(--accent-tint); }
.tagpill[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.tagpill .count { font-size: 12px; opacity: .65; }
.tag-status { font-size: 14px; color: var(--ink-3); margin-top: 18px; }

.song-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; margin-top: 12px; }
@media (max-width: 760px) { .song-cols { grid-template-columns: 1fr; } }
.song-row { display: flex; align-items: center; gap: 14px; padding: 12px 10px; border-bottom: 1px solid var(--rule-soft); }
.song-row:hover { background: var(--accent-tint); }
.song-row[hidden] { display: none; }
.song-row .title { flex: 1; font-size: 16px; font-weight: 600; color: var(--ink); min-width: 0; }
.song-row .meta { font-size: 13px; color: var(--ink-3); }

.play-btn {
  width: 34px; height: 34px; flex: none; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--accent-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238c491a'%3E%3Cpath d='M8 5l12 7-12 7z'/%3E%3C/svg%3E") no-repeat center / 13px;
}
.play-btn:hover { background-color: #ffe1d0; }
.play-btn.is-playing { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238c491a'%3E%3Crect x='6' y='4' width='4' height='16' rx='1'/%3E%3Crect x='14' y='4' width='4' height='16' rx='1'/%3E%3C/svg%3E"); }

.archive-item { display: flex; gap: 26px; align-items: flex-start; border-top: 1px solid var(--rule); padding: 26px 0; }
@media (max-width: 620px) { .archive-item { gap: 14px; } }
.archive-item img { width: 150px; height: 150px; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow-sm); flex: none; }
@media (max-width: 620px) { .archive-item img { width: 92px; height: 92px; } }
.archive-item h3 { font-size: 30px; margin-top: 6px; }
@media (max-width: 620px) { .archive-item h3 { font-size: 20px; } }
.year { font-size: 13px; letter-spacing: .14em; font-weight: 700; color: var(--accent-ink); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 44px; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }
.poem-link { display: block; font-family: var(--font-head); font-size: 24px; color: var(--ink); padding: 13px 0; border-bottom: 1px solid var(--rule); }
.history-row { display: flex; gap: 28px; align-items: baseline; padding: 15px 0; border-bottom: 1px solid var(--rule); }
.history-row .y { width: 70px; flex: none; font-family: var(--font-head); font-size: 24px; color: var(--accent-ink); }
.history-row .t { flex: 1; font-size: 20px; font-weight: 600; color: var(--ink); }
.history-row .k { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
@media (max-width: 620px) {
  .history-row { flex-wrap: wrap; gap: 4px 14px; }
  .history-row .y, .history-row .t { width: auto; font-size: 17px; }
}

/* ---------- single ---------- */
.page-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 44px; align-items: start; padding-top: 20px; }
.page-grid-solo { grid-template-columns: minmax(0, 1fr); }
.page-grid-blog { grid-template-columns: minmax(0, 1fr) 230px; padding-top: 0; }
@media (max-width: 760px) { .page-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; } }
.single-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 56px; padding: 26px 0 44px; align-items: start; }
@media (max-width: 860px) { .single-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; } }
.prose { font-size: 17.5px; line-height: 1.7; color: var(--ink-2); overflow-wrap: break-word; }
.prose img, .prose iframe, .prose video, .prose embed, .prose object, .prose table, .prose pre { max-width: 100%; }
.prose table { display: block; overflow-x: auto; }
/* WordPress oEmbed cards ship fixed pixel widths — clamp them */
.prose .wp-block-embed,
.prose .wp-block-embed__wrapper,
.prose blockquote.wp-embedded-content { max-width: 100%; overflow: hidden; }
.prose iframe.wp-embedded-content,
.prose .wp-block-embed iframe,
.prose .wp-block-embed__wrapper iframe { width: 100% !important; max-width: 100% !important; }
.prose .wp-block-embed-youtube .wp-block-embed__wrapper,
.prose .wp-block-embed-vimeo .wp-block-embed__wrapper { position: relative; aspect-ratio: 16 / 9; }
.prose .wp-block-embed-youtube iframe,
.prose .wp-block-embed-vimeo iframe { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.prose h2, .prose h3 { margin: 1.4em 0 .4em; }
.prose img { border-radius: var(--radius); margin: 1.2em 0; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.poem-body { font-size: 20px; line-height: 1.95; color: var(--ink-2); }
.credits { font-size: 15px; line-height: 1.6; color: var(--ink-3); }

.playlist { border: 1px solid var(--rule); border-radius: var(--radius-lg); overflow: hidden; margin-top: 16px; }
.playlist .song-row { padding: 12px 16px; border-bottom: 1px solid var(--rule-soft); background: var(--bg); }
.playlist .song-row:last-child { border-bottom: 0; }
.playlist .num { width: 22px; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 2px; align-items: center; }
.row-actions a, .row-actions button {
  color: var(--accent-ink);
  background: none;
  border: 0;
  cursor: pointer;
  /* a real tap target: the icons are stroke-only, so the anchor has to own the hit area */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  padding: 0;
}
.row-actions a:hover, .row-actions button:hover { background: var(--accent-tint); color: var(--accent); }
.row-actions svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  /* clicks belong to the anchor, not the hollow interior of the glyph */
  pointer-events: none;
}
@media (max-width: 700px) {
  .row-actions a, .row-actions button { width: 40px; height: 40px; }
}

.photo-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 12px; }
@media (max-width: 620px) { .photo-grid { grid-template-columns: repeat(3, 1fr); } }
.photo-grid img { aspect-ratio: 1; object-fit: cover; border-radius: 10px; }

.neighbour { display: flex; gap: 16px; align-items: center; background: var(--surface); border-radius: var(--radius-lg); padding: 16px; margin-top: 24px; }
.neighbour img { width: 88px; height: 88px; border-radius: 14px; object-fit: cover; flex: none; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--rule); padding: 26px 44px 34px; display: flex; flex-wrap: wrap; gap: 18px 40px; justify-content: space-between; align-items: center; font-size: 15px; }
@media (max-width: 700px) { .site-foot { padding: 22px 18px 28px; } }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 18px; }
.site-foot a { color: var(--ink-2); font-weight: 600; }

/* Legacy/third-party post content: nothing inside .prose may exceed the column on
   small screens, whatever width attribute or inline style it arrived with. */
@media (max-width: 860px) {
  .prose * { max-width: 100% !important; }
  .prose [style*="width"],
  .prose [width] { width: auto !important; }
  .prose img[width] { height: auto !important; }
  .prose table,
  .prose .scroll-x { display: block; width: 100% !important; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ---------- player ---------- */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--bar); color: #fff;
  transform: translateY(110%); transition: transform .25s ease;
}
.player.is-live { transform: none; }
.player-inner { max-width: var(--wrap); margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 12px 24px; }
@media (max-width: 700px) { .player-inner { gap: 12px; padding: 10px 14px; } }
.player img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; }
@media (max-width: 700px) { .player img { width: 40px; height: 40px; } }
.player-toggle {
  width: 44px; height: 44px; flex: none; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5l12 7-12 7z'/%3E%3C/svg%3E") no-repeat center / 18px;
  order: 3;
}
@media (min-width: 701px) { .player-toggle { order: 0; } }
.player-toggle.is-playing { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Crect x='6' y='4' width='4' height='16' rx='1'/%3E%3Crect x='14' y='4' width='4' height='16' rx='1'/%3E%3C/svg%3E"); }
.player-body { flex: 1; min-width: 0; }
.player-title { font-size: 15px; font-weight: 700; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-title span { color: #c0b6a5; font-weight: 500; }
.player-seek { width: 100%; margin-top: 8px; height: 4px; -webkit-appearance: none; appearance: none; background: #645c50; border-radius: 2px; cursor: pointer; }
.player-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 999px; background: var(--accent-bright); }
.player-seek::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 999px; background: var(--accent-bright); }
.player-time { font-size: 13px; color: #c0b6a5; font-variant-numeric: tabular-nums; flex: none; }
@media (max-width: 700px) { .player-time, .player-skip { display: none; } }
.player-skip { background: none; border: 0; color: #dcd3c4; cursor: pointer; font-size: 20px; line-height: 1; padding: 4px 6px; }
.player-skip:hover { color: #fff; }

/* ---------- sub-menus (child pages) ---------- */
.nav li { position: relative; }
.nav .sub-menu {
  display: none; position: absolute; top: 100%; left: -14px;
  flex-direction: column; gap: 0; min-width: 200px; margin: 0; padding: 8px;
  background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: var(--shadow-md); z-index: 60;
}
.nav li:hover > .sub-menu, .nav li:focus-within > .sub-menu { display: flex; }
.nav .sub-menu a { display: block; padding: 8px 12px; border-radius: 10px; font-size: 15px; white-space: nowrap; }
.nav .sub-menu a:hover { background: var(--accent-tint); }
.nav .menu-item-has-children > a::after { content: " ▾"; font-size: 11px; opacity: .6; }

.drawer .sub-menu { list-style: none; margin: 4px 0 2px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.drawer .sub-menu a, .drawer-sub a {
  display: inline-flex; align-items: center; width: auto;
  font-family: var(--font-body); font-size: 14px; font-weight: 600; line-height: 1;
  color: #dcd3c4; border: 1px solid #645c50; border-radius: 999px; padding: 10px 16px;
}
.drawer .sub-menu a:active, .drawer-sub a:active { border-color: var(--accent-bright); color: var(--accent-bright); }

/* ---------- widget areas (album photos, project photos) ---------- */
.widget-area .sideblock + .sideblock { margin-top: 28px; }
.widget-area h4 { font-size: 20px; margin-bottom: 12px; }
.widget-area ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.widget-area ul li { margin: 0; }
.widget-area img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; filter: saturate(.6) contrast(.85) brightness(1.1) opacity(.94); }
.widget-area img:hover { filter: none; }
.widget-area p { font-size: 15px; }
@media (max-width: 620px) { .widget-area ul { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Flickr photo widgets (album photos / project photos) ---------- */
/* Targets the multiFlickrWidget markup directly, so it works wherever the widget sits. */
#multiFlickrWidgetImages,
.widget-area ul.multi_flickr_list,
.widget-area .sideblock ul {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
#multiFlickrWidgetImages li,
.widget-area .sideblock ul li {
  margin: 0;
  padding: 0;
  list-style: none;
}
#multiFlickrWidgetImages li::marker { content: none; }
#multiFlickrWidgetImages a,
.widget-area .sideblock ul a { display: block; border-radius: 10px; overflow: hidden; }
#multiFlickrWidgetImages img,
.widget-area .sideblock ul img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border: 0;
  border-radius: 10px;
  filter: saturate(.6) contrast(.85) brightness(1.1) opacity(.94);
  transition: filter .2s ease, transform .2s ease;
}
#multiFlickrWidgetImages img:hover,
.widget-area .sideblock ul img:hover { filter: none; transform: scale(1.03); }

/* The widget's caption/title line above the grid */
.widget-area .sideblock > p,
.widget-area .sideblock > div:not([id]) {
  font-size: 14px;
  color: var(--ink-3);
  background: none;
  border: 0;
  padding: 0;
  margin: 0 0 4px;
}

@media (max-width: 620px) {
  #multiFlickrWidgetImages,
  .widget-area .sideblock ul { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  display: none; align-items: center; justify-content: center; gap: 12px;
  padding: 24px; background: rgba(32,30,29,.92);
  opacity: 0; transition: opacity .2s ease;
}
.lightbox.open { display: flex; opacity: 1; }
.lightbox-figure { margin: 0; max-width: min(1100px, 92vw); max-height: 88vh; display: flex; flex-direction: column; gap: 10px; }
.lightbox-figure img {
  max-width: 100%; max-height: 80vh; width: auto; height: auto;
  border-radius: var(--radius); background: #fff; padding: 8px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.lightbox figcaption { color: #eee7db; font-size: 15px; text-align: center; }
.lightbox-close {
  position: absolute; top: 16px; right: 20px;
  background: none; border: 0; color: #f9f4ed; font-size: 38px; line-height: 1; cursor: pointer; padding: 4px 10px;
}
.lightbox-nav {
  flex: none; width: 52px; height: 52px; border-radius: 999px; cursor: pointer;
  border: 0; background: rgba(249,244,237,.14); color: #f9f4ed; font-size: 30px; line-height: 1;
}
.lightbox-nav:hover { background: rgba(249,244,237,.26); }
.lightbox-close:hover, .lightbox-nav:hover { color: #fff; }
@media (max-width: 700px) {
  .lightbox { padding: 12px; gap: 6px; }
  .lightbox-nav { width: 42px; height: 42px; font-size: 24px; }
}

/* ---------- weighted tag cloud (songs) ---------- */
.tagcloud {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 14px;
  margin-top: 14px;
  line-height: 1.28;
}
.tagword {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--ink-3);
  background: none;
  border: 0;
  padding: 2px 0;
  cursor: pointer;
  line-height: 1.1;
  transition: color .15s ease;
}
.tagword:hover { color: var(--accent); }
.tagword[aria-pressed="true"] {
  color: var(--accent-ink);
  box-shadow: inset 0 -3px 0 var(--accent);
}
@media (prefers-color-scheme: dark) {
  .tagword[aria-pressed="true"] { color: var(--accent); }
}
@media (max-width: 700px) {
  .tagcloud { gap: 2px 10px; }
  .tagword { font-size: 15px !important; }  /* even weight on phones, where scale reads as noise */
}

/* video inside the lightbox */
.lightbox-video { width: min(1100px, 92vw); aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.lightbox-video[hidden] { display: none; }
.lightbox-video iframe { width: 100%; height: 100%; border: 0; display: block; }
.lightbox-figure img[hidden] { display: none; }
