/*
 Theme Name:   Bricks Child Theme
 Theme URI:    https://bricksbuilder.io/
 Description:  Use this child theme to extend Bricks.
 Author:       Bricks
 Author URI:   https://bricksbuilder.io/
 Template:     bricks
 Version:      1.1
 Text Domain:  bricks
*/

/* ============================================================
 * /comunicati/ — date range filter normalization
 * Uniforma <input type="date"> tra Chrome / Safari desktop /
 * iOS Safari / Firefox. Side-by-side sempre, sfondo trasparente,
 * icona calendario e padding stretti per evitare overlap anche
 * a larghezze contenute (~140px per input).
 * ============================================================ */
.lnd-date-range {
	display: flex;
	flex-direction: row;
	align-items: center;
}

/* Wrapper inserito da JS attorno a ciascun input[type="date"].
   Serve per: (1) target di :has() per il fake placeholder iOS,
   (2) click area estesa (label → focus input). */
.lnd-date-field {
	position: relative;
	display: block;
	flex: 1 1 0;
	min-width: 0;
}

/* Fake placeholder: iOS Safari/Chrome iOS non mostrano placeholder
   nativo per <input type="date"> vuoto. Attivo solo su html.is-ios
   (classe aggiunta da JS). Chrome/Safari desktop mostrano già il loro. */
html.is-ios .lnd-date-field:has(input[type="date"]:required:invalid)::before {
	content: 'GG/MM/AAAA';
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	color: #8A8D9A;
	font-size: 16px;
	pointer-events: none;
	font-family: inherit;
}

.lnd-date-range input[type="date"] {
	-webkit-appearance: none;
	appearance: none;
	position: relative;
	box-sizing: border-box;
	width: 100%;
	padding: 8px 20px 8px 0;
	min-height: 36px;
	font-family: inherit;
	font-size: 16px; /* >=16px evita lo zoom auto iOS al focus */
	line-height: 1.2;
	color: var(--grey-700, #3A3D48);
	background-color: transparent;
	background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24"><path fill="%238A8D9A" d="M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 18H4V8h16v13z"/></svg>');
	background-repeat: no-repeat;
	background-position: right 4px center;
	background-size: 12px 12px;
	border: none;
	border-radius: 0;
}

.lnd-date-range input[type="date"]::-webkit-date-and-time-value {
	text-align: left;
	text-transform: none;
	margin: 0;
}

/* Non forziamo color su ::-webkit-datetime-edit: lasciamo al browser
   la distinzione cromatica tra stato empty e stato filled. */

/* Picker indicator nativo → overlay invisibile full-input.
   Click/tap ovunque apre il picker del device. */
.lnd-date-range input[type="date"]::-webkit-calendar-picker-indicator {
	position: absolute;
	top: 0;
	right: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	background: transparent;
	color: transparent;
	cursor: pointer;
	opacity: 0;
}
