/* Accessible action colors. Keep text accents readable on both token surfaces. */
:root{--qa-action:#b53625;--qa-action-hover:#982c1e;--accent:#b53625;--muted:#5e675d}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--accent:#ff9985}}
:root[data-theme=dark]{--accent:#ff9985}
.button:not(.secondary):not([data-google]){background:var(--qa-action);color:var(--surface)}
.button:not(.secondary):not([data-google]):hover{background:var(--qa-action-hover);color:#fff}
/* Action foreground stays light even when the surface token is dark. */
.button:not(.secondary):not([data-google]){color:#fff}

/* Book cards share content tracks across each visual row, including live results.
   Variable titles, author lines and editorial notes cannot move the actions. */
.book-grid{row-gap:0;justify-content:start}
.book-grid.carousel{grid-template-rows:repeat(8,auto);justify-content:start;align-content:start;padding-inline:0;scroll-padding-inline:0}
.book-grid>.book-card{display:grid;grid-template-rows:subgrid;grid-row:span 8;row-gap:0;height:auto;min-width:0;padding-bottom:28px}
.book-card>.flip,.book-card>a{grid-row:1;align-self:start}
.book-card .card-caption{display:grid;grid-template-rows:subgrid;grid-row:2 / span 7;row-gap:0;min-width:0}
.book-card .card-caption>.eyebrow{grid-row:1}
.book-card .card-caption>h3{grid-row:2;min-height:44px;line-height:1.3}
.book-card .card-caption>h3 a{display:block;min-height:44px}
.book-card .card-caption>.byline{grid-row:3;margin-top:0;margin-bottom:8px}
.book-card .card-caption>.small,.book-card .card-caption>.because,.book-card .card-caption>.card-description{grid-row:4;margin-top:0;margin-bottom:12px}
.book-card .card-caption>.save-book,.book-card .card-caption>.save-book:first-of-type{grid-row:6;margin-top:0;align-self:start;justify-self:start}
.book-card .card-caption>.move-shelf,.book-card .card-caption>.deal-report{grid-row:7;align-self:start}
.book-card .card-caption>.price-line{grid-row:5;min-height:1.5em;margin-top:0;margin-bottom:10px}
.book-card .card-caption>.card-actions,.book-card.feed-book .card-caption>.card-actions{grid-row:6;align-self:start;margin-top:0;padding-top:0}
.book-card.feed-book .card-caption>.deal-report{grid-row:7}
.book-card .card-caption>.card-description{font-size:14px;line-height:1.5;color:var(--muted);min-height:4.5em;text-overflow:ellipsis}
.price-notice{font-size:14px;line-height:1.5;color:var(--muted);margin:0 0 18px;max-width:72ch}
.pick-note p+p{margin-top:1em}
@media(min-width:900px){.home-body{max-width:none;width:100%;margin-inline:0}}
.book-card .card-caption>.eyebrow{min-height:2.1em}
.byline{font-size:var(--fs-small)}

/* Medical cards use the same shared-track alignment without changing markup. */
.medical-edition .medical-grid{row-gap:0}
.medical-grid>.medical-card{display:grid;grid-template-rows:subgrid;grid-row:span 7;row-gap:0;align-items:stretch;min-width:0;padding-bottom:28px}
.medical-card>.cover,.medical-card>a:first-child{grid-row:1;align-self:start}
.medical-card .cover{width:100%;height:auto;aspect-ratio:2/3;object-fit:cover}
.medical-card>.eyebrow{grid-row:2}
.medical-card>h3{grid-row:3;min-height:44px}
.medical-card>h3 a{display:block;min-height:44px}
.medical-card>.byline{grid-row:4}
.medical-grid .medical-card>.byline{font-size:var(--fs-small)}
.medical-card>p:not(.eyebrow):not(.byline){grid-row:5}
.medical-card>.button{grid-row:6;align-self:start}
.medical-card>.save-book{grid-row:7;justify-self:start;align-self:start;margin-top:0}
.medical-edition .medical-chips a{font-size:var(--fs-small)}
.medical-edition .paper-card>a,.medical-edition .section>a{display:inline-flex;align-items:center;min-width:44px;min-height:44px}

/* Standalone links and small icon controls need a complete touch target. */
.text-link,.story-card h3 a,.list-card h3 a{display:inline-flex;align-items:center;min-height:44px;min-width:44px}
.theme-toggle,.taste-items button,.taste-chip button,.step-link{min-width:44px;min-height:44px}
.promo-table td>a{display:inline-flex;align-items:center;min-width:44px;min-height:44px}
.tag{display:inline-flex;align-items:center;min-width:44px;min-height:44px;font-size:var(--fs-small)}
.book-detail>.eyebrow a,.book-detail .eyebrow a,.author-reading nav a,.topic-guide nav a{display:inline-flex;align-items:center;min-height:44px;min-width:44px;font-size:inherit}
.button,.nav-cta{min-height:52px;height:auto;text-align:center;padding-block:12px}
.button{overflow-wrap:anywhere}
:where(input,select,textarea){min-width:0;max-width:100%}
.taste-row,.prefs-pair,.choice-card,.author-grid>*{min-width:0}

/* Repeated editorial cards keep their links on the last shared content line. */
.story-grid,.list-grid,.author-grid{align-items:stretch}
.story-card,.list-card,.author-guide-card{min-width:0}
.story-card,.list-card{display:flex;flex-direction:column}
.story-card>.text-link,.list-card>.text-link{margin-top:auto;padding-top:20px}

/* Keep long subjects and source links inside narrow content columns. */
.prose,.topic-hub,.topic-page,.medical-card,.story-card,.list-card{overflow-wrap:anywhere}
.topic-book .card-caption p:not(.eyebrow):not(.byline){display:block;-webkit-line-clamp:unset;overflow:visible}
.topic-guide section sup a{font-size:var(--fs-small)}
.genre-tile .tile-count{color:var(--ink)}
.brand-mark,.author-banner{background:var(--qa-action);color:#fff}

/* Footer columns are columns, rather than nested two-column grids on phones. */
.site-footer .footer-top{align-items:stretch}
.site-footer .footer-top nav{display:flex;flex-direction:column;align-items:stretch;max-width:none}
.row-head>h2{min-width:0}
.row-head .text-link{flex-shrink:0;white-space:normal;max-width:45%}
.pick>span{min-height:2.6em}
.hero-inner{width:100%;min-width:0}
.hero-inner>.hero-panel{width:100%;max-width:min(100%,560px)}
.hero-picks .picks-row{min-width:0;max-width:100%}

/* Editorial content shares tracks as well as card edges. Long headlines and
   summaries expand their whole row, keeping the following text and links level. */
.list-grid,.story-grid,.author-guides .author-grid,.papers-grid{row-gap:0}
.list-grid>.list-card{display:grid;grid-template-rows:subgrid;grid-row:span 4;row-gap:0;margin-bottom:20px}
.list-card>.eyebrow{grid-row:1}
.list-card>h3{grid-row:2}
.list-card>p:not(.eyebrow){grid-row:3}
.list-card>.text-link{grid-row:4;margin-top:0;align-self:start}
.story-grid>.story-card{display:grid;grid-template-rows:subgrid;grid-row:span 5;row-gap:0;margin-bottom:24px}
.story-card>.story-art{grid-row:1}
.story-card>.eyebrow{grid-row:2}
.story-card>h3{grid-row:3}
.story-card>p:not(.eyebrow){grid-row:4}
.story-card>.text-link{grid-row:5;margin-top:0;align-self:start}
.author-guides .author-grid>.author-guide-card{display:grid;grid-template-rows:subgrid;grid-row:span 2;row-gap:0;margin-bottom:24px}
.author-guide-card>h3{grid-row:1}
.author-guide-card>p{grid-row:2}
.medical-edition .papers-grid>.paper-card{display:grid;grid-template-rows:subgrid;grid-row:span 3;row-gap:0;margin-bottom:24px}
.paper-card>.eyebrow{grid-row:1}
.paper-card>h3{grid-row:2}
.paper-card>a{grid-row:3;align-self:start;justify-self:start}

/* Guide thumbnails span the shared title and count tracks. */
.guide-grid{row-gap:0}
.guide-grid>.guide-card{grid-template-rows:subgrid;grid-row:span 2;row-gap:0;align-content:stretch;margin-bottom:16px}
.guide-card>.guide-title{grid-row:1;align-self:stretch;min-width:0;overflow-wrap:anywhere}
.guide-card>.guide-count{grid-row:2}
.guide-title .nowrap{display:contents;white-space:normal}
