/* =========================================================
   Blog: indice, categorie, articolo. Card neutre, testo lungo leggibile.
   Usa archive-head, section-title e closing da service.css.
   ========================================================= */

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Breadcrumb ---------- */
/* Stile comune in base.css; nel blog stanno nel flusso della testata invece che sopra. */
.blog-head .breadcrumbs, .post__head .breadcrumbs { position: static; }

/* ---------- Testa dell'indice e filtro categorie ---------- */
.blog-head { gap: 20px; }
.blog-head .breadcrumbs { margin-bottom: 4px; }
.blog-filter ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.blog-filter a {
	display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: var(--radius-pill);
	background: var(--surface); box-shadow: var(--hairline); text-decoration: none; font-size: var(--fs-xs); font-weight: 700; color: var(--muted);
	transition: color .25s, box-shadow .25s;
}
.blog-filter a:hover { color: var(--text); box-shadow: var(--hairline-hi); }
.blog-filter a[aria-current] { color: var(--text); box-shadow: inset 0 0 0 1px var(--magenta); }

/* ---------- Griglia e card articolo ---------- */
.post-grid { list-style: none; padding: 0 var(--gutter); display: grid; gap: clamp(20px, 2.4vw, 32px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.post-card {
	position: relative; height: 100%; display: grid; grid-template-rows: auto 1fr; overflow: hidden;
	border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--hairline), var(--shadow-card);
	transition: transform .5s var(--ease-out), box-shadow .3s;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--hairline-hi), var(--shadow-card); }
.post-card:focus-within { box-shadow: 0 0 0 2px var(--focus), var(--shadow-card); }
.post-card__media { aspect-ratio: 16 / 9; background: var(--bg-sunk); overflow: hidden; }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; }
.post-card__media--empty {
	display: flex; align-items: flex-end; padding: 20px 24px;
	background: var(--surface-hi);
	box-shadow: inset 0 -1px 0 rgb(255 255 255 / .06);
}
.post-card__mark { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); font-weight: 800; letter-spacing: -.03em; line-height: 1; color: rgb(242 239 247 / .14); overflow-wrap: anywhere; }
.post-card__body { padding: 24px 24px 26px; display: grid; gap: 10px; align-content: start; }
.post-card__cat { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); }
.post-card__title { font-size: clamp(1.25rem, 1.1rem + .5vw, 1.5rem); line-height: 1.15; letter-spacing: -.02em; }
.post-card__title a { text-decoration: none; }
.post-card__title a::after { content: ""; position: absolute; inset: 0; } /* intera card cliccabile */
.post-card__title a:focus-visible { outline: none; }
.post-card__excerpt { color: var(--muted); }
.post-card__meta, .post__meta { display: flex; flex-wrap: wrap; gap: 4px 0; font-size: var(--fs-xs); color: var(--subtle); }
.post-card__meta > * + *::before, .post__meta > * + *::before { content: "·"; margin: 0 10px; }
.post-card__meta { margin-top: 6px; }

/* ---------- Paginazione ---------- */
.pagination { padding: clamp(40px, 5vw, 64px) var(--gutter) 0; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 14px;
	border-radius: var(--radius-pill); text-decoration: none; font-weight: 700; font-size: var(--fs-xs); font-variant-numeric: tabular-nums;
	background: var(--surface); box-shadow: var(--hairline); color: var(--muted);
}
.pagination a.page-numbers:hover { color: var(--text); box-shadow: var(--hairline-hi); }
.pagination .page-numbers.current { color: var(--text); box-shadow: inset 0 0 0 1px var(--magenta); }
.pagination .page-numbers.dots { background: none; box-shadow: none; }

/* ---------- Articolo ---------- */
.post { padding: calc(var(--header-h) + 48px) var(--gutter) 0; }
.post__head { max-width: 1120px; margin-inline: auto; display: grid; gap: 20px; justify-items: center; text-align: center; }
.post__head .breadcrumbs ol { justify-content: center; }
.post__title { font-size: var(--fs-xl); line-height: 1.08; max-width: 24ch; text-wrap: balance; } /* largo: 2 righe invece di 4 */
.post__meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; }
.post__meta { color: var(--muted); }
.post__meta a { color: var(--text); font-weight: 700; text-decoration: none; }
.post__meta a:hover { text-decoration: underline; }
.post__cover { margin: clamp(32px, 5vw, 56px) auto 0; max-width: 1120px; border-radius: var(--radius-card); overflow: hidden; background: var(--bg-sunk); box-shadow: var(--hairline), var(--shadow-card); }
.post__cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.post__layout { margin: clamp(40px, 6vw, 72px) auto 0; max-width: 900px; display: grid; gap: 40px; }

/* Indice dei contenuti */
.toc { padding: 20px 22px; border-radius: var(--radius-field); background: rgb(18 17 22 / .86); box-shadow: var(--hairline); }
.toc__title { font-weight: 800; margin-bottom: 12px; }
.toc ol { list-style: none; display: grid; gap: 2px; }
.toc ol ol { margin: 2px 0 6px 14px; padding-left: 12px; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 6px 0; color: var(--muted); text-decoration: none; font-size: var(--fs-xs); line-height: 1.4; transition: color .2s; }
.toc a:hover { color: var(--text); }
.toc a[aria-current] { color: var(--text); font-weight: 700; }
.toc a[aria-current]::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 8px 0 0; border-radius: 50%; background: var(--magenta); vertical-align: .15em; } /* pallino della voce attiva */

