/* Browse by Topic (/topics/). Owner's picks, 16 Nov 2026: look A "Gallery" (clean-edged photos, name underneath),
   option 2 (group name and a line of text on the left, its topics on the right), "Find a topic" with two tabs
   (search, or every topic A to Z). No counts of books or topics. Mockups: design/topics-mockups/v6, v9.
   Everything is scoped to .tp so the shared listing styles stay as they are. */

.tp { font-family: var(--tmme-font-body); color: var(--tmme-ink); }
.tp a { color: inherit; text-decoration: none; }
.tp a:focus-visible,
.tp button:focus-visible { outline: 2px solid var(--tmme-ink); outline-offset: 3px; }
.tp img { display: block; }
:where(.tp) h2, :where(.tp) h3, :where(.tp) p { margin: 0; font-weight: 400; }

/* Title: left-aligned with a rule under it (listing.css centres it on other pages) */
.tp-head { border-bottom: 1px solid var(--tmme-ink); padding-bottom: 16px; margin: 0 0 40px; }
.tp .listing-page__title { text-align: left; margin: 0; }

.tp-arrow { display: inline-block; transition: transform .25s ease; }
.tp a:hover .tp-arrow { transform: translateX(4px); }
.tp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tp-chip {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--tmme-border); border-radius: 2px; background: var(--tmme-surface);
  font-size: 14px; white-space: nowrap; transition: border-color .2s ease;
}
.tp-chip:hover { border-color: var(--tmme-ink); }
.tp-btn {
  display: inline-flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 24px;
  background: var(--tmme-ink); font-size: 13px; letter-spacing: .16em; text-transform: uppercase;
  font-weight: 700; white-space: nowrap;
}
.tp a.tp-btn { color: #fff; }

/* Photos: clean edges, a slow zoom on hover */
.tp-ph { display: block; overflow: hidden; background: var(--tmme-surface-alt); }
.tp-ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s cubic-bezier(.2, .7, .2, 1); }
.tp a:hover .tp-ph img { transform: scale(1.04); }

/* Bibles: text panel beside the photo */
.tp-bibles { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); background: var(--tmme-surface-alt); }
.tp-bibles__text { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 64px; }
.tp-bibles__name { font-family: var(--tmme-font-display); font-size: 84px; line-height: .95; margin: 0 0 20px; }
.tp-bibles__lead { color: var(--tmme-ink-muted); font-size: 16px; line-height: 1.6; margin: 0 0 28px; max-width: 34ch; }
.tp-bibles .tp-chips { margin: 0 0 32px; }
.tp-bibles .tp-ph { position: relative; min-height: 480px; }
.tp-bibles .tp-ph img { position: absolute; inset: 0; }

/* Groups: name and a line of text on the left (stays in view while its topics scroll), topics on the right */
.tp-group {
  display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 56px;
  margin: 80px 0 0; padding-top: 32px; border-top: 1px solid var(--tmme-border);
}
.tp-group__side { display: flex; flex-direction: column; gap: 10px; align-self: start; position: sticky; top: 24px; }
.tp-group__name { font-family: var(--tmme-font-display); font-size: 36px; line-height: 1.1; }
.tp-group__desc { color: var(--tmme-ink-muted); font-size: 15px; line-height: 1.5; }
.tp-group__row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 32px 20px; }
.tp-group__row > * { grid-column: span var(--span, 2); }

/* Topic tile: photo, name underneath */
.tp-tile { display: flex; flex-direction: column; min-width: 0; }
.tp-tile .tp-ph { height: 300px; }
.tp-tile__name {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  font-family: var(--tmme-font-display); font-size: 26px; line-height: 1.15; margin: 14px 0 0;
}
.tp-tile .tp-arrow { font-family: var(--tmme-font-body); font-size: 18px; flex: none; }

/* Find a topic: two tabs, search or the full A to Z list (its heading does not stick) */
.tp-find .tp-group__side { position: static; }
.tp-find + .tp-group { margin-top: 56px; }
.tp-tabs { display: flex; gap: 36px; border-bottom: 1px solid var(--tmme-border); margin: 0 0 22px; }
.tp .tp-tabs button {
  position: relative; min-height: 48px; padding: 0; font-size: 12px; letter-spacing: .16em;
  text-transform: uppercase; font-weight: 700; color: var(--tmme-ink-muted); transition: color .2s ease;
}
.tp .tp-tabs button:hover,
.tp .tp-tabs button[aria-selected="true"] { color: var(--tmme-ink); }
.tp .tp-tabs button[aria-selected="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--tmme-ink);
}
.tp-panel[hidden] { display: none; }
.tp:not(.js) .tp-tabs { display: none; }

