/* ============================================================
   Dr. Z Answers — topic hub v2
   Questions first. The essay is background, not the entrance.
   Loaded after answers.css, only on /answers/topic/*.
   ============================================================ */

/* display rules below use grid/flex, which beat the [hidden] attribute. Restore it. */
.topic-v2 [hidden] { display: none !important; }

.topic-v2 {
  --ink: #192D4D;
  --navy: #1C4779;
  --blue: #B7D4E8;
  --paper: #FFFDF9;
  --muted: #667085;
  --line: rgba(25, 45, 77, .12);
  max-width: 940px;
  margin: 0 auto;
  padding: 40px 24px 90px;
}

/* ---------- 1. Header ---------- */
.tp-head { padding-bottom: 4px; }
.tp-head .breadcrumbs { margin-bottom: 18px; }
.tp-head h1 {
  font-size: clamp(32px, 4.2vw, 46px);
  line-height: 1.06;
  letter-spacing: -.035em;
  color: var(--ink);
  margin: 0 0 10px;
  font-weight: 800;
}
.tp-dek {
  max-width: 660px;
  color: #46566d;
  font-size: 17px;
  line-height: 1.55;
  margin: 0 0 16px;
}
.tp-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 13.5px; color: var(--muted); margin: 0;
  padding-bottom: 22px; border-bottom: 1px solid var(--line);
}
.tp-meta strong { color: var(--ink); font-weight: 700; }
.tp-meta span { opacity: .45; }
.tp-meta a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- 2. Filter ---------- */
.tp-filter {
  position: relative; display: flex; align-items: center; gap: 10px;
  margin: 22px 0 6px; padding: 0 16px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px; height: 52px;
  transition: border-color .18s, box-shadow .18s;
}
.tp-filter:focus-within { border-color: var(--navy); box-shadow: 0 0 0 4px rgba(28, 71, 121, .09); }
.tp-filter svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.tp-filter input {
  flex: 1; border: 0; background: none; outline: none;
  font: inherit; font-size: 15.5px; color: var(--ink);
}
.tp-filter input::placeholder { color: #90a0b4; }
.tp-filter button {
  border: 0; background: rgba(25, 45, 77, .07); color: var(--ink);
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  font-size: 17px; line-height: 1; display: grid; place-items: center;
}
.tp-noresults { margin: 16px 2px 0; font-size: 15px; color: var(--muted); }
.tp-noresults a { color: var(--navy); text-decoration: underline; }

/* ---------- 3. The questions ---------- */
.tp-groups { margin-top: 30px; }
.tp-group + .tp-group { margin-top: 38px; }
.tp-group[hidden] { display: none; }

.tp-group-name {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 12px; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--navy);
  margin: 0 0 4px; padding-bottom: 10px;
}
.tp-group-name i {
  font-style: normal; font-size: 11px; letter-spacing: .04em;
  color: var(--muted); background: rgba(183, 212, 232, .34);
  border-radius: 20px; padding: 2px 8px;
}

.tp-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.tp-list li { border-bottom: 1px solid var(--line); }
.tp-list li[hidden] { display: none; }

.tp-list a {
  display: grid;
  grid-template-columns: 1fr 34px;
  grid-template-areas: "q go" "line go";
  align-items: center;
  column-gap: 16px;
  padding: 17px 14px 17px 4px;
  border-radius: 12px;
  text-decoration: none;
  transition: background .16s, padding-left .16s;
}
.tp-list a:hover, .tp-list a:focus-visible {
  background: rgba(255, 253, 249, .95);
  padding-left: 14px;
  outline: none;
}
.tp-q {
  grid-area: q;
  font-size: 16.5px; font-weight: 650; line-height: 1.35;
  letter-spacing: -.011em; color: var(--ink);
}
.tp-list a:hover .tp-q { color: var(--navy); }
.tp-line {
  grid-area: line;
  margin-top: 4px;
  font-size: 13.5px; line-height: 1.5; color: var(--muted);
  max-width: 68ch;
}
.tp-go {
  grid-area: go; justify-self: end;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--navy); background: transparent;
  opacity: .35; transition: opacity .16s, background .16s, color .16s, transform .16s;
}
.tp-go svg { width: 14px; height: 14px; }
.tp-list a:hover .tp-go {
  opacity: 1; background: var(--navy); color: #fff; transform: translate(1px, -1px);
}

