/* ── layout ── */
body {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1rem;
}

header nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--pico-muted-border-color);
  margin-bottom: 2rem;
}

header nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
}

.site-title {
  font-weight: bold;
  font-size: 1.1rem;
  text-decoration: none;
  white-space: nowrap;
}

/* nav-right groups the links/menu + search trigger so they sit together at
   the end of the row — keeps the search icon pinned next to the toggle
   instead of drifting to the middle of a 3-item space-between. */
.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* nav-menu (a Pico .dropdown) is the mobile-only collapsed menu. It's a
   *separate* element from the plain .nav-links list rather than one element
   reused at both sizes: a closed native <details> hides its content
   regardless of the details element's own `display`, so it can't also serve
   as the always-visible desktop list — it only ever shows links once opened. */
.nav-menu {
  display: none;
}

.nav-toggle-label {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  list-style: none;
}

.nav-toggle-label::-webkit-details-marker {
  display: none;
}

/* Pico's .dropdown styles <summary> as a bordered/backgrounded control with
   a chevron via ::after — appropriate for a labeled dropdown, not our
   icon-only hamburger. Override at matching specificity (Pico's own
   `details.dropdown > summary` selectors), not a bare class, since a plain
   `.nav-toggle-label` rule loses to those once `dropdown` is in play. */
nav details.dropdown > summary.nav-toggle-label {
  height: auto;
  padding: 0;
  border: none;
  background: none;
  color: var(--pico-primary);
}

nav details.dropdown > summary.nav-toggle-label::after {
  display: none;
}

/* ── mobile nav: collapse About/Archives/Categories behind a toggle;
   the search trigger stays visible at all widths ── */
@media (max-width: 600px) {
  .nav-links {
    display: none;
  }

  .nav-menu {
    display: block;
    order: 1;
  }

  /* Pico's `details.dropdown{position:relative}` (element+class) outranks a
     bare `.nav-menu` override; match its selector shape to win. Static
     positioning here means the panel anchors to <nav>'s position:relative
     instead of to the (icon-sized) toggle, so it can span edge-to-edge. */
  details.nav-menu.dropdown {
    position: static;
  }

  .nav-search-trigger {
    order: 0;
  }

  .nav-toggle-label {
    display: inline-flex;
  }

  /* Background/border/shadow/per-item padding come from Pico's .dropdown
     component (details.dropdown > summary + ul); only positioning needs
     overriding since Pico sizes+anchors dropdowns to their trigger and ours
     should span the full header instead. Selector shape matches Pico's own
     to win on specificity without !important. */
  details.dropdown > summary + ul.nav-menu-links {
    left: 0;
    right: 0;
    width: auto;
    min-width: 0;
  }
}

footer {
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--pico-muted-border-color);
  text-align: center;
  font-size: 0.9rem;
}

/* ── hero ── */
.site-hero {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  height: 420px;
  overflow: hidden;
  margin-bottom: 2.5rem;
}

.site-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
}

/* ── post header ── */
.post-header {
  margin-bottom: 1.5rem;
}

.post-header h1 {
  margin-bottom: 0.25rem;
}

.post-meta {
  color: var(--pico-muted-color);
  font-size: 0.9rem;
}

.post-meta .categories a {
  margin-right: 0.5rem;
}

/* ── comments ── */
.comments {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--pico-muted-border-color);
}

.comment-list,
.comment-replies {
  list-style: none;
  padding-left: 0;
}

.comment-replies {
  margin-top: 0.75rem;
  padding-left: 1.5rem;
  border-left: 2px solid var(--pico-muted-border-color);
}

.comment {
  margin-bottom: 1.25rem;
}

.comment-meta {
  color: var(--pico-muted-color);
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
}

.comment-author {
  font-weight: 600;
}

.comment-text {
  white-space: pre-wrap;
}

/* ── images ── */
img {
  max-width: 100%;
  height: auto;
}

figure {
  margin: 1.5rem 0;
}

figcaption, .caption {
  font-size: 0.875rem;
  color: var(--pico-muted-color);
  margin-top: 0.4rem;
  font-style: italic;
}

/* ── gallery ── */
.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.gallery figure {
  margin: 0;
}

.gallery figure img {
  width: auto;
  height: 200px;
  display: block;
}

