/* ==========================================================================
   Pahl's Market — hours block
   Deliberately light-touch: inherits the theme's font, colour and size so it
   sits in a footer column or a contact card without being told to.
   ========================================================================== */

.pahls-hours {
	--pahls-hours-accent: #004B2A;
	--pahls-hours-muted: #5C6560;
}

.pahls-hours__title {
	margin: 0 0 0.65em;
	color: var(--pahls-hours-accent);
}

.pahls-hours__list {
	margin: 0;
	padding: 0;
}

.pahls-hours__row {
	margin: 0 0 0.85em;
}

.pahls-hours__row:last-child {
	margin-bottom: 0;
}

.pahls-hours__row dt {
	margin: 0;
	font-weight: 400;
}

.pahls-hours__row dd {
	margin: 0;
	font-weight: 700;
}

/* Two-column variant, for wider spaces. */
.pahls-hours--table .pahls-hours__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1.5em;
	margin-bottom: 0.45em;
}

.pahls-hours--table .pahls-hours__row dt {
	flex: 0 0 auto;
}

.pahls-hours--table .pahls-hours__row dd {
	flex: 0 0 auto;
	text-align: right;
	white-space: nowrap;
}

.pahls-hours__row.is-closed dd {
	color: var(--pahls-hours-muted);
	font-weight: 500;
}

/* Today. Weight and a rule rather than colour alone, so it still reads for
   anyone who cannot distinguish the accent from the body text. */
.pahls-hours__row.is-today dt,
.pahls-hours__row.is-today dd {
	color: var(--pahls-hours-accent);
}

.pahls-hours--table .pahls-hours__row.is-today {
	border-bottom: 2px solid currentColor;
	padding-bottom: 0.3em;
}

.pahls-hours__closures {
	list-style: none;
	margin: 1.1em 0 0;
	padding: 0.85em 0 0;
	border-top: 1px solid rgba(0, 0, 0, 0.12);
	font-size: 0.9em;
}

.pahls-hours__closures li {
	margin: 0 0 0.4em;
}

.pahls-hours__closures strong {
	display: inline-block;
	min-width: 4.2em;
}

.pahls-hours__note {
	margin: 1em 0 0;
	font-size: 0.9em;
	color: var(--pahls-hours-muted);
}

/* On a dark footer the border and muted text need to invert. Set
   --pahls-hours-muted on the block in the editor, or add this to the theme:
   .wp-block-pahls-market-hours.has-white-color { --pahls-hours-muted:rgba(255,255,255,.72) } */
.pahls-hours__closures:where(.has-text-color *) {
	border-top-color: currentColor;
}

/* ===========================================================================
 * "Open now" — the answer, before the table.
 *
 * The list below this was answering a question nobody asked. People check
 * hours to find out whether they can drive over now and whether they will
 * make it before closing. This says that; the list stays underneath as the
 * reference it always was.
 * ======================================================================== */

.pahls-hours__status {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 10px;
	margin: 0 0 18px;
	padding: 12px 14px;
	border: 1px solid var( --pm-line, var( --wp--preset--color--border, #e2e4e0 ) );
	border-radius: 10px;
	background: #fff;
	line-height: 1.35;
}

.pahls-hours__dot {
	width: 8px;
	height: 8px;
	flex: none;
	align-self: center;
	border-radius: 50%;
	background: #9ca3af;
}

.pahls-hours__status.is-open .pahls-hours__dot {
	background: #16a34a;
}

.pahls-hours__status.is-closing .pahls-hours__dot {
	background: var( --pm-gold, var( --wp--preset--color--secondary, #cb9d18 ) );
}

.pahls-hours__state {
	font-size: 15px;
	font-weight: 700;
	color: var( --pm-green, var( --wp--preset--color--primary, #004b2a ) );
}

.pahls-hours__status.is-closed .pahls-hours__state {
	color: var( --pm-ink, var( --wp--preset--color--foreground, #1a1a1a ) );
}

.pahls-hours__status.is-closing .pahls-hours__state {
	color: #8a6a12;
}

/* Pushed to its own line on narrow cards, inline when there is room. */
.pahls-hours__until {
	flex: 1 1 100%;
	color: var( --pm-muted, var( --wp--preset--color--muted-foreground, #6b7280 ) );
	font-size: 13.5px;
}

/*
 * Today's row no longer carries the meaning on its own — the line above says
 * it in words — so the colour steps back to a quiet marker rather than a
 * second green that read as a mistake.
 */
.pahls-hours__status + .pahls-hours__list .pahls-hours__row.is-today dt,
.pahls-hours__status + .pahls-hours__list .pahls-hours__row.is-today dd {
	color: inherit;
	font-weight: 700;
}

.pahls-hours__status + .pahls-hours__list .pahls-hours__row.is-today dt::after {
	content: " · Today";
	color: var( --pm-gold, var( --wp--preset--color--secondary, #cb9d18 ) );
	font-weight: 700;
}
