/*
Theme Name: Fatti in Chiaro
Description: Tema a blocchi della rete Fatti in Chiaro: elegante e minimal, un solo template articolo pensato per Discover, un solo carattere scaricato (Literata), testata in SVG, niente jQuery.
Version: 0.4.0
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: fattiinchiaro
*/

/* Scelta dell'editore del 7 nov 2026: variante «Literata», colore bordeaux #9f1d35 (al posto del lampone). Identità (studi del 6 nov 2026, reports/): bianco e nero, un solo colore usato con misura,
   edizione sotto il nome. Uguale in tutta la rete.
   Dal 30 nov 2026 la testata è il logo «fattiinchiaro» in SVG (Libre Caslon, due i a occhi: brand/README.md). */
:root {
  --cm-max: 720px;
  --cm-ink: var(--wp--preset--color--ink);
  --cm-muted: var(--wp--preset--color--muted);
  --cm-line: var(--wp--preset--color--line);
  --cm-accent: var(--wp--preset--color--accent);
  --cm-tint: var(--wp--preset--color--tint);
  --cm-serif: var(--wp--preset--font-family--serif);
}
body { margin: 0; -webkit-text-size-adjust: 100%; }
img { max-width: 100%; height: auto; }
a { text-underline-offset: 2px; }

/* Testata */
.cm-header { text-align: center; padding: 18px 16px 0; border-bottom: 1px solid var(--cm-line); }
.cm-masthead { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cm-masthead__name { margin: 0; line-height: 0; }
.cm-masthead__name a { display: inline-block; color: var(--cm-ink); text-decoration: none; }
.cm-masthead__logo { display: block; width: 240px; max-width: 72vw; height: auto; }
@media (min-width: 700px) { .cm-masthead__logo { width: 320px; } }
.cm-masthead__edition { margin: 0; font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--cm-muted); }
.cm-header .cm-masthead { padding-bottom: 14px; border-bottom: 2px solid var(--cm-accent); margin: 0 -16px; }
.cm-nav .cm-nav__list { display: flex; gap: 18px; justify-content: safe center; overflow-x: auto; list-style: none; margin: 0; padding: 10px 0; white-space: nowrap; scrollbar-width: none; font-size: .82rem; }
.cm-nav .cm-nav__list a { color: var(--cm-ink); text-decoration: none; }
.cm-nav .cm-nav__list a[aria-current] { color: var(--cm-accent); }

