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

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

	--tqq-text: #333;
	--tqq-text-soft: #666;
	--tqq-border: #dddddd;

	--tqq-month-bg: #ffffff;

	--tqq-date-width: 82px;
	--tqq-gap: 24px;
}

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

body {
	margin: 0;
	padding: 0;
}

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

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

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

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

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

	background: #ffffff;
}

#tqq_titolo {
	margin: 0;
	padding: 12px 10px;

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

	text-align: left;
	text-transform: uppercase;

	font-size: 1.05em;
}

#tqq_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(--tqq-border);
}

#tqq_nav_month {
	font-size: 1.4rem;

	font-weight: 600;

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

#tqq_filter_button {
	height: 46px;

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

	margin: 0;
	padding: 0 14px;

	border: 0;
	background: transparent;

	color: #669933;

	cursor: pointer;
}

#tqq_filter_button i {
	font-size: 1.4rem;
	opacity: 85%;
}

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

.mese_tqq {
	position: relative;
}

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

.mese_tqq_flusso {
	padding-left: 10px;

	text-align: left;

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

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

.giorno_tqq {
	display: grid;
	grid-template-columns: var(--tqq-date-width) minmax(0, 1fr);
	column-gap: var(--tqq-gap);

	position: relative;

	padding: 28px 0 0 0;
}

.data_tqq {
	align-self: start;

	font-family: var(--tqq-font-date);
	text-align: center;
	color: #194900;
}

.nome_giorno {
	margin-top: 2px;
	margin-bottom: 1px;

	font-size: 0.78rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	line-height: 1;
}

.numero_giorno {
	font-size: 2.25rem;
	font-weight: 400;
	line-height: 1;
	letter-spacing: -0.04em;
}

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

.eventi_giorno {
	min-width: 0;
}

.ippodromo_tqq {
	padding-bottom: 28px;
}

.ippodromo_tqq + .ippodromo_tqq {
	padding-top: 24px;
	border-top: 1px solid var(--tqq-border);
}

.ippodromo_nome_tqq {
	margin-bottom: 5px;

	font-size: 1.2rem;
	color: #194900;
	font-weight: 600;
}

/* =========================================================
   SINGOLA TQQ
   ========================================================= */

.evento_tqq {
	padding: 0;
}

.evento_tqq:not(:last-child) {
	padding-bottom: 26px;
}

.evento_tqq + .evento_tqq {
	padding-top: 26px;
	border-top: 1px solid var(--tqq-border);
}

.placeholder_tqq {
	font-size: 0.95rem;
	font-weight: 400;
	font-style: italic;
	color: var(--tqq-text-soft);
}

.nome_tqq {
	font-size: 0.95rem;
	font-weight: 600;
}

.montepremi_tqq {
	margin-top: 5px;

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

.distanza_tqq {
	margin-top: 2px;

	font-size: 0.85rem;
	font-weight: 400;
	color: var(--tqq-text-soft);
}

.note_tqq {
	margin-top: 5px;

	font-size: 0.78rem;
	font-weight: 500;
	line-height: 1.4;
	color: var(--tqq-text-soft);
}

.proposizione_tqq {
	max-width: 900px;
	margin-top: 5px;

	font-size: 0.95rem;
	font-weight: 400;
	line-height: 1.55;

	color: var(--tqq-text);
}

.azioni_tqq {
	margin-top: 5px;
}

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

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

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

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

#tqq_filter_panel[hidden] {
	display: none;
}

#tqq_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);
}

#tqq_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: tqq_filter_slide_in 0.28s ease-out;
}

@keyframes tqq_filter_slide_in {

	from {
		transform: translateX(100%);
	}

	to {
		transform: translateX(0);
	}
}

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

	padding: 18px 20px;

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

#tqq_filter_title {
	margin: 0;

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

	color: #194900;
}

#tqq_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;
}

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

#tqq_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;
}

#tqq_filter_controls {
	padding: 20px;
}

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

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

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

	margin: 0;
	padding: 10px 15px;

	background: transparent;

	font-family: var(--tqq-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) {
	#tqq_filter_apply:hover {
		background: #669933;
		color: #ffffff;
		font-weight: 500;
		font-size: 0.80rem;
	}
}

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

#tqq_filter_panel_inner.tqq_filter_closing {
    animation: tqq_filter_slide_out 0.28s ease-in forwards;
}

@keyframes tqq_filter_slide_out {

    from {
        transform: translateX(0);
    }

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

.tqq_filter_field {
	margin-bottom: 28px;
}

.tqq_filter_field label {
	display: block;

	margin-bottom: 9px;

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

	color: #194900;
}

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

#tqq_filter_year,
#tqq_filter_month,
#tqq_filter_track {
	width: 100%;
	height: 42px;

	box-sizing: border-box;

	padding: 0 32px 0 12px;

	background: #ffffff;

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

	color: var(--tqq-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;
}

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

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

	margin: 0;
	padding: 0 14px;

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

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

	color: #333;

	cursor: pointer;
	white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
	#tqq_vai_corrente: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_tqq {
		display: grid;
		grid-template-columns: 1fr 250px;
		column-gap: 24px;
		align-items: start;
		padding-top: 40px;
	}

	#tqq_content {
		grid-column: 1;
	}

	#tqq_titolo {
		font-weight: 300;
	}

	#tqq_filter_button {
		display: none;
	}

	#tqq_filter_panel,
	#tqq_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(--tqq-border);
	}

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

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

	#tqq_filter_close {
		display: none;
	}

	#tqq_filter_controls {
		padding: 20px 0;
	}

	#tqq_filter_footer {
		padding: 16px 0;
	}

}

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

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

	:root {
		--tqq-date-width: 52px;
		--tqq-gap: 14px;
	}

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

	#tqq_titolo {
		text-align: center;
		padding: 11px 20px;
		font-weight: 400;
	}

	#tqq_nav_mobile {
		height: 43px;
	}

	#tqq_nav_month {
		font-size: 1.2rem;

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

	#tqq_filter_button {
		height: 42px;
		padding: 0 12px;
	}

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

	.giorno_tqq {
		padding-top: 22px;
	}

	.nome_giorno {
		font-size: 0.66rem;
		letter-spacing: 0.06em;
	}

	.numero_giorno {
		font-size: 2rem;
	}

	.ippodromo_tqq {
		padding-bottom: 24px;
	}

	.ippodromo_tqq + .ippodromo_tqq {
		padding-top: 20px;
	}

	.evento_tqq:not(:last-child) {
		padding-bottom: 22px;
	}

	.evento_tqq + .evento_tqq {
		padding-top: 22px;
	}

	.proposizione_tqq {
		font-size: 0.9rem;
		line-height: 1.5;
	}

	#tqq_filter_apply {
		font-size: 0.85rem;
	}

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