/* Insights (inc/insights.php): the Insights page, each article, and the article lists on the homepage,
   episode pages and topic pages. Same editorial language as Episodes: serif headlines, fine rules, sand and sage fields. */

/* An article in a list */
.insight-row { display: grid; align-content: start; gap: 6px; padding: 22px 0 24px; border-bottom: 1px solid var(--rule); }
.insight-row-topic { color: var(--red); font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; }
.insight-row-title { font-size: clamp(1.375rem, 2vw, 1.625rem); line-height: 1.18; letter-spacing: -0.02em; text-wrap: balance; }
.insight-row-title a { text-decoration: none; }
.insight-row-title a:hover { text-decoration: underline; }
.insight-row-summary { max-width: 62ch; color: #4b4d47; font-size: 1rem; line-height: 1.6; }
.insight-row-meta, .insight-row-episode { color: var(--muted); font-size: var(--text-sm); }
.insight-row-episode a { color: var(--ink); }

/* The newest article leads the Insights page on a sand field. */
.insight-row--lead { gap: 10px; margin-bottom: 8px; padding: clamp(28px, 3.4vw, 44px) clamp(22px, 3.4vw, 44px); border-bottom: 0; background: var(--sand); }
.insight-row--lead .insight-row-title { max-width: 22ch; font-size: clamp(2rem, 3.8vw, 3.125rem); line-height: 1.05; letter-spacing: -0.03em; }
.insight-row--lead .insight-row-summary { max-width: 44rem; color: var(--ink); font-family: var(--serif); font-size: clamp(1.125rem, 1.6vw, 1.3125rem); font-style: italic; line-height: 1.5; }
.insight-row--lead .insight-row-meta, .insight-row--lead .insight-row-episode { color: #4b4d47; }

/* The Insights page */
.insights-header { padding-block: clamp(36px, 5vw, 64px) clamp(24px, 3vw, 36px); }
.insights-header .eyebrow { margin: 0 0 12px; }
.insights-header h1 { font-size: clamp(2.75rem, 5.4vw, 4.75rem); line-height: 1; letter-spacing: -0.035em; }
.insights-intro { max-width: 40rem; margin-top: 14px; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.125rem); line-height: 1.6; }
.insights-intro p { margin: 0; }
.insights-list { padding-bottom: clamp(40px, 5vw, 64px); }
.insights-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px 20px; padding-bottom: clamp(48px, 6vw, 80px); font-size: var(--text-sm); }
.insights-pagination .page-numbers { display: inline-block; padding-block: 6px; }
.insights-pagination .current { font-weight: 600; text-decoration: underline; }
.insights-empty { max-width: 44rem; margin-bottom: clamp(56px, 7vw, 96px); padding-top: 28px; border-top: 1px solid var(--ink); }
.insights-empty h2 { font-size: clamp(1.75rem, 3vw, 2.25rem); line-height: 1.12; letter-spacing: -0.02em; }
.insights-empty > p { margin-top: 10px; color: var(--muted); font-size: 1.0625rem; }
.insights-empty .hero-latest { margin-top: 28px; }
.insights-empty > .text-link { display: inline-flex; margin-top: 24px; }

/* One article */
.insight-header { padding-block: clamp(36px, 5vw, 64px) clamp(28px, 3.4vw, 44px); }
.insight-kicker { margin: 0 0 14px; }
.insight-kicker a { text-decoration: none; }
.insight-kicker a:hover { text-decoration: underline; }
.insight-header h1 { max-width: 20ch; font-size: clamp(2.5rem, 5vw, 4.25rem); line-height: 1.03; letter-spacing: -0.035em; text-wrap: balance; }
.insight-standfirst { max-width: 40rem; margin-top: 18px; font-family: var(--serif); font-size: clamp(1.25rem, 1.9vw, 1.5rem); font-style: italic; line-height: 1.45; }
.insight-byline { margin-top: 20px; color: var(--muted); font-size: var(--text-sm); }
.insight-byline a { color: var(--ink); }
.insight-figure { margin-top: 0; margin-bottom: clamp(28px, 4vw, 48px); }
.insight-figure img { width: 100%; height: auto; }
.insight-figure figcaption { margin-top: 10px; color: var(--muted); font-size: var(--text-xs); }

