/*
 * Every page but the homepage: articles, pages, the lists (Guides, a section, a tag, search), Foods and "not found".
 * docs/DESIGN.md is the brief and home.css the reference: a white page, hairlines not shadows, 6 px corners, words 7:1
 * on their ground, nothing under 16 px, targets 44 px. An article reads in a 720 px column that starts two columns in on
 * the 12-column grid; its head, picture and reading clock take more of the grid; a piece with class "wide" takes it all.
 * No side rail.
 */

html { scroll-padding-top: 72px; }

.frame { display: block; padding-top: 22px; }
.frame .wrap { padding-bottom: 0; }

/* ---- Breadcrumbs ------------------------------------------------------------------------------------------------- */

.frame nav[aria-label="Breadcrumb"] ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; column-gap: 10px; font-size: var(--label); font-weight: 500; color: var(--smoke); }
.frame nav[aria-label="Breadcrumb"] li { display: inline-flex; align-items: center; min-height: 44px; }
.frame nav[aria-label="Breadcrumb"] li + li::before { content: "/"; margin-right: 10px; color: var(--smoke); }
.frame nav[aria-label="Breadcrumb"] a { color: var(--smoke); font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.frame nav[aria-label="Breadcrumb"] a:hover { color: var(--char); text-decoration: underline; text-decoration-thickness: 2px; }
.frame nav[aria-label="Breadcrumb"] [aria-current] { color: var(--smoke); }
/* On a phone the current page's own crumb is dropped (the title is right under it) and "Home / Section" stays on one line. */
@media (max-width: 699px) {
  .frame nav[aria-label="Breadcrumb"] ol { flex-wrap: nowrap; }
  .frame nav[aria-label="Breadcrumb"] li:has(> [aria-current]) { display: none; }
}

/* ---- The head of an article or page ------------------------------------------------------------------------------ */

.art-head h1 { margin-top: 10px; }
.art-sum { margin-top: 16px; font-size: 21px; line-height: 1.45; color: var(--smoke); max-width: 36em; }
.page-meta, .page-upd { margin-top: 18px; font-size: var(--label); line-height: 1.5; color: var(--smoke); }
.page-meta time, .page-upd time { color: var(--char); font-weight: 600; }
.list-kind { font-size: var(--label); font-weight: 700; color: var(--ember-deep); margin-top: 8px; }
.list-kind + h1 { margin-top: 2px; }
@media (min-width: 1024px) {
  .art-sum { font-size: 24px; }
}

/* ---- The featured picture, with its heat twin: the seam figure ---------------------------------------------------- */

.art .ftg-figure { display: grid; grid-template-columns: minmax(0, 1fr); margin: 24px calc(-1 * var(--edge)) 0; touch-action: pan-y; }
.ftg-figure > img, .ftg-figure > picture, .ftg-figure > .hx-seam, .ftg-figure > .hx-range { grid-area: 1 / 1; }
.ftg-figure > img, .ftg-figure > picture img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: #CFC7BC; }
.ftg-figure figcaption { grid-row: 2; margin-top: 10px; padding: 0 var(--edge); font-size: var(--label); line-height: 1.45; color: var(--smoke); max-width: 52em; }
.hx-heat { clip-path: inset(0 calc(100% - var(--seam, 0%)) 0 0); pointer-events: none; }
.hx-seam { position: relative; width: 100%; aspect-ratio: 16 / 9; pointer-events: none; }
.hx-seam::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--seam, 0%) - 1px); width: 2px; background: var(--white); opacity: 0; }
.has-heat .hx-seam::before { opacity: 1; }
.hx-grip { position: absolute; top: 50%; left: clamp(22px, var(--seam, 0%), calc(100% - 22px)); width: 36px; height: 44px; margin: -22px 0 0 -18px; border-radius: 6px; background: var(--white); box-shadow: var(--raise); }
.hx-grip::before, .hx-grip::after { content: ""; position: absolute; top: 15px; width: 0; height: 0; border: 7px solid transparent; }
.hx-grip::before { left: 2px; border-right-color: var(--char); }
.hx-grip::after { right: 2px; border-left-color: var(--char); }
.hx-on > .hx-photo, .hx-on > .hx-heat { cursor: ew-resize; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.hx-range { align-self: end; width: 100%; height: 44px; margin: 0; opacity: 0; pointer-events: none; }
.ftg-figure:has(.hx-range:focus-visible) .hx-grip { outline: 2px solid var(--char); outline-offset: 2px; }
.ftg-figure:has(.hx-range) figcaption { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 14px; }
.hx-label { display: inline-flex; align-items: center; gap: 2px; padding: 10px 0; color: var(--char); font-weight: 700; line-height: 24px; cursor: pointer; }
.hx-label::before, .hx-label::after { content: ""; width: 0; height: 0; border: 6px solid transparent; }
.hx-label::before { order: -2; border-right-color: var(--char); border-left-width: 0; }
.hx-label::after { order: -1; margin-right: 8px; border-left-color: var(--char); border-right-width: 0; }
.hx-what { flex: 1 1 20em; }
.no-js .hx-heat, .no-js .hx-seam, .no-js .hx-range, .no-js .hx-label { display: none; }
@media (min-width: 700px) {
  .art .ftg-figure { margin-inline: 0; }
  .ftg-figure > img, .ftg-figure > picture img, .hx-seam { border-radius: 4px; }
  .ftg-figure figcaption { padding: 0; }
}

/* ---- The reading clock ------------------------------------------------------------------------------------------- */

.rc-slot { margin-top: 28px; }
.rc { background: var(--white); }
.rc p { margin: 0; }
.rc-head { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.rc-label { font-size: var(--label); font-weight: 600; color: var(--smoke); }
.rc-total { margin-left: 12px; color: var(--char); font-weight: 700; }
.rc-now, .rc-toggle, .rc-strip, .rc-own:empty { display: none; }
.rc-list { list-style: none; margin: 0; padding: 0; }
.rc-seg a { color: var(--char); text-decoration: none; }
.rc-seg a:focus-visible { outline: 2px solid var(--char); outline-offset: 2px; }
.rc-min { font-size: var(--label); font-weight: 800; line-height: 1.2; white-space: nowrap; }
.rc-u { font-weight: 500; color: var(--smoke); }
.rc-bar, .rc-cell { position: relative; display: block; overflow: hidden; background: var(--line); border-radius: 2px; }
.rc-bar i, .rc-cell i { position: absolute; inset: 0; background: var(--char); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
.is-now > a .rc-bar i, .rc-cell.is-now i { background: var(--ember-deep); }
.rc-name { font-size: var(--label); line-height: 1.3; color: var(--smoke); }
.rc-seg.is-now .rc-name { color: var(--char); font-weight: 700; }
.rc-seg a:hover .rc-name { color: var(--char); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .18em; }

/* As rows: a phone without JavaScript, and the list the Sections button opens. */
.rc-list .rc-seg a { display: grid; grid-template-columns: 4.6em minmax(0, 1fr); align-items: baseline; column-gap: 12px; min-height: 48px; padding: 11px 0; border-top: 1px solid var(--line); }
.rc-list .rc-bar { display: none; }

/* The ribbon: each section a segment as wide as its words, its starting minute over it, its name under it. */
@media (min-width: 900px) {
  .rc:not(.is-open) .rc-list { display: flex; flex-wrap: wrap; gap: 18px 4px; margin-top: 8px; }
  .rc:not(.is-open) .rc-list .rc-seg { flex: var(--g, 1) 1 112px; min-width: 0; }
  .rc:not(.is-open) .rc-list .rc-seg a { display: flex; flex-direction: column; align-items: stretch; min-height: 44px; padding: 0 8px 4px 0; border: 0; }
  .rc:not(.is-open) .rc-list .rc-bar { display: block; height: 10px; margin: 6px 0 8px; }
  .rc:not(.is-open) .rc-name { overflow-wrap: break-word; }
}

/* With the script on a phone: one line (the minute and the section being read), the strip under it, and the list folded
   under the Sections button. */
.rc-toggle { margin-left: auto; min-height: 44px; padding: 0 4px 0 12px; border: 0; background: none; font-size: var(--label); font-weight: 700; color: var(--char); cursor: pointer; white-space: nowrap; align-items: center; gap: 8px; }
.rc-toggle::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .2s ease; }
.rc-toggle[aria-expanded="true"]::after { transform: translateY(2px) rotate(-135deg); }
.rc-toggle:focus-visible { outline: 2px solid var(--char); outline-offset: 2px; }
.rc-now { align-items: baseline; gap: 10px; min-width: 0; flex: 1; font-size: var(--label); line-height: 1.3; }
.rc-now-min { flex: none; font-weight: 800; }
.rc-now-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.rc-strip { gap: 2px; height: 6px; margin: 0; }
.rc-cell { flex: 1 1 0; min-width: 4px; }
@media (max-width: 899px) {
  .js .rc.is-live .rc-label { display: none; }
  .js .rc.is-live .rc-now { display: flex; }
  .js .rc.is-live .rc-toggle { display: inline-flex; }
  .js .rc.is-live .rc-strip { display: flex; margin-top: 4px; }
  .js .rc.is-live:not(.is-open) .rc-list { display: none; }
  .js .rc.is-live.is-open .rc-list { margin-top: 10px; }
  .rc-slot { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px 0 12px; }
  .no-js .rc-slot { padding-bottom: 0; }
}

/* Pinned: a 48 px band at the top of the screen once the reader has scrolled past the clock. */
.rc.is-pinned { position: fixed; top: 0; left: 0; right: 0; z-index: 30; height: 48px; display: flex; align-items: center; gap: 24px; padding: 0 max(var(--edge), calc((100vw - var(--wrap)) / 2)); border-bottom: 1px solid var(--line); }
.rc.is-pinned .rc-head { flex: 0 1 460px; min-width: 0; min-height: 47px; }
.rc.is-pinned .rc-label, .rc.is-pinned .rc-own { display: none; }
.rc.is-pinned .rc-now { display: flex; }
.rc.is-pinned .rc-toggle { display: inline-flex; }
.rc.is-pinned .rc-strip { display: flex; flex: 1; height: 8px; }
.rc.is-pinned .rc-list { display: none; }
.rc.is-pinned.is-open .rc-list { display: block; position: absolute; top: 48px; left: 0; right: 0; max-height: min(70vh, 560px); overflow: auto; overscroll-behavior: contain; padding: 0 max(var(--edge), calc((100vw - var(--wrap)) / 2)) 8px; background: var(--white); border-bottom: 1px solid var(--line); }
.rc.is-pinned.is-open .rc-list .rc-seg a { max-width: 720px; }
@media (max-width: 899px) {
  .rc.is-pinned { gap: 0; }
  .rc.is-pinned .rc-head { flex: 1; }
  .rc.is-pinned .rc-strip { position: absolute; left: 0; right: 0; bottom: -1px; height: 4px; gap: 1px; margin: 0; }
  .rc.is-pinned .rc-cell { border-radius: 0; }
}

/* An article's own shape of the clock stands in for the ribbon where it sits; pinned, the band is the frame's. */
.rc-has-own .rc:not(.is-pinned):not(.is-open) .rc-list { display: none; }
.rc-has-own .rc:not(.is-pinned) .rc-strip { display: none; }
.rc-has-own .rc:not(.is-pinned) .rc-own { display: block; margin-top: 8px; }
.rc-has-own .rc:not(.is-pinned) .rc-label { display: block; }
.rc-has-own .rc:not(.is-pinned) .rc-now { display: none; }

/* ---- The text ---------------------------------------------------------------------------------------------------- */

.content { margin-top: 36px; }
.content > * { max-width: 720px; }
.content > .wide { max-width: none; }
.content p, .content ul, .content ol { margin: 1em 0 0; }
.content > :first-child { margin-top: 0; }
.content ul, .content ol { padding-left: 1.3em; }
.content li + li { margin-top: .4em; }
.content li::marker { color: var(--smoke); }
.content h2 { margin: 2em 0 0; padding-top: 18px; border-top: 2px solid var(--char); font-size: var(--h2); line-height: 1.15; }
.content h2 + p, .content h2 + ul, .content h2 + ol { margin-top: .6em; }
.content h3 { margin: 1.6em 0 0; font-size: 22px; line-height: 1.3; letter-spacing: 0; }
.content h3 + p { margin-top: .4em; }
.content hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.content a { text-decoration-color: var(--smoke); }
.content a:hover { text-decoration-color: var(--char); }
.content b, .content strong { font-weight: 700; }
.content abbr[title] { text-decoration: none; }
.content table { width: 100%; font-size: var(--label); margin-top: 1em; }
.content th, .content td { border-bottom: 1px solid var(--line); padding: 10px 12px 10px 0; text-align: left; vertical-align: top; line-height: 1.4; }
.content thead th { border-bottom: 2px solid var(--char); font-weight: 700; }
.link-later { text-decoration: none; }
.content .toc { margin-top: 1.4em; padding-top: 12px; border-top: 2px solid var(--char); font-size: var(--label); }
.content .toc__title { font-weight: 700; }
.content .toc ol { margin-top: 6px; }
@media (min-width: 1024px) {
  .content h2 { margin-top: 1.8em; }
  .content h3 { font-size: 24px; }
}

/* The list of every page ([ftg_sitemap]). */
.content .sitemap { list-style: none; padding: 0; }
.content .sitemap li { margin: 0; padding: 12px 0; border-top: 1px solid var(--line); line-height: 1.4; }
.content .sitemap a { font-weight: 700; }
.content .sitemap__what { display: block; font-size: var(--label); color: var(--smoke); margin-top: 2px; }
.content .sitemap small { display: block; font-size: 16px; color: var(--smoke); margin-top: 2px; }

/* ---- The end of an article --------------------------------------------------------------------------------------- */

.ae { margin-top: 64px; display: grid; gap: 44px; }
.ae > * { max-width: 720px; }
.ae h2, .list-h { font-size: 22px; line-height: 1.25; letter-spacing: 0; padding-bottom: 10px; border-bottom: 2px solid var(--char); }
.ae-made p { margin-top: 12px; font-size: var(--label); line-height: 1.55; }
.ae-made a { font-weight: 600; white-space: nowrap; }
.src-rows { list-style: none; margin: 0; padding: 0; counter-reset: src; }
.src-rows li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: var(--label); line-height: 1.4; }
.src-rows a { font-weight: 600; }
.src-rows span { display: block; color: var(--smoke); margin-top: 2px; }
.ae-next { max-width: 920px; }
.ae-filed { display: grid; gap: 4px; padding-top: 14px; border-top: 1px solid var(--line); }
.ae-filed p { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 18px; font-size: var(--label); }
.ae-k { flex: none; width: 5.2em; font-weight: 600; color: var(--smoke); line-height: 44px; }
.ae-filed a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.ae-tag-list { display: flex; flex-wrap: wrap; column-gap: 20px; flex: 1; min-width: 0; }

/* ---- Rows of articles (lists, Read next): the title, the one-line answer, the date, the minutes set big ------------- */

.ar-rows { list-style: none; margin: 0; padding: 0; }
.ar { border-bottom: 1px solid var(--line); }
.ar-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 20px; padding: 18px 0; color: var(--char); text-decoration: none; }
.ar-link:focus-visible { outline: 2px solid var(--char); outline-offset: 2px; }
.ar-title { grid-column: 1; font-size: 20px; font-weight: 700; line-height: 1.3; }
.ar-link:hover .ar-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .18em; }
.ar-answer { grid-column: 1; margin-top: 4px; font-size: var(--label); line-height: 1.45; color: var(--smoke); }
.ar-meta { grid-column: 1; margin-top: 6px; font-size: 16px; line-height: 1.4; color: var(--smoke); }
.ar-meta time { font-weight: 600; }
.ar-min { grid-column: 2; grid-row: 1 / span 3; align-self: start; text-align: right; line-height: 1; padding-top: 2px; white-space: nowrap; }
.ar-min b { font-size: 30px; font-weight: 900; letter-spacing: -0.02em; }
.ar-min .ar-u { font-size: 17px; font-weight: 700; margin-left: 2px; }
.ar-min small { display: block; font-size: 16px; color: var(--smoke); font-weight: 500; margin-top: 6px; }
@media (min-width: 1024px) {
  .ar-link { column-gap: 32px; padding: 22px 0; }
  .ar-title { font-size: 22px; }
  .ar-min b { font-size: 34px; }
}
.ar-pages { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; margin-top: 24px; font-size: var(--label); color: var(--smoke); }

