/*
Theme Name:   Collab Theme
Theme URI:    https://collab.di.uniba.it/
Description:  Child theme di Spacious per il sito del COLLAB e i siti personali dei membri (Dipartimento di Informatica, UniBa). Restyling moderno: tipografia Inter self-hosted, header sticky, layout full-width, componenti Gutenberg aggiornati. Il tema padre resta aggiornabile.
Author:       COLLAB – Università degli Studi di Bari Aldo Moro
Template:     spacious
Version:      1.4.0
Requires at least: 6.0
Requires PHP: 7.4
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  collab-theme
*/

/* =========================================================================
   0. Font (Inter, variabile, self-hosted — SIL OFL 1.1)
   ========================================================================= */
@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
}
@font-face {
	font-family: "Inter";
	font-style: italic;
	font-weight: 100 900;
	font-display: swap;
	src: url("assets/fonts/inter-latin-wght-italic.woff2") format("woff2");
}

/* =========================================================================
   1. Design token — blu e giallo COLLAB si impostano da Customizer > Colori COLLAB
   ========================================================================= */
:root {
	--c-accent: #143d59; /* blu COLLAB (sovrascritto dal Customizer) */
	--c-yellow: #f4b41d; /* giallo COLLAB (sovrascritto dal Customizer) */
	--c-yellow-soft: color-mix(in oklab, var(--c-yellow) 22%, #fff);
	--c-accent-strong: color-mix(in oklab, var(--c-accent) 82%, #000);
	--c-accent-soft: color-mix(in oklab, var(--c-accent) 9%, #fff);

	--c-bg: #ffffff;
	--c-surface: #f6f7f9;
	--c-ink: #14171f;
	--c-text: #2b303b;
	--c-muted: #5d6472;
	--c-border: #e4e7ec;
	--c-footer: color-mix(in oklab, var(--c-accent) 72%, #000); /* blu COLLAB scurito */

	--font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

	--wrap: 1180px;
	--gutter: clamp(16px, 4vw, 32px);
	--radius: 12px;
	--radius-sm: 8px;
	--shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
	--shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 24px -8px rgba(16, 24, 40, .12);
	--header-h: 76px;
	--ease: cubic-bezier(.2, .7, .2, 1);
}

/* =========================================================================
   2. Base
   ========================================================================= */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition: none !important; animation: none !important; }
}

body,
body.wide-1218,
body.wide-978 {
	background: var(--c-bg);
	color: var(--c-text);
	font-family: var(--font-sans);
	font-size: 17px;
	line-height: 1.65;
	padding: 0;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	font-feature-settings: "cv11", "ss01";
}

/* Il padre forza 'Lato' su molti elementi: lo sostituiamo ovunque tranne le icone */
body, button, input, select, textarea, p, li, td, th, dt, dd, label, blockquote,
.main-navigation li, h1, h2, h3, h4, h5, h6,
#site-title, #site-description, .entry-meta, .post .entry-meta,
.widget, .widget-title, #colophon, .copyright, .breadcrumb, .header-post-title-class,
.call-to-action-content, .wp-block-button__link {
	font-family: var(--font-sans);
}

/* Layout full-width: niente "scatola" con ombra */
#page,
.wide-1218 #page,
.wide-978 #page,
.narrow-978 #page {
	max-width: none;
	width: 100%;
	box-shadow: none;
	background: var(--c-bg);
}

#page .inner-wrap {
	max-width: var(--wrap);
	width: auto;
	margin-inline: auto;
	padding-inline: var(--gutter);
	box-sizing: border-box;
}

::selection { background: var(--c-yellow-soft); color: var(--c-ink); }

/* Titoli */
h1, h2, h3, h4, h5, h6 {
	color: var(--c-ink);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.2;
	text-wrap: balance;
	padding-bottom: 0;
	margin: 0 0 .6em;
}
h1 { font-size: clamp(2rem, 1.4rem + 2.2vw, 2.75rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2rem); }
h3 { font-size: clamp(1.25rem, 1.1rem + .5vw, 1.45rem); }
h4 { font-size: 1.15rem; }
h5 { font-size: 1rem; }
h6 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--c-muted); }

p { line-height: 1.7; margin: 0 0 1.15em; text-wrap: pretty; }

a { color: var(--c-accent); text-decoration: none; transition: color .15s var(--ease); }
a:hover, a:active { color: var(--c-accent-strong); }

.entry-content a:not(.wp-block-button__link):not(.wp-element-button) {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: .2em;
	text-decoration-color: color-mix(in oklab, var(--c-accent) 35%, transparent);
}
.entry-content a:not(.wp-block-button__link):not(.wp-element-button):hover {
	text-decoration-color: currentColor;
}

