/* ==========================================================================
   The Collective — /publications/ (The Collective Library)
   Colour tokens and shared header/nav/footer rules match / and /explore/
   exactly (same brand, same accessibility patterns).
   ========================================================================== */

:root {
  --teal: #6BB7B0;
  --teal-deep: #326762;
  --bg-warm: #F7F5F0;
  --pale-aqua: #E7F2F0;
  --mustard: #D9A441;
  --teal-near-black: #1B3733;
  --text-dark: #1E3A38;
  --text-muted: #5C7A78;
  --white: #FFFFFF;

  --radius-lg: 20px;
  --radius-md: 12px;
  --shadow-soft: 0 4px 16px rgba(30, 58, 56, 0.08);
  --shadow-card: 0 6px 20px rgba(30, 58, 56, 0.10);
  --focus-ring: 3px solid var(--teal-deep);

  --content-width: 1080px;
  --transition-fast: 200ms ease;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  /* Keeps scroll targets (skip link, in-page focus jumps) from landing
     underneath the sticky header. */
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--bg-warm);
  color: var(--text-dark);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--teal-deep);
}

a:focus-visible,
button:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 12px;
  background: var(--teal-deep);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 700;
  z-index: 100;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
}

/* ==========================================================================
   Header / navigation (shared pattern with /, /explore/ and /join/)
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.header-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.brand-link:hover,
.brand-link:focus-visible {
  opacity: 0.85;
  transform: scale(1.02);
}

.nav-logo-wrap {
  position: relative;
  overflow: hidden;
  display: block;
  width: 130px;
  aspect-ratio: 1004 / 142;
}

.nav-logo-wrap .nav-logo {
  position: absolute;
  top: 0;
  left: 0;
  width: 107.57%;
  max-width: none;
  height: auto;
  transform: translate(-2.778%, -43.426%);
}

@media (min-width: 640px) {
  .nav-logo-wrap {
    width: 165px;
  }
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  background: none;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
}

.nav-toggle-icon {
  width: 20px;
  height: 2px;
  background: var(--text-dark);
  position: relative;
  display: inline-block;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: var(--text-dark);
}

.nav-toggle-icon::before {
  top: -6px;
}

.nav-toggle-icon::after {
  top: 6px;
}

.primary-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.primary-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-dark);
  font-weight: 600;
  text-decoration: none;
}

.primary-nav a:hover {
  background: var(--pale-aqua);
}

.primary-nav a[aria-current="page"] {
  color: var(--teal-deep);
  background: var(--pale-aqua);
  font-weight: 700;
}

@media (max-width: 780px) {
  .nav-toggle {
    display: inline-flex;
  }

  .primary-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 8px 0 12px;
  }

  .primary-nav.is-open {
    display: flex;
  }

  .primary-nav a {
    width: 100%;
  }

  .header-inner {
    flex-wrap: wrap;
  }
}

/* ==========================================================================
   Back link (used on the reader page)
   ========================================================================== */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 24px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
}

.back-link:hover {
  color: var(--teal-deep);
  text-decoration: underline;
}

/* ==========================================================================
   Library hero
   ========================================================================== */

.pub-hero {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 40px 24px 8px;
}

.pub-hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.pub-hero h1 {
  margin: 0 0 12px;
  font-size: 2.4rem;
  line-height: 1.15;
  color: var(--teal-deep);
}

.pub-hero-subtitle {
  margin: 0 auto;
  max-width: 560px;
  font-size: 1.1875rem;
  color: var(--text-muted);
}

.pub-hero-cally-image {
  display: block;
  width: 200px;
  max-width: 55vw;
  flex-shrink: 0;
}

.pub-hero-cally-image img {
  width: 100%;
  height: auto;
  display: block;
}

@media (min-width: 640px) {
  .pub-hero h1 {
    font-size: 3rem;
  }
}

@media (min-width: 780px) {
  .pub-hero-inner {
    flex-direction: row;
    justify-content: center;
    text-align: left;
    gap: 40px;
    padding-bottom: 16px;
  }

  .pub-hero-subtitle {
    margin-left: 0;
  }

  .pub-hero-cally-image {
    width: 220px;
  }
}

/* ==========================================================================
   Section shell
   ========================================================================== */

.section-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 24px 24px 56px;
}

.section-inner h2 {
  color: var(--teal-deep);
  font-size: 1.6rem;
  margin: 0 0 24px;
}

.empty-state {
  color: var(--text-muted);
  font-style: italic;
  padding: 20px 0;
  margin: 0;
}

/* ==========================================================================
   Publication cards — shared by the featured (Latest Edition / Manifesto)
   treatment and the grid used for previous editions / future publications.
   Each card is a single <a>, so it is one tab stop with a full-card
   click/tap target and a descriptive aria-label.
   ========================================================================== */

.pub-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  text-decoration: none;
  color: var(--text-dark);
  border: 2px solid transparent;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.pub-card:hover,
.pub-card:focus-visible {
  border-color: var(--teal);
  transform: translateY(-4px);
  box-shadow: 0 10px 26px rgba(30, 58, 56, 0.14);
}