/* Occhiello: COMUNE · categoria */
.cm-kicker { margin: 0; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.cm-kicker a { text-decoration: none; }
.cm-kicker__comune { color: var(--cm-accent); font-weight: 700; }
.cm-kicker__cat { color: var(--cm-muted); }
.cm-kicker__sep { color: var(--cm-muted); }

/* Articolo */
.cm-article { max-width: var(--cm-max); margin: 0 auto; padding: 22px 16px 40px; box-sizing: border-box; overflow-wrap: break-word; }
.cm-article > * + * { margin-top: 12px; }
.cm-article .wp-block-post-title { margin: 6px 0 0; font-family: var(--cm-serif); font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
.cm-dek { font-size: 1.02rem; line-height: 1.5; margin: 0; color: #333; }
.cm-byline { font-size: .8rem; color: var(--cm-muted); margin: 0; }
.cm-byline__author { color: var(--cm-ink); }
.cm-hero { margin: 16px -16px 0; }
.cm-hero__img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: #f2f2f2; }
.cm-hero figcaption { font-size: .78rem; line-height: 1.45; color: var(--cm-muted); padding: 6px 16px 0; }
.cm-hero__credit { overflow-wrap: anywhere; }
.cm-hero__credit::before { content: "· "; }
.cm-lead { font-size: 1.06rem; line-height: 1.6; font-weight: 500; }
.cm-article .wp-block-post-content p, .cm-article .wp-block-post-content li { line-height: 1.62; }
.cm-article .wp-block-post-content h2 { font-size: 1.25rem; margin-top: 1.6em; }
.cm-article .wp-block-post-content a { color: var(--cm-accent); text-decoration: underline; }
/* «Cosa cambia per te»: riquadro a sé, fondo rosa carta e riga lampone (richiesta dell'editore, 7 nov 2026) */
.cm-box { background: var(--cm-tint); border-top: 3px solid var(--cm-accent); padding: 14px 16px 10px; margin: 24px 0; }
.cm-box__title { margin: 0 0 8px; font-family: inherit; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--cm-accent); }
.cm-box dl { margin: 0; }
.cm-box__row { padding: 8px 0; border-top: 1px solid #ecdcdf; }
.cm-box__row:first-child { border-top: 0; padding-top: 2px; }
.cm-box dt { font-weight: 700; font-size: .95rem; }
.cm-box dd { margin: 0; font-size: .95rem; line-height: 1.5; }
.cm-fonte { border: 1px solid var(--cm-line); padding: 12px 16px; margin: 26px 0 12px; font-size: .9rem; line-height: 1.5; }
.cm-fonte__title { margin: 0 0 4px; font-family: inherit; font-size: .7rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--cm-muted); }
.cm-fonte p { margin: 0; }
.cm-fonte a { color: var(--cm-accent); }
.cm-nota-ai { font-size: .8rem; color: var(--cm-muted); }
.cm-luoghi { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.cm-luoghi a { border: 1px solid var(--cm-line); padding: 3px 12px; font-size: .82rem; text-decoration: none; color: var(--cm-ink); }
.cm-correlati { border-top: 1px solid var(--cm-ink); margin-top: 28px; padding-top: 8px; }
.cm-correlati h2 { font-family: inherit; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--cm-accent); margin: 0 0 6px; }
.cm-correlati ul { list-style: none; padding: 0; margin: 0; }
.cm-correlati li { padding: 10px 0; border-bottom: 1px solid var(--cm-line); font-family: var(--cm-serif); font-weight: 600; line-height: 1.3; }
.cm-correlati a { color: var(--cm-ink); text-decoration: none; }

/* Spazi pubblicitari riservati: altezza fissa, nessuno spostamento del contenuto (CLS) */
.cm-ad { min-height: 280px; margin: 24px 0; background: #fafafa; }

/* Liste: home, comune, categoria — apertura grande, poi righe con miniatura a destra */
.cm-list { max-width: 1120px; margin: 0 auto; padding: 8px 16px 40px; box-sizing: border-box; }
.cm-list .wp-block-query-title { font-family: inherit; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--cm-accent); margin: 14px 0 4px; }
.cm-list .wp-block-post-template { list-style: none; padding: 0; margin: 0; }
.cm-list .wp-block-post-template > li { border-bottom: 1px solid var(--cm-line); padding: 14px 0; }
.cm-card { display: grid; grid-template-columns: 1fr 96px; grid-template-areas: "kicker img" "title img"; column-gap: 12px; row-gap: 4px; align-items: start; }
.cm-card .wp-block-post-featured-image { grid-area: img; margin: 0; }
.cm-card .wp-block-post-featured-image img { aspect-ratio: 1; object-fit: cover; width: 100%; height: auto; }
.cm-card .cm-kicker { grid-area: kicker; }
.cm-card .wp-block-post-title { grid-area: title; font-family: var(--cm-serif); font-weight: 600; font-size: 1.05rem; line-height: 1.25; margin: 0; }
.cm-card .wp-block-post-title a { color: var(--cm-ink); text-decoration: none; }
.cm-card .cm-dek { display: none; }
/* La prima notizia della prima pagina: grande */
.cm-lead-q .wp-block-post-template > li:first-child { padding-top: 16px; }
.cm-lead-q .wp-block-post-template > li:first-child .cm-card { grid-template-columns: 1fr; grid-template-areas: "img" "kicker" "title" "dek"; row-gap: 8px; }
.cm-lead-q .wp-block-post-template > li:first-child .wp-block-post-featured-image img { aspect-ratio: 16 / 9; }
.cm-lead-q .wp-block-post-template > li:first-child .wp-block-post-title { font-size: 1.5rem; line-height: 1.2; }
.cm-lead-q .wp-block-post-template > li:first-child .cm-dek { display: block; grid-area: dek; font-size: .98rem; color: #333; }
@media (min-width: 900px) {
  .cm-list .wp-block-post-template { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 28px; }
  .cm-lead-q .wp-block-post-template > li:first-child { grid-column: 1 / -1; }
  .cm-lead-q .wp-block-post-template > li:first-child .cm-card { grid-template-columns: 3fr 2fr; grid-template-rows: auto auto 1fr; grid-template-areas: "img kicker" "img title" "img dek"; column-gap: 28px; align-content: start; }
  .cm-lead-q .wp-block-post-template > li:first-child .wp-block-post-title { font-size: 1.9rem; }
}
.wp-block-query-pagination { margin-top: 24px; gap: 14px; }

/* Piede */
.cm-footer { border-top: 2px solid var(--cm-accent); padding: 22px 16px 36px; text-align: center; font-size: .82rem; color: var(--cm-muted); }
.cm-footer .cm-masthead__logo { width: 180px; }
.cm-footer a { color: var(--cm-muted); }
.cm-footer p { margin: 8px 0 0; }

/* Firma: autore e data esplicita a sinistra, WhatsApp a destra (studio «Struttura pagina per Discover») */
.cm-byline { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; }
.cm-byline__text { margin: 0; font-size: .8rem; line-height: 1.5; color: var(--cm-muted); }
.cm-byline__author { color: var(--cm-ink); font-weight: 600; text-decoration: none; }
.cm-share-wa { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 6px 10px; border: 1px solid var(--cm-line); border-radius: 999px; font-size: .78rem; color: var(--cm-ink); text-decoration: none; }
.cm-share-wa svg { color: #128c4b; }

/* Home: «Ultime notizie» con l'ora, subito dopo l'apertura */
.cm-ultime { border-top: 1px solid var(--cm-ink); padding: 10px 0 4px; margin: 6px 0 4px; }
.cm-ultime h2 { margin: 0 0 6px; font-family: inherit; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--cm-accent); }
.cm-ultime ol { list-style: none; margin: 0; padding: 0; }
.cm-ultime li { display: grid; grid-template-columns: 52px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--cm-line); font-size: .95rem; line-height: 1.35; }
.cm-ultime time { font-size: .78rem; color: var(--cm-muted); padding-top: 2px; font-variant-numeric: tabular-nums; }
.cm-ultime a { color: var(--cm-ink); text-decoration: none; }
.cm-ultime__com { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--cm-accent); font-weight: 700; margin-right: 4px; }

/* Home: dopo l'apertura, righe con titolo a sinistra e immagine a destra (come lo stile Le Monde) */
.cm-rows-q .cm-card .wp-block-post-title { font-size: 1.05rem; }

/* «Leggi anche»: articoli collegati dalla pipeline (stessa storia), subito dopo il box */
.cm-collegati { margin: 20px 0 8px; padding: 10px 0 2px; border-top: 1px solid var(--cm-ink); }
.cm-collegati h2 { margin: 0 0 4px; font-family: inherit; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--cm-accent); }
.cm-collegati ul { list-style: none; margin: 0; padding: 0; }
.cm-collegati li { padding: 8px 0; border-bottom: 1px solid var(--cm-line); font-family: var(--cm-serif); font-weight: 600; line-height: 1.3; }
.cm-collegati a { color: var(--cm-ink); text-decoration: none; }