:focus-visible {
	outline: 2px solid var(--c-accent);
	outline-offset: 3px;
	border-radius: 4px;
}

hr, .wp-block-separator {
	border: 0;
	border-top: 1px solid var(--c-border);
	background: none;
	height: 0;
	margin: 2.5rem 0;
}

img { height: auto; }
.entry-content img,
.entry-content .wp-block-image img { border-radius: var(--radius-sm); }
.entry-content .wp-block-image.is-style-rounded img { border-radius: 9999px; }

/* Codice */
code, kbd, pre, tt, var { font-family: var(--font-mono); font-size: .9em; }
:not(pre) > code {
	background: var(--c-surface);
	border: 1px solid var(--c-border);
	padding: .1em .4em;
	border-radius: 6px;
}
pre, .wp-block-code {
	background: #0f1320;
	color: #e6e9f2;
	border-radius: var(--radius);
	padding: 1.1rem 1.25rem;
	overflow-x: auto;
	line-height: 1.55;
	border: 0;
}

blockquote, .wp-block-quote {
	border-left: 3px solid var(--c-yellow);
	background: var(--c-surface);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	margin: 1.75rem 0;
	padding: 1rem 1.5rem;
	font-style: normal;
	color: var(--c-ink);
}
blockquote p:last-child { margin-bottom: 0; }
blockquote::before { display: none; }

/* =========================================================================
   3. Header sticky
   ========================================================================= */
#masthead.site-header {
	position: sticky;
	top: 0;
	z-index: 1000;
	background: color-mix(in oklab, var(--c-bg) 86%, transparent);
	-webkit-backdrop-filter: saturate(180%) blur(14px);
	backdrop-filter: saturate(180%) blur(14px);
	transition: box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.admin-bar #masthead.site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar #masthead.site-header { top: 0; position: relative; } }
@supports not (backdrop-filter: blur(1px)) {
	#masthead.site-header { background: var(--c-bg); }
}
.is-scrolled #masthead.site-header { box-shadow: 0 1px 0 var(--c-border), 0 6px 20px -12px rgba(16, 24, 40, .25); }

#masthead #header-text-nav-container {
	border-bottom: 1px solid var(--c-border);
	background: transparent;
}
.is-scrolled #masthead #header-text-nav-container { border-bottom-color: transparent; }

#masthead #header-text-nav-wrap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: var(--header-h);
	padding: 10px 0;
	box-sizing: border-box;
}
#masthead #header-text-nav-wrap::before,
#masthead #header-text-nav-wrap::after { display: none; }

#masthead #header-left-section {
	display: flex;
	align-items: center;
	gap: 14px;
	float: none;
	margin: 0;
	min-width: 0;
}
#masthead #header-logo-image {
	float: none;
	padding: 0;
	margin: 0;
	flex: none;
}
#masthead #header-logo-image img,
#masthead .custom-logo {
	display: block;
	max-height: 48px;
	width: auto;
	margin: 0;
}
#masthead #header-text {
	float: none;
	padding: 0;
	margin: 0;
	text-align: left;
	min-width: 0;
}
#masthead #site-title,
#masthead h1#site-title,
#masthead h3#site-title {
	font-size: 2rem;
	line-height: 1;
	margin: 0;
	padding: 0;
	letter-spacing: -0.02em;
	font-weight: 800;
}
#masthead #site-title a { color: var(--c-ink); font-size: inherit; display: block; }
/* Scritta COLLAB vettoriale (stessa del logo) */
#masthead #site-title .collab-wordmark {
	display: block;
	height: 26px;
	width: auto;
	margin: 0;
}
#masthead #site-title a:hover .collab-wordmark { opacity: .85; }
/* Siti personali: nome in testo, stesso colore della scritta COLLAB */
#masthead #site-title a { color: var(--c-accent); letter-spacing: -0.025em; }

