/* ============================================================
   Ensemble Newsletter — editorial/magazine identity.
   Deliberately its own look (light "paper", serif display),
   distinct from the dark landing page. Scoped under .mag so it
   never leaks into other pages and doesn't collide with main.css.
   ============================================================ */

.mag {
  --ink: #191512;
  --ink-soft: #4b453d;
  --paper: #faf7f1;
  --paper-2: #ffffff;
  --line: #e4ddd0;
  --navy: #1a3d6f;
  --gold: #856410; /* darkened for WCAG AA: 5.13:1 on --paper (kicker text) */
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.mag a { color: var(--navy); }
.mag-shell { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.mag-measure { max-width: 68ch; }

/* ---- Masthead (shared) ---- */
.mag-masthead {
  border-bottom: 2px solid var(--ink);
  padding: 30px 0 18px;
  margin-bottom: 34px;
}
.mag-kicker {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 6px;
}
.mag-wordmark {
  font-family: var(--serif);
  font-size: clamp(30px, 7vw, 52px);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}
.mag-standfirst {
  font-family: var(--sans);
  color: var(--ink-soft);
  font-size: 15px;
  margin: 10px 0 0;
}

/* ---- Back / breadcrumb link ---- */
.mag-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  padding: 22px 0 0;
}
.mag-back:hover { color: var(--navy); }

/* ---- Month section headers (index) ---- */
.mag-month {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 46px 0 20px;
}
.mag-month h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
}
.mag-month .rule { flex: 1; height: 1px; background: var(--line); }
.mag-month .count { font-size: 12px; color: var(--ink-soft); letter-spacing: 0.04em; }

/* ---- Card grid ---- */
.mag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 26px;
}
.mag-card {
  display: flex;
  flex-direction: column;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.mag-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(25, 21, 18, 0.12);
  border-color: #d5c9b3;
  text-decoration: none;
}
.mag-card:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }

/* Generated cover (no photo needed): a branded editorial plate */
.mag-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, hsl(var(--h, 210) 42% 26%), hsl(calc(var(--h, 210) + 24) 46% 16%));
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px 18px;
}
.mag-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mag-cover .cover-date {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0.92;
}
.mag-cover .cover-count {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  backdrop-filter: blur(4px);
}
.mag-card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.mag-card h3 {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.25;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}
.mag-card .subhead { font-size: 13.5px; color: var(--navy); font-weight: 600; margin: -4px 0 0; }
.mag-card .excerpt { font-size: 14.5px; color: var(--ink-soft); margin: 0; }
.mag-venues { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.mag-chip {
  font-size: 11.5px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}
.mag-readmore { font-size: 13px; font-weight: 700; color: var(--navy); margin-top: 4px; }

/* ---- Article ---- */
.mag-article { padding-bottom: 24px; }
.mag-article .lead {
  font-family: var(--serif);
  font-size: clamp(18px, 2.4vw, 21px);
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 34px;
}
.mag-article-head { border-bottom: 2px solid var(--ink); padding-bottom: 20px; margin-bottom: 28px; }
.mag-article-head .issue-kicker {
  text-transform: uppercase; letter-spacing: 0.16em; font-size: 12px; font-weight: 700;
  color: var(--gold); margin: 0 0 10px;
}
.mag-article-head h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 6vw, 46px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  max-width: 20ch;
}
.mag-article-head .subhead { font-size: 16px; color: var(--navy); font-weight: 600; margin: 14px 0 0; }

/* Concert entries */
.mag-entry { padding: 26px 0; border-top: 1px solid var(--line); }
.mag-entry:first-of-type { border-top: none; padding-top: 0; }
.mag-entry h2 {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 10px;
}
.mag-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.mag-pill {
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.mag-pill.is-primary { color: var(--navy); border-color: #cad9ef; background: #f2f6fc; font-weight: 600; }
.mag-entry p { margin: 0 0 12px; font-size: 16px; }
.mag-entry .event-link { font-size: 14px; font-weight: 700; color: var(--navy); }

/* Prev/next + all issues */
.mag-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 40px 0 12px; }
.mag-pager a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  background: var(--paper-2);
  transition: border-color .15s ease, transform .15s ease;
}
.mag-pager a:hover { border-color: #d5c9b3; transform: translateY(-2px); text-decoration: none; }
.mag-pager .dir { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-soft); font-weight: 700; }
.mag-pager .t { font-family: var(--serif); font-size: 16px; color: var(--ink); margin-top: 6px; line-height: 1.3; }
.mag-pager .next { text-align: right; }
.mag-allissues { text-align: center; margin: 26px 0 10px; }
.mag-allissues a { font-weight: 700; color: var(--navy); }

/* Empty state */
.mag-empty { text-align: center; color: var(--ink-soft); padding: 60px 0; }
.mag-empty h2 { font-family: var(--serif); color: var(--ink); }

@media (max-width: 560px) {
  .mag-grid { grid-template-columns: 1fr; gap: 20px; }
  .mag-pager { grid-template-columns: 1fr; }
  .mag-pager .next { text-align: left; }
  .mag-month { margin-top: 34px; }
}
