/* DailyFact article template v2: hero header, contents rail, in-article recommendations,
   previous/next and related posts. Loaded only on single posts, after design.css. */

body.df-design.df-article { --df-rail: 300px; --df-col: 720px; --df-gap: 56px; }

/* ---------- Frame ---------- */
body.df-design.df-article .site-inner { max-width: 1180px; margin: 0 auto; padding: 20px 24px 96px; }
body.df-design.df-article .site-inner > .authority-featured-image { display: none; }
body.df-design.df-article .content { float: none; width: 100%; max-width: none; margin: 0; }
body.df-design.df-article article.entry {
	display: grid;
	grid-template-columns: minmax(0, var(--df-col)) var(--df-rail);
	column-gap: var(--df-gap);
	justify-content: center;
	max-width: none;
	margin: 0;
	padding: 0;
	background: none;
	box-shadow: none;
}
body.df-design.df-article article.entry > .entry-header { grid-column: 1 / -1; grid-row: 1; margin: 0; padding: 0; text-align: left; }
body.df-design.df-article article.entry > .entry-content { grid-column: 1; grid-row: 2; max-width: none; margin: 40px 0 0; min-width: 0; }
body.df-design.df-article article.entry > .df-rail { grid-column: 2; grid-row: 2; margin-top: 40px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
body.df-design.df-article article.entry > .entry-footer { grid-column: 1 / -1; grid-row: 3; margin: 0; padding: 0; border: 0; min-width: 0; }
body.df-design.df-article .sidebar, body.df-design.df-article .after-entry, body.df-design.df-article .entry-comments, body.df-design.df-article .entry-pings, body.df-design.df-article .comment-respond { display: none; }

/* ---------- Header ---------- */
body.df-design.df-article .df-article__head { max-width: 900px; margin: 0; padding: 12px 0 0; text-align: left; }
.df-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 14px; font-size: 13px; color: var(--df-muted); }
.df-crumbs a { color: var(--df-muted); text-decoration: none; font-weight: 500; }
.df-crumbs a:hover { color: var(--df-accent-dark); text-decoration: underline; }
.df-crumbs span { color: #b8b2a4; }
.df-crumbs a:last-child { color: var(--df-accent-dark); font-weight: 700; }
body.df-design.df-article h1.entry-title.df-article__title { margin: 0; font-size: clamp(28px, 3.6vw, 42px); line-height: 1.12; letter-spacing: -.02em; text-align: left; }
body.df-design.df-article .df-article__dek { max-width: 720px; margin: 14px 0 0; font-size: clamp(16px, 1.6vw, 19px); line-height: 1.55; color: var(--df-muted); text-align: left; }
body.df-design.df-article .df-article__meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 6px 16px; margin-top: 18px; font-size: 13.5px; color: var(--df-muted); }
body.df-design.df-article .df-article__meta span + span::before { content: none; }
.df-avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--df-accent-solid); color: #fff; font: 700 13px/1 var(--df-sans); }
.df-article__by a { color: var(--df-ink); font-weight: 700; text-decoration: none; }
.df-article__by a:hover { text-decoration: underline; }
body.df-design.df-article .df-ai-note { max-width: 720px; margin: 16px 0 0; }

body.df-design.df-article .df-article__hero { max-width: none; margin: 26px 0 0; }
body.df-design.df-article .df-article__img { display: block; width: 100%; height: auto; max-height: none; aspect-ratio: 16 / 7.5; object-fit: cover; border-radius: 22px; box-shadow: 0 18px 50px rgba(15, 23, 42, .14); }
body.df-design.df-article .df-article__hero figcaption { margin: 10px 4px 0; font-size: 12.5px; text-align: left; color: var(--df-muted); }

/* ---------- Body ---------- */
body.df-design.df-article .entry-content { font-size: 17px; line-height: 1.75; }
body.df-design.df-article .entry-content > h2:first-child, body.df-design.df-article .entry-content > .df-takeaways:first-child { margin-top: 0; }
body.df-design.df-article .entry-content h2 { position: relative; margin: 2em 0 .55em; padding-top: 1.1em; font-size: clamp(22px, 2.4vw, 27px); }
body.df-design.df-article .entry-content h2::before { content: ""; position: absolute; top: 0; left: 0; width: 44px; height: 3px; border-radius: 3px; background: var(--df-accent); }
body.df-design.df-article .entry-content > h2:first-child::before { display: none; }
body.df-design.df-article .entry-content > h2:first-child { padding-top: 0; }
body.df-design.df-article .entry-content img { border-radius: 14px; }