/* Profilo personale: blocco Media & Testo con stile "Profilo" */
.wp-block-media-text.is-style-collab-profile {
	grid-template-columns: minmax(160px, 260px) 1fr !important;
	gap: clamp(20px, 4vw, 48px);
	align-items: center;
	margin-bottom: 2.5rem;
}
.wp-block-media-text.is-style-collab-profile .wp-block-media-text__media img {
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 999px;
	box-shadow: 0 0 0 4px var(--c-bg), 0 0 0 7px var(--c-yellow);
}
.wp-block-media-text.is-style-collab-profile .wp-block-media-text__content { padding: 0; }
.wp-block-media-text.is-style-collab-profile h1,
.wp-block-media-text.is-style-collab-profile h2 { margin: 0 0 .25em; }
.wp-block-media-text.is-style-collab-profile p { margin-bottom: .35em; color: var(--c-muted); }
@media (max-width: 600px) {
	.wp-block-media-text.is-style-collab-profile { grid-template-columns: 1fr !important; text-align: center; }
	.wp-block-media-text.is-style-collab-profile .wp-block-media-text__media { max-width: 200px; margin: 0 auto; }
}
#masthead #site-title a:hover { color: var(--c-accent); }
#masthead #site-description { display: none; } /* sottotitolo nascosto nell'header */
#masthead #site-description {
	font-size: .8rem;
	line-height: 1.35;
	color: var(--c-muted);
	margin: 3px 0 0;
	padding: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#masthead #header-right-section {
	display: flex;
	align-items: center;
	gap: 8px;
	float: none;
	margin: 0;
}
#masthead #header-right-section .widget { padding: 0; }
#masthead .header-action { order: 2; }

/* Menu desktop */
#masthead .main-navigation {
	float: none;
	padding: 0;
	margin: 0;
}
#masthead .main-navigation .menu-primary-container > ul,
#masthead .main-navigation > div > ul,
#masthead .main-navigation > ul {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 2px;
	margin: 0;
}
#masthead .main-navigation .menu-primary-container > ul::after { display: none; }
#masthead .main-navigation .menu-primary-container > ul { margin-right: -14px; } /* allinea il testo dell'ultima voce al bordo */
#masthead .main-navigation li {
	float: none;
	margin: 0;
}
#masthead .main-navigation a {
	float: none;
	display: block;
	color: var(--c-text);
	font-size: .95rem;
	font-weight: 500;
	line-height: 1;
	padding: 10px 14px;
	border-radius: 999px;
	transition: background-color .15s var(--ease), color .15s var(--ease);
}
#masthead .main-navigation ul li a:hover,
#masthead .main-navigation ul li:hover > a {
	background: var(--c-surface);
	color: var(--c-ink);
}
#masthead .main-navigation ul li.current-menu-item > a,
#masthead .main-navigation ul li.current_page_item > a,
#masthead .main-navigation ul li.current-menu-ancestor > a,
#masthead .main-navigation ul li.current_page_ancestor > a {
	background: var(--c-accent-soft);
	color: var(--c-accent-strong);
	box-shadow: inset 0 -2px 0 var(--c-yellow);
}

/* Sottomenu desktop */
#masthead .main-navigation ul li ul {
	background: var(--c-bg);
	border: 1px solid var(--c-border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 6px;
	min-width: 220px;
	top: calc(100% + 6px);
}
#masthead .main-navigation ul li ul::before { /* ponte invisibile per non perdere l'hover */
	content: "";
	position: absolute;
	inset: -10px 0 auto 0;
	height: 10px;
}
#masthead .main-navigation ul li ul li { float: none; display: block; width: 100%; }
#masthead .main-navigation ul li ul li a {
	border-radius: var(--radius-sm);
	padding: 10px 12px;
	line-height: 1.3;
	width: auto;
	border: 0;
	color: var(--c-text);
	background: transparent;
}
#masthead .main-navigation ul li ul li a:hover { background: var(--c-surface); color: var(--c-ink); }
#masthead .main-navigation ul li ul ul { top: -7px; left: 100%; }
#masthead .main-navigation ul li .sub-toggle { color: var(--c-muted); }
#masthead .main-navigation .menu-item-has-children > a { padding-right: 28px; }

/* Ricerca nell'header */
#masthead .search-wrapper .search {
	width: 40px; height: 40px;
	display: grid; place-items: center;
	border-radius: 999px;
	color: var(--c-text);
	cursor: pointer;
}
#masthead .search-wrapper .search:hover { background: var(--c-surface); }
#masthead .header-search-form {
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	border: 1px solid var(--c-border);
}

