/* Questions & answers (/answers/, built by aeo.py), draft redesign.
   Without JavaScript the page is the built list: every question grouped by the page that answers it in full.
   answers.js turns it into topic pictures, rounded question cards and pages (.qa-ready); those rules follow. */
.answers-masthead { padding-bottom: clamp(12px, 1.4vw, 24px); }
.answers-index { padding-top: clamp(16px, 2vw, 32px); }
.answers-form { margin-top: 0; }
.answers-groups { margin-top: 8px; border-top: 1px solid var(--rule); }
.answers-group { display: grid; grid-template-columns: minmax(220px, 4fr) minmax(0, 8fr); column-gap: var(--columns, 48px); padding: 28px 0; border-bottom: 1px solid var(--rule); }
.answers-group[hidden], .answers-item[hidden], .answers-groups[hidden] { display: none; }
.answers-source { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 16px; align-items: start; align-self: start; position: sticky; top: calc(var(--header-offset, 100px) + 20px); color: inherit; text-decoration: none; }
.answers-source img { width: 72px; height: 72px; object-fit: cover; background: var(--surface); }
.answers-source > span { display: grid; gap: 6px; min-width: 0; }
.answers-kind { font-size: var(--small); line-height: 1.4; color: var(--muted); letter-spacing: .02em; }
.answers-source h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: var(--card-title); line-height: 1.2; color: var(--ink); text-wrap: balance; overflow-wrap: anywhere; }
.letter-world .answers-list details:first-child { border-top: 0; padding-top: 0; }
.letter-world .answers-list details:last-child { border-bottom: 0; padding-bottom: 0; }
.answers-item > p { max-width: var(--reading, 68ch); }
.answers-item .text-link { display: inline-block; margin: 8px 0 6px; color: var(--accent); }
.answers-empty { padding: 40px 0; border-bottom: 1px solid var(--rule); }
.answers-empty[hidden] { display: none; }
.answers-empty p { font-family: var(--font-display); font-size: var(--lead); line-height: 1.35; margin: 0 0 20px; max-width: 30ch; }
@media (max-width: 900px) {
  .answers-group { grid-template-columns: minmax(0, 1fr); row-gap: 18px; padding: 24px 0; }
  .answers-source { position: static; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; align-items: center; }
  .answers-source img { width: 56px; height: 56px; }
}
@media (max-width: 740px) {
  .answers-on { display: none; }
  .answers-masthead .page-intro { font-size: var(--body); line-height: 1.5; }
}

/* ---------- The redesign (answers.js adds .qa-ready) ---------- */
.qa-ready { --qa-line: rgb(121 36 42 / .14); --qa-soft: 0 1px 2px rgb(51 48 51 / .05), 0 14px 32px -24px rgb(121 36 42 / .45); --qa-ease: cubic-bezier(.23, 1, .32, 1); }

