/* The Catalog (/catalog): an editorial shelf of curated 100x-aligned
   resources. Tokens only — both themes follow variables.css.

   The signature element is the plate: every card leads with the item's own
   photograph, or the house topography texture carrying a kind glyph when
   there is none. Gold is the single accent — the tick above the masthead,
   the kind line, the hover edge. Everything else stays quiet. */

.catalog-page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 5rem;
  font-family: var(--font-body);
  color: var(--text-body);
}

/* ── Masthead ── */

.catalog-masthead {
  margin-bottom: 3rem;
  max-width: 620px;
}

.catalog-masthead::before {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  background: var(--gold-dark);
  margin-bottom: 1.25rem;
}

.catalog-eyebrow {
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 1.275rem;
  color: var(--text-secondary);
  margin: 0 0 0.5rem;
}

.catalog-masthead-title {
  font-family: var(--font-heading);
  color: var(--text-heading);
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  line-height: 1.1;
  margin: 0 0 0.75rem;
}

.catalog-masthead-sub {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0;
}

.catalog-empty { color: var(--text-muted); }

/* ── Category sections ── */

.catalog-section { margin-bottom: 3.5rem; }

.catalog-section-rule {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border-medium);
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
}

.catalog-section-name {
  font-family: var(--font-heading);
  color: var(--text-heading);
  font-size: 1.45rem;
  margin: 0;
}

.catalog-section-count {
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.catalog-section-sub {
  color: var(--text-secondary);
  margin: 0 0 1.5rem;
  max-width: 60ch;
}

/* ── The shelf ── */

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem 1.5rem;
}

.catalog-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--text-body);
  animation: catalog-enter 0.5s both;
  animation-delay: var(--enter-delay, 0ms);
}

@keyframes catalog-enter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .catalog-card { animation: none; }
}

/* The plate */
.catalog-plate {
  position: relative;
  display: block;
  aspect-ratio: 8 / 5;
  overflow: hidden;
  background: var(--surface-inverse);
  border: 1px solid var(--border-light);
  margin-bottom: 0.35rem;
}

.catalog-plate-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.catalog-card:hover .catalog-plate-img { transform: scale(1.03); }

.catalog-plate-texture {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--surface-footer);
  background-image: var(--texture-topography);
  background-size: 420px;
}

.catalog-plate-texture i {
  font-size: 2.6rem;
  color: var(--gold);
}

.catalog-plate-badge {
  position: absolute;
  left: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--gold-dark);
  color: var(--text-on-accent);
  font-size: 0.8rem;
}

/* Card text */
.catalog-card-kind {
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 1.17rem;
  color: var(--gold-dark);
}

.catalog-card-title {
  font-family: var(--font-heading);
  color: var(--text-heading);
  font-size: 1.3rem;
  line-height: 1.2;
}

.catalog-card:hover .catalog-card-title { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

.catalog-card-summary {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Item page ── */

.catalog-article { max-width: 760px; }

.catalog-back { margin-bottom: 2rem; }

.catalog-back a {
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.catalog-back a:hover { color: var(--text-heading); }

.catalog-article-head { margin-bottom: 2rem; }

.catalog-article-head .catalog-eyebrow { color: var(--gold-dark); }

.catalog-article-title {
  font-family: var(--font-heading);
  color: var(--text-heading);
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1.08;
  margin: 0 0 1rem;
}

.catalog-article-standfirst {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
  max-width: 56ch;
}

.catalog-article-hero {
  margin: 0 0 2rem;
}

.catalog-article-hero img {
  width: 100%;
  height: auto;
  display: block;
}

/* Player */
.catalog-player {
  position: relative;
  aspect-ratio: 16 / 9;
  margin-bottom: 2rem;
  background: var(--surface-inverse);
}

.catalog-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.catalog-audio {
  display: block;
  width: 100%;
  margin-bottom: 2rem;
}

.catalog-media-link {
  margin: 0 0 2rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border-light);
}

.catalog-media-link i { color: var(--gold-dark); margin-right: 0.4rem; }

.catalog-transcript-label {
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 1.275rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-medium);
  padding-bottom: 0.4rem;
  margin: 0 0 1rem;
}

/* Body copy. The rendered rich text arrives wrapped in .trix-content, which
   components.css dresses as an EDITOR FIELD (border, field background,
   padding). This is an article, not a field — strip that chrome here. */
.catalog-body {
  font-size: 1.06rem;
  line-height: 1.7;
  max-width: 68ch;
}

.catalog-body .trix-content,
[data-theme="dark"] .catalog-body .trix-content {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  min-height: 0;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

.catalog-body .trix-content p { margin: 0 0 1.1em; }

.catalog-body p { margin: 0 0 1.1em; }

.catalog-body h2,
.catalog-body h3 {
  font-family: var(--font-heading);
  color: var(--text-heading);
  line-height: 1.2;
  margin: 1.6em 0 0.6em;
}

.catalog-body a { color: var(--text-heading); }

.catalog-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 2.5rem 0;
}

.catalog-images img {
  width: 100%;
  height: auto;
  display: block;
}

.catalog-source {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 0.9rem;
}