/* Banda titolo pagina */
#masthead .header-post-title-container {
	background:
		radial-gradient(900px 260px at 0% 0%, var(--c-accent-soft), transparent 70%),
		radial-gradient(700px 240px at 100% 0%, color-mix(in oklab, var(--c-yellow) 10%, #fff), transparent 70%),
		var(--c-bg);
	border-bottom: 1px solid var(--c-border);
	box-shadow: none;
	padding: clamp(28px, 5vw, 56px) 0 clamp(22px, 4vw, 40px);
}
#masthead .header-post-title-container .inner-wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 8px 24px;
}
#masthead .header-post-title-container .inner-wrap::before,
#masthead .header-post-title-container .inner-wrap::after { display: none; }
#masthead .header-post-title-container .post-title-wrapper { float: none; padding: 0; }
#masthead .header-post-title-class {
	font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.75rem);
	line-height: 1.1;
	letter-spacing: -0.03em;
	margin: 0;
	padding: 0;
	color: var(--c-ink);
}
#masthead .breadcrumb {
	float: none;
	text-align: left;
	margin: 0;
	font-size: .85rem;
	color: var(--c-muted);
}
#masthead .breadcrumb a { color: var(--c-muted); }
#masthead .breadcrumb a:hover { color: var(--c-accent); }

.header-image { border-bottom: 0; display: block; }

/* =========================================================================
   4. Contenuto
   ========================================================================= */
#main { padding: clamp(32px, 5vw, 64px) 0 clamp(40px, 6vw, 80px); }

#primary .entry-content,
#primary .entry-summary { font-size: 1.0625rem; }

/* Contenuto a tutta larghezza del contenitore (nessuna sidebar) */
#primary,
.left-sidebar #primary,
.no-sidebar #primary,
.no-sidebar-full-width #primary {
	float: none;
	width: 100%;
	max-width: none;
	margin: 0;
}
#secondary { display: none; }

.entry-content ul, .entry-content ol { margin: 0 0 1.25em 1.25em; padding: 0; }
.entry-content li { margin-bottom: .4em; line-height: 1.65; }
.entry-content ul li::marker { color: var(--c-yellow); }

/* Home: il primo titolo diventa un "hero" */
.collab-group-site.home #primary .entry-content > h2:first-of-type,
.collab-group-site.home #primary .entry-content > .wp-block-heading:first-child {
	font-size: clamp(2.2rem, 1.4rem + 3.4vw, 3.6rem);
	line-height: 1.05;
	letter-spacing: -0.035em;
	font-weight: 800;
	margin-bottom: .35em;
}
.collab-group-site.home #primary .entry-content > h2:first-of-type::after {
	content: "";
	display: block;
	width: 64px;
	height: 6px;
	margin-top: .35em;
	border-radius: 3px;
	background: linear-gradient(90deg, var(--c-accent) 0 50%, var(--c-yellow) 50% 100%);
}
.collab-group-site.home #primary .entry-content > h2:first-of-type + h2,
.collab-group-site.home #primary .entry-content > h2:first-of-type + h3 {
	font-size: clamp(1.1rem, 1rem + .5vw, 1.35rem);
	font-weight: 500;
	color: var(--c-muted);
	letter-spacing: -0.01em;
	margin-top: 0;
	margin-bottom: 1.6em;
}
.home.page #primary .entry-header,
.home.page #primary .entry-title { display: none; }

/* Articoli / archivi come card */
.blog #primary article,
.archive #primary article,
.search #primary article {
	background: var(--c-bg);
	border: 1px solid var(--c-border);
	border-radius: var(--radius);
	padding: clamp(18px, 3vw, 28px);
	margin-bottom: 24px;
	box-shadow: var(--shadow-sm);
	transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease);
}
.blog #primary article:hover,
.archive #primary article:hover,
.search #primary article:hover {
	box-shadow: var(--shadow);
	border-color: color-mix(in oklab, var(--c-accent) 25%, var(--c-border));
}
#primary article .post-featured-image img,
#primary article .wp-post-image { border-radius: var(--radius-sm); }

.entry-title, .entry-title a { color: var(--c-ink); }
.entry-title a:hover { color: var(--c-accent); }
#primary .entry-title { font-size: clamp(1.35rem, 1.15rem + .8vw, 1.75rem); }

.post .entry-meta {
	border: 0;
	padding: 12px 0 0;
	margin-top: 16px;
	border-top: 1px solid var(--c-border);
	font-size: .85rem;
	color: var(--c-muted);
}
.post .entry-meta a { color: var(--c-muted); }
.post .entry-meta a:hover { color: var(--c-accent); }
.post .entry-meta .read-more-link {
	background: transparent;
	padding: 0;
}
.post .entry-meta .read-more-link a,
.post .entry-meta a.read-more {
	color: var(--c-accent);
	font-weight: 600;
}
.post .entry-meta .read-more-link:hover { background: transparent; }

/* Paginazione */
.pagination span, .pagination a, .nav-links .page-numbers {
	border-radius: var(--radius-sm);
	border: 1px solid var(--c-border);
	padding: 6px 12px;
}
.pagination span, .nav-links .page-numbers.current {
	background: var(--c-accent);
	border-color: var(--c-accent);
	color: #fff;
}

