:root {
  --brand: #0077b6;
  --brand-dark: #004f7a;
  --accent: #e76f32;
  --ink: #17212b;
  --muted: #607080;
  --line: #dce4e9;
  --surface: #ffffff;
  --background: #f3f6f8;
  --radius: 18px;
  --shadow: 0 14px 36px rgba(23, 33, 43, .10);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
img { display: block; max-width: 100%; }
a { color: var(--brand-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, audio:focus-visible {
  outline: 3px solid #ffbf47;
  outline-offset: 3px;
}

.topmenu {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: .85rem clamp(1rem, 4vw, 4rem);
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand { color: var(--ink); font-size: 1.15rem; font-weight: 800; text-decoration: none; }
.brand span { color: var(--brand); }
.topmenu__links { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.topmenu__links a, .link-button {
  display: inline-flex;
  padding: .65rem .8rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
.topmenu__links a:hover, .link-button:hover { background: #eaf3f8; color: var(--brand-dark); }
.logout-form { margin: 0; }

.page-shell { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(2rem, 5vw, 4.5rem) 0; }
.page-heading { margin-bottom: 2rem; }
.eyebrow { margin: 0 0 .4rem; color: var(--brand); font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.8rem); line-height: 1.04; letter-spacing: -.04em; }
.lead { max-width: 680px; margin: .9rem 0 0; color: var(--muted); font-size: 1.08rem; }

.issue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: clamp(1rem, 2.5vw, 2rem); }
.issue-card { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; }
.issue-card:hover { transform: translateY(-4px); box-shadow: 0 18px 45px rgba(23, 33, 43, .16); }
.issue-card__cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 749 / 1024;
  object-fit: contain;
  object-position: center;
  background: #fff;
}
.issue-card__body { padding: 1rem; }
.issue-card h2 { min-height: 2.6em; margin: 0 0 1rem; font-size: 1.08rem; line-height: 1.3; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: .72rem 1rem; border: 0; border-radius: 11px; background: var(--brand); color: white; font-weight: 750; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--brand-dark); color: white; }
.button--full { width: 100%; }
.button--accent { background: var(--accent); }

.auth-shell, .message-shell { display: grid; min-height: 100vh; place-items: center; padding: 1rem; background: radial-gradient(circle at 20% 10%, #d8effb, transparent 38%), var(--background); }
.panel { width: min(100%, 460px); padding: clamp(1.4rem, 5vw, 2.4rem); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.panel h1 { font-size: clamp(1.8rem, 7vw, 2.7rem); }
.panel p { color: var(--muted); }
.field { margin: 1rem 0; }
.field label { display: block; margin-bottom: .35rem; font-weight: 700; }
.field input { width: 100%; min-height: 48px; padding: .75rem .85rem; border: 1px solid #aab8c2; border-radius: 10px; background: white; color: var(--ink); font: inherit; }
.auth-links { margin-top: 1rem; text-align: center; }
.message-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

.audio-list { display: grid; gap: 1.5rem; }
.audio-card { display: grid; grid-template-columns: minmax(150px, 240px) 1fr; overflow: hidden; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.audio-card__cover { width: 100%; height: 100%; object-fit: contain; object-position: center; background: #fff; }
.audio-card__body { padding: clamp(1rem, 3vw, 2rem); }
.track { padding: .8rem 0; border-top: 1px solid var(--line); }
.track strong { display: block; margin-bottom: .4rem; }
.track audio { width: 100%; }
.reader-frame { width: 100%; height: 100vh; border: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 720px) {
  .topmenu { align-items: flex-start; gap: .5rem; }
  .topmenu__links { flex-wrap: wrap; justify-content: flex-end; }
  .topmenu__links a, .link-button { padding: .45rem .55rem; font-size: .9rem; }
  .audio-card { grid-template-columns: 1fr; }
  .audio-card__cover { max-height: 380px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
