/* HoursPilot – inherits the theme's font and text colour; override the variables to restyle. | v0.4.0 | Arthur Sam Mahdi */
.hourspilot {
	--hp-accent: #0f766e;
	--hp-open: #15803d;
	--hp-soon: #b45309;
	--hp-shut: #b91c1c;
	--hp-line: rgba(128, 128, 128, 0.22);
	--hp-radius: 12px;
	--hp-pad: 1.25rem;

	box-sizing: border-box;
	max-width: 30rem;
	padding: var(--hp-pad);
	border: 1px solid var(--hp-line);
	border-radius: var(--hp-radius);
	line-height: 1.45;
	font-variant-numeric: tabular-nums;
}
.hourspilot *,
.hourspilot *::before,
.hourspilot *::after { box-sizing: inherit; }
.hourspilot [hidden] { display: none !important; }

/* Header */
.hourspilot .hp-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.75rem;
	margin-bottom: 1rem;
}
.hourspilot .hp-title {
	flex: 1 1 auto;
	margin: 0;
	font-size: 1.125em;
	font-weight: 650;
	letter-spacing: -0.01em;
}
.hourspilot .hp-localtime { font-size: 0.8125em; opacity: 0.65; }

/* Status – the one loud element */
.hourspilot .hp-status {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.3em 0.8em 0.3em 0.65em;
	border-radius: 999px;
	font-size: 0.8125em;
	font-weight: 600;
	color: var(--hp-shut);
	background: rgba(185, 28, 28, 0.1);
}
.hourspilot .hp-status::before {
	content: "";
	width: 0.5em;
	height: 0.5em;
	border-radius: 50%;
	background: currentColor;
}
.hourspilot .hp-status.hp-open { color: var(--hp-open); background: rgba(21, 128, 61, 0.12); }
.hourspilot .hp-status.hp-soon { color: var(--hp-soon); background: rgba(180, 83, 9, 0.12); }
.hourspilot .hp-status.hp-open::before { animation: hp-pulse 2.4s ease-out infinite; }
@keyframes hp-pulse {
	0% { box-shadow: 0 0 0 0 currentColor; }
	70%, 100% { box-shadow: 0 0 0 0.45em transparent; }
}
@media (prefers-reduced-motion: reduce) {
	.hourspilot .hp-status::before { animation: none !important; }
}

.hourspilot .hp-notice {
	margin: 0 0 1rem;
	padding: 0.6em 0.85em;
	border-inline-start: 3px solid var(--hp-soon);
	border-radius: 4px;
	background: rgba(180, 83, 9, 0.08);
	font-size: 0.875em;
}

/* Hours table – reset common theme table styles */
.hourspilot .hp-table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	background: none;
	font-size: 0.9375em;
}
.hourspilot .hp-table th,
.hourspilot .hp-table td {
	padding: 0.55em 0;
	border: 0;
	border-top: 1px solid var(--hp-line);
	background: none;
	vertical-align: top;
	font-weight: 400;
}
.hourspilot .hp-table tr:first-child > * { border-top: 0; }
.hourspilot .hp-table th { text-align: start; padding-inline-end: 1rem; }
.hourspilot .hp-table td { text-align: end; }
.hourspilot .hp-slot { display: block; white-space: nowrap; }
.hourspilot .hp-closed { opacity: 0.55; }

.hourspilot .hp-row.hp-is-today > * { font-weight: 650; }
.hourspilot .hp-row.hp-is-today th {
	position: relative;
	padding-inline-start: 0.8em;
}
.hourspilot .hp-row.hp-is-today th::before {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	top: 0.6em;
	bottom: 0.6em;
	width: 3px;
	border-radius: 3px;
	background: var(--hp-accent);
}

/* "Today" view: only today's row */
.hourspilot.hp-view-today .hp-row:not(.hp-is-today) { display: none; }
.hourspilot.hp-view-today .hp-table th,
.hourspilot.hp-view-today .hp-table td { border-top: 0; }