/* =========================================================================
   5. Sidebar & widget
   ========================================================================= */
#secondary .widget {
	background: var(--c-surface);
	border: 1px solid var(--c-border);
	border-radius: var(--radius);
	padding: 20px 22px;
	margin-bottom: 20px;
}
#secondary h3.widget-title,
#secondary .widget-title {
	font-size: .78rem;
	text-transform: uppercase;
	letter-spacing: .09em;
	color: var(--c-muted);
	border: 0;
	padding: 0;
	margin-bottom: 12px;
}
#secondary h3.widget-title span,
#secondary .widget-title span { border: 0; padding: 0; }
#secondary .widget ul li {
	border-bottom: 1px solid var(--c-border);
	padding: 8px 0;
	line-height: 1.45;
}
#secondary .widget ul li:last-child { border-bottom: 0; }
#secondary a { color: var(--c-text); }
#secondary a:hover { color: var(--c-accent); }

/* =========================================================================
   6. Form e pulsanti
   ========================================================================= */
input[type="text"], input[type="email"], input[type="url"], input[type="password"],
input[type="search"], input[type="tel"], input[type="number"], textarea, select {
	font: inherit;
	font-size: 1rem;
	color: var(--c-ink);
	background: var(--c-bg);
	border: 1px solid var(--c-border);
	border-radius: var(--radius-sm);
	padding: 10px 14px;
	box-shadow: var(--shadow-sm);
	transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
	max-width: 100%;
	box-sizing: border-box;
}
input:focus, textarea:focus, select:focus {
	outline: none;
	border-color: var(--c-accent);
	box-shadow: 0 0 0 4px color-mix(in oklab, var(--c-accent) 18%, transparent);
}

.spacious-button, input[type="reset"], input[type="button"], input[type="submit"], button,
.wp-block-button__link, .wp-element-button, .call-to-action-button {
	font-family: var(--font-sans);
	font-size: .95rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0;
	color: #fff;
	background: var(--c-accent);
	border: 1px solid transparent;
	border-radius: 999px;
	padding: 11px 20px;
	box-shadow: var(--shadow-sm);
	cursor: pointer;
	text-decoration: none;
	transition: background-color .15s var(--ease), transform .15s var(--ease), box-shadow .15s var(--ease);
}
.spacious-button:hover, input[type="reset"]:hover, input[type="button"]:hover, input[type="submit"]:hover, button:hover,
.wp-block-button__link:hover, .wp-element-button:hover, .call-to-action-button:hover {
	background: var(--c-accent-strong);
	color: #fff;
	transform: translateY(-1px);
	box-shadow: var(--shadow);
}
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--c-accent);
	border: 1px solid currentColor;
	box-shadow: none;
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--c-accent-soft);
	color: var(--c-accent-strong);
}

.search-form { position: relative; }
.search-form span, .search-form .search-submit { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* =========================================================================
   7. Blocchi Gutenberg
   ========================================================================= */
.entry-content table,
.wp-block-table table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	border: 1px solid var(--c-border);
	border-radius: var(--radius);
	overflow: hidden;
	font-size: .95rem;
	margin: 0 0 1.5em;
}
.wp-block-table { overflow-x: auto; }
.entry-content th, .entry-content td,
.wp-block-table th, .wp-block-table td {
	border: 0;
	border-bottom: 1px solid var(--c-border);
	padding: 12px 14px;
	text-align: left;
	vertical-align: top;
}
.entry-content tr:last-child td { border-bottom: 0; }
.entry-content td a { overflow-wrap: anywhere; }
.entry-content thead th, .entry-content th {
	background: var(--c-surface);
	color: var(--c-ink);
	font-weight: 600;
	font-size: .85rem;
	text-transform: uppercase;
	letter-spacing: .05em;
}
.entry-content tbody tr:hover td { background: color-mix(in oklab, var(--c-surface) 60%, #fff); }
.wp-block-table.is-style-stripes { border: 0; }
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) { background: var(--c-surface); }

.wp-block-columns { gap: clamp(20px, 3vw, 40px); margin-bottom: 2rem; }
.entry-content > h2:not(:first-child) { margin-top: 1.8em; }
.entry-content > h3:not(:first-child) { margin-top: 1.5em; }
.wp-block-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 1.5em 0; }
.wp-block-buttons > .wp-block-button { margin: 0; }

/* Gruppi con sfondo → card */
.entry-content .wp-block-group.has-background {
	border-radius: var(--radius);
	padding: clamp(20px, 3vw, 36px);
}