/* ---- Lists: Guides, a section, a tag, search, not found ---------------------------------------------------------- */

.list-head { max-width: 900px; }
.list-head h1 { margin-top: 10px; }
.list-intro { margin-top: 24px; max-width: 720px; }
.list-page section, .list-page > nav { margin-top: 52px; }
.list-page section .list-h + * { margin-top: 0; }
.list-n { font-size: var(--label); font-weight: 600; color: var(--smoke); margin-left: 8px; }
.list-empty { padding: 18px 0; color: var(--smoke); font-size: var(--label); }
.newest { max-width: 920px; }

/* The eight sections, each with its lede and how many guides it has. */
.sec-rows { list-style: none; margin: 0; padding: 0; }
.sec { border-bottom: 1px solid var(--line); }
.sec-in { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; align-items: baseline; padding: 16px 0; color: var(--char); text-decoration: none; }
a.sec-in:focus-visible { outline: 2px solid var(--char); outline-offset: 2px; }
.sec-name { font-size: 21px; font-weight: 800; line-height: 1.25; }
a.sec-in:hover .sec-name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .18em; }
.sec-count { font-size: var(--label); color: var(--smoke); white-space: nowrap; }
.sec-count b { font-size: 22px; font-weight: 900; color: var(--char); }
.sec-lede { grid-column: 1 / -1; margin-top: 4px; font-size: var(--label); line-height: 1.45; color: var(--smoke); max-width: 40em; }
.sec-none .sec-name { color: var(--smoke); font-weight: 700; }
@media (min-width: 900px) {
  .sec-rows { display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; }
  .sec-in { padding: 20px 0; }
}