/* ---------- 4. Decision aid ---------- */
.tp-decision {
  margin-top: 56px; padding: 30px 32px 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
}
.tp-decision > h2 {
  font-size: 21px; letter-spacing: -.02em; color: var(--ink);
  margin: 0 0 6px; font-weight: 750;
}
.tp-decision-body { font-size: 15.5px; line-height: 1.72; color: #43536a; }
.tp-decision-body p { margin: 0 0 16px; }
.tp-decision-body table,
.tp-background-body table {
  width: 100%; border-collapse: collapse; margin: 20px 0 22px;
  font-size: 14.5px; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.tp-decision-body thead th,
.tp-background-body thead th {
  background: rgba(183, 212, 232, .28);
  font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase;
  font-weight: 700; color: var(--ink); text-align: left;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.tp-decision-body td,
.tp-background-body td {
  padding: 13px 16px; vertical-align: top; line-height: 1.55;
  border-bottom: 1px solid rgba(25, 45, 77, .07);
  color: #43536a;
}
.tp-decision-body tbody tr:last-child td,
.tp-background-body tbody tr:last-child td { border-bottom: 0; }
.tp-decision-body tbody tr:nth-child(odd) td,
.tp-background-body tbody tr:nth-child(odd) td { background: rgba(245, 241, 233, .45); }
.tp-decision-body td:first-child { font-weight: 600; color: var(--ink); }

/* ---------- 5. Background essay, collapsed ---------- */
.tp-background { margin-top: 34px; }
.tp-details {
  border: 1px solid var(--line); border-radius: 22px;
  background: rgba(255, 253, 249, .55);
}
.tp-details > summary {
  list-style: none; cursor: pointer;
  padding: 22px 56px 22px 26px; position: relative;
  border-radius: 22px;
}
.tp-details > summary::-webkit-details-marker { display: none; }
.tp-details > summary::after {
  content: ""; position: absolute; right: 26px; top: 30px;
  width: 9px; height: 9px;
  border-right: 2px solid var(--navy); border-bottom: 2px solid var(--navy);
  transform: rotate(45deg); transition: transform .2s;
}
.tp-details[open] > summary::after { transform: rotate(-135deg); top: 34px; }
.tp-details[open] > summary { border-bottom: 1px solid var(--line); border-radius: 22px 22px 0 0; }
.tp-details-title {
  display: block; font-size: 17px; font-weight: 700;
  letter-spacing: -.017em; color: var(--ink);
}
.tp-details-note {
  display: block; margin-top: 4px;
  font-size: 13.5px; color: var(--muted);
}
.tp-background-body {
  padding: 6px 26px 26px;
  font-size: 16px; line-height: 1.78; color: #43536a;
  max-width: 72ch;
}
.tp-background-body h2 {
  font-size: 19px; font-weight: 700; letter-spacing: -.018em;
  color: var(--ink); margin: 30px 0 10px;
}
.tp-background-body p { margin: 0 0 15px; }
.tp-background-body a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- 6. Other topics ---------- */
.tp-other { margin-top: 52px; }
.tp-other > h2 {
  font-size: 12px; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--navy); margin: 0 0 14px;
}
.tp-other-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tp-other-grid a {
  display: block; padding: 16px 18px; border-radius: 16px;
  background: var(--paper); border: 1px solid var(--line);
  text-decoration: none; transition: border-color .18s, transform .18s;
}
.tp-other-grid a:hover { border-color: var(--navy); transform: translateY(-2px); }
.tp-other-grid b {
  display: block; font-size: 15px; font-weight: 650;
  letter-spacing: -.012em; color: var(--ink); line-height: 1.3;
}
.tp-other-grid span { display: block; margin-top: 4px; font-size: 12.5px; color: var(--muted); }

.topic-v2 .ans-cta { margin-top: 46px; }

/* ---------- Responsive ---------- */
@media (max-width: 780px) {
  .topic-v2 { padding: 28px 18px 70px; }
  .tp-other-grid { grid-template-columns: 1fr; }
  .tp-line { font-size: 13px; }
  .tp-decision { padding: 24px 20px 6px; }
  .tp-background-body { padding: 6px 20px 22px; font-size: 15.5px; }
  .tp-decision-body table, .tp-background-body table { display: block; overflow-x: auto; }
}
@media (max-width: 520px) {
  .tp-list a { grid-template-columns: 1fr 26px; padding: 15px 8px 15px 2px; }
  .tp-q { font-size: 15.5px; }
}

@media print {
  .tp-filter, .tp-go, .tp-other, .ans-cta { display: none; }
  .tp-details[open] > summary::after { display: none; }
}
