/* Barsanti Galilei Magazine — pagine pubbliche */
:root {
	--primary: #1a3a5c;
	--accent: #b85f00;
	--accent-chiaro: #e8880a;
	--text: #222;
	--muted: #5a5a5a;
	--bg: #f9f9f9;
	--card-bg: #fff;
	--border: #ddd;
	--radius: 6px;
	--max-width: 780px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Georgia, 'Times New Roman', serif; font-size: 18px; line-height: 1.7; color: var(--text); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 3px solid var(--accent-chiaro); outline-offset: 2px; }
img { max-width: 100%; height: auto; }

.salta { position: absolute; left: -9999px; }
.salta:focus { left: 8px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; }

.testata { background: var(--primary); color: #fff; padding: 1rem 2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.testata a { color: #fff; }
.testata .site-name { font-size: 1.3rem; font-weight: bold; letter-spacing: .02em; }
.testata nav { display: flex; gap: 1.4rem; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: .9rem; }

main { max-width: 1100px; margin: 0 auto; padding: 2rem 1.25rem 3rem; }

/* Elenco */
.page-header { margin-bottom: 1.2rem; }
.page-title { font-size: 2rem; color: var(--primary); line-height: 1.2; }
.conteggio { color: var(--muted); font-size: .95rem; }
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.8rem; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; }
.filter-bar a { padding: .35rem .95rem; border: 1px solid var(--primary); border-radius: 20px; color: var(--primary); font-size: .9rem; background: #fff; }
.filter-bar a.active, .filter-bar a:hover { background: var(--primary); color: #fff; text-decoration: none; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; color: var(--text); display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.card:hover { text-decoration: none; box-shadow: 0 6px 18px rgba(0,0,0,.12); transform: translateY(-2px); }
.card-img { width: 100%; height: 190px; object-fit: cover; display: block; }
.card-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.card-cat { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 700; }
.card-title { font-size: 1.12rem; line-height: 1.3; color: var(--primary); font-weight: bold; }
.card-excerpt { font-size: .92rem; line-height: 1.5; color: #444; }
.card-meta { margin-top: auto; padding-top: .5rem; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: .8rem; color: var(--muted); }

.pagine { margin-top: 2rem; display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: .9rem; }
.pagine .page-numbers { padding: .4rem .85rem; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: var(--primary); }
.pagine .page-numbers.current { background: var(--primary); color: #fff; border-color: var(--primary); }
.vuoto { color: var(--muted); padding: 2rem 0; }

/* Articolo */
.articolo { max-width: var(--max-width); margin: 0 auto; }
.post-header { margin-bottom: 1.5rem; }
.categories { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin-bottom: .5rem; }
.post-header h1 { font-size: 2.1rem; line-height: 1.2; color: var(--primary); margin-bottom: .6rem; }
.post-meta { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: .92rem; color: var(--muted); }
.post-meta strong { color: var(--text); }
.featured-image { width: 100%; height: auto; border-radius: var(--radius); margin-bottom: 1.8rem; display: block; }

.post-content p { margin-bottom: 1.2em; }
.post-content h2 { font-size: 1.45rem; color: var(--primary); margin: 1.8em 0 .6em; line-height: 1.3; }
.post-content h3, .post-content h4 { font-size: 1.2rem; color: var(--primary); margin: 1.6em 0 .5em; }
.post-content ul, .post-content ol { margin: 0 0 1.2em 1.5em; }
.post-content li { margin-bottom: .4em; }
.post-content blockquote { border-left: 4px solid var(--accent-chiaro); padding: .4rem 0 .4rem 1.2rem; margin: 1.5em 0; color: #444; font-style: italic; }
.post-content blockquote p:last-child { margin-bottom: 0; }
.post-content figure { margin: 1.8em 0; max-width: 100%; }
.post-content .wp-caption { width: auto !important; max-width: 100%; margin: 1.8em 0; }
.post-content img { border-radius: var(--radius); display: block; margin-left: auto; margin-right: auto; }
.post-content figcaption, .post-content .wp-caption-text { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: .85rem; color: var(--muted); text-align: center; margin-top: .5rem; }
.post-content .alignleft { float: left; margin: .3em 1.4em 1em 0; max-width: 50%; }
.post-content .alignright { float: right; margin: .3em 0 1em 1.4em; max-width: 50%; }
.post-content::after { content: ''; display: block; clear: both; }

.post-footer { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: .92rem; }
.post-footer .modifica { background: var(--primary); color: #fff; padding: .35rem .9rem; border-radius: var(--radius); }

.piede { background: var(--primary); color: #dfe6ee; text-align: center; padding: 1.5rem 1rem; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: .85rem; }
.piede a { color: #fff; text-decoration: underline; }

@media (max-width: 600px) {
	body { font-size: 17px; }
	.testata { padding: .9rem 1.1rem; }
	.page-title, .post-header h1 { font-size: 1.6rem; }
	.post-content .alignleft, .post-content .alignright { float: none; max-width: 100%; margin: 1.5em 0; }
}