/* ── embeds ── */
.embed-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.embed-wrapper iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}

/* ── pagefind component UI ── */

/* Reduce the library's boxed "Search... ⌘K" trigger to an icon-only button
   matching the weight of the other nav links. Its button is plain light DOM
   (no shadow part), and the library boosts its own rules' specificity with
   :is(*, #\#) x3, so overriding it needs a real selector plus !important. */
.nav-search-trigger .pf-trigger-btn {
  all: unset !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 2rem !important;
  height: 2rem !important;
  color: var(--pico-primary) !important;
  cursor: pointer !important;
}

.nav-search-trigger .pf-trigger-btn:hover {
  opacity: 0.7 !important;
}

.nav-search-trigger .pf-trigger-icon {
  width: 20px !important;
  height: 20px !important;
  background: currentColor !important;
}

.nav-search-trigger .pf-trigger-text,
.nav-search-trigger .pf-trigger-shortcut {
  display: none !important;
}

/* The category dropdown's menu is absolutely positioned below its trigger,
   but the modal (dialog.pf-modal) clips overflow. With an empty query the
   modal has no results and sizes to its short intrinsic content, so the open
   dropdown gets cut off — reserve enough body height for it while it's open.
   --pf-dropdown-max-height defaults to 280px; pad for the trigger + gaps. */
pagefind-modal-body:has(.pf-dropdown-trigger.open) {
  min-height: calc(var(--pf-dropdown-max-height, 280px) + 80px) !important;
}

/* ── inline image alignment ── */
.alignright {
  float: right;
  margin: 0 0 1rem 1.5rem;
}

/* ── multi-column layout ── */
.columns {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

.column {
  flex: 1 1 0;
  min-width: 0;
}

/* ── file download button ── */
.button {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: var(--pico-primary);
  color: var(--pico-primary-inverse);
  border-radius: var(--pico-border-radius, 4px);
  text-decoration: none;
  font-size: 0.9rem;
}

.button:hover {
  opacity: 0.85;
}

/* ── misc ── */
.song-marker {
  font-style: normal;
  font-weight: bold;
  color: var(--pico-muted-color);
}

blockquote {
  border-left: 3px solid var(--pico-primary);
  padding-left: 1rem;
  margin-left: 0;
  color: var(--pico-muted-color);
}

/* ── home / archive ── */
.post-list {
  list-style: none;
  padding: 0;
}

.post-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--pico-muted-border-color);
  display: flex;
  gap: 1rem;
  align-items: baseline;
}

/* archive lists sit under a date heading — no need for the date column */
.archive-day-heading + .post-list li {
  padding: 0.35rem 0;
}

.post-list .post-date {
  color: var(--pico-muted-color);
  font-size: 0.875rem;
  white-space: nowrap;
  min-width: 6rem;
}

.archive-day-heading {
  margin: 1.25rem 0 0.25rem;
  font-size: 0.875rem;
  color: var(--pico-muted-color);
  font-weight: normal;
  border-bottom: 1px solid var(--pico-muted-border-color);
  padding-bottom: 0.2rem;
}

/* ── home / featured posts ── */
.featured-posts {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin: 1.5rem 0 2rem;
}

/* .featured-post's border/padding/shadow come from Pico's default <article>
   card styling; .featured-posts' gap alone separates the cards. */
.featured-post-heading {
  margin-bottom: 0.5rem;
}

.featured-post-heading h2 {
  margin: 0;
  font-size: 1.15rem;
}

.featured-post-excerpt {
  margin: 0.5rem 0 1rem;
  color: var(--pico-color);
}

.featured-post-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--pico-border-radius, 4px);
  margin-bottom: 0.75rem;
}

.featured-post-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.featured-post-more {
  font-size: 0.9rem;
}

.pagination {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 2rem 0;
}

/* ── post prev/next nav ── */
.post-nav {
  display: flex;
  gap: 1.5rem;
  margin: 2.5rem 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--pico-muted-border-color);
}

.post-nav-prev,
.post-nav-next {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-decoration: none;
}

.post-nav-next {
  margin-left: auto;
  text-align: right;
}

.post-nav-label {
  font-size: 0.8rem;
  color: var(--pico-muted-color);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.post-nav-title {
  font-size: 0.95rem;
}
