/* ======= Base ======= */
:root {
	--bg: #f6f2eb;
	--bg-2: #fbf9f5;
	--surface: #ffffff;
	--surface-soft: #f8f5ef;
	--text: #1e1b18;
	--text-soft: #5f594f;
	--text-muted: #877f74;
	--border: rgba(30, 27, 24, 0.09);
	--border-soft: rgba(30, 27, 24, 0.05);
	--shadow-sm: 0 8px 24px rgba(22, 18, 14, 0.04);
	--shadow-md: 0 18px 46px rgba(22, 18, 14, 0.06);
	--radius-xl: 30px;
	--radius-lg: 22px;
	--radius-md: 16px;
	--radius-sm: 10px;
	--max-width: 1280px;
	--text-width: 100%;
	--footer-bg: #174a84;
	--accent: #174a84;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	padding: 0;
	min-height: 100%;
	background:
		linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
	color: var(--text);
	font-family: Georgia, "Times New Roman", serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

body {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

img {
	max-width: 100%;
	display: block;
}

a {
	color: inherit;
}

.site-shell {
	width: 100%;
	flex: 1;
}

/* ======= Layout ======= */
.page {
	width: min(calc(100% - 56px), var(--max-width));
	margin: 0 auto;
	padding: 42px 0 72px;
}

.hero-card,
.opera-card {
	background: var(--surface);
	border: 1px solid var(--border-soft);
	box-shadow: var(--shadow-md);
	border-radius: var(--radius-xl);
}

.hero-card {
	padding: 48px;
	margin-top: 28px;
}

.opera-card {
	padding: 28px;
	overflow: hidden;
}

.eyebrow {
	display: inline-block;
	margin-bottom: 20px;
	padding: 8px 14px;
	border-radius: 999px;
	background: var(--surface-soft);
	border: 1px solid var(--border);
	color: var(--text-muted);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

h1,
h2,
h3 {
	margin: 0;
	line-height: 1.08;
	font-weight: 500;
	letter-spacing: -0.02em;
	color: var(--text);
}

h1 {
	font-size: clamp(2.5rem, 5vw, 5rem);
	margin-bottom: 16px;
	max-width: 12ch;
}

h2 {
	font-size: clamp(1.3rem, 2vw, 1.8rem);
	font-weight: 500;
}

p {
	margin: 0;
	line-height: 1.9;
	color: var(--text-soft);
	font-size: 1.04rem;
}

.button-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 20px;
	border-radius: 999px;
	background: var(--text);
	color: #ffffff;
	text-decoration: none;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	font-weight: 600;
}

/* ======= Header opera ======= */
.opera-header {
	display: grid;
	grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
	gap: 30px;
	align-items: start;
}

.opera-intro {
	padding: 18px 10px 18px 8px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.opera-subtitle {
	margin: 0 0 16px;
	font-size: 1.18rem;
	line-height: 1.6;
	color: var(--text);
	font-weight: 500;
}

.opera-breve {
	margin: 0 0 24px;
	font-size: 1.08rem;
	line-height: 1.95;
	color: var(--text-soft);
	max-width: 56ch;
}

.opera-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 4px;
	color: var(--text-muted);
	font-size: 0.92rem;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.opera-meta span {
	display: inline-flex;
	align-items: center;
	padding: 8px 12px;
	border-radius: 999px;
	background: var(--surface-soft);
	border: 1px solid var(--border);
}

.opera-cover-wrap {
	position: relative;
	min-height: 620px;
	border-radius: calc(var(--radius-xl) - 8px);
	overflow: hidden;
	background: #e7e0d5;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.opera-cover-button {
	border: 0;
	padding: 0;
	margin: 0;
	background: transparent;
	cursor: zoom-in;
	width: 100%;
	height: 100%;
	display: block;
}

.opera-cover {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.45s ease;
}

.opera-cover-button:hover .opera-cover {
	transform: scale(1.015);
}

/* ======= Sezioni ======= */
.opera-section {
	padding: 34px 8px 10px;
}

.opera-section+.opera-section {
	margin-top: 18px;
	padding-top: 34px;
	border-top: 1px solid var(--border);
}

.section-heading {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 16px;
	margin-bottom: 22px;
}

.gallery-count {
	color: var(--text-muted);
	font-size: 0.92rem;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.opera-content {
	margin-top: 10px;
	max-width: var(--text-width);
	color: var(--text);
	line-height: 2;
	font-size: 1.08rem;
}

.opera-content p {
	color: var(--text);
	margin-bottom: 1.15em;
}

.opera-content strong,
.opera-content b {
	font-weight: 600;
	color: var(--text);
}

/* ======= Galleria ======= */
.gallery-grid {
	display: grid;
	gap: 20px;
}

.gallery-grid.single {
	grid-template-columns: 1fr;
	max-width: 820px;
}

.gallery-grid.multiple {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gallery-item {
	border: 0;
	padding: 0;
	margin: 0;
	cursor: pointer;
	background: var(--surface);
	border-radius: var(--radius-lg);
	overflow: hidden;
	border: 1px solid var(--border-soft);
	box-shadow: var(--shadow-sm);
	transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.gallery-item:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-md);
}

.gallery-item img {
	width: 100%;
	aspect-ratio: 4 / 3;
	height: auto;
	object-fit: cover;
	background: #efe9df;
}

/* ======= Allegati ======= */
.document-list {
	display: grid;
	gap: 14px;
	max-width: 920px;
}

.document-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	padding: 18px 20px;
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	background: var(--surface-soft);
	text-decoration: none;
	color: inherit;
	transition: transform 0.18s ease, background 0.18s ease;
}

.document-item:hover {
	transform: translateY(-1px);
	background: #f3eee6;
}

.document-item-main,
.document-item-side {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.document-item-main strong {
	font-size: 1rem;
	font-weight: 600;
	color: var(--text);
}

.document-item-main span,
.document-item-side span {
	color: var(--text-soft);
	font-size: 0.93rem;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.document-download {
	font-weight: 700;
	color: var(--accent) !important;
}

/* ======= Lightbox ======= */
.lightbox {
	position: fixed;
	inset: 0;
	z-index: 999;
	display: none;
}

.lightbox.is-open {
	display: block;
}

.lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(18, 16, 14, 0.9);
}

.lightbox-content {
	position: relative;
	z-index: 2;
	width: min(calc(100% - 36px), 1280px);
	margin: 22px auto;
	background: #111;
	border-radius: 24px;
	overflow: hidden;
	box-shadow: 0 28px 90px rgba(0, 0, 0, 0.4);
}

.lightbox-content img {
	width: 100%;
	max-height: 84vh;
	object-fit: contain;
	background: #0a0a0a;
}

.lightbox-caption {
	padding: 0;
	min-height: 0;
	font-size: 0;
	line-height: 0;
}

.lightbox-close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 3;
	width: 48px;
	height: 48px;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	font-size: 28px;
	cursor: pointer;
	transition: background 0.18s ease, transform 0.18s ease;
}

.lightbox-close:hover {
	background: rgba(255, 255, 255, 0.22);
	transform: scale(1.04);
}

/* ======= Footer ======= */
.site-footer {
	width: 100%;
	background: linear-gradient(180deg, #205b9c 0%, var(--footer-bg) 100%);
	color: #ffffff;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	margin-top: 56px;
}

.site-footer p,
.site-footer a,
.site-footer strong,
.site-footer span {
	color: #ffffff;
}

.footer-inner {
	width: min(calc(100% - 56px), var(--max-width));
	margin: 0 auto;
	padding: 26px 0 22px;
	display: flex;
	flex-direction: column;
	gap: 18px;
	font-size: 13px;
	line-height: 1.8;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.footer-block {
	max-width: 1000px;
	opacity: 0.96;
}

.footer-block p {
	margin: 0;
}

.footer-block a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	font-weight: 500;
}

.footer-bottom {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 14px;
	margin-top: 6px;
	padding-top: 14px;
	border-top: 1px solid rgba(255, 255, 255, 0.16);
	font-size: 12px;
	opacity: 0.92;
}

.footer-powered {
	font-weight: 600;
	letter-spacing: 0.02em;
}

.footer-main {
	display: grid;
	grid-template-columns: 1fr 160px;
	gap: 32px;
	align-items: start;
}

.footer-text {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.footer-logo {
	display: flex;
	justify-content: center;
	align-items: flex-start;
}

.footer-logo img {
	max-width: 140px;
	height: auto;
	opacity: 0.95;
}

/* Mobile */
@media (max-width: 700px) {
	.footer-main {
		grid-template-columns: 1fr;
	}

	.footer-logo {
		justify-content: flex-start;
		margin-top: 10px;
	}

	.footer-logo img {
		max-width: 120px;
	}
}


/* ======= Responsive ======= */
@media (max-width: 980px) {
	.opera-header {
		grid-template-columns: 1fr;
	}

	.opera-cover-wrap {
		min-height: 400px;
	}

	h1 {
		max-width: none;
	}
}

@media (max-width: 700px) {
	.page {
		width: min(calc(100% - 20px), var(--max-width));
		padding: 16px 0 34px;
	}

	.hero-card,
	.opera-card {
		border-radius: 22px;
	}

	.hero-card {
		padding: 28px 22px;
	}

	.opera-card {
		padding: 14px;
	}

	.opera-intro,
	.opera-section {
		padding-left: 8px;
		padding-right: 8px;
	}

	.opera-cover-wrap {
		min-height: 280px;
		border-radius: 18px;
	}

	.gallery-grid.multiple {
		grid-template-columns: 1fr;
	}

	.section-heading {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}

	.document-item {
		flex-direction: column;
		align-items: flex-start;
	}

	.footer-inner {
		width: min(calc(100% - 20px), var(--max-width));
		padding: 20px 0 18px;
	}

	.footer-bottom {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}
}