.df-takeaways { margin: 0 0 1.8em; padding: 20px 22px 6px; border: 1px solid #f3d3bb; border-left: 5px solid var(--df-accent); border-radius: 14px; background: var(--df-accent-soft); }
body.df-design.df-article .entry-content .df-takeaways h2 { margin: 0 0 10px; padding: 0; font-size: 18px; }
body.df-design.df-article .entry-content .df-takeaways h2::before { display: none; }
body.df-design.df-article .entry-content .df-takeaways ul { margin: 0 0 14px; }
body.df-design.df-article .entry-content tbody tr:nth-child(even) td { background: var(--df-stripe); }

/* ---------- Contents + recent rail ---------- */
.df-rail__toc { flex: 1 1 auto; min-height: 0; }
.df-rail__sticky { position: sticky; top: 96px; }
body.admin-bar .df-rail__sticky { top: 128px; }
.df-toc { border: 1px solid var(--df-border); border-radius: 16px; background: var(--df-card); overflow: hidden; }
.df-toc > summary { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; font: 700 12.5px/1 var(--df-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--df-ink); cursor: pointer; list-style: none; background: var(--df-surface); }
.df-toc > summary::-webkit-details-marker { display: none; }
.df-toc > summary::after { content: "+"; font-size: 18px; font-weight: 500; letter-spacing: 0; color: var(--df-muted); }
.df-toc[open] > summary::after { content: "\2212"; }
.df-toc ol { max-height: calc(100vh - 220px); margin: 0; padding: 10px 6px 12px; overflow-y: auto; list-style: none; counter-reset: toc; }
.df-toc li { margin: 0; counter-increment: toc; }
.df-toc a { display: block; padding: 8px 12px 8px 14px; border-left: 3px solid transparent; border-radius: 0 8px 8px 0; font-size: 14px; line-height: 1.4; color: var(--df-text); text-decoration: none; }
.df-toc a:hover { background: var(--df-surface); color: var(--df-ink); }
.df-toc a.is-active { border-left-color: var(--df-accent); background: var(--df-accent-soft); color: var(--df-accent-dark); font-weight: 600; }
.df-rail__recent { padding: 20px; border: 1px solid var(--df-border); border-radius: 16px; background: var(--df-surface); }
.df-rail__title { margin: 0 0 14px; font: 700 12.5px/1 var(--df-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--df-ink); }
.df-rail__recent .df-mini + .df-mini { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--df-border); }
.df-rail__recent .df-mini__img { flex-basis: 72px; height: 54px; }