.wp-block-image figcaption, .wp-caption-text, .wp-element-caption {
	font-size: .85rem;
	color: var(--c-muted);
	text-align: center;
	margin-top: .6em;
}

.wp-block-media-text { gap: clamp(20px, 3vw, 40px); }
.wp-block-media-text .wp-block-media-text__media img { border-radius: var(--radius); }

.wp-block-cover { border-radius: var(--radius); overflow: hidden; }
.wp-block-gallery img { border-radius: var(--radius-sm); }

.wp-block-pullquote {
	border-top: 2px solid var(--c-ink);
	border-bottom: 2px solid var(--c-ink);
	padding: 2rem 0;
}

/* Immagini profilo (pagina Members): blocchi immagine "rounded" o colonne con foto */
.wp-block-columns .wp-block-image img { box-shadow: var(--shadow-sm); }

/* =========================================================================
   8. Footer
   ========================================================================= */
#colophon {
	font-size: .9rem;
	line-height: 1.6;
	background: var(--c-footer);
	color: #b7bdcc;
	margin-top: 0;
	border-top: 4px solid var(--c-yellow);
}
#colophon p { font-size: .9rem; line-height: 1.6; color: #b7bdcc; }
#colophon .footer-widgets-wrapper {
	background: transparent;
	border-top: 0;
}
#colophon .footer-widgets-area {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 8px 40px;
	padding-top: clamp(40px, 5vw, 64px);
	padding-bottom: 16px;
	color: #b7bdcc;
}
#colophon .footer-widgets-area::before,
#colophon .footer-widgets-area::after { display: none; }
#colophon .footer-widgets-area > div {
	float: none;
	width: auto;
	margin: 0;
	padding: 0;
}
#colophon .footer-widgets-area > div:empty { display: none; }
#colophon .footer-widgets-area p, #colophon .footer-widgets-area .widget-title { text-align: left; }
#colophon .footer-widgets-area h3.widget-title,
#colophon .widget-title {
	font-size: .78rem;
	line-height: 1.4;
	text-transform: uppercase;
	letter-spacing: .1em;
	color: #ffffff;
	margin-bottom: 14px;
	text-align: left;
}
#colophon .widget-title span { border: 0; padding: 0; }
#colophon .footer-widgets-area a { color: #e3e7f1 !important; }
#colophon .footer-widgets-area a:hover { color: #ffffff !important; text-decoration: underline; text-underline-offset: .2em; }
#colophon .widget ul li { border: 0; padding: 4px 0; }
#colophon .widget img { opacity: .95; }

#colophon .footer-socket-wrapper {
	background: transparent;
	border-top: 1px solid rgba(255, 255, 255, .09);
	padding: 18px 0;
}
#colophon .footer-socket-area {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 24px;
}
#colophon .footer-socket-area::before,
#colophon .footer-socket-area::after { display: none; }
#colophon .footer-socket-wrapper .copyright {
	float: none;
	max-width: none;
	font-size: .82rem;
	color: #8e95a8;
	text-align: left;
}
#colophon .footer-socket-wrapper .copyright a { color: #c9cedb; }
#colophon .footer-socket-wrapper .copyright a:hover { color: #fff; }
#colophon .footer-socket-wrapper .small-menu { float: none; }
#colophon .footer-socket-wrapper .small-menu ul { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; }
#colophon .footer-socket-wrapper .small-menu li { float: none; margin: 0; }
#colophon .footer-socket-wrapper .small-menu a { color: #c9cedb; font-size: .82rem; padding: 0; }
#colophon .footer-socket-wrapper .small-menu a:hover { color: #fff; }

/* Torna su */
a#scroll-up {
	display: grid !important;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	right: 20px;
	bottom: 20px;
	border-radius: 999px;
	background: var(--c-ink);
	color: #fff;
	font-size: 22px;
	box-shadow: var(--shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s, background-color .15s;
	z-index: 900;
}
.show-scroll-up a#scroll-up { opacity: .9; visibility: visible; transform: none; }
a#scroll-up:hover { opacity: 1; background: var(--c-accent); box-shadow: 0 0 0 3px var(--c-yellow); }

/* =========================================================================
   9. Responsive (≤ 768px: menu mobile)
   ========================================================================= */
@media screen and (max-width: 1078px) {
	body, body.wide-1218, body.wide-978 { padding: 0; }
}