/* Search: one rounded bar, the glass inside it, the button at its end. */
.qa-ready .answers-form { display: block; margin: 0; padding: 0; background: none; }
.qa-ready .answers-form > label, .qa-ready .answers-form > select { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.qa-search { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 22px; border-radius: 999px; background: var(--white); border: 1px solid var(--qa-line); box-shadow: var(--qa-soft); transition: border-color 200ms ease, box-shadow 200ms ease; }
.qa-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgb(167 52 57 / .12), var(--qa-soft); }
.qa-glass { flex: none; color: var(--muted); }
.qa-ready .qa-search input { flex: 1; min-width: 0; min-height: 52px; padding: 0 4px; border: 0; background: transparent; outline: none; font-family: var(--font-ui); font-size: 18px; }
.qa-ready .qa-search input::placeholder { color: #8d8086; }
.qa-ready .qa-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; width: 28px; height: 28px; margin-right: 6px; border-radius: 50%; cursor: pointer; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 6l8 8M14 6l-8 8' stroke='%2379242A' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / 16px no-repeat; }
.qa-tile.is-none { opacity: .4; }
.qa-ready .qa-search .button { flex: none; min-height: 52px; margin: 0; padding: 0 30px; border-radius: 999px; }

/* Topics: big rounded pictures, the name and how many questions on each. */
.qa-topics { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: clamp(10px, .9vw, 18px); margin: clamp(20px, 1.8vw, 32px) 0 0; }
.qa-tile { position: relative; display: block; aspect-ratio: 5 / 6; max-height: 260px; width: 100%; padding: 0; overflow: hidden; border: 0; border-radius: 22px; background: var(--surface); color: var(--white); text-align: left; cursor: pointer; isolation: isolate; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: transform 450ms var(--qa-ease), box-shadow 450ms var(--qa-ease), opacity 300ms ease; }
.qa-tile-pic { position: absolute; inset: 0; display: block; overflow: hidden; border-radius: inherit; }
.qa-tile-pic img { width: 100%; height: 100%; object-fit: cover; transform: scale(var(--z, 1)); transition: transform 900ms var(--qa-ease), filter 300ms ease; }
.qa-tile::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; background: linear-gradient(180deg, rgb(40 14 18 / 0) 38%, rgb(40 14 18 / .74)); pointer-events: none; }
.qa-tile-text { position: absolute; left: 18px; right: 14px; bottom: 16px; z-index: 2; display: grid; gap: 4px; }
.qa-tile-name { font-family: var(--font-display); font-size: clamp(20px, 1.3vw, 27px); line-height: 1.08; text-wrap: balance; }
.qa-tile-count { font-family: var(--font-ui); font-size: 13px; letter-spacing: .04em; opacity: .86; }
.qa-tile--all { background: var(--wine); }
.qa-tile--all::after { background: radial-gradient(120% 80% at 0% 0%, rgb(255 255 255 / .12), transparent 60%); }
.qa-tile-big { position: absolute; left: 18px; top: 14px; font-family: var(--font-display); font-size: clamp(44px, 3.6vw, 72px); line-height: 1; color: var(--foil-light); }
.qa-tile:hover { transform: translateY(-4px); box-shadow: 0 20px 36px -22px rgb(121 36 42 / .7); }
.qa-tile:hover .qa-tile-pic img { transform: scale(calc(var(--z, 1) * 1.06)); }
.qa-tile:active { transform: scale(.97); transition-duration: 120ms; }
.qa-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.qa-tile[aria-pressed=true] { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }
.qa-topics.has-pick .qa-tile[aria-pressed=false] { opacity: .62; }
.qa-topics.has-pick .qa-tile[aria-pressed=false]:hover { opacity: 1; }

