/*
 * Bundled single-template styles.
 *
 * TOKENS
 * ------
 * Components read `--lbt-*` only. Each one resolves through a chain:
 *
 *     var(--lbt-line, var(--rrg-line, var(--rrg-rule, #e6ded6)))
 *                     |               |               |
 *                     doc 08 name     the name the    built-in
 *                                     RRG theme
 *                                     actually ships
 *
 * That order matters. Doc 08 declares the token names as the contract, but the
 * Red Rose Guide theme shipped a different, smaller set (--rrg-rule,
 * --rrg-ink-muted, --rrg-paper-alt, --rrg-accent). Reading only the documented
 * names would make every component fall back to its own defaults on Red Rose
 * Guide itself. Reading only the theme's would break on any other site. The
 * chain honours whichever exists and needs no per-site bridge file.
 *
 * No colour or font family is hard-coded below the token block, so a site that
 * defines either set inherits its own palette.
 */

.lbt-single {
	--lbt-ink: var(--rrg-ink, var(--e-global-color-rrg-ink, #1f1a1c));
	--lbt-ink-soft: var(--rrg-ink-soft, var(--e-global-color-rrg-ink-soft, var(--rrg-ink-muted, #5c5458)));
	--lbt-paper: var(--rrg-paper, var(--e-global-color-rrg-paper, #fbf7f2));
	--lbt-surface: var(--rrg-surface, var(--e-global-color-rrg-surface, var(--rrg-paper-alt, #fff)));
	--lbt-line: var(--rrg-line, var(--e-global-color-rrg-line, var(--rrg-rule, #e6ded6)));
	--lbt-accent: var(--rrg-red, var(--e-global-color-rrg-red, var(--rrg-accent, #c41e3a)));
	--lbt-focus: var(--rrg-focus, var(--e-global-color-rrg-red, var(--rrg-red, #c41e3a)));

	--lbt-font-body: var(--rrg-font-body, inherit);
	--lbt-font-display: var(--rrg-font-display, var(--lbt-font-body));

	--lbt-radius: var(--rrg-radius-md, var(--rrg-radius, 12px));
	--lbt-gap: var(--rrg-space-5, 24px);
	--lbt-measure: var(--rrg-measure, 68ch);

	max-width: var(--rrg-content-width, 1200px);
	margin-inline: auto;
	padding: var(--rrg-section-y, 32px) var(--rrg-gutter, 16px);
	color: var(--lbt-ink);
	font-family: var(--lbt-font-body);
}

/* -- Header ----------------------------------------------------------- */

.lbt-header {
	margin-bottom: var(--lbt-gap);
}

.lbt-kicker {
	margin: 0 0 0.35em;
	color: var(--lbt-ink-soft);
	font-size: 0.8125rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.lbt-title {
	margin: 0;
	font-family: var(--lbt-font-display);
	line-height: 1.15;
}

.lbt-standfirst {
	max-width: var(--lbt-measure);
	margin: 0.5em 0 0;
	color: var(--lbt-ink-soft);
	font-size: 1.125rem;
}

.lbt-figure {
	margin: 0 0 var(--lbt-gap);
}

.lbt-figure img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--lbt-radius);
}

.lbt-content {
	max-width: var(--lbt-measure);
	margin-bottom: var(--lbt-gap);
}

/* -- Field groups ----------------------------------------------------- */

.lbt-group {
	margin-bottom: var(--lbt-gap);
	padding: var(--lbt-gap);
	background: var(--lbt-surface);
	border: 1px solid var(--lbt-line);
	border-radius: var(--lbt-radius);
}

.lbt-group > h2 {
	margin: 0 0 0.75em;
	font-family: var(--lbt-font-display);
	font-size: 1.0625rem;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--lbt-ink-soft);
}

.lbt-group > h3 {
	margin: 1.25em 0 0.5em;
	font-size: 0.9375rem;
}

.lbt-group dl {
	margin: 0;
}

/*
 * Two columns on wide viewports, stacked on narrow. Grid rather than a
 * float/table layout so a long value wraps under its own label instead of
 * pushing the next row out of alignment.
 */
.lbt-field {
	display: grid;
	gap: 0.15em 1.5em;
	padding: 0.55em 0;
	border-top: 1px solid var(--lbt-line);
}

.lbt-field:first-child {
	border-top: 0;
	padding-top: 0;
}

@media (min-width: 40em) {
	.lbt-field {
		grid-template-columns: minmax(10em, 15em) 1fr;
		align-items: baseline;
	}
}

.lbt-field dt {
	color: var(--lbt-ink-soft);
	font-size: 0.9375rem;
}

.lbt-field dd {
	margin: 0;
	overflow-wrap: anywhere;
}

.lbt-empty {
	color: var(--lbt-ink-soft);
	font-style: italic;
	opacity: 0.75;
}

/* -- Opening hours ---------------------------------------------------- */

.lbt-hours {
	width: 100%;
	max-width: 24em;
	border-collapse: collapse;
}

.lbt-hours th,
.lbt-hours td {
	padding: 0.4em 0;
	border-top: 1px solid var(--lbt-line);
	text-align: left;
	font-weight: 400;
}

.lbt-hours tr:first-child th,
.lbt-hours tr:first-child td {
	border-top: 0;
}

.lbt-hours th {
	color: var(--lbt-ink-soft);
	font-size: 0.9375rem;
}

.lbt-hours td {
	font-variant-numeric: tabular-nums;
}

.lbt-exceptions {
	margin: 0;
	padding-left: 1.2em;
	font-variant-numeric: tabular-nums;
}

/* -- Links and notes -------------------------------------------------- */

.lbt-single a {
	color: var(--lbt-accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}

/*
 * :focus-visible with a real offset. Accessibility is listed as
 * non-negotiable in spec 06, and a focus ring that sits flush against the
 * text is the most common way of technically having one while being unusable.
 */
.lbt-single a:focus-visible,
.lbt-single :focus-visible {
	outline: 2px solid var(--lbt-focus);
	outline-offset: 2px;
	border-radius: 2px;
}

.lbt-note {
	max-width: var(--lbt-measure);
	margin: 0;
	color: var(--lbt-ink-soft);
	font-size: 0.9375rem;
}

.lbt-note--provisional {
	margin-top: var(--lbt-gap);
	padding-top: 0.75em;
	border-top: 1px dashed var(--lbt-line);
	font-size: 0.8125rem;
}

.lbt-editlink {
	margin: var(--lbt-gap) 0 0;
	font-size: 0.9375rem;
}

/* -- Archive listing -------------------------------------------------- */

.lbt-archive {
	--lbt-ink: var(--rrg-ink, var(--e-global-color-rrg-ink, #1f1a1c));
	--lbt-ink-soft: var(--rrg-ink-soft, var(--e-global-color-rrg-ink-soft, var(--rrg-ink-muted, #5c5458)));
	--lbt-surface: var(--rrg-surface, var(--e-global-color-rrg-surface, var(--rrg-paper-alt, #fff)));
	--lbt-line: var(--rrg-line, var(--e-global-color-rrg-line, var(--rrg-rule, #e6ded6)));
	--lbt-accent: var(--rrg-red, var(--e-global-color-rrg-red, var(--rrg-accent, #c41e3a)));
	--lbt-focus: var(--rrg-focus, var(--e-global-color-rrg-red, var(--rrg-red, #c41e3a)));
	--lbt-font-body: var(--rrg-font-body, inherit);
	--lbt-font-display: var(--rrg-font-display, var(--lbt-font-body));
	--lbt-radius: var(--rrg-radius-md, var(--rrg-radius, 12px));
	--lbt-gap: var(--rrg-space-5, 24px);

	max-width: var(--rrg-content-width, 1200px);
	margin-inline: auto;
	padding: var(--rrg-section-y, 32px) var(--rrg-gutter, 16px);
	color: var(--lbt-ink);
	font-family: var(--lbt-font-body);
}

.lbt-count {
	margin: 0.5em 0 0;
	color: var(--lbt-ink-soft);
	font-size: 0.9375rem;
}

/*
 * Summary and fact styles live in lbt-components.css, which this sheet
 * declares as a dependency — the archive template and the record-list widget
 * render the same Summary component, so they must not carry two copies of its
 * styles that can drift.
 */

/* -- Pagination ------------------------------------------------------- */

.lbt-pagination {
	margin-top: var(--lbt-gap);
}

.lbt-pagination ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35em;
	margin: 0;
	padding: 0;
	list-style: none;
}

.lbt-pagination a,
.lbt-pagination span {
	display: inline-block;
	min-width: 2.5em;
	padding: 0.4em 0.6em;
	border: 1px solid var(--lbt-line);
	border-radius: var(--rrg-radius-sm, 6px);
	text-align: center;
	text-decoration: none;
}

.lbt-pagination .current {
	background: var(--lbt-accent);
	border-color: var(--lbt-accent);
	color: #fff;
}

/* -- Appended mode ---------------------------------------------------- */

/*
 * When the data is appended to the content rather than rendered by a bundled
 * template, the theme owns the page width. Sit inside it rather than
 * reimposing our own container.
 */
.lbt-single--appended {
	max-width: none;
	margin: var(--lbt-gap, 24px) 0 0;
	padding: 0;
}

/* -- Fallback shell --------------------------------------------------- */

/*
 * Only ever rendered on a theme that ships neither header.php nor footer.php.
 * Enough to orient someone, not an attempt at a design.
 */
.lbt-fallback-header,
.lbt-fallback-footer {
	max-width: var(--rrg-content-width, 1200px);
	margin-inline: auto;
	padding: 16px var(--rrg-gutter, 16px);
	font-family: var(--rrg-font-body, inherit);
}

.lbt-fallback-header {
	border-bottom: 1px solid var(--rrg-line, var(--rrg-rule, #e6ded6));
	font-weight: 600;
}

.lbt-fallback-footer {
	margin-top: 48px;
	border-top: 1px solid var(--rrg-line, var(--rrg-rule, #e6ded6));
	color: var(--rrg-ink-soft, var(--rrg-ink-muted, #5c5458));
	font-size: 0.875rem;
}