@media screen and (max-width: 768px) {
	:root { --header-h: 64px; }
	body { font-size: 16px; }

	#masthead #header-text-nav-wrap { gap: 12px; padding: 8px 0; }
	#masthead #header-left-section,
	.better-responsive-menu #masthead #header-left-section { float: none; margin: 0; flex: 1 1 auto; }
	#masthead #header-logo-image,
	.better-responsive-menu #masthead #header-logo-image { float: none; margin: 0; text-align: left; }
	#masthead #header-logo-image img, #masthead .custom-logo { max-height: 40px; }
	#masthead #header-text,
	.better-responsive-menu #masthead #header-text { float: none; margin: 0; text-align: left; }
	#masthead #site-title, .better-responsive-menu #masthead #site-title a { font-size: 1.6rem; }
	#masthead #site-title .collab-wordmark { height: 22px; }
	#masthead #site-description, .better-responsive-menu #masthead #site-description { display: none; }

	#masthead #header-right-section,
	.better-responsive-menu #masthead #header-right-section { float: none; margin: 0; flex: none; }
	#masthead #site-navigation,
	.better-responsive-menu #masthead #site-navigation { float: none; margin: 0; padding: 0; position: static; }

	/* Pulsante hamburger */
	#masthead .menu-toggle,
	.better-responsive-menu #masthead .menu-toggle {
		display: grid;
		place-items: center;
		width: 44px;
		height: 44px;
		margin: 0;
		padding: 0;
		border-radius: 12px;
		background: var(--c-surface);
		border: 1px solid var(--c-border);
		color: var(--c-ink);
		font-size: 0;
		position: relative;
		cursor: pointer;
	}
	#masthead .menu-toggle:hover,
	.better-responsive-menu #masthead .menu-toggle:hover { background: var(--c-accent-soft); }
	#masthead .menu-toggle::before,
	.better-responsive-menu #masthead .menu-toggle::before {
		content: "";
		position: absolute;
		left: 50%; top: 50%;
		width: 18px; height: 2px;
		margin: 0;
		background: currentColor;
		border-radius: 2px;
		box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
		transform: translate(-50%, -50%);
		transition: transform .2s var(--ease), box-shadow .2s var(--ease);
	}
	.menu-open #masthead .menu-toggle::before {
		box-shadow: none;
		transform: translate(-50%, -50%) rotate(45deg);
	}
	.menu-open #masthead .menu-toggle::after {
		content: "";
		position: absolute;
		left: 50%; top: 50%;
		width: 18px; height: 2px;
		background: currentColor;
		border-radius: 2px;
		transform: translate(-50%, -50%) rotate(-45deg);
	}

	/* Pannello menu: nascosto finché non si apre */
	#masthead .main-navigation ul,
	#masthead .main-navigation .menu-primary-container > ul,
	#masthead .main-navigation > div > ul,
	#masthead .main-navigation > ul { display: none; }
	#masthead .main-small-navigation {
		width: auto;
		margin: 0;
	}
	#masthead .main-small-navigation .menu-primary-container,
	#masthead .main-small-navigation > div:not(.menu-toggle) {
		position: absolute;
		left: 0; right: 0;
		top: 100%;
		background: var(--c-bg);
		border-bottom: 1px solid var(--c-border);
		box-shadow: 0 18px 30px -18px rgba(16, 24, 40, .35);
		padding: 8px var(--gutter) 16px;
		max-height: calc(100vh - var(--header-h));
		overflow-y: auto;
		animation: collab-drop .18s var(--ease);
	}
	@keyframes collab-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

	#masthead .main-small-navigation ul,
	#masthead .main-small-navigation .menu-primary-container > ul,
	#masthead .main-small-navigation > div > ul {
		display: block;
		margin: 0;
		padding: 0;
		background: transparent;
	}
	#masthead .main-small-navigation li,
	#masthead .main-small-navigation li:hover,
	#masthead .main-small-navigation ul > .current_page_item,
	#masthead .main-small-navigation ul > .current-menu-item {
		background: transparent;
		float: none;
		margin: 0;
		border-bottom: 1px solid var(--c-border);
	}
	#masthead .main-small-navigation li:last-child { border-bottom: 0; }
	#masthead .main-small-navigation a {
		display: block;
		float: none;
		color: var(--c-ink);
		font-size: 1.05rem;
		font-weight: 500;
		padding: 14px 4px;
		border-radius: 0;
		background: transparent;
		line-height: 1.3;
	}
	#masthead .main-small-navigation a:hover { background: transparent; color: var(--c-accent); }
	#masthead .main-small-navigation li.current-menu-item > a,
	#masthead .main-small-navigation li.current_page_item > a { color: var(--c-accent); background: transparent; box-shadow: inset 3px 0 0 var(--c-yellow); padding-left: 12px; }
	#masthead .main-small-navigation ul ul { position: static; box-shadow: none; border: 0; padding: 0 0 6px 12px; min-width: 0; }
	#masthead .main-small-navigation ul ul li { border: 0; }
	#masthead .main-small-navigation ul ul a { padding: 10px 4px; font-size: .95rem; color: var(--c-text); }
	#masthead .main-small-navigation .sub-toggle {
		background: var(--c-surface);
		color: var(--c-ink);
		border-radius: 8px;
		top: 10px;
		width: 32px; height: 32px; line-height: 32px;
	}

	#masthead .header-post-title-container .inner-wrap { display: block; }
	#masthead .breadcrumb { margin-top: 10px; }

	.entry-content th, .entry-content td { padding: 10px; }
	#primary, #secondary { width: 100%; float: none; }
	#secondary { margin-top: 32px; }

	#colophon .footer-socket-area { flex-direction: column; align-items: flex-start; }
	#colophon .footer-socket-wrapper .copyright { text-align: left; }
}