/* Other sections, and where to go from "not found". */
.list-more ul, .list-links { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; column-gap: 28px; }
.list-more a, .list-links a { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--label); font-weight: 600; }
.go-rows { list-style: none; margin: 0; padding: 0; max-width: 920px; }
.go-rows li { border-bottom: 1px solid var(--line); }
.go-rows a { display: grid; gap: 2px; padding: 16px 0; color: var(--char); text-decoration: none; }
.go-rows a:focus-visible { outline: 2px solid var(--char); outline-offset: 2px; }
.go-name { font-size: 21px; font-weight: 800; }
.go-rows a:hover .go-name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .18em; }
.go-what { font-size: var(--label); color: var(--smoke); }
.nf .list-kind { font-size: 34px; font-weight: 900; color: var(--ember-deep); line-height: 1; }

/* The search box. */
.find { margin-top: 28px; max-width: 640px; }
.find-label { display: block; font-size: var(--label); font-weight: 600; margin-bottom: 8px; }
.find-row { display: flex; gap: 10px; }
.find-q { flex: 1; min-width: 0; height: 48px; padding: 0 14px; border: 2px solid var(--char); border-radius: 6px; background: var(--white); font-size: 20px; }
.find-q:focus-visible { outline: 2px solid var(--char); outline-offset: 2px; }
.find-q::-webkit-search-cancel-button { display: none; }