/* Inside a topic: smaller rounded choices. */
.qa-pages { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.qa-pages[hidden] { display: none; }
.qa-chip { display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 5px 18px; border: 1px solid var(--qa-line); border-radius: 999px; background: var(--white); font: 15px/1.2 var(--font-ui); color: var(--ink); white-space: nowrap; cursor: pointer; touch-action: manipulation; transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, transform 160ms ease; }
.qa-chip:has(img) { padding-left: 5px; }
.qa-chip img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.qa-chip:hover { border-color: var(--accent); color: var(--accent); }
.qa-chip:active { transform: scale(.97); }
.qa-chip[aria-pressed=true] { background: var(--wine); border-color: var(--wine); color: var(--white); }

/* How many, then the cards. */
.qa-ready .qa-count { margin: clamp(24px, 2vw, 34px) 0 14px; font-family: var(--font-ui); font-size: 15px; letter-spacing: .02em; color: var(--muted); }
.qa-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.qa-card { overflow: hidden; border: 1px solid rgb(121 36 42 / .08); border-radius: 20px; background: var(--white); box-shadow: var(--qa-soft); transition: box-shadow 300ms ease, border-color 300ms ease; }
.qa-card[hidden] { display: none; }
.qa-card:hover, .qa-card[open] { border-color: rgb(121 36 42 / .18); box-shadow: 0 1px 2px rgb(51 48 51 / .05), 0 22px 40px -26px rgb(121 36 42 / .55); }
.qa-card > summary { display: flex; align-items: center; gap: 18px; min-height: 86px; padding: 18px 20px 18px 26px; list-style: none; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.qa-card > summary::-webkit-details-marker { display: none; }
.qa-card > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; border-radius: 20px; }
.qa-q { flex: 1; min-width: 0; font-family: var(--font-display); font-size: clamp(20px, 1.25vw, 24px); line-height: 1.25; color: var(--ink); text-wrap: pretty; transition: color 200ms ease; }
.qa-card:hover .qa-q, .qa-card[open] .qa-q { color: var(--wine); }
.qa-icon { position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--surface); transition: background-color 250ms ease; }
.qa-icon::before, .qa-icon::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 1.5px; border-radius: 1px; background: var(--wine); transform: translate(-50%, -50%); transition: transform 320ms var(--qa-ease), background-color 250ms ease; }
.qa-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.qa-card[open] .qa-icon { background: var(--wine); }
.qa-card[open] .qa-icon::before, .qa-card[open] .qa-icon::after { background: var(--white); }
.qa-card[open] .qa-icon::after { transform: translate(-50%, -50%) rotate(0deg); }
.qa-body { overflow: hidden; }
.qa-inner { padding: 0 26px 22px; }
.qa-inner > p { max-width: 68ch; margin: 0; font-size: clamp(18px, 1.05vw, 20px); line-height: 1.55; color: var(--ink); }
.qa-source { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 18px; padding: 8px 18px 8px 8px; border-radius: 16px; background: var(--bg); color: inherit; text-decoration: none; transition: background-color 200ms ease; }
.qa-source:hover { background: var(--surface); }
.qa-source img { flex: none; width: 44px; height: 44px; border-radius: 12px; object-fit: cover; }
.qa-from { display: grid; flex: 1 1 180px; min-width: 0; gap: 1px; }
.qa-from small { font: 11px/1.3 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.qa-from b { font-family: var(--font-display); font-weight: 400; font-size: 18px; line-height: 1.25; color: var(--ink); }
.qa-go { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font: 14px/1.2 var(--font-ui); letter-spacing: .03em; color: var(--accent); white-space: nowrap; }
.qa-go svg { transition: transform 200ms var(--qa-ease); }
.qa-source:hover .qa-go svg { transform: translateX(3px); }

/* Pages: round numbers, the current one filled. */
.qa-pager { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 36px; }
.qa-pager[hidden] { display: none; }
.qa-nums { display: flex; align-items: center; gap: 6px; }
.qa-pager button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 48px; height: 48px; padding: 0 14px; border: 1px solid var(--qa-line); border-radius: 999px; background: var(--white); font: 16px/1 var(--font-ui); color: var(--ink); cursor: pointer; touch-action: manipulation; transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, transform 160ms ease; }
.qa-pager button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.qa-pager button:active:not(:disabled) { transform: scale(.95); }
.qa-pager button[aria-current=page] { background: var(--wine); border-color: var(--wine); color: var(--white); }
.qa-pager button:disabled { opacity: .35; cursor: default; }
.qa-pager .qa-step { padding: 0 20px; }
.qa-dots { min-width: 24px; text-align: center; color: var(--muted); font-family: var(--font-ui); }
.qa-of { display: none; font: 15px/1 var(--font-ui); color: var(--muted); min-width: 64px; text-align: center; }

/* Nothing found, and the way to ask. */
.qa-ready .answers-empty { margin-top: 8px; padding: clamp(28px, 3vw, 48px); border: 0; border-radius: 24px; background: var(--surface); }
.qa-ready .answers-empty .button { border-radius: 999px; }
.qa-ask { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 44px; padding: clamp(22px, 2vw, 32px) clamp(24px, 2.4vw, 40px); border-radius: 24px; background: var(--wine); color: var(--white); }
.qa-ask[hidden] { display: none; }
.qa-ask p { margin: 0; font-family: var(--font-display); font-size: clamp(22px, 1.6vw, 30px); line-height: 1.2; }
.qa-ask a { flex: none; display: inline-flex; align-items: center; min-height: 50px; padding: 0 28px; border-radius: 999px; background: var(--white); color: var(--wine); font: 14px/1 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; transition: transform 160ms ease, background-color 200ms ease; }
.qa-ask a:hover { background: var(--foil-light); }
.qa-ask a:active { transform: scale(.97); }