@media screen and (max-width: 420px) {
	#masthead #site-description { display: none; }
}

/* =========================================================================
   11. Stili di blocco COLLAB (Editor > blocco > Stili)
   ========================================================================= */
/* Colonne → schede (es. aree di ricerca in home, tesi da assegnare) */
.wp-block-columns.is-style-collab-cards { gap: 20px; }
.wp-block-columns.is-style-collab-cards > .wp-block-column,
.wp-block-group.is-style-collab-card {
	background: var(--c-bg);
	border: 1px solid var(--c-border);
	border-top: 3px solid var(--c-yellow);
	border-radius: var(--radius);
	padding: clamp(18px, 2.5vw, 26px);
	box-shadow: var(--shadow-sm);
	transition: box-shadow .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.wp-block-columns.is-style-collab-cards > .wp-block-column:hover,
.wp-block-group.is-style-collab-card:hover {
	box-shadow: var(--shadow);
	transform: translateY(-2px);
}
.wp-block-columns.is-style-collab-cards > .wp-block-column > :last-child,
.wp-block-group.is-style-collab-card > :last-child { margin-bottom: 0; }
.wp-block-columns.is-style-collab-cards h2,
.wp-block-columns.is-style-collab-cards h3,
.wp-block-group.is-style-collab-card h2,
.wp-block-group.is-style-collab-card h3 { font-size: 1.15rem; margin-bottom: .4em; }
.wp-block-columns.is-style-collab-cards p,
.wp-block-group.is-style-collab-card p { font-size: .97rem; color: var(--c-muted); }

/* Colonne → griglia persone: foto tonda, nome, ruolo centrati */
.wp-block-columns.is-style-collab-people {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 28px 20px;
}
.wp-block-columns.is-style-collab-people > .wp-block-column {
	text-align: center;
	flex-basis: auto !important;
	margin: 0 !important;
}
.wp-block-columns.is-style-collab-people img,
.wp-block-image.is-style-collab-avatar img {
	width: 140px;
	height: 140px;
	object-fit: cover;
	border-radius: 999px;
	box-shadow: 0 0 0 3px var(--c-bg), 0 0 0 5px var(--c-yellow);
	margin: 0 auto;
}
.wp-block-columns.is-style-collab-people .wp-block-image { margin: 0 0 12px; }
.wp-block-columns.is-style-collab-people p { margin: 0; font-size: .9rem; color: var(--c-muted); line-height: 1.45; }
.wp-block-columns.is-style-collab-people p:first-of-type,
.wp-block-columns.is-style-collab-people h3,
.wp-block-columns.is-style-collab-people h4 { font-size: 1rem; font-weight: 600; color: var(--c-ink); margin: 0 0 2px; }

/* Link "skip to content" visibile al focus */
.skip-link.screen-reader-text:focus {
	clip: auto !important;
	clip-path: none;
	width: auto; height: auto;
	position: fixed;
	top: 12px; left: 12px;
	z-index: 100000;
	padding: 12px 18px;
	background: var(--c-ink);
	color: #fff;
	border-radius: var(--radius-sm);
	font-weight: 600;
}

/* =========================================================================
   10. Stampa
   ========================================================================= */
@media print {
	#masthead.site-header { position: static; backdrop-filter: none; box-shadow: none; }
	#colophon, a#scroll-up, .menu-toggle { display: none !important; }
	body { font-size: 11pt; color: #000; }
}

/* Titolo del sito come <p> nelle pagine interne: stesso aspetto dell'h1 */
#masthead p#site-title { font-weight: 800; }
