/* Guides: the article (guide.html) and the hub (guides.html). */
@layer page {
  /* ------------------------------------------------------------ article */
  .guide { padding-bottom: var(--sp-6); }
  .guide__layout { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: var(--sp-5); }
  .guide__head { padding-top: var(--sp-3); }
  .guide__head h1 { max-width: 24ch; }
  .guide__byline { display: grid; gap: 0.15rem; margin-top: var(--sp-3); color: var(--ink-2); font-size: var(--fs-s); }
  .guide__byline time { font-variant-numeric: tabular-nums; }

  /* Table of contents: a closed sheet on mobile, a sticky rail from 64em. */
  .guide__toc-sheet { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .guide__toc-sheet summary { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0; font-weight: 600; cursor: pointer; list-style: none; }
  .guide__toc-sheet summary::-webkit-details-marker { display: none; }
  .guide__toc-sheet[open] summary .icon { transform: rotate(180deg); }
  .guide__toc-sheet .guide__toc-list { padding-bottom: var(--sp-3); }
  .guide__toc-title { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); margin-bottom: var(--sp-2); }
  .guide__toc-list { counter-reset: toc; display: grid; }
  .guide__toc-list li { counter-increment: toc; }
  .guide__toc-list a { display: flex; gap: var(--sp-3); padding: 0.35rem 0; color: var(--ink); text-decoration: none; font-size: var(--fs-s); line-height: 1.35; }
  .guide__toc-list a::before { content: counter(toc, decimal-leading-zero); flex: none; color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: var(--fs-xs); padding-top: 0.15em; }
  .guide__toc-list a:hover { color: var(--sea-ink); }
  .guide__toc-list a:hover span { text-decoration: underline; text-underline-offset: 0.14em; }

  /* Body: one measure, a clear rhythm of sections. */
  .guide__body { display: grid; row-gap: var(--sp-7); min-width: 0; }
  .guide__section { scroll-margin-top: calc(var(--header-h) + var(--sp-5)); }
  .guide__section h2 { font-size: var(--fs-xl); margin-bottom: var(--sp-3); }
  .guide__prose { line-height: 1.6; }
  .guide__section:first-child .guide__prose > p:first-child { font-size: 1.1875rem; line-height: 1.5; }

  /* Questions buyers ask */
  .faq { border-top: 1px solid var(--line); }
  .faq__item { border-bottom: 1px solid var(--line); }
  .faq__item summary { display: flex; justify-content: space-between; gap: var(--sp-3); align-items: center; padding: var(--sp-3) 0; font-weight: 600; cursor: pointer; list-style: none; }
  .faq__item summary::-webkit-details-marker { display: none; }
  .faq__item summary:hover { color: var(--sea-ink); }
  .faq__item summary .icon { color: var(--ink-3); }
  .faq__item[open] summary .icon { transform: rotate(180deg); }
  .faq__answer { padding-bottom: var(--sp-4); }

  /* Author */
  .guide__author { display: flex; gap: var(--sp-4); align-items: flex-start; padding: var(--sp-5); }
  .guide__author-photo { width: 4.5rem; height: 4.5rem; border-radius: 50%; object-fit: cover; flex: none; }
  .guide__author-text { display: grid; gap: var(--sp-1); min-width: 0; }
  .guide__author-name { font-weight: 650; font-size: var(--fs-l); line-height: 1.25; }
  .guide__author-name a { color: var(--ink); text-decoration: none; }
  .guide__author-name a:hover { text-decoration: underline; }
  .guide__author-role { color: var(--ink-2); font-size: var(--fs-s); }
  .guide__author-note { margin-top: var(--sp-2); font-size: var(--fs-s); }
  .guide__author .cluster { margin-top: var(--sp-3); }

  /* Explore: the pages this guide is about, then the rest of the site. */
  .guide__explore h2 { font-size: var(--fs-xl); }
  .guide__explore-label { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); margin-top: var(--sp-4); }
  .guide__links { border-top: 1px solid var(--line); margin-top: var(--sp-2); }
  .guide__links li { border-bottom: 1px solid var(--line); }
  .guide__links a { display: flex; align-items: baseline; gap: var(--sp-3); padding: var(--sp-3) 0; color: var(--ink); text-decoration: none; }
  .guide__links a > span:first-child { font-weight: 600; }
  .guide__links-kind { color: var(--ink-3); font-size: var(--fs-xs); }
  .guide__links .icon { margin-left: auto; align-self: center; color: var(--ink-3); }
  .guide__links a:hover > span:first-child { text-decoration: underline; text-underline-offset: 0.14em; }
  .guide__links a:hover .icon { color: var(--ink); }

  @media (min-width: 48em) {
    .guide__byline { display: flex; flex-wrap: wrap; gap: 0.25rem var(--sp-3); }
    .guide__byline span + span::before { content: "·"; margin-right: var(--sp-3); color: var(--line-2); }
    .guide__prose { font-size: 1.125rem; }
    .guide__section:first-child .guide__prose > p:first-child { font-size: 1.3125rem; }
  }
  @media (min-width: 64em) {
    .guide__layout { grid-template-columns: 12rem minmax(0, 42rem); column-gap: var(--sp-8); row-gap: var(--sp-6); justify-content: start; }
    .guide__head { grid-column: 2; padding-top: var(--sp-4); }
    .guide__toc { grid-column: 1; grid-row: 2; position: sticky; top: calc(var(--header-h) + var(--sp-5)); align-self: start; }
    .guide__body { grid-column: 2; grid-row: 2; row-gap: calc(var(--sp-7) + var(--sp-2)); }
  }

  /* ---------------------------------------------------------------- hub */
  .guides { max-width: 48rem; padding-bottom: var(--sp-6); }
  .guides__head { padding-top: var(--sp-3); margin-bottom: var(--sp-6); }
  .guides__head .section__lead { margin-top: var(--sp-3); }
  .guides__list { border-top: 1px solid var(--line); }
  .guides__list li { border-bottom: 1px solid var(--line); }
  .guides__item { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-5) 0; color: var(--ink); text-decoration: none; }
  .guides__num { flex: none; width: 2ch; color: var(--ink-3); font-size: var(--fs-s); }
  .guides__title { font-size: var(--fs-l); font-weight: 650; line-height: 1.3; letter-spacing: -0.01em; text-wrap: balance; }
  .guides__item .icon { margin-left: auto; color: var(--ink-3); }
  .guides__item:hover .guides__title { text-decoration: underline; text-underline-offset: 0.14em; }
  .guides__item:hover .icon { color: var(--ink); }
  .guides__agent { margin-top: var(--sp-7); }
  @media (min-width: 64em) {
    .guides__head { padding-top: var(--sp-5); }
    .guides__title { font-size: var(--fs-xl); }
  }
}