.pub-card:active {
  transform: translateY(-2px) scale(0.99);
}

.pub-card-cover {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  background: var(--pale-aqua);
}

.pub-card-cover img {
  width: 100%;
  height: 100%;
  /* contain, not cover — these are genuine publication covers; nothing
     about the real artwork should ever be cropped away. */
  object-fit: contain;
  transition: transform var(--transition-fast);
}

.pub-card:hover .pub-card-cover img,
.pub-card:focus-visible .pub-card-cover img {
  transform: scale(1.03);
}

.pub-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--mustard);
  color: var(--text-dark);
  font-weight: 700;
  font-size: 0.8125rem;
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}

.pub-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
}

.pub-card-kicker {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.pub-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--teal-deep);
}

.pub-card-issue {
  color: var(--text-muted);
  margin-bottom: 8px;
}

.pub-card-teaser {
  display: block;
  color: var(--text-dark);
  font-size: 0.9375rem;
  margin-bottom: 12px;
}

.pub-card-link {
  font-weight: 700;
  color: var(--teal-deep);
}

/* Featured cards (Latest Edition, Manifesto): image beside content on
   wider screens, larger cover. */
.pub-card-featured {
  max-width: 640px;
}

@media (min-width: 640px) {
  .pub-card-featured {
    flex-direction: row;
  }

  .pub-card-featured .pub-card-cover {
    flex: 0 0 220px;
    aspect-ratio: auto;
  }

  .pub-card-featured .pub-card-body {
    justify-content: center;
    padding: 24px 28px;
  }

  .pub-card-featured .pub-card-title {
    font-size: 1.5rem;
  }
}

/* ==========================================================================
   Previous editions / more publications grid
   ========================================================================== */

.pub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

/* ==========================================================================
   Latest Edition + Manifesto sections — subtle tinted band so each reads
   as its own moment on the page.
   ========================================================================== */

.latest-edition {
  background: var(--pale-aqua);
}

.manifesto-section {
  background: var(--white);
  border-top: 1px solid var(--pale-aqua);
  border-bottom: 1px solid var(--pale-aqua);
}

/* ==========================================================================
   Footer (shared pattern with /, /explore/ and /join/)
   ========================================================================== */

.site-footer {
  background: var(--teal-near-black);
  color: var(--pale-aqua);
  padding: 64px 24px 24px;
  border-top: 3px solid var(--mustard);
}

.footer-inner {
  max-width: var(--content-width, 1080px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  text-align: left;
}

.footer-brand .footer-wordmark {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--white);
  margin: 0 0 8px;
}

.footer-brand .footer-tagline {
  margin: 0;
  color: var(--pale-aqua);
  font-size: 0.9375rem;
  max-width: 34ch;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.footer-col-heading {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mustard);
  margin: 0 0 4px;
}

.footer-col a,
.footer-email a {
  color: var(--white);
  text-decoration: none;
  font-size: 0.9375rem;
  overflow-wrap: break-word;
  word-break: break-word;
}

.footer-col a:hover,
.footer-email a:hover {
  text-decoration: underline;
  color: var(--mustard);
}

.footer-email {
  margin: 0 0 16px;
}

.footer-social {
  list-style: none;
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.footer-social a:hover {
  background: var(--mustard);
  color: var(--teal-deep);
}

.footer-social svg {
  width: 18px;
  height: 18px;
}

.footer-bottom {
  max-width: var(--content-width, 1080px);
  margin: 40px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8125rem;
  color: var(--pale-aqua);
}

.footer-bottom-links {
  display: flex;
  gap: 16px;
}

.footer-bottom-links a {
  color: var(--pale-aqua);
  text-decoration: none;
}

.footer-bottom-links a:hover {
  text-decoration: underline;
  color: var(--white);
}

.site-footer a:focus-visible,
.site-footer button:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 3px;
}

@media (max-width: 780px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
    margin-bottom: 8px;
  }
}

@media (max-width: 480px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Reader page
   ========================================================================== */

.reader-page {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.reader-header {
  margin-bottom: 20px;
}

.reader-kicker {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.reader-header h1 {
  margin: 4px 0 6px;
  color: var(--teal-deep);
  font-size: 1.9rem;
}

.reader-issue {
  color: var(--text-muted);
  margin: 0 0 16px;
}

.reader-external-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--teal-deep);
}

.reader-frame-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 80vh;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: var(--pale-aqua);
}

@media (min-width: 640px) {
  .reader-frame-wrap {
    aspect-ratio: 16 / 10;
  }
}

.reader-frame-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.reader-not-found {
  padding: 40px 0;
}

.reader-not-found h1 {
  color: var(--teal-deep);
}

/* ==========================================================================
   Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }

  html {
    scroll-behavior: auto;
  }

  .pub-card:hover,
  .pub-card:focus-visible,
  .pub-card:hover .pub-card-cover img,
  .pub-card:focus-visible .pub-card-cover img {
    transform: none !important;
  }
}