/* ---------- Mini cards (rail and inline) ---------- */
.df-mini { display: flex; gap: 14px; align-items: center; color: var(--df-ink); text-decoration: none; }
.df-mini:hover .df-mini__title { color: var(--df-accent-dark); text-decoration: underline; text-underline-offset: 3px; }
.df-mini__img { position: relative; flex: 0 0 96px; height: 72px; overflow: hidden; border-radius: 10px; background: var(--df-surface); }
.df-mini__img img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; border-radius: 0; }
.df-mini__ph { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(135deg, var(--df-accent-soft), #f1ebe0); font: 800 13px/1 var(--df-serif); color: var(--df-accent-dark); }
.df-mini__ph b { color: #ea580c; }
.df-mini__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.df-mini__cat { font: 700 10.5px/1 var(--df-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--df-accent-dark); }
.df-mini__title { font: 700 14.5px/1.3 var(--df-serif); color: var(--df-ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.df-mini__meta { font-size: 12px; color: var(--df-muted); }

/* ---------- In-article recommendation blocks ---------- */
body.df-design.df-article .df-inline-rec { clear: both; margin: 2.2em 0; padding: 18px 20px 20px; border: 1px solid var(--df-border); border-radius: 16px; background: var(--df-surface); }
.df-inline-rec__label { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font: 700 12px/1 var(--df-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--df-ink); }
.df-inline-rec__label::before { content: ""; width: 22px; height: 3px; border-radius: 3px; background: var(--df-accent); }
.df-inline-rec__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.df-inline-rec .df-mini { padding: 10px; border-radius: 12px; background: var(--df-card); border: 1px solid var(--df-border); transition: box-shadow .2s, transform .2s; }
.df-inline-rec .df-mini:hover { box-shadow: var(--df-shadow); transform: translateY(-1px); }
.df-inline-rec--latest { background: var(--df-deep); border-color: var(--df-deep); }
.df-inline-rec--latest .df-inline-rec__label { color: #fff; }
.df-inline-rec--latest .df-mini { border-color: transparent; }

/* ---------- After the article ---------- */
body.df-design.df-article .df-article__after { max-width: var(--df-col); margin: 52px 0 0; padding-top: 26px; }
.df-postnav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.df-postnav__item { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--df-border); border-radius: 14px; background: var(--df-card); text-decoration: none; color: var(--df-ink); transition: box-shadow .2s, transform .2s, border-color .2s; }
.df-postnav__item--next { text-align: right; }
.df-postnav__item:hover { border-color: var(--df-accent); box-shadow: var(--df-shadow); transform: translateY(-2px); }
.df-postnav__item--empty { border: 0; background: none; box-shadow: none; pointer-events: none; }
.df-postnav__label { font: 700 11.5px/1 var(--df-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--df-accent-dark); }
.df-postnav__title { font: 700 16px/1.3 var(--df-serif); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

body.df-design.df-article .df-related { margin: 64px 0 0; padding: 48px 0 0; border-top: 1px solid var(--df-border); }
.df-related__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 24px; }
body.df-design.df-article .df-related h2 { margin: 0; font-size: clamp(22px, 2.4vw, 28px); }
body.df-design.df-article .df-related__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
body.df-design.df-article .df-related__grid .df-card__title { font-size: 18px; }
body.df-design.df-article .df-related__grid .df-card__excerpt { font-size: 14px; }

.df-top { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--df-deep); color: #fff; font-size: 20px; line-height: 1; box-shadow: 0 8px 24px rgba(15, 23, 42, .3); cursor: pointer; transform: none; }
.df-top:hover { background: var(--df-accent-solid); color: #fff; transform: none; }
.df-top[hidden] { display: none; }

/* ---------- Tablet and below: single column, collapsible contents ---------- */
@media (max-width: 1099px) {
	body.df-design.df-article { --df-col: 760px; --df-rail: 0px; --df-gap: 0px; }
	body.df-design.df-article article.entry { grid-template-columns: minmax(0, var(--df-col)); }
	body.df-design.df-article article.entry > .df-rail { grid-column: 1; grid-row: 2; margin-top: 24px; gap: 0; }
	body.df-design.df-article article.entry > .entry-content { grid-row: 3; margin-top: 28px; }
	body.df-design.df-article article.entry > .entry-footer { grid-row: 4; }
	.df-rail__recent { display: none; }
	.df-rail__sticky { position: static; }
	.df-toc ol { max-height: none; }
	.df-toc:not([open]) > summary { border-radius: 16px; }
	body.df-design.df-article .df-article__after { max-width: none; }
	body.df-design.df-article .df-article__img { aspect-ratio: 16 / 9; }
}
@media (min-width: 1100px) { .df-toc > summary { pointer-events: none; cursor: default; } .df-toc > summary::after { display: none; } }
@media (max-width: 899px) {
	body.df-design.df-article .df-related__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	body.df-design.df-article .df-related__grid .df-card:nth-child(3) { display: none; }
}

/* ---------- Phones ---------- */
@media (max-width: 680px) {
	body.df-design.df-article .site-inner { padding: 8px 16px 72px; }
	.df-crumbs { margin-bottom: 10px; font-size: 12px; }
	body.df-design.df-article h1.entry-title.df-article__title { font-size: 26px; line-height: 1.17; }
	body.df-design.df-article .df-article__dek { font-size: 15.5px; margin-top: 10px; }
	body.df-design.df-article .df-article__meta { gap: 4px 12px; margin-top: 14px; font-size: 12.5px; }
	.df-avatar { width: 26px; height: 26px; font-size: 12px; }
	body.df-design.df-article .df-article__hero { margin: 18px -16px 0; }
	body.df-design.df-article .df-article__img { aspect-ratio: 4 / 3; border-radius: 0; box-shadow: none; }
	body.df-design.df-article .df-article__hero figcaption { margin: 8px 16px 0; font-size: 12px; }
	body.df-design.df-article article.entry > .df-rail { margin-top: 18px; }
	body.df-design.df-article .entry-content { font-size: 16px; line-height: 1.68; margin-top: 22px; }
	body.df-design.df-article .entry-content h2 { font-size: 21px; margin-top: 1.7em; }
	.df-takeaways { padding: 16px 16px 2px; margin-left: 0; margin-right: 0; }
	.df-inline-rec__grid { grid-template-columns: 1fr; gap: 10px; }
	.df-inline-rec { padding: 14px 14px 14px; margin: 1.8em -4px; }
	.df-mini__img { flex-basis: 88px; height: 66px; }
	.df-postnav { grid-template-columns: 1fr; }
	.df-postnav__item--next { text-align: left; }
	.df-postnav__item--empty { display: none; }
	body.df-design.df-article .df-related { margin-top: 48px; padding-top: 36px; }
	.df-related__head { flex-direction: column; align-items: flex-start; gap: 6px; }
	body.df-design.df-article .df-related__grid { grid-template-columns: 1fr; gap: 18px; }
	body.df-design.df-article .df-related__grid .df-card:nth-child(3) { display: flex; }
	.df-top { right: 12px; bottom: 12px; width: 42px; height: 42px; }
}
@media print { .df-rail, .df-inline-rec, .df-related, .df-postnav, .df-top, .df-progress { display: none !important; } }

/* Specificity: keep rail/nav text dark and sans, not link-orange or serif */
body.df-design .df-toc a { color: var(--df-text); }
body.df-design .df-toc a:hover { color: var(--df-ink); }
body.df-design .df-toc a.is-active { color: var(--df-accent-dark); }
body.df-design .df-postnav__item, body.df-design .df-postnav__item:hover { color: var(--df-ink); }
body.df-design .df-postnav__title { color: var(--df-ink); }
body.df-design .df-postnav__label { color: var(--df-accent-dark); }
body.df-design .df-rail__recent h2.df-rail__title { margin: 0 0 14px; font: 700 12.5px/1 var(--df-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--df-ink); padding: 0; }
body.df-design .df-rail__recent h2.df-rail__title::before { display: none; }
body.df-design .df-mini, body.df-design .df-mini:hover { color: var(--df-ink); }
body.df-design .df-mini__cat { color: var(--df-accent-dark); }
body.df-design .df-inline-rec--latest .df-mini__title { color: var(--df-ink); }
body.df-design .df-crumbs a { color: var(--df-muted); }
body.df-design .df-crumbs a:last-child { color: var(--df-accent-dark); }

/* Even paragraph rhythm (legacy has-larger-font-size paragraphs carried extra margin) */
body.df-design.df-article .entry-content > p, body.df-design.df-article .entry-content p.has-larger-font-size { margin: 0 0 1.05em !important; }

/* Specificity: dark "Latest" block and filled thumbnails */
body.df-design.df-article .df-inline-rec.df-inline-rec--latest { background: var(--df-deep); border-color: var(--df-deep); }
body.df-design.df-article .df-inline-rec--latest .df-inline-rec__label { color: #fff; }
body.df-design.df-article .df-inline-rec--latest .df-inline-rec__label::before { background: #fb923c; }
body.df-design .df-mini__img img, body.df-design.df-article .entry-content .df-mini__img img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; border-radius: 0; margin: 0; }

/* Related-card images: make the link fill the 3:2 frame so the photo shows */
body.df-design.df-article .df-related .df-card .wp-block-post-featured-image { position: relative; aspect-ratio: 3 / 2; overflow: hidden; }
body.df-design.df-article .df-related .df-card .wp-block-post-featured-image > a { position: absolute !important; inset: 0; display: block; width: 100%; height: 100%; }
body.df-design.df-article .df-related .df-card .wp-block-post-featured-image img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }

/* Author byline with bio */
body.df-design.df-article .df-byline { display: flex; gap: 16px; align-items: flex-start; }
.df-avatar--lg { flex: 0 0 auto; width: 48px; height: 48px; font-size: 20px; }
body.df-design.df-article .df-byline__text { gap: 6px; }
body.df-design.df-article .df-byline__text span { line-height: 1.55; }
@media (max-width: 680px) { .df-avatar--lg { width: 40px; height: 40px; font-size: 17px; } }