/* ---- Foods: the homepage's food clocks table, each food linking to its page ---------------------------------------- */

.foods-clocks { margin-top: 48px; }
.foods-clocks .list-h { margin-bottom: 0; border-bottom: 0; padding-bottom: 0; font-size: var(--h2); }
.foods-sub { margin: 8px 0 24px; color: var(--smoke); max-width: 46em; }
.fc-linked .fc-food a { color: var(--char); }
.foods-more { margin-top: 48px; }

/* ---- The grid on a wide screen: the reading column starts two columns in; the head, picture and clock take more ---- */

@media (min-width: 1024px) {
  .frame { padding-top: 28px; }
  .art { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: start; }
  .art > * { grid-column: 3 / span 9; min-width: 0; }
  .art > .rc-slot { grid-column: 3 / -1; }
  .art > .content { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; }
  .art > .content > * { grid-column: 3 / span 7; max-width: none; }
  .art > .content > .wide { grid-column: 1 / -1; }
  .art > .ae { grid-column: 3 / span 8; }
  .art .ftg-figure { margin-top: 32px; }
  .rc-slot { margin-top: 32px; }
  .content { margin-top: 44px; }
  /* Foods is a tool page: it takes the whole grid. */
  .art.foods > * { grid-column: 1 / span 9; }
  .art.foods > .content > * { grid-column: 1 / span 7; }
  .art.foods > .foods-clocks { grid-column: 1 / -1; }
}
