/* Weekly hours and absences editors, used in the staff portal and in wp-admin. */

form[data-kdmed-hours] {
	clear: both; /* wp-admin floats the doctor picker above it */
	max-width: 640px;
}

.kdmed-hours__day {
	display: grid;
	grid-template-columns: 9em 1fr;
	gap: 0.5em 1em;
	align-items: start;
	padding: 0.75em 0;
	border-bottom: 1px solid var(--wp--preset--color--accent-3, #e6e0d8);
}

.kdmed-hours__name {
	padding-top: 0.45em;
	font-weight: 500;
}

.kdmed-hours__intervals {
	display: flex;
	flex-direction: column;
	gap: 0.5em;
}

.kdmed-hours__interval {
	display: flex;
	align-items: center;
	gap: 0.5em;
}

form[data-kdmed-hours] .kdmed-hours__interval input[type="time"] {
	width: 8.5em;
	padding: 0.4em 0.5em;
	border: 1px solid var(--wp--preset--color--accent-3, #e6e0d8);
	font: inherit;
}

form[data-kdmed-hours] .kdmed-hours__location {
	max-width: 12em;
	padding: 0.4em 0.5em;
	border: 1px solid var(--wp--preset--color--accent-3, #e6e0d8);
	font: inherit;
}

.kdmed-hours__interval {
	flex-wrap: wrap;
}

.kdmed-hours__remove,
.kdmed-hours__add {
	padding: 0.3em 0.5em;
	border: 0;
	background: none;
	color: var(--wp--preset--color--accent-2, #7a5a3a);
	font: inherit;
	cursor: pointer;
}

.kdmed-hours__remove {
	font-size: 1.2em;
	line-height: 1;
}

.kdmed-hours__add {
	margin-top: 0.3em;
	padding-left: 0;
	font-size: var(--wp--preset--font-size--small, 13px);
	text-decoration: underline;
}

.kdmed-hours__help {
	color: var(--wp--preset--color--accent-4, #686868);
	font-size: var(--wp--preset--font-size--small, 13px);
}

@media (max-width: 600px) {
	.kdmed-hours__day {
		grid-template-columns: 1fr;
	}

	.kdmed-hours__name {
		padding-top: 0;
	}
}

/* Absences */

form[data-kdmed-absence] label {
	display: block;
	margin-bottom: 0.3em;
	font-weight: 500;
}

form[data-kdmed-absence] .kdmed-form__check label {
	display: inline-flex;
	gap: 0.4em;
	font-weight: 400;
}

form[data-kdmed-absence] input[type="text"] {
	width: 100%;
	max-width: 420px;
}

.kdmed-absence__dates,
.kdmed-absence__times {
	display: flex;
	flex-wrap: wrap;
	gap: 0 1em;
}

.kdmed-absence__dates p,
.kdmed-absence__times p {
	flex: 1 1 10em;
}

/* Times only matter for part-day absences. */
form:has(input[name="all_day"]:checked) .kdmed-absence__times {
	display: none;
}

.kdmed-absence__list {
	margin-top: 1.5em;
}

.kdmed-warning {
	margin: 1em 0;
	padding: 0.75em 1em;
	border-left: 3px solid #dba617;
	background: #fcf9e8;
}

.kdmed-warning ul {
	margin: 0.5em 0 0;
}
