/*
 * Published Work: front-end styles.
 * Colours, type and spacing are set as variables at the top so the design
 * can be adjusted in one place without touching the rest.
 */
.pw {
  --pw-bg: transparent;
  --pw-surface: #fff;
  --pw-ink: #172033;
  --pw-muted: #566079;
  --pw-line: #d5dbe5;
  --pw-focus: #2f6feb;
  --pw-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --pw-sans: inherit;
  --pw-radius: 6px;
  --pw-gap: 20px;
  color: var(--pw-ink);
  font-family: var(--pw-sans);
}
@media (prefers-color-scheme: dark) {
  .pw:not([data-theme="light"]) {
    --pw-surface: #1b2230; --pw-ink: #e7ebf2; --pw-muted: #9aa5ba; --pw-line: #2c3547;
  }
}
.pw *, .pw *::before, .pw *::after { box-sizing: border-box; }

/* [published_work_header]: shares the .pw colour variables so it matches
   the grid below even when placed outside the .pw wrapper. */
.pw-hero { --pw-ink: #172033; --pw-muted: #566079; --pw-serif: "Newsreader", Georgia, "Times New Roman", serif; padding: 8px 0 24px; }
.pw-hero h1 { font-family: var(--pw-serif); font-weight: 600; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 10px; color: var(--pw-ink); max-width: 20ch; }
.pw-hero p { margin: 0; color: var(--pw-muted); max-width: 62ch; font-size: 1rem; line-height: 1.5; }
@media (prefers-color-scheme: dark) {
  .pw-hero:not([data-theme="light"]) { --pw-ink: #e7ebf2; --pw-muted: #9aa5ba; }
}

.pw-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--pw-line); }
.pw-chips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 auto; }
.pw-chip { font: 500 .9rem/1 var(--pw-sans); color: var(--pw-ink); background: var(--pw-surface); border: 1px solid var(--pw-line); border-radius: 999px; padding: 9px 14px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.pw-chip .pw-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pw-c, var(--pw-ink)); }
.pw-chip .pw-n { color: var(--pw-muted); font-weight: 400; }
.pw-chip[aria-pressed="true"] { background: var(--pw-ink); color: var(--pw-surface); border-color: var(--pw-ink); }
.pw-chip[aria-pressed="true"] .pw-n { color: inherit; opacity: .75; }
.pw-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.pw-q, .pw-sort { font: 400 .95rem var(--pw-sans); color: var(--pw-ink); background: var(--pw-surface); border: 1px solid var(--pw-line); border-radius: 8px; padding: 9px 12px; }
.pw-q { width: 220px; max-width: 100%; }
.pw-seg { display: inline-flex; border: 1px solid var(--pw-line); border-radius: 8px; overflow: hidden; background: var(--pw-surface); }
.pw-seg button { font: 500 .9rem var(--pw-sans); color: var(--pw-ink); background: none; border: 0; padding: 9px 12px; cursor: pointer; }
.pw-seg button + button { border-left: 1px solid var(--pw-line); }
.pw-seg button[aria-pressed="true"] { background: var(--pw-ink); color: var(--pw-surface); }
.pw :focus-visible { outline: 2px solid var(--pw-focus); outline-offset: 2px; }
.pw-status { color: var(--pw-muted); font-size: .9rem; margin: 18px 0 0; }

.pw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--pw-gap); padding: 24px 0 8px; }
.pw-card { position: relative; background: var(--pw-surface); border: 1px solid var(--pw-line); border-radius: var(--pw-radius); overflow: hidden; display: flex; flex-direction: column; }
.pw-card:hover { border-color: var(--pw-c); }
.pw-card:focus-within { outline: 2px solid var(--pw-focus); outline-offset: 2px; }
.pw-card[hidden] { display: none; }
.pw-thumb { aspect-ratio: 16 / 9; background-color: var(--pw-c); background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.07) 0 2px, transparent 2px 14px); display: grid; place-items: center; }
.pw-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pw-meta { display: flex; align-items: center; gap: 10px; padding: 14px 16px 0; }
.pw-mono { width: 34px; height: 34px; border-radius: 50%; background: var(--pw-c); color: #fff; display: grid; place-items: center; font: 600 .78rem/1 var(--pw-sans); flex: none; }
.pw-who { display: flex; flex-direction: column; line-height: 1.25; }
.pw-outlet { font-weight: 600; font-size: .92rem; }
.pw-who time { font-size: .82rem; color: var(--pw-muted); }
.pw-lb { margin-left: auto; align-self: flex-start; font: 600 .72rem/1 var(--pw-sans); letter-spacing: .04em; border: 1px solid var(--pw-line); border-radius: 999px; padding: 5px 10px; white-space: nowrap; }
.pw-body { padding: 10px 16px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pw-title { font-family: var(--pw-serif); font-weight: 600; font-size: 1.2rem; line-height: 1.25; margin: 0; }
.pw-title a { color: inherit; text-decoration: none; }
.pw-title a::after { content: ""; position: absolute; inset: 0; }
.pw-sum { margin: 0; color: var(--pw-muted); font-size: .95rem; line-height: 1.5; }
.pw-alt { margin: 0; font-size: .88rem; color: var(--pw-muted); position: relative; z-index: 2; line-height: 1.45; }
.pw-alt a { color: var(--pw-ink); text-decoration: underline; text-decoration-color: var(--pw-c); text-underline-offset: 3px; }
.pw-foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.pw-tag { font-size: .78rem; color: var(--pw-muted); border: 1px solid var(--pw-line); border-radius: 4px; padding: 2px 8px; }
.pw-empty { padding: 32px 0; color: var(--pw-muted); }
.pw .screen-reader-text { position: absolute; left: -9999px; }
@media (max-width: 640px) { .pw-q { flex: 1; } }