.tp-search { position: relative; max-width: 620px; }
.tp-search__icon {
  position: absolute; left: 18px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%);
  color: var(--tmme-ink-muted); pointer-events: none;
}
.tp .tp-search__input {
  display: block; width: 100%; height: 56px; padding: 0 18px 0 52px; border: 1px solid var(--tmme-border);
  border-radius: 2px; background: var(--tmme-surface); font-size: 17px; color: var(--tmme-ink); cursor: text;
  transition: border-color .2s ease;
}
.tp .tp-search__input::placeholder { color: var(--tmme-ink-faint); }
.tp .tp-search__input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.tp .tp-search__input:hover { border-color: #bdbdbd; }
.tp .tp-search__input:focus { outline: none; border-color: var(--tmme-ink); }
.tp-search__list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; list-style: none; margin: 0; padding: 6px 0;
  background: var(--tmme-surface); border: 1px solid var(--tmme-border);
  box-shadow: 0 1px 2px rgba(40, 32, 20, .06), 0 10px 24px -8px rgba(40, 32, 20, .14), 0 28px 56px -16px rgba(40, 32, 20, .18);
}
.tp-search__list[hidden] { display: none; }
.tp-search__list a { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 48px; padding: 0 18px; font-size: 16px; }
.tp-search__list a:hover,
.tp-search__list a[aria-selected="true"] { background: var(--tmme-surface-alt); }
.tp-search__list mark { background: none; color: inherit; font-weight: 700; }
.tp-search__group { font-size: 13px; color: var(--tmme-ink-muted); white-space: nowrap; }
.tp-search__none { padding: 12px 18px; color: var(--tmme-ink-muted); font-size: 15px; }
.tp:not(.js) .tp-search { display: none; }

.tp-az { columns: 3 200px; column-gap: 40px; }
.tp-az__block { break-inside: avoid; display: grid; grid-template-columns: 28px 1fr; gap: 0 10px; margin: 0 0 20px; }
.tp-az__letter { font-family: var(--tmme-font-display); font-size: 26px; line-height: 1; color: var(--tmme-ink-faint); padding-top: 4px; }
.tp-az ul { list-style: none; margin: 0; padding: 0; }
.tp-az li a { display: inline-flex; align-items: center; min-height: 32px; font-size: 15px; }
.tp-az a:hover span { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

@media (max-width: 767px) {
  .tp-head { padding-bottom: 14px; margin-bottom: 24px; }
  .tp-chip { min-height: 44px; }
  .tp-bibles { grid-template-columns: 1fr; }
  .tp-bibles .tp-ph { min-height: 0; aspect-ratio: 3 / 2; order: -1; }
  .tp-bibles__text { padding: 28px 20px 32px; }
  .tp-bibles__name { font-size: 56px; margin: 0 0 14px; }
  .tp-bibles__lead { font-size: 15px; margin-bottom: 20px; }
  .tp-bibles .tp-chips { margin-bottom: 24px; }
  .tp-group { display: block; margin-top: 52px; padding-top: 16px; }
  .tp-group__side { position: static; gap: 4px; margin: 0 0 16px; }
  .tp-group__name { font-size: 28px; }
  .tp-group__desc { font-size: 14px; }
  .tp-group__row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .tp-group__row > * { grid-column: auto; }
  .tp-tile .tp-ph { height: auto; aspect-ratio: 4 / 5; }
  .tp-group__row > .tp-tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .tp-group__row > .tp-tile:last-child:nth-child(odd) .tp-ph { aspect-ratio: 16 / 9; }
  .tp-tile__name { font-size: 21px; margin-top: 10px; }
  .tp-find + .tp-group { margin-top: 40px; }
  .tp-tabs { gap: 24px; }
  .tp .tp-tabs button { min-height: 44px; }
  .tp .tp-search__input { height: 52px; font-size: 16px; }
  .tp-search__group { display: none; }
  .tp-az { columns: 2; column-gap: 20px; }
  .tp-az__block { grid-template-columns: 22px 1fr; margin-bottom: 14px; }
  .tp-az__letter { font-size: 22px; }
  .tp-az li a { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .tp * { transition: none !important; }
  .tp a:hover .tp-ph img, .tp a:hover .tp-arrow { transform: none; }
}
