/* =========================================================
   THE MUSIC BLUEPRINT — SHARED STYLES
   Loaded by every page (search.html, archive.html, issues.html).
   Article.html and index.html keep their inline styles for now
   so we don't break the existing layout; this file covers the
   new discovery pages and any future ones.
   ========================================================= */

:root {
  --bg: whitesmoke;
  --ink: #121212;
  --ink-soft: rgba(18, 18, 18, 0.62);
  --ink-faint: rgba(18, 18, 18, 0.16);
  --rule: rgba(18, 18, 18, 0.12);
}

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

html { scroll-behavior: smooth; }
html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; }

/* =========================================================
   MASTHEAD WITH GLOBAL SEARCH
   ========================================================= */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem clamp(1.25rem, 4vw, 3rem);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 50;
  gap: 1rem;
}
.masthead .issue {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
  white-space: nowrap;
}
.masthead .logo {
  font-weight: 900;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  letter-spacing: -0.01em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.masthead nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  align-items: center;
}
.masthead nav a {
  color: var(--ink);
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.masthead nav a:hover { opacity: 0.55; }
.masthead nav a.is-current {
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
}

/* Global search button — opens overlay search */
.masthead-search {
  background: transparent;
  border: 1px solid var(--ink-faint);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.masthead-search:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.masthead-search svg { width: 14px; height: 14px; stroke-width: 1.75; }
.masthead-search-kbd {
  font-size: 0.65rem;
  letter-spacing: 0;
  padding: 1px 5px;
  border: 1px solid var(--ink-faint);
  border-radius: 3px;
}
@media (max-width: 720px) {
  .masthead nav { display: none; }
  .masthead-search-kbd { display: none; }
  .masthead-search-text { display: none; }
}

/* =========================================================
   PAGE HEADER (large editorial title on archive/search/issues)
   ========================================================= */
.page-header {
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 6rem) clamp(1.25rem, 4vw, 3rem) clamp(2rem, 4vw, 3.5rem);
  border-bottom: 1px solid var(--rule);
}
.page-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
  margin-bottom: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.page-eyebrow::before {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--ink-faint);
}
.page-title {
  font-weight: 900;
  font-size: clamp(2.5rem, 7vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  max-width: 18ch;
}
.page-title .italic {
  font-style: italic;
  font-weight: 500;
}
.page-dek {
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 52ch;
  margin-top: 1.5rem;
}

/* =========================================================
   FOOTER
   ========================================================= */
footer.site-footer {
  margin-top: 6rem;
  padding: 3rem clamp(1.25rem, 4vw, 3rem) 2rem;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
footer.site-footer .logo {
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 0.5rem;
  display: block;
  text-decoration: none;
}

/* =========================================================
   GLOBAL SEARCH OVERLAY — used on every page via the masthead
   button. Contains the live search + autocomplete.
   ========================================================= */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 18, 18, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
  padding: clamp(2rem, 8vh, 6rem) 1.25rem 2rem;
  overflow-y: auto;
}
.search-overlay.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease;
}

.search-panel {
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg);
  border: 1px solid var(--ink-faint);
  transform: translateY(-12px);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.search-overlay.is-open .search-panel {
  transform: translateY(0);
}

.search-input-row {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--rule);
  gap: 0.75rem;
}
.search-input-row svg { width: 18px; height: 18px; stroke-width: 1.5; color: var(--ink-soft); }
.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 1.1rem;
  padding: 0.85rem 0;
  color: var(--ink);
}
.search-input::placeholder { color: var(--ink-soft); }
.search-input:focus { outline: none; }
.search-close {
  background: transparent;
  border: 1px solid var(--ink-faint);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  font-family: inherit;
  font-size: 0.7rem;
  color: var(--ink-soft);
  cursor: pointer;
}

/* Results list */
.search-results {
  max-height: 60vh;
  overflow-y: auto;
}
.search-results::-webkit-scrollbar { width: 6px; }
.search-results::-webkit-scrollbar-thumb { background: var(--ink-faint); }

.search-section {
  padding: 0.75rem 1rem 0.5rem;
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  background: rgba(18, 18, 18, 0.03);
}

.search-item {
  display: block;
  padding: 0.85rem 1rem;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: background 0.15s ease;
}
.search-item:hover,
.search-item.is-active {
  background: rgba(18, 18, 18, 0.04);
}
.search-item-title {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.015em;
  margin-bottom: 0.2rem;
  line-height: 1.25;
}
.search-item-title mark {
  background: rgba(18, 18, 18, 0.12);
  color: var(--ink);
  padding: 0 2px;
}
.search-item-meta {
  font-size: 0.75rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.search-item-meta .sep::before {
  content: '·';
  margin: 0 0.4rem;
}

.search-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.search-hint {
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.search-hint kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid var(--ink-faint);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.7rem;
  margin: 0 2px;
}

/* =========================================================
   ARTICLE CARDS (used on archive + issues pages)
   ========================================================= */
.article-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  gap: 0.85rem;
}
.article-card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  display: block;
  transition: filter 0.4s ease;
}
.article-card:hover .article-card-img {
  filter: grayscale(0) contrast(1);
}
.article-card-cat {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
}
.article-card-title {
  font-weight: 700;
  font-size: clamp(1.15rem, 1.5vw, 1.4rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
}
.article-card-title .italic { font-style: italic; font-weight: 500; }
.article-card-dek {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.article-card-meta {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  display: flex;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--rule);
}
.article-card-meta .sep::before { content: '·'; margin-right: 0.75rem; }

/* List view variant — horizontal */
.article-list-item {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: var(--ink);
  align-items: start;
}
.article-list-item:first-child { padding-top: 0; }
.article-list-item-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  transition: filter 0.3s ease;
}
.article-list-item:hover .article-list-item-img {
  filter: grayscale(0) contrast(1);
}
.article-list-item-num {
  font-weight: 500;
  font-size: 2rem;
  letter-spacing: -0.03em;
  color: var(--ink-soft);
  white-space: nowrap;
  text-align: right;
}
@media (max-width: 720px) {
  .article-list-item {
    grid-template-columns: 100px 1fr;
  }
  .article-list-item-num { display: none; }
}

/* =========================================================
   FILTER BAR (used on archive page)
   ========================================================= */
.filter-bar {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem clamp(1.25rem, 4vw, 3rem);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  position: sticky;
  top: 73px;     /* clear of sticky masthead */
  background: var(--bg);
  z-index: 40;
}
.filter-count {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.filter-count strong { color: var(--ink); font-weight: 700; }

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.filter-label {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  margin-right: 0.25rem;
}
.filter-chip {
  background: transparent;
  border: 1px solid var(--ink-faint);
  padding: 0.4rem 0.85rem;
  font-family: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  color: var(--ink);
  border-radius: 999px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.filter-chip:hover { border-color: var(--ink); }
.filter-chip.is-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.filter-sort {
  font-family: inherit;
  font-size: 0.82rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--ink-faint);
  background: transparent;
  color: var(--ink);
  border-radius: 4px;
  cursor: pointer;
}
.filter-sort:focus { outline: none; border-color: var(--ink); }