:root {
	--gc-max-width: 1180px;

	--gc-font-main: "Montserrat", sans-serif;
	--gc-font-date: "Roboto", sans-serif;

	--gc-text: #333;
	--gc-text-soft: #666;
	--gc-border: #dddddd;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	padding: 0;
}

html.gc_filters_open,
body.gc_filters_open {
	overflow: hidden;
	overscroll-behavior: none;
}

#calendario_gc {
	width: calc(100% - 40px);
	max-width: var(--gc-max-width);
	margin: 0 auto;
	padding: 30px 0 60px 0;

	font-family: var(--gc-font-main);
	color: var(--gc-text);
}

/* =========================================================
   TITOLO + BARRA MESE (blocco sticky unico)
   ========================================================= */

#gc_titlebar {
	position: sticky;
	top: 0;
	z-index: 41;

	background: #ffffff;
}

#gc_titolo {
	position: relative;
	margin: 0;
	padding: 12px 0px;

	background-color: #669933;
	color: #fff;

	text-align: center;
	text-transform: uppercase;

	font-size: 1.05em;
}

#gc_nav_mobile {
	display: flex;
	align-items: center;
	justify-content: space-between;

	z-index: 40;

	height: 47px;

	box-sizing: border-box;

	background: #ffffff;
	border-bottom: 1px solid var(--gc-border);
}

#gc_nav_month {
	font-size: 1.4rem;

	font-weight: 600;

	padding-left: 10px;
	color: #194900;
}

/* titolo completo (landscape) e titolo corto (portrait) */
#gc_titolo .titolo_P {
	display: none;
}

/* pulsante filtri dentro il titolo, a destra (standard come nei libretti) */
#gc_filter_button {
	position: absolute;
	top: 0;
	right: 0;

	width: 48px;
	height: 100%;

	display: flex;
	align-items: center;
	justify-content: center;

	margin: 0;
	padding: 0;

	border: 0;
	background: transparent;

	color: #ffffff;

	cursor: pointer;
}

#gc_filter_button i {
	font-size: 1.3rem;
}

/* =========================================================
   MESE
   ========================================================= */

.mese_gc {
	position: relative;
}

.mese_gc:not(:last-child) {
	margin-bottom: 55px;
}

.mese_gc_flusso {
	padding-left: 10px;

	text-align: left;

	/*font-size: 1.2rem;*/
	color: #194900;
	font-weight: 400;

	font-size: 1.35rem;
}

/* =========================================================
   GIORNO
   ========================================================= */

.giorno_gc {
	position: relative;

	padding: 44px 0 0 0;

	border-bottom: 1px solid var(--gc-border);
}

.mese_gc_flusso.gc_nascosto + .giorno_gc {
	padding-top: 20px;
}

.data_gc {
	display: flex;
	align-items: baseline;
	gap: 7px;

	/*padding-bottom: 9px;*/
	padding-bottom: 2px;

	margin-bottom: 18px;

	border-bottom: 1px solid var(--gc-border);

	font-family: var(--gc-font-date);
	text-align: left;
	color: #194900;
	padding-left: 10px;
}

.nome_giorno {
	margin: 0;

	/*font-size: 0.95rem;*/
	/*font-weight: 500;*/
	letter-spacing: 0em;
	line-height: 1;

	text-transform: capitalize;

	font-family: var(--gc-font-main);
	font-size: 1.3rem;
	font-weight: 400;
}

.numero_giorno {
	/*font-size: 1.3rem;*/
	/*font-weight: 700;*/
	line-height: 1;
	letter-spacing: 0;

	/*color: var(--gc-text);*/

	font-size: 1.8rem;
	font-weight: 400;
	letter-spacing: -0.02;
}

/* =========================================================
   CONTENUTO DEL GIORNO
   ========================================================= */

.eventi_giorno {
	min-width: 0;
}

.ippodromo_gc {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;

	padding-bottom: 14px;
	padding-left: 10px;
}

/* righe alterne contando solo gli ippodromi VISIBILI (con i filtri quelli nascosti non contano) */
.ippodromo_gc:nth-child(even of :not(.gc_nascosto)) {
	background-color: #f7f7f7;
}

