/* Guides, templates and feature pages — additions on top of styles.css + pages.css.
   Also styles .shots/.srcs/.rel, which the live tracker markup uses but no stylesheet defined. */

/* Byline: "By … · Updated … · N min read". Each part draws its dot just left of itself, inside the gap
   after the previous part. A part that starts a line has its dot outside the row, where overflow clips
   it — so a wrapped byline (on a phone) never begins with a stray dot. */
.page .byline { display: flex; flex-wrap: wrap; row-gap: 4px; overflow: hidden; }
.page .byline span { position: relative; margin-right: 24px; }
.page .byline span::before { content: "·"; position: absolute; left: -15px; color: var(--ink-soft); }

/* The short answer — first thing under the hero, written for snippets and answer engines. */
.page .answer-box {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid #6C5CE7;
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 24px 0 8px;
  max-width: 52rem;
}
.page .answer-box__label {
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--violet); margin: 0 0 6px;
}
.page .answer-box p:last-child { margin: 0; color: var(--ink); font-size: 1.05rem; line-height: 1.6; }

/* Callouts */
.page .callout {
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 16px 0;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}
.page .callout p { margin: 0 0 8px; }
.page .callout p:last-child { margin-bottom: 0; }
.page .callout .ul { margin-top: 8px; }
.page .callout__title { font-weight: 700; color: var(--ink) !important; margin-bottom: 8px !important; }
.page .callout--warn { background: #FFF7ED; border-color: #FED7AA; }
.page .callout--warn .callout__title::before { content: "! "; color: #C2410C; font-weight: 800; }
.page .callout--note { background: #F5F3FF; border-color: #DDD6FE; }
.page .callout--lilac { background: #f7f5ff; border-color: #e4dcff; }

/* Citations and references */
.page sup.cite { font-size: .72em; line-height: 0; margin-left: 1px; }
.page sup.cite a { text-decoration: none !important; font-weight: 700; color: var(--violet); padding: 0 1px; }
.page sup.cite + sup.cite::before { content: ","; color: var(--ink-soft); }
.page .refs { padding-left: 1.4rem; display: flex; flex-direction: column; gap: 10px; color: var(--ink-muted); font-size: 14px; line-height: 1.5; }
.page .refs span, .page .srcs span { display: block; color: var(--ink-soft); font-size: 13px; }
.page .refs li:target { background: #F5F3FF; border-radius: 8px; }
.page .srcs { padding-left: 1.1rem; display: flex; flex-direction: column; gap: 10px; list-style: disc; color: var(--ink-muted); font-size: 14px; }

/* Screenshots */
.page .shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; margin: 16px 0 8px; align-items: start; }
.page .shot { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.page .shot figcaption { font-size: 13px; color: var(--ink-soft); line-height: 1.45; text-align: center; max-width: 240px; }
/* Framed screenshots carry their own device frame (a 210 × 424 phone in a 250 px image, 20 px of air above
   and below). Plain screenshots get the same frame in CSS, sized to the same height, so a row matches. */
.page .shot--framed img { width: min(250px, 100%); height: auto; filter: drop-shadow(0 16px 24px rgba(10, 10, 11, .12)); }
.page .shot .iphone--sm { width: min(204px, 100%); margin: 20px 0; padding: 6px; background: #0b0b0c; border: 2px solid #d3c4a6; border-radius: 36px; box-shadow: 0 16px 28px rgba(10, 10, 11, .14); }
.page .shot .iphone--sm .iphone__screen { border-radius: 28px; overflow: hidden; }
.page .shot .iphone--sm .iphone__screen img { width: 100%; height: auto; filter: none; border-radius: 0; }

/* Related links */
.page .rel { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 40px; }
.page .rel h3 { margin-bottom: 10px; }

/* Data figures */
.page .fig--chart img { background: #fff; border: 1px solid var(--line); }
.page .fig picture { display: block; }
/* The figure under a guide's intro keeps to the width of the short answer above it; at full width a
   720-wide chart was drawn at 1.6× and its labels outgrew the headings. */
.page .section--wiki .wrap > .fig { max-width: 52rem; }
.page .fig--diagram img { background: #fff; border: 1px solid var(--line); max-width: 720px; }
.page .num { font-variant-numeric: tabular-nums; }
.page table.cmp--data td, .page table.cmp--data th { font-variant-numeric: tabular-nums; }
.page table.cmp thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }

/* Key figures row */
.page .keyfigs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 14px 0; }
.page .keyfig { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.page .keyfig strong { display: block; font-size: 1.6rem; letter-spacing: -.03em; color: var(--ink); line-height: 1.1; }
.page .keyfig span { display: block; font-size: 13px; color: var(--ink-muted); margin-top: 6px; line-height: 1.4; }

/* Checklists (doctor questions, printable previews) */
.page .checks { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.page .checks li { position: relative; padding-left: 30px; color: var(--ink-muted); line-height: 1.6; }
.page .checks li::before { content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border: 2px solid #6C5CE7; border-radius: 5px; }

/* Templates */
.page .tpl-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; margin-top: 24px; }
.page .tpl-preview { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px; box-shadow: 0 18px 40px rgba(10, 10, 11, .08); }
.page .tpl-preview img { width: 100%; height: auto; border-radius: 8px; display: block; }
/* Download buttons: the page's main action, so a filled button for US Letter and an outlined one for A4. */
.page .dl-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.page .dl-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px; border: 1.5px solid var(--ink); border-radius: var(--radius-pill); background: #fff; color: var(--ink); font-size: 15px; font-weight: 600; white-space: nowrap; transition: background-color .15s ease-out, transform .1s ease-out; }
.page .dl-btn:hover { background: var(--bg-soft); }
.page .dl-btn:active { transform: scale(.98); }
.page .dl-btn:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.page .dl-btn--primary { background: #0a0a0b; border-color: #0a0a0b; color: #fff; }
.page .dl-btn--primary:hover { background: #1f1f23; }
.page .dl-btn__icon { flex: none; }
.page .dl-btn__meta { font-size: 13px; font-weight: 500; opacity: .72; font-variant-numeric: tabular-nums; }

/* Hub cards grouped by section */
.page .hub-sec { display: flex; flex-direction: column; gap: 16px; scroll-margin-top: calc(var(--nav-h) + 24px); }
.page .hub-sec > p { color: var(--ink-muted); max-width: 44rem; }

/* Hubs: links to each section under the intro, then cards two (or, with pictures, three) to a row.
   A card in these layouts is one link — the title's hit area is stretched over the whole card. */
.page .hub-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.page .hub-jump a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid rgba(10, 10, 11, .14); border-radius: var(--radius-pill); background: #fff; font-size: 14px; font-weight: 600; transition: border-color .15s ease-out; }
.page .hub-jump a span { font-size: 12px; font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.page .hub-jump a:hover { border-color: rgba(10, 10, 11, .36); }
.page .hub-jump a:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.page .idx-list--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.page .idx-list--thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.page .idx-list--grid .idx-item, .page .idx-list--thumbs .idx-item { position: relative; transition: box-shadow .15s ease-out, transform .15s ease-out; }
.page .idx-list--grid .idx-item a::after, .page .idx-list--thumbs .idx-item a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.page .idx-list--grid .idx-item:hover, .page .idx-list--thumbs .idx-item:hover { box-shadow: 0 12px 28px rgba(10, 10, 11, .08); transform: translateY(-2px); }
.page .idx-item:has(a:focus-visible) { outline: 2px solid var(--violet); outline-offset: 2px; }
@supports selector(:has(a)) { .page .idx-list--grid .idx-item a:focus-visible, .page .idx-list--thumbs .idx-item a:focus-visible { outline: none; } }
.page .idx-item--thumb { padding: 0; overflow: hidden; border-left: 1px solid var(--line); }
.page .idx-thumb { padding: 24px 24px 0; background: linear-gradient(160deg, #efebff 0%, #f7f3ff 48%, #f4f2fa 100%); }
.page .idx-thumb img { width: 100%; height: auto; border-radius: 6px 6px 0 0; box-shadow: 0 8px 24px rgba(10, 10, 11, .10); }
.page .idx-thumb--phone { padding: 0; }
.page .idx-thumb--phone img { border-radius: 0; box-shadow: none; filter: drop-shadow(0 12px 16px rgba(10, 10, 11, .16)); }
.page .idx-item--thumb a { display: block; margin: 20px 24px 8px; }
.page .idx-item--thumb p { margin: 0 24px 24px; }
@media (prefers-reduced-motion: reduce) {
  .page .idx-list--grid .idx-item:hover, .page .idx-list--thumbs .idx-item:hover { transform: none; }
}
@media (max-width: 960px) { .page .idx-list--thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Glossary */
.page .gloss { display: flex; flex-direction: column; gap: 4px; }
.page .gloss dt { font-weight: 700; color: var(--ink); margin-top: 18px; scroll-margin-top: calc(var(--nav-h, 64px) + 16px); }
.page .gloss dd { margin: 4px 0 0; color: var(--ink-muted); line-height: 1.65; }
.page .gloss-az { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.page .gloss-az a { display: inline-flex; min-width: 34px; height: 34px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; font-weight: 700; font-size: 14px; background: #fff; }
.page .gloss dfn { font-style: normal; }
.page .toc--letters .toc-box ol { list-style: none; padding: 0; flex-direction: row; flex-wrap: wrap; gap: 6px; }
.page .toc--letters .toc-box a { display: inline-flex; min-width: 30px; height: 30px; align-items: center; justify-content: center; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 700; }

.page .wiki-sec h3 { font-size: 1.05rem; margin: 18px 0 8px; color: var(--ink); }
.page .wiki-body ol.ol, .page .wiki-body ul.ul { margin: 0 0 12px; }
.page .wiki-sec { scroll-margin-top: calc(var(--nav-h, 64px) + 16px); }

@media (max-width: 720px) {
  .page .rel, .page .tpl-hero, .page .idx-list--grid, .page .idx-list--thumbs { grid-template-columns: 1fr; }
  .page .answer-box { padding: 16px 18px; }
}

@media print {
  .announce, .nav, .footer, .crumbs, .toc, .skip { display: none !important; }
}

/* A framed app screenshot used as a page's hero figure */
.page .fig--shot { display: flex; flex-direction: column; align-items: center; }
.page .fig--shot img { width: min(300px, 80%); height: auto; background: transparent; border-radius: 0; filter: drop-shadow(0 18px 30px rgba(10, 10, 11, .14)); }
/* A plain screenshot as the hero gets the device frame the framed images carry, at the same phone
   height (244 wide ≈ the 252 × 509 phone inside a 300 px framed image). The rounded border also clips
   the screenshot's corners concentrically. */
.page .fig--shot img[src*="/shots17/"] { width: min(244px, 72%); margin: 20px 0; padding: 7px; background: #0b0b0c; border: 2px solid #d3c4a6; border-radius: 42px; filter: none; box-shadow: 0 18px 30px rgba(10, 10, 11, .14); }
.page .fig--shot figcaption { text-align: center; max-width: 36rem; }

/* Read by screen readers, not shown */
.page .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Image credits: where a picture comes from, under its caption */
.page .fig-credit { display: block; margin-top: 4px; font-size: 12px; color: var(--ink-soft); }
.page .shots-credit { margin-top: 8px; font-size: 12px; color: var(--ink-soft); text-align: center; }
/* App icons in comparisons */
.page .app-icons { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; margin: 8px 0 4px; }
.page .app-icon { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 96px; text-align: center; font-size: 13px; font-weight: 600; color: var(--ink); }
.page .app-icon img { width: 72px; height: 72px; border-radius: 16px; box-shadow: 0 1px 2px rgba(10, 10, 11, .08), 0 0 0 1px rgba(10, 10, 11, .06); }
.page .cell-icon { display: inline-flex; align-items: center; gap: 8px; }
.page .cell-icon img { width: 28px; height: 28px; border-radius: 7px; box-shadow: 0 0 0 1px rgba(10, 10, 11, .06); flex: none; }
/* Promo card linking a hub to a sub-hub */
.page .hub-promo { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 20px 24px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); }
.page .hub-promo h2 { font-size: 18px; margin: 0 0 4px; }
.page .hub-promo p { margin: 0; color: var(--ink-muted); }

/* Data tables whose later columns are figures ("25.6 g", "125 kcal", "FDC 171496"): keep each figure on one line. */
.cmp--nums td:nth-of-type(n+2) { white-space: nowrap; }

/* A photograph under a guide's intro. The site's photos are 600–760 px wide, so they stay at card size
   (sharp on a 2× screen) beside their caption instead of being stretched across the column. */
.page .fig--portrait { display: grid; grid-template-columns: minmax(0, 320px) 1fr; gap: 8px 28px; align-items: end; }
.page .fig--portrait img { aspect-ratio: 4 / 5; object-fit: cover; object-position: center 22%; }
.page .fig--portrait figcaption { margin-top: 0; max-width: 34ch; }
@media (max-width: 640px) {
  .page .fig--portrait { grid-template-columns: 1fr; }
  .page .fig--portrait img { max-width: 360px; }
}
.page .app-icon { margin: 0; width: 150px; }
.page .app-icon figcaption { margin: 0; line-height: 1.3; }
.page .app-icon figcaption span { display: block; font-weight: 400; font-size: 12px; color: var(--ink-soft); }

/* Grid children default to their content's minimum width, so a wide data table (cells that must not wrap) would
   widen the whole column on a phone. With min-width: 0 the table scrolls inside .cmp-scroll instead. */
.page .wiki > * { min-width: 0; }