/* Telefono e tablet: indice compatto (prime voci + "Mostra tutto"), così si comincia subito a leggere. */
.toc__more { display: none; margin-top: 10px; padding: 8px 0; border: 0; background: none; color: var(--text); font: 700 var(--fs-xs)/1.4 var(--font); cursor: pointer; text-decoration: underline; text-decoration-color: var(--magenta); text-underline-offset: .25em; }
@media (max-width: 1099px) {
	.toc--collapsible .toc__more { display: inline-block; }
	.toc--collapsed .toc__list { max-height: 9.6em; overflow: hidden; -webkit-mask: linear-gradient(#000 55%, transparent); mask: linear-gradient(#000 55%, transparent); }
}

@media (min-width: 1100px) {
	.post--toc .post__layout { max-width: 1120px; grid-template-columns: 240px minmax(0, 1fr); column-gap: clamp(48px, 5vw, 80px); align-items: start; }
	.post__aside { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100dvh - var(--header-h) - 48px); overflow-y: auto; }
	.toc { background: none; box-shadow: none; padding: 0 0 0 16px; border-left: 1px solid var(--line); }
}

/* Testo lungo */
.prose--long { max-width: 70ch; color: rgb(242 239 247 / .8); line-height: 1.75; }
.prose--long > * + * { margin-top: 1.25em; }
.prose--long h2 { font-size: var(--fs-lg); line-height: 1.15; margin-top: 2.2em; scroll-margin-top: calc(var(--header-h) + 24px); }
.prose--long h3 { font-size: clamp(1.1875rem, 1.05rem + .5vw, 1.375rem); line-height: 1.25; letter-spacing: -.02em; margin-top: 1.8em; scroll-margin-top: calc(var(--header-h) + 24px); }
.prose--long h2 + *, .prose--long h3 + * { margin-top: .7em; }
.prose--long strong { color: var(--text); font-weight: 700; }
.prose--long a { color: var(--text); text-decoration-color: var(--magenta); text-decoration-thickness: 2px; }
.prose--long a:hover { color: var(--magenta-hi); }
.prose--long li + li { margin-top: .45em; }
.prose--long li::marker { color: var(--subtle); }
.prose--long blockquote { margin-inline: 0; padding: 4px 0 4px 24px; border-left: 1px solid var(--line-strong); color: var(--text); font-size: 1.08em; font-weight: 600; }
.prose--long blockquote cite { display: block; margin-top: .6em; font-size: var(--fs-xs); font-style: normal; font-weight: 600; color: var(--subtle); }
.prose--long figure { margin-inline: 0; }
.prose--long img { border-radius: var(--radius-field); }
.prose--long figcaption { margin-top: 10px; font-size: var(--fs-xs); color: var(--subtle); }
.prose--long hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.5em; }
.prose--long code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; padding: .1em .4em; border-radius: 6px; background: var(--surface-hi); color: var(--text); }
.prose--long pre { overflow-x: auto; padding: 18px 20px; border-radius: var(--radius-field); background: var(--bg-sunk); box-shadow: var(--hairline); }
.prose--long pre code { padding: 0; background: none; }
.prose--long table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); display: block; overflow-x: auto; }
.prose--long th, .prose--long td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose--long th { color: var(--text); font-weight: 700; border-bottom-color: var(--line-strong); }

/* Condivisione e servizio collegato */
.post__foot { margin: clamp(48px, 6vw, 80px) auto 0; max-width: 900px; display: grid; gap: clamp(32px, 4vw, 48px); }
.post--toc .post__foot { max-width: 1120px; }
@media (min-width: 1100px) {
	.post--toc .post__foot { padding-left: calc(240px + clamp(48px, 5vw, 80px)); }
}
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-top: 24px; border-top: 1px solid var(--line); }
.share__title { font-weight: 700; color: var(--muted); }
.share__list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.share__link {
	display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; cursor: pointer;
	border-radius: var(--radius-pill); background: var(--surface); box-shadow: var(--hairline);
	text-decoration: none; font-size: var(--fs-xs); font-weight: 700; transition: box-shadow .25s;
}
.share__link:hover { box-shadow: var(--hairline-hi); }
.share__link[hidden] { display: none; }
.share__icon { width: 18px; height: 18px; flex: none; }

.post-service {
	display: grid; gap: 24px; padding: clamp(24px, 3vw, 36px); border-radius: var(--radius-card);
	background: var(--surface); box-shadow: var(--hairline), var(--shadow-card);
}
.post-service__art { width: min(100%, 240px); aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--bg); }
.post-service__art img { width: 100%; height: 100%; object-fit: cover; }
.post-service__body { display: grid; gap: 12px; justify-items: start; align-content: center; }
.post-service__title { font-size: var(--fs-lg); }
.post-service__promise { font-size: var(--fs-md); font-weight: 600; color: var(--text); }
.post-service__text { color: var(--muted); max-width: 52ch; }
.post-service .actions { margin-top: 8px; }
@media (min-width: 700px) {
	.post-service:not(.post-service--plain) { grid-template-columns: 240px 1fr; align-items: center; gap: clamp(24px, 3vw, 40px); }
}

/* Correlati */
.related { padding-top: var(--section); }
.related .section-title { padding: 0 var(--gutter); max-width: none; }

@media (prefers-reduced-motion: reduce) {
	.post-card, .post-card:hover { transition: none; transform: none; }
}

/* ---------- Autore ---------- */
.post__byline { color: var(--text); font-weight: 600; }
.post-author { display: flex; gap: 16px; align-items: flex-start; padding: 20px; border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--hairline); }
.post-author__mark { flex: none; width: 44px; height: 44px; background: url("../img/ring.webp") center / contain no-repeat; }
.post-author__name { font-weight: 800; letter-spacing: -.01em; }
.post-author__bio { color: var(--muted); font-size: var(--fs-xs); margin-top: 4px; max-width: 60ch; }
.post-author__link { margin-top: 10px; font-size: var(--fs-xs); }
