/* QTK Fine Cabinetry, reading pages: the journal articles, the privacy policy and the terms of service
   Loaded after home.css, which brings the tokens, the bar, buttons, links and the footer. */

/* ---------- intro: a way back, the title, the date ---------- */
.page-intro { padding: calc(var(--bar) + clamp(3rem, 9vh, 6rem)) var(--margin) 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
.page-back { grid-column: 1 / -1; justify-self: start; font-size: var(--step-small); color: var(--muted); }
.page-back span { display: inline-block; transition: translate var(--t-ui) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .page-back:hover span { translate: -4px 0; } }
.page-title { grid-column: 1 / span 10; margin-top: 1.25rem; font-size: clamp(2.5rem, 1.2rem + 4.4vw, 5.5rem); font-weight: 500; line-height: 0.98; letter-spacing: -0.04em; }
.page-meta { grid-column: 1 / -1; margin-top: clamp(1.5rem, 4vh, 2.25rem); display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; font-size: var(--step-small); color: var(--muted); }

.article-pic { margin: clamp(2.5rem, 7vh, 4.5rem) var(--margin) 0; }
.article-pic img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface); }

/* ---------- article body: heading in the left column, the text beside it ---------- */
.article { padding: clamp(3rem, 8vh, 5rem) var(--margin) 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
.article > * { grid-column: 4 / span 6; }
.article p { line-height: 1.6; }
.article p + p { margin-top: 1rem; }
.article-lead { font-size: var(--step-lead); line-height: 1.35 !important; margin-bottom: clamp(3rem, 8vh, 5rem); }

/* No numbers: each section is a row, its heading sits in the margin and stays put while the text scrolls */
.tip-number, .step-badge { display: none; }
.article > .tip-block, .article > .step-block,
.article > .blog-warning, .article > .timeline-box { grid-column: 1 / span 9; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); column-gap: var(--gutter); }
.tip-content, .step-content { display: contents; }
.tip-content h2, .step-content h2, .warning-label, .timeline-box h3 {
  grid-column: 1 / span 3; grid-row: 1 / span 6; align-self: start;
  position: sticky; top: calc(var(--bar) + 1.5rem);
  font-size: var(--step-body); font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; max-width: 18ch;
}
.tip-content > p, .step-content > p, .blog-warning > p, .timeline-row { grid-column: 4 / -1; }
.tip-content > p:first-of-type, .step-content > p:first-of-type { margin-top: 0; }
.article > .tip-divider, .article > .step-divider { grid-column: 1 / span 9; border: 0; border-top: 1px solid var(--surface-2); margin: clamp(3rem, 7vh, 4.5rem) 0; }

