/* Site-wide date picker (assets/js/date-picker.js). Loaded on the site and
   in wp-admin, so every colour has a fallback for screens without the
   theme's variables. */

.aj-dp {
	position: relative;
	display: block;
	max-width: 100%;
}

.aj-dp__field {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	min-height: 44px;
	padding: 10px 14px;
	border: 1px solid var(--aj-border, #e6e9f0);
	border-radius: var(--aj-radius-sm, 8px);
	background: var(--aj-bg, #fff);
	color: var(--aj-text, #10141c);
	font: inherit;
	font-size: 15px;
	text-align: left;
	cursor: pointer;
	transition: border-color 160ms ease, box-shadow 160ms ease;
}

.wp-admin .aj-dp__field {
	min-height: 32px;
	padding: 4px 10px;
	font-size: 14px;
	max-width: 260px;
}

.aj-dp__field:hover,
.aj-dp__field[aria-expanded="true"] {
	border-color: var(--aj-brand, #0070ff);
}

.aj-dp__field:focus-visible {
	outline: none;
	border-color: var(--aj-brand, #0070ff);
	box-shadow: 0 0 0 3px rgba(0, 112, 255, 0.18);
}

.aj-dp__field.is-empty .aj-dp__value {
	color: var(--aj-text-muted, #8a93a3);
}

.aj-dp__field.is-invalid {
	border-color: #d63638;
	box-shadow: 0 0 0 3px rgba(214, 54, 56, 0.15);
}

.aj-dp__field svg {
	flex: none;
	width: 18px;
	height: 18px;
	color: var(--aj-brand, #0070ff);
}

.aj-dp__pop {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 1000;
	box-sizing: border-box;
	width: 320px;
	padding: 18px;
	border: 1px solid var(--aj-border, #e6e9f0);
	border-radius: 14px;
	background: #fff;
	color: #10141c;
	box-shadow: 0 20px 48px rgba(16, 20, 28, 0.16);
	font-size: 14px;
	animation: aj-dp-in 160ms ease-out;
}

@keyframes aj-dp-in {
	from {
		opacity: 0;
		transform: translateY(-4px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.aj-dp__pop {
		animation: none;
	}
}

.aj-dp__pop button {
	font: inherit;
	cursor: pointer;
}

.aj-dp__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
}

.aj-dp__top strong {
	font-size: 16px;
}

.aj-dp__top > span {
	display: flex;
	align-items: center;
	gap: 6px;
}

.aj-dp__today {
	padding: 5px 12px;
	border: 1.5px solid var(--aj-brand, #0070ff);
	border-radius: 8px;
	background: #fff;
	color: var(--aj-brand, #0070ff);
	font-weight: 600;
}

.aj-dp__today:hover {
	background: var(--aj-brand-light, #eaf2ff);
}

.aj-dp__x {
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 8px;
	background: none;
	color: #10141c;
	font-size: 22px;
	line-height: 1;
}

.aj-dp__x:hover {
	background: #f1f3f7;
}

.aj-dp__cap {
	display: block;
	margin-bottom: 6px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #616b7a;
}

.aj-dp__time {
	margin-bottom: 14px;
}

.aj-dp__hm {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 8px;
	border: 1px solid #c8ced8;
	border-radius: 8px;
}

.aj-dp .aj-dp__hm input[type="number"] {
	width: 40px;
	min-height: 0;
	padding: 6px 2px;
	border: 0;
	background: none;
	box-shadow: none;
	font: inherit;
	font-size: 16px;
	text-align: center;
	-moz-appearance: textfield;
}

.aj-dp__hm input::-webkit-outer-spin-button,
.aj-dp__hm input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.aj-dp__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
}

.aj-dp__nav button {
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--aj-brand, #0070ff);
	font-size: 20px;
}

.aj-dp__nav button:hover {
	background: var(--aj-brand-light, #eaf2ff);
}

.aj-dp__month {
	font-size: 15px;
}

.aj-dp__grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	row-gap: 4px;
	text-align: center;
}

.aj-dp__dow {
	padding: 4px 0 8px;
	font-size: 12px;
	color: #616b7a;
}

.aj-dp__day {
	position: relative;
	justify-self: center;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: none;
	color: #10141c;
	font-size: 14px;
	transition: background-color 120ms ease;
}

.aj-dp__day:hover:not([disabled]) {
	background: var(--aj-brand-light, #eaf2ff);
}

.aj-dp__day:focus-visible {
	outline: 2px solid var(--aj-brand, #0070ff);
	outline-offset: 1px;
}

/* Today: a small dot under the number. */
.aj-dp__day.is-today::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 4px;
	width: 4px;
	height: 4px;
	margin-left: -2px;
	border-radius: 50%;
	background: var(--aj-brand, #0070ff);
}

.aj-dp__day.is-selected {
	background: var(--aj-brand, #0070ff);
	color: #fff;
	font-weight: 700;
}

.aj-dp__day.is-selected::after {
	background: #fff;
}

.aj-dp__day[disabled] {
	color: #c3c8d1;
	cursor: default;
}

.aj-dp__foot {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px solid #eef0f4;
}

.aj-dp__foot button {
	padding: 7px 14px;
	border: 0;
	border-radius: 8px;
	background: none;
	color: #616b7a;
	font-weight: 600;
}

.aj-dp__foot button:hover {
	background: #f1f3f7;
}

.aj-dp__foot .aj-dp__done {
	background: var(--aj-brand, #0070ff);
	color: #fff;
}

.aj-dp__foot .aj-dp__done:hover {
	background: var(--aj-brand-dark, #0057c7);
}

/* Phones: a sheet from the bottom of the screen. */
@media (max-width: 520px) {
	.aj-dp__pop {
		position: fixed;
		top: auto;
		left: 0;
		right: 0;
		bottom: 0;
		width: auto;
		padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
		border-radius: 18px 18px 0 0;
		box-shadow: 0 -12px 40px rgba(16, 20, 28, 0.2);
	}

	.aj-dp__day {
		width: 40px;
		height: 40px;
	}
}
