/* Approved topics overview design; all topic content remains canonical. */
.topics-overview {
    padding-block: 24px 54px;
    color: #172943;
    background: linear-gradient(140deg, #f1e4ca, #fbf5e9 58%, #e8c98f);
    font-family: var(--interface-font);
  }

  .topics-breadcrumbs {
    margin-block-end: 20px;
    color: #526174;
  }

  .topics-breadcrumbs a { color: inherit; }

  .topics-introduction { margin-block-end: 26px; }

  .topics-introduction h1 {
    margin: 0 0 10px;
    font-family: inherit;
    font-size: clamp(2rem, 3.8vw, 2.8rem);
    font-weight: 750;
    line-height: 1.3;
  }

  .topics-introduction p {
    max-width: 70ch;
    margin: 0;
    color: #46566a;
    font-size: 1.05rem;
    line-height: 1.75;
  }

  .topics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .topics-grid > li { min-width: 0; }

  .topics-card {
    display: flex;
    flex-direction: column;
    min-height: 170px;
    height: 100%;
    min-width: 0;
    padding: 22px;
    border: 1px solid rgba(109, 95, 68, .32);
    border-radius: 16px;
    background-color: #d9d2c1;
    background-image: linear-gradient(145deg, rgba(203,215,214,.88), rgba(223,208,180,.88)), url("/assets/archive-hub-bg-v2@2x.webp");
    background-position: center;
    background-size: cover;
    box-shadow: 0 8px 24px rgba(74, 55, 24, .09);
    color: #172943;
    text-decoration: none;
    transition: border-color .18s ease, box-shadow .18s ease;
  }

  .topics-card:hover {
    border-color: #9a8055;
    box-shadow: 0 10px 26px rgba(74, 55, 24, .14);
  }

  .topics-card:focus-visible {
    outline: 3px solid #1e5d91;
    outline-offset: 4px;
  }

  .topics-card-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
  }

  .topics-symbol {
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .65);
    color: #3e617d;
    font-size: 1.25rem;
  }

  .topics-card h2 {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-family: inherit;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: break-word;
  }

  .topics-arrow { flex: 0 0 auto; color: #7a5b2c; font-size: 1.35rem; }

  .topics-description {
    margin: 12px 0 18px;
    color: #34465b;
    font-size: 1rem;
    line-height: 1.65;
  }

  .topics-count {
    margin: auto 0 0;
    color: #34465b;
    font-size: .88rem;
    line-height: 1.6;
  }

  .topics-full-archive {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-block-start: 28px;
    padding-block-start: 22px;
    border-block-start: 1px solid #d5d4ca;
  }

  .topics-full-archive p { margin: 0; color: #46566a; line-height: 1.7; }
  .topics-full-archive .button { gap: 10px; }

  @media (max-width: 980px) {
    .topics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }

  @media (max-width: 600px) {
    .topics-overview { padding-block: 20px 38px; }
    .topics-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .topics-card { padding: 20px; }
    .topics-introduction { margin-block-end: 22px; }
    .topics-full-archive { align-items: flex-start; }
  }

  @media (prefers-reduced-motion: reduce) {
    .topics-card { transition: none; }
  }

/* The approved ivory surface stays dominant beneath the local blue tint. */
.topics-reading-page #main .topics-card {
  border-color: #ccb48e;
  border-block-start: 3px solid #b38a4d;
  background-color: #f2e8d3;
  background-image: radial-gradient(ellipse at 0% 100%,rgba(117,172,213,.18) 0%,rgba(117,172,213,.065) 25%,rgba(117,172,213,0) 55%),linear-gradient(145deg,rgba(253,247,235,.94),rgba(239,225,199,.94)),image-set(url("/assets/archive-hub-bg-v2.webp") 1x,url("/assets/archive-hub-bg-v2@2x.webp") 2x);
  box-shadow: inset 0 1px 0 #ffffffc4,0 2px 4px #6f512014,0 8px 22px #6f512014;
}
.topics-reading-page #main .topics-card:hover {
  border-color: #b2884a;
  box-shadow: inset 0 1px 0 #ffffffc4,0 3px 7px #6f51201a,0 10px 24px #6f51201a;
}
.topics-reading-page #main .topics-symbol {
  border: 1px solid #d7c4a3;
  background: linear-gradient(135deg,#fffaf0,#efe2ca);
  color: #234f75;
}
.topics-reading-page #main .topics-description { color: #4b4943; }
.topics-reading-page #main .topics-count {
  padding-block-start: 9px;
  border-block-start: 1px solid #d9c8aa;
  color: #62594b;
}
.topics-reading-page #main .topics-full-archive .button {
  border-color: #b58b4a;
  background: linear-gradient(125deg,#dfbc7d,#cfa459);
  color: #29303a;
  box-shadow: inset 0 1px 0 #ffffff59,0 3px 8px #80500e24;
}

/* Small transparent archive and study motifs; text remains on the upper layer. */
.topics-reading-page #main .topics-card { position: relative; isolation: isolate; overflow: hidden; }
.topics-reading-page #main .topics-card::before {
  content: "";
  position: absolute;
  left: 8px;
  bottom: 8px;
  width: var(--motif-width,145px);
  height: var(--motif-height,100px);
  background: var(--archive-motif,none) left bottom / contain no-repeat;
  opacity: var(--motif-opacity,.12);
  pointer-events: none;
  z-index: 0;
}
.topics-reading-page #main .topics-card > * { position: relative; z-index: 1; }
.topics-reading-page #main [data-topic-slug="sermons"] .topics-card { --archive-motif: url("/assets/archive-cutouts/torah-study-v1.png"); --motif-width: 155px; --motif-height: 108px; --motif-opacity: .12; }
.topics-reading-page #main [data-topic-slug="piyyutim"] .topics-card { --archive-motif: url("/assets/archive-cutouts/piyyutim-v1.png"); --motif-width: 145px; --motif-height: 105px; --motif-opacity: .12; }
.topics-reading-page #main [data-topic-slug="films"] .topics-card { --archive-motif: url("/assets/archive-cutouts/film-v2.png"); --motif-width: 140px; --motif-height: 112px; --motif-opacity: .13; }
.topics-reading-page #main [data-topic-slug="photographs"] .topics-card { --archive-motif: url("/assets/archive-cutouts/drawers-v1.png"); --motif-width: 140px; --motif-height: 100px; --motif-opacity: .10; }
.topics-reading-page #main [data-topic-slug="memories"] .topics-card { --archive-motif: url("/assets/archive-cutouts/memories-v1.png"); --motif-width: 145px; --motif-height: 100px; --motif-opacity: .11; }
.topics-reading-page #main [data-topic-slug="writings"] .topics-card { --archive-motif: url("/assets/archive-cutouts/torah-study-v1.png"); --motif-width: 145px; --motif-height: 102px; --motif-opacity: .10; }
.topics-reading-page #main [data-topic-slug="letters-and-documents"] .topics-card { --archive-motif: url("/assets/archive-cutouts/drawers-v1.png"); --motif-width: 150px; --motif-height: 105px; --motif-opacity: .11; }
@media (max-width:600px) {
  .topics-reading-page #main .topics-card::before { width: calc(var(--motif-width,145px) * .84); height: calc(var(--motif-height,100px) * .84); opacity: min(var(--motif-opacity,.12),.10); }
}

.topics-reading-page #main .topics-introduction .topics-overlap-note { font-size: .83rem; line-height: inherit; }