/* the warning and the timeline read as one more section, not as boxes */
.tip-divider + .blog-warning, .step-divider + .timeline-box { margin-top: 0; }
.blog-warning { margin-bottom: clamp(3rem, 7vh, 4.5rem); padding-bottom: clamp(3rem, 7vh, 4.5rem); border-bottom: 1px solid var(--surface-2); }
.warning-label { color: var(--accent); }
.timeline-box { margin-bottom: clamp(3rem, 7vh, 4.5rem); padding-bottom: clamp(3rem, 7vh, 4.5rem); border-bottom: 1px solid var(--surface-2); }
.timeline-box h3 { color: var(--ink); }
.timeline-row { display: flex; justify-content: space-between; gap: 1.5rem; padding: 0.75rem 0; border-top: 1px solid var(--surface-2); }
.timeline-row:last-child { border-bottom: 1px solid var(--surface-2); }
.timeline-duration { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

.blog-closing { margin-top: clamp(3.5rem, 9vh, 5.5rem); }
.blog-closing p { font-size: var(--step-lead); line-height: 1.35 !important; }

.blog-cta {
  margin-top: var(--section); padding: clamp(5rem, 10vw, 8rem) var(--margin);
  background: var(--dark); color: var(--dark-ink);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: end;
}
.blog-cta h2 { grid-column: 1 / span 6; font-size: var(--step-head); line-height: 1; letter-spacing: -0.035em; }
.blog-cta p { grid-column: 8 / -1; color: var(--dark-muted); max-width: 34ch; }
.blog-cta .button { grid-column: 8 / -1; justify-self: start; margin-top: 1.5rem; }
.blog-cta { border-bottom: 1px solid rgba(235, 229, 227, 0.12); }

/* ---------- legal: contents on the left, the text on the right ---------- */
.policy-wrapper { padding: clamp(3rem, 8vh, 5rem) var(--margin) var(--section); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: start; }
.toc { grid-column: 1 / span 4; position: sticky; top: calc(var(--bar) + 1rem); max-height: calc(100svh - var(--bar) - 2rem); overflow-y: auto; overscroll-behavior: contain; padding-right: 1rem; scrollbar-width: thin; }
.toc h2 { font-size: var(--step-small); font-weight: 500; margin-bottom: 0.75rem; }
.toc ol { counter-reset: toc; display: grid; gap: 0.45rem; font-size: 0.8125rem; color: var(--muted); }
.toc li { counter-increment: toc; display: grid; grid-template-columns: 2rem minmax(0, 1fr); }
.toc li::before { content: counter(toc, decimal-leading-zero); font-variant-numeric: tabular-nums; }
.toc a { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.2em; transition: color var(--t-hover) ease, text-decoration-color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) { .toc a:hover { color: var(--ink); text-decoration-color: currentColor; } }

.policy-content { grid-column: 6 / -1; max-width: 46rem; }
.policy-content p, .policy-content li { line-height: 1.6; }
.policy-content p + p, .policy-content p + ul, .policy-content ul + p { margin-top: 1rem; }
.policy-content ul { list-style: disc; padding-left: 1.25em; display: grid; gap: 0.6rem; margin-top: 1rem; }
.policy-content a:not(.button) { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 0.07em; transition: color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) { .policy-content a:not(.button):hover { color: var(--accent); } }
.policy-content strong { font-weight: 500; }

.policy-intro { font-size: var(--step-body); }
.summary-card { margin-top: 3rem; padding: clamp(1.5rem, 3vw, 2.25rem); background: var(--surface); }
.summary-card h2 { font-size: var(--step-lead); font-weight: 500; letter-spacing: -0.01em; margin-bottom: 0.75rem; }
.summary-item { padding: 1rem 0; border-top: 1px solid var(--surface-2); line-height: 1.6; }
.summary-item strong { display: block; margin-bottom: 0.25rem; }

.policy-section { margin-top: clamp(3.5rem, 8vh, 5rem); scroll-margin-top: calc(var(--bar) + 1rem); }
.section-header { display: grid; gap: 0.5rem; margin-bottom: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--surface-2); }
.section-num { font-size: var(--step-small); color: var(--muted); font-variant-numeric: tabular-nums; }
.section-header h2 { font-size: var(--step-lead); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }
.sub-section { margin-top: 2rem; scroll-margin-top: calc(var(--bar) + 1rem); }
.sub-section h3 { font-weight: 500; margin-bottom: 0.5rem; }
.short-label { font-style: italic; color: var(--muted); }
.caps-block { font-size: 0.875em; }
.address-block { margin-top: 1rem; padding: 1.25rem 1.5rem; background: var(--surface); line-height: 1.7; }

/* ---------- tablet ---------- */
@media (max-width: 60em) {
  .article > * { grid-column: 3 / span 9; }
  .article > .tip-block, .article > .step-block, .article > .blog-warning, .article > .timeline-box,
  .article > .tip-divider, .article > .step-divider { grid-column: 1 / -1; grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .tip-content h2, .step-content h2, .warning-label, .timeline-box h3 { grid-column: 1 / span 4; }
  .tip-content > p, .step-content > p, .blog-warning > p, .timeline-row { grid-column: 5 / -1; }
  .policy-wrapper { display: block; }
  .toc { position: static; max-height: none; overflow: visible; padding: 1.5rem; background: var(--surface); }
  .policy-content { max-width: none; margin-top: 3rem; }
  .blog-cta h2, .blog-cta p, .blog-cta .button { grid-column: 1 / -1; }
  .blog-cta p { margin-top: 1.5rem; }
}

/* ---------- phone ---------- */
@media (max-width: 40em) {
  .page-intro { padding-top: calc(var(--bar) + 2rem); }
  .page-title { grid-column: 1 / -1; font-size: 10vw; }
  .article-pic { margin-top: 2rem; margin-inline: 0; }
  .article > * { grid-column: 1 / -1; }
  .article > .tip-block, .article > .step-block, .article > .blog-warning, .article > .timeline-box { display: block; }
  .tip-content h2, .step-content h2, .warning-label, .timeline-box h3 { position: static; max-width: none; margin-bottom: 1rem; font-size: var(--step-lead); }
  .article-lead, .blog-closing p { font-size: 1.25rem; }
  .toc { padding: 1.25rem; }
  .timeline-row { flex-direction: column; gap: 0.15rem; }
  .timeline-duration { text-align: left; }
}
