/* Variabili e componenti condivisi fra tutte le pagine. */
:root {
	--ink: #233447;
	--muted: #637184;
	--accent: #234e70;
	--line: #dce3e9;
	--surface: #f4f6f8;
	--table-stripe: #eef6fb;
	--vote-yes: #4ca777;
	--vote-no: #bb2e38;
	--vote-maybe: #9a642d;
	--default: black;
}

/* Colori sobri per le preferenze espresse nel riepilogo. */
.vote-result {
	font-weight: 600;
}
.vote-result-yes {
	color: var(--vote-yes);
}
.vote-result-no {
	color: var(--vote-no);
}
.vote-result-maybe {
	color: var(--vote-maybe);
}
* {
	box-sizing: border-box;
}
body {
	font-family:
		"Montserrat",
		system-ui,
		-apple-system,
		"Segoe UI",
		sans-serif;
	color: var(--ink);
	background: var(--surface);
	font-size: 1rem;
}
/*
h1, h2, h3, h4 {
	font-weight: 650;
	letter-spacing: -0.025em;
}
h1 {
	font-size: 2rem;
}
h2 {
	font-size: 1.7rem;
}
h3 {
	font-size: 1.15rem;
}
h4 {
	font-size: 1rem;
}
*/
.site-header {
	padding: 1.1rem 0;
	background: white;
	border-bottom: 1px solid var(--line);
}
.brand {
	font-size: 1.3rem;
	font-weight: 700;
}
.content-area {
	padding-top: 2.5rem;
	padding-bottom: 4rem;
}
.panel {
	background: white;
	border: 1px solid var(--line);
	/* border-radius: 8px;*/
	padding: 1.2rem;
}
.btn {
	border-radius: 5px;
	font-weight: 600;
}
.btn-primary {
	--bs-btn-bg: var(--accent);
	--bs-btn-border-color: var(--accent);
	--bs-btn-hover-bg: #173d5a;
	--bs-btn-hover-border-color: #173d5a;
}
.btn-outline-primary {
	--bs-btn-color: var(--accent);
	--bs-btn-border-color: var(--accent);
	--bs-btn-hover-bg: var(--accent);
	--bs-btn-hover-border-color: var(--accent);
}
.form-control,
.form-select {
	border-color: #c9d3dd;
	border-radius: 5px;
	min-height: 44px;
}
.form-control:focus,
.form-select:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 0.2rem #234e7018;
}
.form-label {
	font-weight: 600;
}
.form-error,
.danger-title {
	color: #a4313b;
}
.section-head {
	display: flex;
	justify-content: space-between;
	align-items: end;
	gap: 1rem;
	margin-bottom: 1.5rem;
}
.section-head h2 {
	margin-bottom: 0;
}
.eyebrow {
	display: block;
	color: var(--muted);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	margin-bottom: 0.5rem;
}
.section-subtitle,
.meta-line {
	color: var(--muted);
}
.table {
	--bs-table-bg: transparent;
}
#flash {
	position: fixed;
	top: 1rem;
	right: 1rem;
	z-index: 1100;
	width: min(390px, calc(100% - 2rem));
	margin: 0;
}
.notification {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition:
		opacity 300ms ease,
		visibility 300ms ease;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 1.25rem;
	border-left: 5px solid #2e9d55;
	background: #c5f5d6;
	color: #256c3e;
	box-shadow: 0 5px 20px rgb(20 32 48 / 12%);
}
.notification-visible {
	opacity: 1;
	visibility: visible;
}
.notification-danger {
	border-left-color: #b13943;
	background: #fce1e4;
	color: #8a2832;
}
@media (prefers-reduced-motion: reduce) {
	.notification {
		transition: none;
	}
}
/* Scheda meta condivisa fra votazione e consultazione amministratore. */
.destination-card {
	background: white;
	border: 1px solid var(--line);
	/* border-radius: 8px;*/
	padding: 1rem;
}
.destination-top {
	display: grid;
	grid-template-columns: minmax(180px, 25%) minmax(0, 1fr);
	gap: 1rem;
}
.destination-photo {
	width: 100%;
	height: 100%;
	min-height: 270px;
	max-height: 440px;
	object-fit: cover;
	/*border-radius: 5px;*/
	background: #e5eaf0;
}
.destination-body {
	min-width: 0;
}
.destination-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.75rem;
	background: var(--accent);
	color: white;
	padding: 0.65rem 1rem;
	font-size: 1.5rem;
	/*border-radius: 4px;
	margin-bottom: 0.5rem;*/
}
.destination-title h3 {
	font-size: inherit;
	margin: 0;
}
.destination-title .vote-group button:focus-visible {
	outline-color: white;
}
.destination-table {
	margin: 0;
	font-size: 0.9rem;
	text-align: center;
}
.destination-table th,
.destination-table td {
	vertical-align: middle;
	padding: 0.6rem;
	border-color: var(--line);
}
.destination-table thead {
	background: #edf2f6;
}
.destination-table thead th {
	font-size: 0.82rem;
}
.destination-table small {
	font-size: 0.8rem;
	font-weight: 400;
}
.destination-table .total-cost {
	background: #edf2f6;
	font-weight: 700;
	white-space: nowrap;
}
.cost-caption {
	color: var(--muted);
	font-size: 0.82rem;
	text-align: right;
	margin: 0.5rem 0 1rem;
}
.activities-section {
	background: #f4f7f9;
	padding: 1rem;
	border-radius: 4px;
}
.activities-section h4 {
	border-bottom: 1px solid var(--line);
	padding-bottom: 0.6rem;
	margin-bottom: 0.6rem;
}
.activities-section h4 small {
	color: var(--muted);
	font-size: 0.85rem;
	font-weight: 400;
	margin-left: 0.4rem;
}
.activity-list {
	columns: 2;
	column-gap: 2rem;
	padding-left: 1.1rem;
	margin: 0;
}
.activity-list li {
	break-inside: avoid;
	padding: 0.3rem 0;
	font-size: 0.9rem;
}
.activity-list strong {
	font-weight: 600;
}
.activity-list small {
	display: block;
	color: var(--muted);
	font-size: 0.85rem;
}
.activity-list a {
	color: var(--accent);
}
.vote-group {
	display: inline-grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0.3rem;
	justify-content: center;
}
.vote-group button {
	min-width: 4rem;
	background: white;
	color: var(--ink);
	border: 1px solid #b7c5d1;
	border-radius: 4px;
	padding: 0.3rem 0.5rem;
	font-size: 0.85rem;
}
.vote-group button.selected {
	background: #dfe3e7;
	border-color: #b8c0c8;
	color: var(--ink);
}
.vote-group button:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}
.destination-bottom {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
	margin-top: 1rem;
}
.destination-note {
	background: #f4f7f9;
	padding: 1rem;
	border: 1px solid var(--line);
	border-radius: 4px;
}
.mini-heading {
	font-size: 1rem;
	font-weight: 650;
	margin-bottom: 0.5rem;
}
.note-box {
	min-height: 70px;
	resize: vertical;
}
.note-saved {
	color: #28634a;
	font-size: 0.9rem;
}
.history-area,
.revision-list {
	margin-top: 1rem;
}
@media (max-width: 767px) {
	/* Correzioni per il touch senza alterare le proporzioni desktop. */
	.content-area {
		padding-top: 1.5rem;
	}
	.panel {
		padding: 1rem;
		min-width: 0;
	}
	.btn,
	.vote-group button,
	summary {
		min-height: 44px;
	}
	summary {
		padding-block: 0.6rem;
	}
	.form-control,
	.form-select {
		font-size: 1rem;
	}
	#header-actions {
		min-width: 0;
		width: 100%;
		justify-content: space-between;
	}
	#header-actions > span {
		overflow-wrap: anywhere;
		min-width: 0;
	}
	#header-actions .btn {
		flex-shrink: 0;
	}
	.note-item p,
	.activity-list,
	.voted-list {
		overflow-wrap: anywhere;
	}
	.destination-top,
	.destination-bottom {
		grid-template-columns: 1fr;
	}
	.destination-photo {
		height: 200px;
		min-height: 0;
	}
	.activity-list {
		columns: 1;
	}
	.section-head {
		display: block;
	}
	.section-subtitle {
		display: block;
		margin-top: 0.5rem;
	}
	.destination-table {
		min-width: 0;
	}
	/* Ogni data diventa una riga compatta con costi e voto sempre visibili. */
	.destination-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
	}
	.destination-table tbody,
	.destination-table tr {
		display: grid;
	}
	.destination-table tr {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		margin-top: 0.75rem;
		border: 1px solid var(--line);
	}
	.destination-table th[scope="row"] {
		grid-column: 1 / -1;
		order: -1;
		background: #edf2f6;
		text-align: left;
	}
	.destination-table td {
		padding: 0.65rem 0.25rem;
		overflow-wrap: anywhere;
	}
	.destination-table td[data-label]::before {
		content: attr(data-label);
		display: block;
		font-size: 0.8rem;
		font-weight: 400;
		color: var(--muted);
		margin-bottom: 0.35rem;
	}
	.destination-table td:first-child {
		grid-column: 1 / -1;
		order: 1;
	}
	.destination-table .vote-group {
		width: 100%;
	}
	.destination-title {
		padding: 0.75rem;
	}
	.destination-title .vote-group {
		width: 100%;
	}
	.activities-section h4 small {
		display: block;
		margin: 0.4rem 0 0;
	}
}