/* Holidays */
.hourspilot .hp-subtitle {
	margin: 1.25rem 0 0.4rem;
	font-size: 0.875em;
	font-weight: 650;
}
.hourspilot ul {
	margin: 0;
	padding: 0;
	list-style: none;
}
.hourspilot .hp-holidays li {
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 0.15rem 0.75rem;
	margin: 0;
	padding: 0.45em 0;
	border-top: 1px solid var(--hp-line);
	font-size: 0.875em;
}
.hourspilot .hp-holidays li:first-child { border-top: 0; }
.hourspilot .hp-h-date { font-weight: 600; white-space: nowrap; }
.hourspilot .hp-h-label { opacity: 0.75; }
.hourspilot .hp-h-hours { text-align: end; }

/* Countdown */
.hourspilot .hp-countdown {
	margin: 0 0 1rem;
	font-size: 0.875em;
	font-weight: 600;
	color: var(--hp-open);
}
.hourspilot .hp-countdown.hp-cd-close { color: var(--hp-soon); }

/* Holiday hours shown in a weekday row */
.hourspilot .hp-row.hp-has-holiday td { color: var(--hp-soon); }
.hourspilot .hp-hol-label {
	display: block;
	font-size: 0.8125em;
	opacity: 0.8;
}

/* Horizontal layout: one column per day (or group of days) */
.hourspilot.hp-layout-horizontal { max-width: none; }
.hourspilot.hp-layout-horizontal .hp-table { display: block; }
.hourspilot.hp-layout-horizontal .hp-table tbody {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
	gap: 0.5rem;
}
.hourspilot.hp-layout-horizontal .hp-row {
	display: flex;
	flex-direction: column;
	padding: 0.6em 0.7em;
	border: 1px solid var(--hp-line);
	border-radius: calc(var(--hp-radius) - 4px);
}
.hourspilot.hp-layout-horizontal .hp-table th,
.hourspilot.hp-layout-horizontal .hp-table td {
	padding: 0;
	border: 0;
	text-align: start;
}
.hourspilot.hp-layout-horizontal .hp-table th { margin-bottom: 0.25em; font-size: 0.875em; opacity: 0.75; }
.hourspilot.hp-layout-horizontal .hp-slot { white-space: normal; } /* narrow cards: 12-hour times must wrap */
.hourspilot.hp-layout-horizontal .hp-row.hp-is-today { border-color: var(--hp-accent); box-shadow: inset 0 3px 0 var(--hp-accent); }
.hourspilot.hp-layout-horizontal .hp-row.hp-is-today th { padding-inline-start: 0; }
.hourspilot.hp-layout-horizontal .hp-row.hp-is-today th::before { display: none; }

/* Calendar layout (rendered by the engine) */
.hourspilot.hp-layout-calendar { max-width: 40rem; }
.hourspilot .hp-cal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.5rem;
}
.hourspilot .hp-cal-title { font-weight: 650; text-transform: capitalize; }
.hourspilot .hp-cal-title:focus { outline: none; }
.hourspilot .hp-cal-nav {
	min-width: 2.25rem;
	min-height: 2.25rem;
	padding: 0 0.6rem;
	border: 1px solid var(--hp-line);
	border-radius: 999px;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 1.125em;
	line-height: 1;
	cursor: pointer;
}
.hourspilot .hp-cal-nav:hover:not(:disabled) { border-color: var(--hp-accent); color: var(--hp-accent); }
.hourspilot .hp-cal-nav:focus-visible { outline: 2px solid var(--hp-accent); outline-offset: 2px; }
.hourspilot .hp-cal-nav:disabled { opacity: 0.35; cursor: default; }  /* ‹ › are bidi-mirrored by the browser in RTL */
.hourspilot .hp-cal {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: separate;
	border-spacing: 3px;
	table-layout: fixed;
	background: none;
	font-size: 0.8125em;
}
.hourspilot .hp-cal th {
	padding: 0.25em 0;
	border: 0;
	background: none;
	font-weight: 600;
	text-align: center;
	opacity: 0.7;
}
.hourspilot .hp-cal td {
	height: 3.6em;
	padding: 0.3em;
	border: 0;
	border-radius: 6px;
	vertical-align: top;
	background: rgba(128, 128, 128, 0.06);
}
.hourspilot .hp-cal td.hp-cal-out { background: none; }
.hourspilot .hp-cal-n { display: block; font-weight: 600; }
.hourspilot .hp-cal-h { display: block; font-size: 0.85em; line-height: 1.25; opacity: 0.8; overflow-wrap: anywhere; }
.hourspilot .hp-cal-closed .hp-cal-h { opacity: 0.5; }
.hourspilot .hp-cal-hol { background: rgba(180, 83, 9, 0.1); }
.hourspilot .hp-cal-hol .hp-cal-n { color: var(--hp-soon); }
.hourspilot .hp-cal-past { opacity: 0.45; }
.hourspilot .hp-cal-today { box-shadow: inset 0 0 0 2px var(--hp-accent); }