/* spazio sopra solo dopo un ippodromo VISIBILE */
.ippodromo_gc:not(.gc_nascosto) ~ .ippodromo_gc {
	padding-top: 14px;
	/*border-top: 1px solid var(--gc-border);*/
}

.ippodromo_gc_testo {
	min-width: 0;
}

.ippodromo_nome_gc {
	/*font-size: 1.2rem;
	color: #194900;
	font-weight: 600;*/

	font-size: 0.95rem;
	font-weight: 600;	
}

.note_gc {
	/*margin-top: 5px;*/
	margin-top: 2px;

	/*font-size: 0.9rem;*/
	font-size: 0.85rem;

	font-weight: 400;
	color: var(--gc-text-soft);
}

.azioni_gc {
	flex: 0 0 auto;
	margin-left: auto;
}

.azioni_gc a.green-link:hover {
	text-decoration: none;
}

.azioni_gc a i {
	margin-right: 5px;

	font-size: 1.6rem;
	opacity: 85%;
}

.azioni_gc a:focus {
	outline: none;
}

/* =========================================================
   PANNELLO FILTRI
   ========================================================= */

#gc_filter_panel[hidden] {
	display: none;
}

#gc_filter_panel {
	position: fixed;
	top: 0;
	right: 0;
	left: 0;

	height: 100dvh;

	z-index: 100;

	overflow: hidden;
	touch-action: none;

	background: rgba(0, 0, 0, 0.20);
}

#gc_filter_panel_inner {
	width: 80%;
	max-width: 500px;
	height: 100%;
	max-height: 100%;

	margin-left: auto;
	box-sizing: border-box;

	display: flex;
	flex-direction: column;

	background: #ffffff;

	animation: gc_filter_slide_in 0.28s ease-out;
}

@keyframes gc_filter_slide_in {

	from {
		transform: translateX(100%);
	}

	to {
		transform: translateX(0);
	}
}

#gc_filter_header {
	display: flex;
	align-items: center;
	justify-content: space-between;

	padding: 18px 20px;

	border-bottom: 1px solid var(--gc-border);
}

#gc_filter_title {
	margin: 0;

	font-family: var(--gc-font-main);
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: 0.05em;

	color: #194900;
}

#gc_filter_close {
	width: 44px;
	height: 44px;

	display: flex;
	align-items: center;
	justify-content: center;

	margin: 0;
	padding: 0;

	border: 0;
	background: transparent;

	color: #669933;

	cursor: pointer;
}

#gc_filter_close i {
	font-size: 1.6rem;
	opacity: 85%;
}

#gc_filter_scroll {
	flex: 1 1 auto;
	min-height: 0;

	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-y;
}

#gc_filter_controls {
	padding: 20px;
}

#gc_filter_footer {
	flex: 0 0 auto;
	padding: 16px 20px;

	border-top: 1px solid var(--gc-border);
	background: #ffffff;
}

#gc_filter_apply {
	width: 100%;
	min-height: 46px;

	margin: 0;
	padding: 10px 15px;

	background: transparent;

	font-family: var(--gc-font-date);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.04em;

	cursor: pointer;

	border: 1.5px solid #669933;
	color: #669933;
}

@media (hover: hover) and (pointer: fine) {
	#gc_filter_apply:hover {
		background: #669933;
		color: #ffffff;
		font-weight: 500;
		font-size: 0.80rem;
	}
}

#gc_filter_count {
	letter-spacing: 0em;
	font-weight: 600;
}

#gc_filter_panel_inner.gc_filter_closing {
    animation: gc_filter_slide_out 0.28s ease-in forwards;
}

@keyframes gc_filter_slide_out {

    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(100%);
    }
}

.gc_filter_field {
	margin-bottom: 28px;
}

.gc_filter_field label {
	display: block;

	margin-bottom: 9px;

	font-family: var(--gc-font-main);
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.06em;

	color: #194900;
}

#gc_filter_year_row {
	display: flex;
	gap: 8px;
}

#gc_filter_year,
#gc_filter_month,
#gc_filter_track {
	width: 100%;
	height: 42px;

	box-sizing: border-box;

	padding: 0 32px 0 12px;

	background: #ffffff;

	font-family: var(--gc-font-main);

	color: var(--gc-text);

	border: 1px solid #57724e;
	border-radius: 0;
	font-size: 0.95rem;
	cursor: pointer;
	line-height: 20px;

	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;

	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpolygon points='0,0 10,0 5,6' fill='%2357724e'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 10px 6px;
}