.insight-layout { display: grid; grid-template-columns: minmax(0, 42rem) minmax(240px, 300px); justify-content: space-between; align-items: start; gap: clamp(32px, 6vw, 96px); padding-top: clamp(28px, 3.4vw, 40px); border-top: 1px solid var(--rule); }
.insight-prose { font-size: 1.125rem; line-height: 1.75; }
.insight-prose h2 { font-size: clamp(1.625rem, 2.4vw, 2rem); line-height: 1.15; letter-spacing: -0.02em; }
.insight-prose h3 { font-size: clamp(1.25rem, 1.8vw, 1.5rem); line-height: 1.2; }
.insight-prose blockquote { margin: 32px 0; padding-left: 22px; border-left: 2px solid var(--red); font-family: var(--serif); font-size: 1.375rem; font-style: italic; line-height: 1.45; }
.insight-prose blockquote p { margin-bottom: 8px; }
.insight-prose img { height: auto; }
.insight-main { min-width: 0; }

/* Paragraph styles (inc/insights.php): "Note" is a small side note such as "Not legal advice"; "Summary" boxes the short answer. */
.is-style-tgp-note { padding: 12px 16px; border: 1px solid var(--rule); border-left: 3px solid var(--red); color: #4b4d47; font-size: var(--text-md); line-height: 1.6; }
.is-style-tgp-note strong { color: var(--ink); }
.insight-prose .is-style-tgp-note { margin: 0 0 32px; font-size: var(--text-md); line-height: 1.6; }
.is-style-tgp-summary { padding: 20px 24px; background: var(--sand); }
.insight-prose .is-style-tgp-summary { font-size: 1.1875rem; line-height: 1.65; }

/* Tables: fine rules and a sand header row, words never split; on phones each row becomes a card (below). */
.insight-prose .wp-block-table { margin: 28px 0 32px; overflow-x: auto; }
.insight-prose .wp-block-table table { width: 100%; table-layout: auto; border-collapse: collapse; font-size: 1rem; line-height: 1.5; }
.insight-prose .wp-block-table thead { border-bottom: 0; }
.insight-prose .wp-block-table table th, .insight-prose .wp-block-table table td { padding: 12px 14px; border: 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; overflow-wrap: normal; word-break: normal; }
.insight-prose .wp-block-table thead th { padding-block: 10px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); background: var(--sand); font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.insight-prose .wp-block-table tbody td:first-child { font-weight: 600; }
.insight-prose .wp-block-table a { overflow-wrap: normal; }
.insight-prose .wp-block-table figcaption { margin-top: 10px; color: var(--muted); font-size: var(--text-xs); text-align: left; }

/* "On this page": beside the text on wide screens, a folded list above it on phones and tablets. */
.insight-toc ol { margin: 0; padding: 0; list-style: none; }
.insight-toc li { border-bottom: 1px solid var(--rule); }
.insight-toc a { display: block; padding: 9px 0; color: var(--ink); font-size: var(--text-md); line-height: 1.35; text-decoration: none; }
.insight-toc a:hover { text-decoration: underline; }
.insight-toc--rail { padding-top: 16px; border-top: 1px solid var(--ink); }
.insight-toc--rail .eyebrow { margin: 0 0 6px; }
.insight-toc--inline { display: none; margin-bottom: 28px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); }
.insight-toc--inline summary { display: flex; justify-content: space-between; align-items: center; min-height: 48px; color: var(--red); font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; list-style: none; cursor: pointer; }
.insight-toc--inline summary::-webkit-details-marker { display: none; }
.insight-toc--inline summary::after { content: '+'; color: var(--ink); font-size: 1.25rem; font-weight: 400; letter-spacing: 0; }
.insight-toc--inline[open] summary::after { content: '\2212'; }
.insight-toc--inline ol { padding-bottom: 8px; border-top: 1px solid var(--rule); }
.insight-toc--inline li:last-child { border-bottom: 0; }
.insight-toc--inline a { padding-block: 11px; }

