/* Pages « Ressources » : actualités, article, agenda fiscal, indicateurs, petite histoire */

/* ---------- Actualités ---------- */
.news-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem 2rem; margin-bottom: 1.6rem; }
.news-count { color: var(--muted); font-size: 0.95rem; }
.featured .f-body { display: flex; flex-direction: column; gap: 1.2rem; justify-content: center; padding-block: 1rem; }
.featured .f-meta { color: var(--muted); font-size: 0.95rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; align-items: center; }
.featured h2 a { text-decoration: none; }
.featured h2 a:hover { color: var(--bordeaux); }
.news-empty { padding: 2rem 0; color: var(--muted); }

/* ---------- Article ---------- */
.article-wrap { display: grid; grid-template-columns: minmax(0, 3.2fr) minmax(0, 8.8fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + 2rem); display: grid; gap: 1rem; }
.toc strong { font-weight: 500; font-size: 0.95rem; color: var(--sable-fonce); }
.toc ol { display: grid; gap: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 0.55rem 0 0.55rem 1rem; margin-left: -1px; border-left: 2px solid transparent; font-size: 0.97rem; color: var(--muted); text-decoration: none; transition: color 0.2s, border-color 0.2s; line-height: 1.35; }
.toc a:hover { color: var(--encre); }
.toc a[aria-current="true"] { color: var(--encre); border-left-color: var(--bordeaux); }
.article-body.prose { max-width: 66ch; font-size: 1.08rem; line-height: 1.75; }
.article-body.prose > p:first-of-type { font-size: 1.25rem; line-height: 1.6; color: var(--muted); }
.article-body.prose h2 { scroll-margin-top: calc(var(--header-h) + 1rem); }
.article-body.prose ol { display: grid; gap: 0.9rem; counter-reset: etape; }
.article-body.prose ol li { position: relative; padding-left: 3rem; counter-increment: etape; }
.article-body.prose ol li::before { content: counter(etape); position: absolute; left: 0; top: -0.15em; font-family: var(--f-display); font-size: 1.9rem; font-weight: 300; color: var(--bordeaux); line-height: 1.2; }
.article-body .note { margin-block: 2rem; }
.article-body .note p { margin: 0; }
.author { display: flex; gap: 1.2rem; align-items: center; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.author img { width: 4.5rem; height: 4.5rem; border-radius: 50%; object-fit: cover; object-position: 50% 15%; background: var(--pierre); flex: none; }
.author p { margin: 0; font-size: 0.97rem; color: var(--muted); }
.author strong { display: block; color: var(--encre); font-weight: 500; font-size: 1.05rem; }
@media (max-width: 900px) {
  .article-wrap { grid-template-columns: 1fr; }
  .toc { position: static; }
  .toc ol { grid-template-columns: 1fr; }
}

/* ---------- Agenda fiscal ---------- */
.ag-top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 5rem); align-items: end; }
.ag-next { position: relative; padding: clamp(1.5rem, 3vw, 2.4rem); background: var(--sapin); color: var(--pierre); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 28px), 0 100%); padding-bottom: calc(clamp(1.5rem, 3vw, 2.4rem) + 28px); }
.ag-next .k { font-size: 0.95rem; color: var(--sable); font-weight: 500; }
.ag-next .days { font-family: var(--f-display); font-weight: 300; font-size: clamp(3.6rem, 8vw, 6.2rem); line-height: 1; letter-spacing: -0.04em; color: var(--sable-clair); margin-top: 0.6rem; }
.ag-next .days small { font-size: 0.28em; letter-spacing: 0; color: var(--muted-dark); margin-left: 0.5rem; }
.ag-next h2 { font-family: var(--f-display); font-weight: 400; font-size: 1.5rem; line-height: 1.25; margin-top: 0.8rem; }
.ag-next p { color: var(--muted-dark); margin-top: 0.4rem; font-size: 0.97rem; }
.ag-tools { display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; align-items: center; justify-content: space-between; padding-block: 1.4rem; border-block: 1px solid var(--line); margin-block: clamp(2rem, 4vw, 3rem) 0; }
.ag-tools .check { color: var(--encre); font-size: 0.97rem; align-items: center; }
.ag-tools .check input { margin-top: 0; }
.ag-month { margin-top: clamp(2rem, 4vw, 3.4rem); }
.ag-month > h3 { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.5rem, 2.4vw, 1.9rem); margin-bottom: 0.8rem; letter-spacing: -0.01em; }
.ag-month .timeline > li { grid-template-columns: 8rem minmax(0, 1fr) auto; align-items: baseline; }
.ag-month .timeline > li:last-child { border-bottom: 0; }
.ag-month .timeline .tag { white-space: nowrap; }
.ag-month .timeline > li.is-past { opacity: 0.5; }
.ag-month .timeline > li.is-past h3 { text-decoration: line-through; text-decoration-color: var(--sable-fonce); text-decoration-thickness: 1px; }
.ag-month .timeline > li.is-next { background: linear-gradient(90deg, rgba(205, 187, 140, 0.3), transparent 75%); }
.ag-month .timeline > li[hidden] { display: none; }
.ag-month[hidden] { display: none; }
.ag-month .timeline .when { font-size: 1.45rem; }
.ag-flag { display: inline-block; margin-left: 0.6rem; padding: 0.1rem 0.6rem; background: var(--bordeaux); color: var(--pierre); font-size: 0.8rem; border-radius: 999px; font-weight: 500; vertical-align: 0.15em; }
.ag-empty { padding: 2.4rem 0; color: var(--muted); }
@media (max-width: 900px) { .ag-top { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .ag-month .timeline > li { grid-template-columns: 1fr; gap: 0.4rem; } }

/* ---------- Indicateurs ---------- */
.ind-stamp { display: inline-flex; gap: 0.6rem; align-items: center; color: var(--muted-dark); font-size: 0.97rem; }
.ind-group + .ind-group { margin-top: clamp(2.5rem, 5vw, 4rem); }
.ind-group > h3 { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.5rem, 2.4vw, 1.9rem); margin-bottom: 1rem; letter-spacing: -0.01em; }
.ind-group .table td.num { white-space: normal; }
.ind-group .table th:nth-child(3), .ind-group .table td:nth-child(3) { padding-right: 0; }
.sim-grid { display: grid; grid-template-columns: minmax(0, 4.6fr) minmax(0, 7.4fr); gap: clamp(1.5rem, 4vw, 3.5rem); }
.sim-in { display: grid; gap: 1.8rem; align-content: start; }
.sim-in .hint { font-size: 0.86rem; color: var(--muted); }
.sim-out .tool-out { margin-top: 0; padding-top: 0; border-top: 0; }
.sim-out .chart-box { margin-top: 1.6rem; }
.chart-box text { font-family: var(--f-ui); font-size: 12px; fill: var(--muted); }
.chart-box .lab-c { fill: var(--sapin); font-weight: 500; font-size: 13px; }
.chart-box .lab-k { fill: var(--bordeaux); font-weight: 500; font-size: 13px; }
.chart-box .lab-p { fill: #5c4f27; font-weight: 500; font-size: 13px; }
.chart-box .grid { stroke: var(--line); stroke-width: 1; }
.sim-reading { margin-top: 1rem; color: var(--muted); font-size: 0.97rem; max-width: 60ch; }
@media (max-width: 900px) { .sim-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .tool-out { grid-template-columns: 1fr; } }

/* ---------- Petite histoire ---------- */
.today { display: grid; grid-template-columns: minmax(0, 4.5fr) minmax(0, 7.5fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.today .yr { font-family: var(--f-display); font-weight: 300; font-size: clamp(5.5rem, 15vw, 12rem); line-height: 0.9; letter-spacing: -0.05em; color: var(--sable); }
.today .yr-k { margin-top: 1.2rem; color: var(--muted-dark); font-size: 1rem; }
.today h2 { font-family: var(--f-display); font-weight: 300; font-size: clamp(2rem, 3.8vw, 3.2rem); line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance; }
.today .txt { margin-top: 1.6rem; font-size: 1.15rem; line-height: 1.75; color: var(--pierre); max-width: 60ch; }
.echo { margin-top: 2rem; padding: 1.1rem 1.3rem; border-left: 3px solid var(--sable); background: rgba(205, 187, 140, 0.1); max-width: 60ch; }
.echo strong { display: block; font-weight: 500; color: var(--sable); margin-bottom: 0.3rem; font-size: 0.95rem; }
.echo p { color: var(--muted-dark); font-size: 1rem; }
@media (max-width: 900px) { .today { grid-template-columns: 1fr; } }

.frise { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 2.5rem; padding-top: 3.2rem; }
.frise::before { content: ""; position: absolute; left: 0; right: 0; top: 1.25rem; height: 2px; background: var(--line); transform: rotate(-1deg); transform-origin: left; }
.frise li { position: relative; padding-right: 1rem; }
.frise a { display: block; text-decoration: none; }
.frise a::before { content: ""; position: absolute; left: 0; top: -2.4rem; width: 1.1rem; height: 1.1rem; background: var(--papier); border: 2px solid var(--sapin); border-radius: 50%; transition: background 0.2s, border-color 0.2s; }
.frise li:nth-child(1) a::before { top: -2.4rem; }
.frise a:hover::before, .frise a:focus-visible::before { background: var(--sable); }
.frise li.is-today a::before { background: var(--bordeaux); border-color: var(--bordeaux); }
.frise .y { font-family: var(--f-display); font-weight: 300; font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -0.02em; line-height: 1; color: var(--encre); }
.frise li.is-today .y { color: var(--bordeaux); }
.frise .t { display: block; margin-top: 0.5rem; font-size: 0.93rem; color: var(--muted); line-height: 1.35; }
.frise .gap { display: block; margin-top: 0.7rem; font-size: 0.85rem; color: var(--sable-fonce); }
.frise .flag { display: inline-block; margin-top: 0.5rem; padding: 0.1rem 0.6rem; background: var(--bordeaux); color: var(--pierre); font-size: 0.8rem; border-radius: 999px; font-weight: 500; }
@media (max-width: 900px) {
  .frise { grid-template-columns: 1fr; padding-top: 0; padding-left: 2.2rem; gap: 1.8rem; }
  .frise::before { left: 0.5rem; right: auto; top: 0.4rem; bottom: 0.4rem; width: 2px; height: auto; transform: none; }
  .frise a::before { left: -2.2rem; top: 0.25rem; }
  .frise li:nth-child(1) a::before { top: 0.25rem; }
}

.story { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: clamp(1.2rem, 4vw, 4rem); padding-block: clamp(2.5rem, 5vw, 4rem); border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 1rem); }
.story .yr { font-family: var(--f-display); font-weight: 300; font-size: clamp(2.8rem, 6vw, 4.8rem); line-height: 1; letter-spacing: -0.04em; color: var(--bordeaux); }
.story h3 { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.6rem, 2.6vw, 2.2rem); line-height: 1.15; letter-spacing: -0.014em; text-wrap: balance; }
.story .txt { margin-top: 1.1rem; font-size: 1.08rem; line-height: 1.75; max-width: 62ch; }
.story .echo { background: rgba(205, 187, 140, 0.2); border-left-color: var(--sable-fonce); }
.story .echo strong { color: var(--sable-fonce); }
.story .echo p { color: var(--encre); }
.story-nav { display: flex; flex-wrap: wrap; gap: 0.6rem 2rem; margin-top: 1.5rem; font-size: 0.97rem; }
.is-today-badge { display: inline-block; margin-left: 0.7rem; padding: 0.1rem 0.65rem; background: var(--bordeaux); color: var(--pierre); font-family: var(--f-ui); font-size: 0.8rem; border-radius: 999px; font-weight: 500; letter-spacing: 0; vertical-align: 0.3em; }
@media (max-width: 760px) { .story { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  .frise a::before, .toc a { transition: none; }
}

/* Évite que le contenu large (tableaux) élargisse la grille */
#baremes .split > * { min-width: 0; }
.featured-art { max-width: 100%; }
.chart-box text { paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.ind-group .table th.num, .ind-group .table td.num { text-align: left; padding-right: 1.6rem; }
.ind-group .table td.num .tag { font-family: var(--f-ui); font-size: 0.82rem; }
.ind-group .table th:first-child, .ind-group .table td:first-child { width: 34%; }
.ind-group .table th.num, .ind-group .table td.num { width: 20%; }

@media (max-width: 640px) {
  .ind-group .table { min-width: 0; }
  .ind-group .table thead { display: none; }
  .ind-group .table, .ind-group .table tbody, .ind-group .table tr, .ind-group .table td { display: block; width: 100% !important; }
  .ind-group .table tr { padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
  .ind-group .table td { border: 0; padding: 0.15rem 0 !important; }
  .ind-group .table td.num { font-size: 1.5rem; padding-block: 0.3rem !important; }
  .chart-box text { font-size: 21px; stroke-width: 6px; }
  .chart-box .lab-c, .chart-box .lab-k, .chart-box .lab-p { font-size: 23px; }
}
.ag-month .timeline .tag { justify-self: start; }

.article-body .table-wrap { margin-block: 2rem; max-width: none; }

/* Fil d'actualités importé : grille de cartes et fiches */
.feed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 2.5rem 2rem; }
.feed-card { display: flex; flex-direction: column; gap: 1.1rem; text-decoration: none; color: inherit; }
.feed-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; background: var(--line); }
.feed-card .meta { font-size: 0.88rem; color: var(--muted); margin-bottom: 0.4rem; }
.feed-card h3 { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.3rem, 2vw, 1.6rem); line-height: 1.2; letter-spacing: -0.012em; transition: color 0.2s; }
.feed-card:hover h3 { color: var(--bordeaux); }
.feed-card p:not(.meta) { margin-top: 0.6rem; color: var(--muted); }
.feed-card .text-link { display: inline-flex; margin-top: 0.8rem; }
.feed-article { margin-inline: auto; }
.feed-hero { margin: 0 0 2rem; }
.feed-hero img { width: 100%; height: auto; display: block; }
.feed-article .table-wrap { overflow-x: auto; margin-block: 1.6rem; max-width: none; }
.feed-article .table th, .feed-article .table td { padding: 0.55rem 0.8rem; vertical-align: top; }
.feed-article img { max-width: 100%; height: auto; }

.feed-article details{margin-block:1.6rem;padding:1.1rem 1.4rem;border-left:3px solid var(--accent, currentColor);background:var(--surface-2, rgba(127,127,127,.08))}
.feed-article details summary{cursor:pointer;font-weight:600}
.feed-article details[open] summary{margin-bottom:.9rem}

.glossaire-az ul { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 2.5rem; }
.glossaire-az a { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border: 1px solid var(--line); font-family: var(--f-display); font-size: 1.15rem; text-decoration: none; transition: color 0.2s, border-color 0.2s; }
.glossaire-az a:hover { color: var(--bordeaux); border-color: var(--bordeaux); }
.glossaire-lettre { scroll-margin-top: calc(var(--header-h) + 1.5rem); margin: 3rem 0 0.8rem; font-family: var(--f-display); font-weight: 400; font-size: 2.6rem; line-height: 1; color: var(--sable-fonce); }
.glossaire .defs > div { scroll-margin-top: calc(var(--header-h) + 1.5rem); }
.glossaire .note { margin-top: 3rem; }
