/*
 * Centro Studi Storico Militari «Gerardo Salinardi» – stile del sito (tema Blocksy)
 * Colori: grigioverde #262b1f / #4b5234, ottone #7d6332 / #c9a96a, carta #faf8f3 / #f1ece1.
 * La tavolozza è impostata anche nel Personalizza di Blocksy (colori 1–8).
 */

:root {
	--csgs-scuro: #262b1f;
	--csgs-grigioverde: #4b5234;
	--csgs-ottone: #7d6332;
	--csgs-ottone-chiaro: #c9a96a;
	--csgs-carta: #faf8f3;
	--csgs-pergamena: #f1ece1;
	--csgs-chiaro: #e9e4d6;
	--csgs-tricolore: linear-gradient(90deg, #009246 0 33.33%, #fff 33.33% 66.66%, #ce2b37 66.66%);
}

/* ---------- Intestazione ---------- */
#header {
	position: relative;
	border-top: 4px solid transparent;
	border-image: var(--csgs-tricolore) 1;
	border-image-width: 4px 0 0 0;
}
#header [data-row*="middle"] {
	background: var(--csgs-scuro);
	border-bottom: 1px solid rgba(201, 169, 106, .35);
}
#header .site-title,
#header .site-title a {
	font-family: 'EB Garamond', Georgia, serif;
	font-weight: 600;
	font-size: 25px;
	line-height: 1.1;
	letter-spacing: .01em;
	color: #fff;
}
#header .site-title a:hover { color: var(--csgs-ottone-chiaro); }
#header .site-description {
	font-size: 12px;
	letter-spacing: .2em;
	text-transform: uppercase;
	color: var(--csgs-ottone-chiaro);
	margin-top: 4px;
}
#header [data-id="menu"] > ul > li > a {
	--theme-link-initial-color: var(--csgs-chiaro);
	--theme-link-hover-color: var(--csgs-ottone-chiaro);
	--theme-link-active-color: var(--csgs-ottone-chiaro);
	font-size: 15px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
}
#header [data-id="menu"] > ul > li.current-menu-item > a,
#header [data-id="menu"] > ul > li.current-menu-ancestor > a,
#header [data-id="menu"] > ul > li.current_page_parent > a {
	color: var(--csgs-ottone-chiaro);
	box-shadow: inset 0 -2px 0 var(--csgs-ottone-chiaro);
}
#header [data-id="menu"] .sub-menu {
	--dropdown-background-color: var(--csgs-scuro);
	--theme-link-initial-color: var(--csgs-chiaro);
	--theme-link-hover-color: var(--csgs-ottone-chiaro);
}
#header .ct-header-search,
#header .ct-header-trigger {
	--theme-icon-color: var(--csgs-chiaro);
	--theme-icon-hover-color: var(--csgs-ottone-chiaro);
}
#offcanvas .ct-panel-inner { background: var(--csgs-scuro); }
#offcanvas {
	--theme-link-initial-color: var(--csgs-chiaro);
	--theme-link-hover-color: var(--csgs-ottone-chiaro);
	--theme-icon-color: var(--csgs-chiaro);
}

/* ---------- Titoli di pagina (hero Blocksy) ---------- */
.hero-section[data-type="type-1"] .page-title,
.entry-header .page-title {
	position: relative;
	padding-bottom: 14px;
}
.hero-section[data-type="type-1"] .page-title::after,
.entry-header .page-title::after {
	content: "";
	display: block;
	width: 64px;
	height: 2px;
	background: var(--csgs-ottone);
	margin-top: 14px;
}
.hero-section[data-type="type-1"][data-alignment="center"] .page-title::after { margin-left: auto; margin-right: auto; }

/* ---------- Contenuti ---------- */
.entry-content a:not(.wp-block-button__link):not(.wp-element-button) {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}
.entry-content blockquote,
.wp-block-quote {
	border-left: 3px solid var(--csgs-ottone);
	font-family: 'EB Garamond', Georgia, serif;
	font-size: 1.2em;
	font-style: italic;
}
.wp-block-separator { border-color: var(--csgs-pergamena); }
.wp-block-separator.is-style-csgs, .csgs-filetto {
	width: 64px; border: 0; border-top: 2px solid var(--csgs-ottone); margin-left: 0;
}

/* Segnaposto dei dati da completare */
.csgs-da-completare {
	background: #fff7d6;
	border: 1px dashed #c9a96a;
	padding: 2px 6px;
	border-radius: 2px;
	color: #6b5520;
}

/* Etichetta sopra i titoli (es. «Centro Studi Storico Militari») */
.csgs-occhiello {
	font-family: 'Source Sans 3', system-ui, sans-serif;
	font-size: 13px !important;
	font-weight: 600;
	letter-spacing: .22em;
	text-transform: uppercase;
	color: var(--csgs-ottone-chiaro);
	margin-bottom: 12px !important;
}
.has-csgs-pergamena-background-color .csgs-occhiello,
.csgs-sezione-chiara .csgs-occhiello { color: var(--csgs-ottone); }

