/*
 * Opening times. Colours and spacing can be changed with the custom
 * properties below, e.g. `.wxp-opening-times { --wxp-ot-open-bg: #d9f2e0; }`.
 */
.wxp-opening-times {
	--wxp-ot-open-bg: #e3f6e8;
	--wxp-ot-open-text: #0b4d1e;
	--wxp-ot-closed-bg: #fbe6e6;
	--wxp-ot-closed-text: #7a1c1c;
	--wxp-ot-today-bg: color-mix(in srgb, currentcolor 8%, transparent);
	--wxp-ot-line: color-mix(in srgb, currentcolor 15%, transparent);
	/* --wxp-ot-note: the colour of the note under a day; by default the note follows the text colour of the theme. */
	--wxp-ot-nav-border: currentcolor;
	--wxp-ot-nav-bg: transparent;
	--wxp-ot-nav-color: inherit;
	--wxp-ot-nav-hover-bg: var(--wxp-ot-today-bg);
	--wxp-ot-nav-radius: 4px;

	max-width: 100%;
}

.wxp-opening-times__title {
	margin: 0 0 0.5em;
}

.wxp-opening-times__status {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25em 0.75em;
	margin: 0 0 0.75em;
}

.wxp-opening-times__line .wxp-opening-times__status {
	display: inline-flex;
	margin: 0;
}

.wxp-opening-times__badge {
	display: inline-block;
	padding: 0.1em 0.8em;
	border-radius: 999px;
	font-size: 0.875em;
	font-weight: 600;
	line-height: 1.6;
}

.wxp-opening-times__status.is-open .wxp-opening-times__badge {
	background: var(--wxp-ot-open-bg);
	color: var(--wxp-ot-open-text);
}

.wxp-opening-times__status.is-closed .wxp-opening-times__badge {
	background: var(--wxp-ot-closed-bg);
	color: var(--wxp-ot-closed-text);
}

.wxp-opening-times__line {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25em 0.75em;
	margin: 0;
}

.wxp-opening-times__summary {
	margin: 0.25em 0 0;
}

/* Week table. */
.wxp-opening-times .wxp-opening-times__table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
}

.wxp-opening-times__table th,
.wxp-opening-times__table td {
	padding: 0.5em 0.75em;
	border: 0;
	border-top: 1px solid var(--wxp-ot-line);
	text-align: start;
	vertical-align: top;
}

.wxp-opening-times__table tr:first-child th,
.wxp-opening-times__table tr:first-child td {
	border-top: 0;
}

.wxp-opening-times__table th {
	width: 38%;
	font-weight: 600;
}

.wxp-opening-times__day.is-today {
	background: var(--wxp-ot-today-bg);
}

.wxp-opening-times__day.is-closed td {
	opacity: 0.75;
}

.wxp-opening-times__date {
	display: block;
	font-size: 0.85em;
	font-weight: 400;
	opacity: 0.75;
}

.wxp-opening-times__slot {
	white-space: nowrap;
}

.wxp-opening-times__slot + .wxp-opening-times__slot::before {
	content: " · ";
	white-space: pre;
}

.wxp-opening-times__note {
	display: block;
	color: var(--wxp-ot-note, inherit);
	font-size: 0.85em;
	font-style: italic;
}

.wxp-opening-times__line .wxp-opening-times__note {
	display: inline;
}

/* Week navigation. The selector is specific on purpose: themes often style `button:hover` and `button:focus`. */
.wxp-opening-times__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75em;
	margin: 0 0 0.5em;
}

.wxp-opening-times__nav[hidden] {
	display: none;
}

.wxp-opening-times .wxp-opening-times__nav-btn,
.wxp-opening-times .wxp-opening-times__nav-btn:hover,
.wxp-opening-times .wxp-opening-times__nav-btn:focus,
.wxp-opening-times .wxp-opening-times__nav-btn:active {
	min-width: 2.5em;
	padding: 0.25em 0.75em;
	border: 1px solid var(--wxp-ot-nav-border);
	border-radius: var(--wxp-ot-nav-radius);
	background: var(--wxp-ot-nav-bg);
	color: var(--wxp-ot-nav-color);
	font: inherit;
	line-height: 1.4;
	cursor: pointer;
	box-shadow: none;
}

.wxp-opening-times .wxp-opening-times__nav-btn:hover,
.wxp-opening-times .wxp-opening-times__nav-btn:focus-visible {
	background: var(--wxp-ot-nav-hover-bg);
}

.wxp-opening-times .wxp-opening-times__nav-btn:focus-visible {
	outline: 2px solid currentcolor;
	outline-offset: 2px;
}

.wxp-opening-times .wxp-opening-times__nav-btn:disabled {
	opacity: 0.35;
	cursor: default;
}

.wxp-opening-times__week {
	font-weight: 600;
	text-align: center;
}

.wxp-opening-times__error {
	color: #b32d2e;
}

.wxp-opening-times .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* A week that is not loaded yet: dim the old one for a moment. */
.wxp-opening-times.is-loading .wxp-opening-times__body {
	opacity: 0.6;
}