/* The conversation the article comes from, and the list of sections, beside the text on wide screens. */
.insight-aside { position: sticky; top: 24px; display: grid; gap: 28px; max-height: calc(100vh - 48px); overflow-y: auto; }
.insight-episode { padding: 24px; background: var(--sage); }
.insight-episode .eyebrow { margin: 0 0 10px; }
.insight-episode-title { font-family: var(--serif); font-size: 1.375rem; line-height: 1.2; }
.insight-episode-title a { text-decoration: none; }
.insight-episode-title a:hover { text-decoration: underline; }
.insight-episode-meta { margin: 8px 0 18px; color: #4b4d47; font-size: var(--text-sm); }

.insight-footer { padding-top: clamp(36px, 5vw, 56px); }
.insight-author { display: flex; align-items: flex-start; gap: 20px; max-width: 42rem; padding: 24px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); }
.insight-author-photo { flex: none; width: 88px; height: 88px; overflow: hidden; border-radius: 50%; background: var(--sand); }
.insight-author-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.insight-author .eyebrow { margin: 0; }
.insight-author-name { margin-top: 6px; font-family: var(--serif); font-size: 1.375rem; line-height: 1.2; }
.insight-author-name a { text-decoration: none; }
.insight-author-name a:hover { text-decoration: underline; }
.insight-author p:last-child { margin-top: 6px; color: #4b4d47; font-size: 0.9375rem; line-height: 1.55; }
.insight-disclaimer { max-width: 42rem; margin-top: 20px; color: var(--muted); font-size: var(--text-xs); line-height: 1.55; }

/* Article lists elsewhere: more articles, the homepage, episode and topic pages. */
.insights-more { padding-top: clamp(56px, 7vw, 88px); }
.insights-more-list, .home-insights-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(24px, 3vw, 40px); border-top: 1px solid var(--ink); }
.home-insights { padding-top: clamp(56px, 7vw, 96px); }
.episode-articles { margin-top: 40px; border-top: 1px solid var(--ink); }
.episode-articles h2 { margin: 22px 0 0; font-size: 1.5rem; }
.topic-articles { padding-top: clamp(40px, 5vw, 64px); }
.topic-articles h2 { margin-bottom: 14px; font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.15; }

@media (max-width: 900px) {
    .insight-layout { grid-template-columns: minmax(0, 1fr); }
    .insight-aside { position: static; max-height: none; overflow: visible; }
    .insight-toc--rail { display: none; }
    .insight-toc--inline { display: block; }
    .insights-more-list, .home-insights-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
    .insight-author { gap: 16px; }
    .insight-author-photo { width: 64px; height: 64px; }
    /* Each table row becomes a card: the first cell as its title, then every other cell under its column's heading. */
    .insight-prose .wp-block-table { overflow: visible; }
    .insight-prose table.tgp-cards, .insight-prose .tgp-cards tbody, .insight-prose .tgp-cards tr, .insight-prose .wp-block-table .tgp-cards td { display: block; width: auto; }
    .insight-prose .tgp-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .insight-prose .tgp-cards tbody { border-top: 1px solid var(--ink); }
    .insight-prose .tgp-cards tr { padding: 16px 0; border-bottom: 1px solid var(--rule); }
    .insight-prose .wp-block-table .tgp-cards td { padding: 0; border: 0; }
    .insight-prose .wp-block-table .tgp-cards td:first-child { margin-bottom: 8px; font-family: var(--serif); font-size: 1.25rem; font-weight: 400; line-height: 1.25; }
    .insight-prose .wp-block-table .tgp-cards td + td { margin-top: 8px; }
    .insight-prose .wp-block-table .tgp-cards td[data-label]:not(:first-child) { display: grid; grid-template-columns: minmax(0, 7rem) minmax(0, 1fr); gap: 12px; }
    .insight-prose .tgp-cards td[data-label]:not(:first-child)::before { content: attr(data-label); padding-top: 3px; color: var(--muted); font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0.08em; line-height: 1.4; text-transform: uppercase; }
}

/* The Insights page: links to the topics that have articles, with counts, under the introduction. */
.insights-topics { margin: 0 0 8px; }
.insights-topics a { gap: 0.3em; }
.insights-topics .topic-count { color: var(--muted); }
.insights-topics a:hover .topic-count { color: var(--ink); }