/* Copertina della Home */
.csgs-copertina h1 { color: #fff; }
.csgs-copertina .wp-block-button__link { border-radius: 2px; }
.csgs-copertina .wp-block-button.is-style-outline .wp-block-button__link { color: #fff !important; border-color: rgba(255,255,255,.65) !important; background: transparent !important; }
.csgs-copertina .wp-block-button.is-style-outline .wp-block-button__link:hover { background: #fff !important; color: var(--csgs-scuro) !important; }

/* Schede (colonne con bordo) */
.csgs-scheda {
	background: #fff;
	border-top: 3px solid var(--csgs-ottone);
	box-shadow: 0 10px 30px -12px rgba(38, 43, 31, .18);
	height: 100%;
}
.csgs-scheda h3 { margin-top: 0; }

/* Elenchi notizie */
.wp-block-post-template .wp-block-post-title a { text-decoration: none; }
.wp-block-post-template .wp-block-post-date { color: var(--csgs-ottone); font-size: 14px; letter-spacing: .04em; text-transform: uppercase; }
.wp-block-post-template .wp-block-post-featured-image img { aspect-ratio: 3/2; object-fit: cover; }
.wp-block-post-template .wp-block-post-featured-image img.csgs-img-intera { object-fit: contain; background: var(--csgs-pergamena); }

/* Pulsanti */
.wp-block-button__link, .ct-button, button[type="submit"], input[type="submit"] { letter-spacing: .03em; }

/* ---------- Piè di pagina ---------- */
#footer {
	--theme-text-color: #b9b4a5;
	--theme-link-initial-color: var(--csgs-chiaro);
	--theme-link-hover-color: var(--csgs-ottone-chiaro);
	--theme-heading-color: #fff;
	color: #b9b4a5;
}
#footer [data-row*="middle"] { background: var(--csgs-scuro); }
#footer [data-row*="bottom"] { background: #1c2017; border-top: 1px solid rgba(201,169,106,.25); }
#footer .ct-widget h2, #footer .ct-widget h3, #footer .widget-title {
	font-family: 'EB Garamond', Georgia, serif;
	font-size: 21px;
	font-weight: 600;
	color: #fff;
}
#footer .ct-footer-copyright { color: #9e998a; font-size: 14px; }
#footer ul { list-style: none; padding-left: 0; }
#footer ul li { margin-bottom: 6px; }
#footer a { text-decoration: none; }

/* Torna su */
.ct-back-to-top { --theme-icon-color: #fff; background: var(--csgs-grigioverde); }

/* Barra di amministrazione: avviso manutenzione */
#wpadminbar .csgs-manutenzione > a { background: #ce2b37 !important; color: #fff !important; }

@media (max-width: 689px) {
	#header .site-title, #header .site-title a { font-size: 20px; }
	#header .site-description { font-size: 10px; letter-spacing: .14em; }
}

/* Copertina: testo allineato alla griglia del sito */
.csgs-copertina .wp-block-cover__inner-container {
	max-width: 1200px !important;
	width: calc(100% - 48px) !important;
	margin-inline: auto !important;
}

/* Copertina con il ritratto di Gerardo Salinardi:
 * desktop → foto nella metà destra a risoluzione piena, sfumata verso il testo;
 * mobile → foto a tutto schermo con velatura scura. */
.csgs-copertina { background: var(--csgs-scuro); }
.csgs-copertina .wp-block-cover__image-background { filter: grayscale(1) contrast(1.05); }
@media (min-width: 782px) {
	.csgs-copertina .wp-block-cover__image-background {
		left: auto !important;
		right: 0;
		width: 58% !important;
		-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 40%);
		mask-image: linear-gradient(90deg, transparent 0, #000 40%);
	}
}
@media (max-width: 781px) {
	.csgs-copertina .wp-block-cover__background {
		background: rgba(38, 43, 31, .82) !important;
	}
}

/* Nome nell'intestazione su due righe */
#header .site-title .csgs-logo-occhiello {
	display: block;
	font-family: 'Source Sans 3', system-ui, sans-serif;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .2em;
	text-transform: uppercase;
	color: var(--csgs-ottone-chiaro);
	margin-bottom: 3px;
}
#header .site-title a { font-size: 27px; }
@media (max-width: 689px) {
	#header .site-title a { font-size: 22px; }
	#header .site-title .csgs-logo-occhiello { font-size: 10px; letter-spacing: .14em; }
}

/* Titoli delle schede senza sottolineatura */
.csgs-scheda h3 a { text-decoration: none !important; color: var(--theme-palette-color-4); }
.csgs-scheda h3 a:hover { color: var(--csgs-ottone); }

/* Menu: tutte le voci su una riga anche con «Ricerche» */
#header [data-id="menu"] { --menu-items-spacing: 16px; }
#header [data-id="menu"] > ul > li > a { font-size: 14px; letter-spacing: .03em; }

/* Note a fine testo delle ricerche */
.csgs-note { font-size: .92em; color: var(--theme-palette-color-3); }
.csgs-note p { margin-bottom: 1em; }
.csgs-note .wp-block-table { font-size: .95em; margin: 1.2em 0 1.6em; }
.entry-content sup a { text-decoration: none; padding: 0 .1em; }
.entry-content [id^="nota-"], .entry-content [id^="rif-"] { scroll-margin-top: 110px; }
