/* Sporting Calendario - griglia mensile (colori del vecchio calendario Tiva Timetables) */
.sc-cal {
	--sc-head-bg: #2e7d32;
	--sc-head-fg: #ffffff;
	--sc-nav: #535353;
	--sc-border: #dddddd;
	--sc-other: #f4f4f4;
	--sc-today: #fff6d9;
	margin: 0 0 30px;
	font-size: 14px;
	scroll-margin-top: 90px;
}
.sc-cal-head {
	display: flex;
	align-items: center;
	gap: 10px;
	background: var(--sc-head-bg);
	color: var(--sc-head-fg);
	padding: 10px 14px;
}
.sc-cal-title {
	flex: 1;
	text-align: center;
	font-family: 'Oswald', Helvetica, Arial, sans-serif;
	font-size: 1.8em;
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: 1px;
	line-height: 1.2;
}
.sc-cal-nav,
.sc-cal-today {
	color: var(--sc-head-fg) !important;
	text-decoration: none !important;
	border: 1px solid rgba(255, 255, 255, .7);
	line-height: 1;
}
.sc-cal-nav {
	font-size: 28px;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding-bottom: 4px;
}
.sc-cal-today {
	order: 3;
	font-size: 13px;
	text-transform: uppercase;
	padding: 6px 10px;
}
.sc-cal-nav:hover,
.sc-cal-today:hover { background: rgba(255, 255, 255, .2); }

/* Griglia (selettori specifici per non ereditare lo stile delle tabelle del tema) */
.sc-cal table.sc-cal-grid {
	width: 100%;
	table-layout: fixed;
	border-collapse: collapse;
	margin: 0;
	background: #fff;
}
.sc-cal table.sc-cal-grid th {
	background: #ffffff;
	color: var(--sc-nav);
	font-weight: 700;
	text-transform: uppercase;
	font-size: .85em;
	text-align: center;
	padding: 8px 2px;
	border: 1px solid var(--sc-border);
}
.sc-cal table.sc-cal-grid tr:nth-child(even) { background: transparent; }
.sc-cal table.sc-cal-grid td {
	vertical-align: top;
	height: 110px;
	padding: 4px;
	border: 1px solid var(--sc-border);
	background: #fff;
	font-size: 1em;
}
.sc-cal table.sc-cal-grid td.sc-other { background: var(--sc-other); }
.sc-cal table.sc-cal-grid td.sc-other .sc-num { color: #aaa; }
.sc-cal table.sc-cal-grid td.sc-today { background: var(--sc-today); }
.sc-cal table.sc-cal-grid td.sc-today .sc-num {
	background: var(--sc-head-bg);
	color: #fff;
	border-radius: 50%;
}
.sc-num {
	display: inline-block;
	min-width: 24px;
	height: 24px;
	line-height: 24px;
	text-align: center;
	font-weight: 700;
	color: var(--sc-nav);
	margin-bottom: 2px;
}

/* Evento */
.sc-cal .sc-ev {
	display: block;
	width: 100%;
	text-align: left;
	border: 0;
	border-radius: 2px;
	background: var(--sc-ev-bg, #567bd2);
	color: var(--sc-ev-fg, #fff);
	padding: 3px 5px;
	margin: 0 0 3px;
	font: inherit;
	font-size: .85em;
	line-height: 1.25;
	cursor: pointer;
	text-transform: none;
	text-shadow: none;
	overflow: hidden;
}
.sc-cal .sc-ev:hover,
.sc-cal .sc-ev:focus { filter: brightness(.9); outline: 2px solid #333; outline-offset: 1px; }
.sc-ev-time { display: block; font-weight: 700; font-size: .9em; opacity: .95; }
.sc-ev-title {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	word-break: break-word;
}

.sc-cal-list { display: none; }
.sc-cal-empty {
	text-align: center;
	padding: 14px;
	margin: 0;
	background: #fff;
	border: 1px solid var(--sc-border);
	border-top: 0;
}

/* Finestra con il dettaglio */
.sc-modal {
	width: min(640px, calc(100vw - 32px));
	max-height: calc(100vh - 60px);
	border: 0;
	padding: 24px 24px 16px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
}
.sc-modal::backdrop { background: rgba(0, 0, 0, .55); }
.sc-modal-close {
	position: absolute;
	top: 6px;
	right: 8px;
	border: 0;
	background: transparent;
	font-size: 30px;
	line-height: 1;
	color: #555;
	cursor: pointer;
	padding: 4px 8px;
}
.sc-modal .sc-detail-title {
	margin: 0 30px 6px 0 !important;
	font-size: 1.6em;
	border: 0;
	padding: 0;
}
.sc-modal .sc-detail-when { color: var(--sc-nav, #535353); margin: 0 0 12px; text-align: left; }
.sc-modal .sc-detail-image img {
	display: block;
	width: auto;
	max-width: 100%;
	max-height: 60vh;
	margin: 0 auto 12px;
}
.sc-modal .sc-detail-text p { text-align: left; }

/* Telefono: elenco dei giorni con eventi al posto della griglia */
@media (max-width: 767px) {
	.sc-cal table.sc-cal-grid { display: none; }
	.sc-cal-list { display: block; background: #fff; border: 1px solid var(--sc-border); border-top: 0; }
	.sc-cal-list:empty { display: none; }
	.sc-list-day { padding: 10px 12px; border-bottom: 1px solid var(--sc-border); }
	.sc-list-day:last-child { border-bottom: 0; }
	.sc-list-date { font-weight: 700; color: var(--sc-nav); margin-bottom: 6px; }
	.sc-cal .sc-list-day .sc-ev { font-size: 1em; padding: 8px 10px; }
	.sc-ev-title { -webkit-line-clamp: unset; display: block; }
	.sc-cal-title { font-size: 1.4em; }
	.sc-modal { padding: 20px 16px 12px; }
}