/* Location */
.hourspilot .hp-info {
	margin-top: 1.25rem;
	padding-top: 1rem;
	border-top: 1px solid var(--hp-line);
	font-size: 0.875em;
}
.hourspilot .hp-image {
	display: block;
	width: 100%;
	height: auto;
	max-height: 14rem;
	margin-bottom: 0.9rem;
	object-fit: cover;
	border-radius: calc(var(--hp-radius) - 4px);
}
.hourspilot .hp-info li { margin: 0; padding: 0.15em 0; }
.hourspilot .hp-info a { color: var(--hp-accent); text-underline-offset: 0.15em; }
.hourspilot .hp-info a:focus-visible { outline: 2px solid var(--hp-accent); outline-offset: 2px; border-radius: 2px; }

@media (max-width: 380px) {
	.hourspilot { --hp-pad: 1rem; }
	.hourspilot .hp-cal-h { display: none; }
	.hourspilot .hp-cal td { height: 2.4em; }
	.hourspilot .hp-holidays li { grid-template-columns: 1fr auto; }
	.hourspilot .hp-h-label { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- Labels and breaks (both styles) ---------- */
.hourspilot .hp-chip {
	display: inline-block;
	margin-inline-end: 0.5em;
	padding: 0.1em 0.5em;
	border-radius: 4px;
	background: var(--hp-chip, #2f4f3a);
	color: #fff;
	font-size: 0.75em;
	font-weight: 600;
	line-height: 1.5;
	vertical-align: 0.1em;
}
.hourspilot .hp-break .hp-time { opacity: 0.6; }

/* ---------- Fonts ---------- */
.hourspilot.hp-font-mono {
	font-family: ui-monospace, "Roboto Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
	letter-spacing: 0.02em;
}

/* ---------- Map (click to load) ---------- */
.hourspilot .hp-map { margin-top: 1rem; }
.hourspilot .hp-map iframe {
	display: block;
	width: 100%;
	height: 16rem;
	border: 0;
	border-radius: calc(var(--hp-radius) - 4px);
}
.hourspilot .hp-map-load {
	padding: 0.55em 1em;
	border: 1px solid var(--hp-line);
	border-radius: 999px;
	background: none;
	color: var(--hp-accent);
	font: inherit;
	font-size: 0.875em;
	font-weight: 600;
	cursor: pointer;
}
.hourspilot .hp-map-load:hover { border-color: var(--hp-accent); }
.hourspilot .hp-map-load:focus-visible { outline: 2px solid var(--hp-accent); outline-offset: 2px; }
.hourspilot .hp-map-note { margin: 0.4em 0 0; font-size: 0.75em; opacity: 0.6; }

/* ---------- Card style: header band, black badge, dashed rows ---------- */
.hourspilot.hp-style-card {
	--hp-band-open: #5f9f4f;
	--hp-band-closed: #b4433a;
	--hp-band-edge: #1d1d1f;
	max-width: 36rem;
	padding: 0;
	overflow: hidden;
	background: #fff;
	color: #333;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.hourspilot.hp-style-card.hp-layout-calendar { max-width: 40rem; }
.hourspilot.hp-style-card.hp-layout-horizontal { max-width: none; }
.hourspilot.hp-style-card .hp-band {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.35rem var(--hp-pad) 1.5rem;
	border-top: 8px solid var(--hp-band-edge);
	background-color: var(--hp-band, var(--hp-accent));
	color: #fff;
}
.hourspilot.hp-style-card.hp-band-status.hp-is-open .hp-band { background-color: var(--hp-band-open); }
.hourspilot.hp-style-card.hp-band-status.hp-is-closed .hp-band { background-color: var(--hp-band-closed); }
.hourspilot.hp-style-card.hp-has-band-image .hp-band {
	min-height: 11rem;
	background-image: var(--hp-band-image);
	background-size: cover;
	background-position: center;
	box-shadow: inset 0 0 0 100vmax rgba(0, 0, 0, 0.5);
}
.hourspilot.hp-style-card .hp-band-main { min-width: 0; }
.hourspilot.hp-style-card .hp-date { font-size: 1.3em; font-weight: 650; line-height: 1.3; }
.hourspilot.hp-style-card .hp-band-line { margin-top: 0.35em; font-size: 0.9em; opacity: 0.95; }
.hourspilot.hp-style-card .hp-band .hp-localtime { font-size: inherit; opacity: 1; }
.hourspilot.hp-style-card .hp-badge {
	flex: none;
	padding: 0.55em 0.95em;
	border-radius: 4px;
	background: #111;
	color: #fff;
	font-size: 0.85em;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}
.hourspilot.hp-style-card .hp-badge::before { display: none; }
.hourspilot.hp-style-card .hp-body { padding: 1.1rem var(--hp-pad) 1.25rem; }
.hourspilot.hp-style-card .hp-countdown,
.hourspilot.hp-style-card .hp-notice { margin: 0 0 0.75rem; }

.hourspilot.hp-style-card .hp-table th,
.hourspilot.hp-style-card .hp-table td {
	padding: 0.6em 0;
	border-top: 0;
	border-bottom: 1px dashed rgba(128, 128, 128, 0.55);
	font-weight: 500;
}
.hourspilot.hp-style-card .hp-row:not(.hp-is-today) th { font-weight: 400; }
.hourspilot.hp-style-card .hp-row.hp-is-today > * { font-weight: 650; }
.hourspilot.hp-style-card .hp-row.hp-is-today th { padding-inline-start: 1.6em; }
.hourspilot.hp-style-card .hp-row.hp-is-today th::before {
	top: calc(0.6em + 0.725em); /* centre of the first line, also in rows with several slots */
	bottom: auto;
	width: 0.8em;
	height: 0.8em;
	border-radius: 50%;
	transform: translateY(-50%);
	background: var(--hp-dot, var(--hp-accent));
}
.hourspilot.hp-style-card.hp-is-closed .hp-row.hp-is-today th::before { background: var(--hp-dot-closed, var(--hp-shut)); }

.hourspilot.hp-style-card .hp-holidays li { border-top: 0; border-bottom: 1px dashed rgba(128, 128, 128, 0.55); }

/* Location: image beside the details */
.hourspilot.hp-style-card .hp-info {
	margin: 0;
	padding: 1.25rem var(--hp-pad);
	border-top: 1px solid var(--hp-line);
}
.hourspilot.hp-style-card .hp-info.hp-has-image {
	display: grid;
	grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
	gap: 1.25rem;
	align-items: start;
}
.hourspilot.hp-style-card .hp-info .hp-image { margin: 0; max-height: 11rem; aspect-ratio: 1; }
.hourspilot.hp-style-card .hp-info-name { font-weight: 650; }
.hourspilot.hp-style-card .hp-info a { color: inherit; text-decoration-thickness: 1px; }
.hourspilot.hp-style-card .hp-map { margin: 0 var(--hp-pad) var(--hp-pad); }

@media (max-width: 480px) {
	.hourspilot.hp-style-card .hp-band { flex-direction: column; }
	.hourspilot.hp-style-card .hp-info.hp-has-image { grid-template-columns: 1fr; }
}