#gc_filter_year {
	flex: 1;
	min-width: 0;
}

#gc_filter_year:focus,
#gc_filter_month:focus,
#gc_filter_track:focus {
	outline: none;
	background-color: #f3f7f0;
}

#gc_reset {
	flex: 0 0 70px;
	height: 42px;

	margin: 0;
	padding: 0 14px;

	border: 1px solid #57724e;
	background: transparent;

	font-family: var(--gc-font-main);
	font-size: 0.95rem;
	font-weight: 400;
	letter-spacing: 0.04em;

	color: var(--gc-text);

	cursor: pointer;
	white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
	#gc_reset:hover {
		background: #57724e;
		color: #ffffff;
		font-weight: 600;
		font-size: 1rem;
	}
}

/* =========================================================
   LANDSCAPE / DESKTOP
   Pannello filtri permanente a destra
   ========================================================= */

@media screen and (min-width: 701px) {

	#calendario_gc {
		display: grid;
		grid-template-columns: 1fr 250px;
		column-gap: 24px;
		align-items: start;
		padding-top: 40px;
	}

	#gc_content {
		grid-column: 1;
	}

	#gc_titolo {
		font-weight: 400;
	}

	#gc_filter_button {
		display: none;
	}

	#gc_filter_panel,
	#gc_filter_panel[hidden] {
		display: block !important;
		position: sticky;
		top: 0;

		grid-column: 2;

		width: 250px;
		height: auto;
		max-height: 100dvh;

		z-index: 39;
		overflow: hidden;
		touch-action: auto;
		background: #ffffff;
		border-left: 1px solid var(--gc-border);
	}

	#gc_filter_panel_inner {
		width: 100%;
		max-width: none;
		max-height: 100dvh;
		margin-left: 0;
		padding-left: 23px;
		background: #ffffff;
		animation: none;
	}

	#gc_filter_header {
		padding: 20px 0 18px 0;
	}

	#gc_filter_close {
		display: none;
	}

	#gc_filter_controls {
		padding: 20px 0;
	}

	#gc_filter_footer {
		padding: 16px 0;
	}

}

/* =========================================================
   PORTRAIT / MOBILE
   ========================================================= */

@media screen and (max-width: 700px) {

	#calendario_gc {
		width: 100%;
		padding-top: 0px;
	}

	#gc_titolo {
		display: flex;
		align-items: center;
		justify-content: center;

		min-height: 44px;
		box-sizing: border-box;
		padding: 0 50px;

		text-align: center;
		font-weight: 400;
	}

	#gc_titolo .titolo_L {
		display: none;
	}

	#gc_titolo .titolo_P {
		display: inline;
	}

	#gc_nav_mobile {
		height: 43px;
	}

	#gc_nav_month {
		font-size: 1.2rem;

		font-weight: 600;
		letter-spacing: 0em;
	}

	.mese_gc:not(:last-child) {
		margin-bottom: 42px;
	}

	.mese_gc_flusso {
		font-size: 1.2rem;
	}

	.giorno_gc {
		padding-top: 38px;
	}

	.mese_gc_flusso.gc_nascosto + .giorno_gc {
		padding-top: 18px;
	}

	.nome_giorno {
		font-size: 1.2rem;
	}

	.numero_giorno {
		font-size: 1.65rem;
	}

	.ippodromo_gc {
		padding-bottom: 12px;
	}

	.ippodromo_gc:not(.gc_nascosto) ~ .ippodromo_gc {
		padding-top: 12px;
	}

	#gc_filter_apply {
		font-size: 0.85rem;
	}

	/* al passaggio il testo cresce (0.85 -> 0.90), non scende a 0.80 */
	@media (hover: hover) and (pointer: fine) {
		#gc_filter_apply:hover {
			font-size: 0.90rem;
		}
	}

	#gc_reset {
		flex: 0 0 85px;
	}
}

/* elementi nascosti dai filtri */
.gc_nascosto {
	display: none !important;
}