/* Laptops and tablets: topics in two rows of four. */
@media (max-width: 1279px) {
  .qa-topics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .qa-tile { aspect-ratio: 16 / 10; max-height: 190px; }
  .qa-tile-big { font-size: 46px; }
}
@media (max-width: 999px) {
  .qa-list { grid-template-columns: minmax(0, 1fr); }
}
/* Short laptop windows: lower topic pictures so the first questions show on the first screen. */
@media (min-width: 1280px) and (max-height: 820px) {
  .qa-tile { aspect-ratio: auto; height: 150px; }
  .qa-tile-big { font-size: 44px; }
}

/* Phones: round topic pictures, four to a row, the name under each; one column of cards; Previous · 2 / 33 · Next. */
@media (max-width: 740px) {
  .answers-masthead .page-intro { font-size: 18px; line-height: 1.45; margin-top: 16px; }
  .qa-topics.has-pick .qa-tile[aria-pressed=false] { opacity: .78; }
  .qa-ready .qa-search { padding-left: 16px; }
  .qa-ready .qa-search .button { display: none; }
  .qa-ready .qa-search input { font-size: 17px; min-height: 50px; }
  .qa-topics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 6px; margin-top: 20px; }
  .qa-tile { display: grid; justify-items: center; align-content: start; gap: 7px; aspect-ratio: auto; max-height: none; height: auto; overflow: visible; border-radius: 0; background: none; color: var(--ink); text-align: center; box-shadow: none !important; }
  .qa-tile::after { display: none; }
  .qa-tile-pic { position: relative; inset: auto; width: min(68px, 100%); aspect-ratio: 1; border-radius: 50%; background: var(--surface); transition: box-shadow 300ms var(--qa-ease); }
  .qa-tile--all .qa-tile-pic { background: var(--wine); }
  .qa-tile--all::after { display: none; }
  .qa-tile-big { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; }
  .qa-tile-text { position: static; gap: 1px; }
  .qa-tile-name { font-family: var(--font-ui); font-size: 13px; line-height: 1.2; }
  .qa-tile-count { font-size: 11px; color: var(--muted); opacity: 1; }
  .qa-tile:hover { transform: none; }
  .qa-tile[aria-pressed=true] .qa-tile-pic { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
  .qa-tile[aria-pressed=true] .qa-tile-name { color: var(--accent); }
  .qa-pages { flex-wrap: nowrap; overflow-x: auto; margin: 16px calc(var(--margin) * -1) 0; padding: 2px var(--margin) 6px; scrollbar-width: none; overscroll-behavior-x: contain; }
  .qa-pages::-webkit-scrollbar { display: none; }
  .qa-chip { flex: none; min-height: 44px; font-size: 14px; }
  .qa-ready .qa-count { margin: 22px 0 12px; font-size: 14px; }
  .qa-list { gap: 10px; }
  .qa-card { border-radius: 18px; }
  .qa-card > summary { min-height: 72px; gap: 14px; padding: 14px 14px 14px 18px; }
  .qa-q { font-size: 19px; }
  .qa-icon { width: 34px; height: 34px; }
  .qa-icon::before, .qa-icon::after { width: 12px; }
  .qa-inner { padding: 0 18px 18px; }
  .qa-inner > p { font-size: 17px; }
  .qa-source { padding-right: 14px; }
  .qa-go { margin-left: 52px; }
  .qa-pager { justify-content: space-between; margin-top: 24px; }
  .qa-nums { display: none; }
  .qa-of { display: block; }
  .qa-ask { flex-direction: column; align-items: flex-start; margin-top: 32px; }
  .qa-ask a { width: 100%; justify-content: center; }
}
@media (max-width: 360px) {
  .qa-pager .qa-step span { display: none; }
  .qa-pager .qa-step { padding: 0 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .qa-tile, .qa-tile-pic img, .qa-chip, .qa-card, .qa-icon::before, .qa-icon::after, .qa-pager button, .qa-go svg { transition: none; }
}
