/*
Theme Name: Broad Street
Theme URI: https://example.org/
Author: The 51 Broad Street history project
Description: A history and memories site for 51 Broad Street and the street around it, in Bristol's Old City. Includes a timeline, a street gazetteer with a map, a picture archive with image credits, a private research archive, and a moderated form for people to share photos and memories.
Version: 1.0.0
Requires at least: 6.2
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: broadstreet
*/

/* Fonts: Alegreya and Alegreya Sans, SIL Open Font License, bundled locally so no third-party requests are made. */
@font-face { font-family: "Alegreya"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/alegreya-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Alegreya"; font-style: italic; font-weight: 400; font-display: swap; src: url("assets/fonts/alegreya-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Alegreya"; font-style: normal; font-weight: 700; font-display: swap; src: url("assets/fonts/alegreya-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Alegreya"; font-style: normal; font-weight: 800; font-display: swap; src: url("assets/fonts/alegreya-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/alegreya-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("assets/fonts/alegreya-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("assets/fonts/alegreya-sans-latin-700-normal.woff2") format("woff2"); }

:root {
	/* The palette is taken from the stones of the 1867 front: Pennant sandstone, red Mansfield sandstone and pale limestone, with verdigris from old ironwork and brass from the shop fittings. */
	--bs-limewash: #ecedea;
	--bs-paper: #f8f8f5;
	--bs-ink: #1e2a31;
	--bs-pennant: #4d5c64;
	--bs-pennant-soft: #7d8b91;
	--bs-red: #9a3b2c;
	--bs-red-deep: #7a2d21;
	--bs-lime: #d9cfb7;
	--bs-verdigris: #2e6b5e;
	--bs-brass: #a8843a;
	--bs-glass: #243039;
	--bs-door: #3a2b22;
	--bs-pavement: #8d8f8b;
	--bs-cobble: #a3a5a0;
	--bs-rule: #cfd2ce;

	--bs-serif: "Alegreya", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
	--bs-sans: "Alegreya Sans", "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;

	/* Type scale: a 1.25 ratio from an 18px base. */
	--bs-s-1: 0.875rem;
	--bs-s0: 1.125rem;
	--bs-s1: 1.406rem;
	--bs-s2: 1.758rem;
	--bs-s3: 2.197rem;
	--bs-s4: 2.747rem;
	--bs-s5: 3.433rem;

	--bs-measure: 66ch;
	--bs-wide: 76rem;
	--bs-gap: clamp(1rem, 2.5vw, 2rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
	margin: 0;
	background: var(--bs-limewash);
	color: var(--bs-ink);
	font-family: var(--bs-serif);
	font-size: var(--bs-s0);
	line-height: 1.62;
	font-variant-numeric: oldstyle-nums proportional-nums;
	text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--bs-verdigris); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--bs-red); }
:focus-visible { outline: 3px solid var(--bs-brass); outline-offset: 2px; }
.screen-reader-text, .bs-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.bs-skip { position: absolute; left: -999px; top: 0; background: var(--bs-ink); color: #fff; padding: 0.5rem 1rem; z-index: 10; }
.bs-skip:focus { left: 1rem; }

h1, h2, h3, h4 { font-family: var(--bs-serif); line-height: 1.15; margin: 0 0 0.5em; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: clamp(var(--bs-s3), 5vw, var(--bs-s5)); }
h2 { font-size: clamp(var(--bs-s2), 3.4vw, var(--bs-s3)); }
h3 { font-size: var(--bs-s1); font-weight: 700; }
h4 { font-size: var(--bs-s0); font-weight: 700; }
p { margin: 0 0 1em; }
blockquote { margin: 1.5em 0; padding: 0 0 0 1.25em; border-left: 4px solid var(--bs-red); font-style: italic; }
blockquote cite { display: block; margin-top: 0.4em; font-style: normal; font-family: var(--bs-sans); font-size: var(--bs-s-1); color: var(--bs-pennant); }
hr { border: 0; height: 1px; background: var(--bs-rule); margin: 2.5rem 0; }
small, .bs-meta { font-family: var(--bs-sans); font-size: var(--bs-s-1); color: var(--bs-pennant); }

.bs-wrap { width: min(100% - 2 * var(--bs-gap), var(--bs-wide)); margin-inline: auto; }
.bs-prose { max-width: var(--bs-measure); }
.bs-prose > * + h2 { margin-top: 1.8em; }
.bs-prose > * + h3 { margin-top: 1.5em; }
.bs-prose ul, .bs-prose ol { padding-left: 1.3em; }
.bs-prose li { margin-bottom: 0.35em; }
.bs-lede { font-size: var(--bs-s1); line-height: 1.45; max-width: 44ch; }

/* The voussoir band: alternating red and stone blocks, as on the arches of No. 51. The one bold decorative device on the site. */
.bs-band {
	height: 14px;
	background: repeating-linear-gradient(90deg, var(--bs-red) 0 34px, var(--bs-lime) 34px 52px);
	border-top: 3px solid var(--bs-pennant);
}
.bs-band--thin { height: 8px; border-top-width: 2px; }

/* Header */
.bs-header { background: var(--bs-limewash); }
.bs-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; flex-wrap: wrap; }
.bs-brand { display: flex; align-items: baseline; gap: 0.55rem; text-decoration: none; color: var(--bs-ink); }
.bs-brand__no { font-weight: 800; font-size: var(--bs-s3); line-height: 1; color: var(--bs-red); font-variant-numeric: lining-nums; }
.bs-brand__name { font-weight: 700; font-size: var(--bs-s1); line-height: 1.1; }
.bs-brand__place { display: block; font-family: var(--bs-sans); font-weight: 400; font-size: var(--bs-s-1); color: var(--bs-pennant); }
.bs-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.2rem 1.25rem; }
.bs-nav a { font-family: var(--bs-sans); font-weight: 500; font-size: 1.02rem; color: var(--bs-ink); text-decoration: none; padding: 0.3rem 0; border-bottom: 2px solid transparent; }
.bs-nav a:hover, .bs-nav .current-menu-item > a, .bs-nav .current_page_item > a { border-bottom-color: var(--bs-red); color: var(--bs-ink); }
.bs-nav__toggle { display: none; font-family: var(--bs-sans); font-size: 1rem; background: none; border: 2px solid var(--bs-ink); color: var(--bs-ink); padding: 0.35rem 0.8rem; border-radius: 2px; cursor: pointer; }
@media (max-width: 760px) {
	.bs-nav__toggle { display: inline-block; }
	.bs-nav { width: 100%; display: none; }
	.bs-nav.is-open { display: block; }
	.bs-nav ul { flex-direction: column; gap: 0; padding-bottom: 0.75rem; }
	.bs-nav a { display: block; padding: 0.55rem 0; border-bottom: 1px solid var(--bs-rule); }
}

main { display: block; }
.bs-section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.bs-section + .bs-section { padding-top: 0; }

/* Home: hero */
.bs-hero { padding: clamp(1.5rem, 4vw, 3rem) 0 0; }
.bs-hero__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: end; }
.bs-hero__text { padding-bottom: clamp(1rem, 4vw, 3.5rem); }
.bs-hero h1 { font-size: clamp(2.4rem, 5.6vw, 4.2rem); line-height: 1.02; letter-spacing: -0.02em; margin-bottom: 0.4em; }
.bs-hero__art { display: block; }
.bs-hero__art .bs-facade { display: block; width: 100%; height: auto; }
.bs-hero__links { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; margin-top: 1.5rem; font-family: var(--bs-sans); font-size: 1.05rem; }
.bs-button { display: inline-block; font-family: var(--bs-sans); font-weight: 700; background: var(--bs-ink); color: var(--bs-paper); text-decoration: none; padding: 0.65rem 1.15rem; border-radius: 2px; border: 0; cursor: pointer; font-size: 1.02rem; }
.bs-button:hover { background: var(--bs-red); color: #fff; }
.bs-button--quiet { background: transparent; color: var(--bs-ink); box-shadow: inset 0 0 0 2px var(--bs-ink); }
.bs-button--quiet:hover { background: var(--bs-ink); color: var(--bs-paper); }
@media (max-width: 860px) { .bs-hero__grid { grid-template-columns: 1fr; } .bs-hero__art { max-width: 520px; margin-inline: auto; } }

/* Facade drawing: windows light up in the evening, once, on load, and only if motion is allowed. */
.bs-facade .bs-win { transition: fill 1.2s ease; }
.bs-facade.is-lit .bs-win { fill: #e7b860; }
.bs-facade.is-lit .bs-win:nth-of-type(3n) { fill: #c99a45; }
@media (prefers-reduced-motion: reduce) { .bs-facade .bs-win { transition: none; } }

/* Two sides: building chapters and street topics */
.bs-sides { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 4rem); }
@media (max-width: 760px) { .bs-sides { grid-template-columns: 1fr; } }
.bs-side h2 { margin-bottom: 0.3em; }
.bs-side > p { color: var(--bs-pennant); max-width: 46ch; }
.bs-chapters { list-style: none; margin: 1.25rem 0 0; padding: 0; counter-reset: ch; }
.bs-chapters li { display: grid; grid-template-columns: 4.5rem 1fr; gap: 0.75rem; padding: 0.8rem 0; border-top: 1px solid var(--bs-rule); }
.bs-chapters li:last-child { border-bottom: 1px solid var(--bs-rule); }
.bs-chapters .bs-when { font-family: var(--bs-sans); font-size: var(--bs-s-1); color: var(--bs-red); font-weight: 700; padding-top: 0.25rem; font-variant-numeric: lining-nums; }
.bs-chapters a { font-weight: 700; font-size: 1.15rem; color: var(--bs-ink); text-decoration: none; }
.bs-chapters a:hover { color: var(--bs-red); text-decoration: underline; }
.bs-chapters p { margin: 0.15rem 0 0; font-size: 1rem; color: var(--bs-pennant); }

/* Map */
.bs-map-wrap { background: var(--bs-paper); border: 1px solid var(--bs-rule); padding: clamp(0.5rem, 2vw, 1.25rem); overflow-x: auto; }
.bs-map { display: block; width: 100%; min-width: 560px; height: auto; }
.bs-map-street { fill: none; stroke: #d3d0c7; stroke-width: 34; stroke-linecap: round; stroke-linejoin: round; }
.bs-map-bldg { fill: #d9dcda; stroke: var(--bs-paper); stroke-width: 1.5; }
.bs-map-bldg.is-listed { fill: var(--bs-pennant-soft); transition: fill 0.2s; }
.bs-map a:hover .bs-map-bldg.is-listed, .bs-map a:focus .bs-map-bldg.is-listed { fill: var(--bs-pennant); }
.bs-map-bldg.is-51, .bs-map a:hover .bs-map-bldg.is-51 { fill: var(--bs-red); }
.bs-map-label { font-family: var(--bs-sans); font-weight: 700; font-size: 13px; fill: #fff; pointer-events: none; font-variant-numeric: lining-nums; }
.bs-map-label.is-name { fill: var(--bs-ink); font-family: var(--bs-serif); font-style: italic; font-weight: 400; font-size: 13px; }
.bs-map-streetname { font-family: var(--bs-serif); font-style: italic; font-size: 16px; fill: var(--bs-ink); letter-spacing: 2px; }
.bs-map-note { margin-top: 0.6rem; }

/* Article */
.bs-article__head { padding: clamp(2rem, 5vw, 3.5rem) 0 1.5rem; }
.bs-article__kicker { font-family: var(--bs-sans); font-size: 1rem; color: var(--bs-pennant); margin: 0 0 0.6rem; }
.bs-article__kicker a { color: var(--bs-pennant); }
.bs-article__head h1 { max-width: 22ch; }
.bs-article__when { font-family: var(--bs-sans); font-weight: 700; color: var(--bs-red); font-variant-numeric: lining-nums; }
.bs-article__body { display: grid; grid-template-columns: minmax(0, 1fr) 18rem; gap: clamp(1.5rem, 4vw, 4rem); padding-bottom: 3rem; }
.bs-article__body > .bs-prose { grid-column: 1; }
.bs-aside { grid-column: 2; font-family: var(--bs-sans); font-size: 1rem; }
.bs-aside h2 { font-family: var(--bs-sans); font-size: 1.05rem; font-weight: 700; margin: 0 0 0.5rem; letter-spacing: 0; }
.bs-aside section + section { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--bs-rule); }
.bs-aside ol, .bs-aside ul { margin: 0; padding-left: 1.1rem; }
.bs-aside li { margin-bottom: 0.45rem; line-height: 1.4; }
@media (max-width: 980px) { .bs-article__body { grid-template-columns: 1fr; } .bs-aside { grid-column: 1; } }
.bs-feature { margin: 0 0 2rem; }
.bs-pagenav { display: flex; justify-content: space-between; gap: 1rem; padding: 1.25rem 0 3rem; border-top: 1px solid var(--bs-rule); font-family: var(--bs-sans); }
.bs-pagenav a { text-decoration: none; font-weight: 700; color: var(--bs-ink); }
.bs-pagenav span { display: block; font-weight: 400; font-size: var(--bs-s-1); color: var(--bs-pennant); }

/* Figures, captions and credits */
figure { margin: 2rem 0; }
figure img { display: block; width: 100%; height: auto; background: var(--bs-rule); }
figcaption, .wp-caption-text, .wp-element-caption { font-family: var(--bs-sans); font-size: var(--bs-s-1); color: var(--bs-pennant); margin-top: 0.5rem; line-height: 1.4; }
.bs-credit { display: block; color: var(--bs-pennant-soft); }
.bs-credit a { color: inherit; }
.bs-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 1.25rem; margin: 2rem 0; }
.bs-gallery figure { margin: 0; }
.bs-gallery img { aspect-ratio: 4 / 3; object-fit: cover; }
.bs-gallery--wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }

/* Timeline: the street on the left, No. 51 on the right, with the years running down the kerb between them. */
.bs-tl-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 2rem; font-family: var(--bs-sans); }
.bs-tl-filter button { font: inherit; font-weight: 500; background: transparent; border: 2px solid var(--bs-ink); color: var(--bs-ink); padding: 0.35rem 0.9rem; border-radius: 2px; cursor: pointer; }
.bs-tl-filter button[aria-pressed="true"] { background: var(--bs-ink); color: var(--bs-paper); }
.bs-tl { list-style: none; margin: 0; padding: 0; position: relative; }
.bs-tl::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 6px; margin-left: -3px; background: repeating-linear-gradient(180deg, var(--bs-pennant) 0 26px, var(--bs-pennant-soft) 26px 30px); }
.bs-tl__item { position: relative; width: 50%; padding: 0 2.25rem 2rem 0; }
.bs-tl__item.is-building { margin-left: 50%; padding: 0 0 2rem 2.25rem; }
.bs-tl__year { display: block; font-weight: 800; font-size: var(--bs-s2); line-height: 1; color: var(--bs-ink); font-variant-numeric: oldstyle-nums; }
.bs-tl__item.is-building .bs-tl__year { color: var(--bs-red); }
.bs-tl__item::after { content: ""; position: absolute; top: 0.55rem; right: -7px; width: 14px; height: 14px; background: var(--bs-paper); border: 3px solid var(--bs-pennant); border-radius: 50%; }
.bs-tl__item.is-building::after { right: auto; left: -7px; border-color: var(--bs-red); }
.bs-tl__item.is-street { text-align: right; }
.bs-tl__item h3 { font-size: 1.15rem; margin: 0.3rem 0 0.25rem; }
.bs-tl__item p { margin: 0; font-size: 1rem; }
.bs-tl__item .bs-meta { display: block; margin-top: 0.3rem; }
.bs-tl__item img { margin-top: 0.6rem; max-width: 18rem; display: inline-block; }
.bs-tl__lanes { display: grid; grid-template-columns: 1fr 1fr; font-family: var(--bs-sans); font-weight: 700; margin-bottom: 1.25rem; }
.bs-tl__lanes span:first-child { text-align: right; padding-right: 2.25rem; }
.bs-tl__lanes span:last-child { padding-left: 2.25rem; color: var(--bs-red); }
.bs-tl[data-show="building"] .is-street, .bs-tl[data-show="street"] .is-building { display: none; }
@media (max-width: 760px) {
	.bs-tl::before { left: 7px; }
	.bs-tl__item, .bs-tl__item.is-building, .bs-tl__item.is-street { width: auto; margin-left: 0; padding: 0 0 1.75rem 2rem; text-align: left; }
	.bs-tl__item::after, .bs-tl__item.is-building::after { left: 0; right: auto; }
	.bs-tl__lanes { display: none; }
	.bs-tl__item .bs-tl__side { display: inline; }
}
.bs-tl__side { display: none; font-family: var(--bs-sans); font-size: var(--bs-s-1); color: var(--bs-pennant); }

/* Gazetteer */
.bs-gz { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); margin-top: 2.5rem; }
@media (max-width: 760px) { .bs-gz { grid-template-columns: 1fr; } }
.bs-gz h2 { font-size: var(--bs-s1); }
.bs-gz ul { list-style: none; margin: 0; padding: 0; }
.bs-gz li { display: grid; grid-template-columns: 4.5rem 1fr; gap: 0.75rem; padding: 0.7rem 0; border-top: 1px solid var(--bs-rule); }
.bs-gz__no { font-weight: 800; font-size: var(--bs-s1); line-height: 1.1; color: var(--bs-pennant); font-variant-numeric: lining-nums; }
.bs-gz li.is-51 .bs-gz__no { color: var(--bs-red); }
.bs-gz a { font-weight: 700; color: var(--bs-ink); text-decoration: none; }
.bs-gz a:hover { text-decoration: underline; color: var(--bs-red); }
.bs-gz p { margin: 0.1rem 0 0; font-size: 0.98rem; color: var(--bs-pennant); }
.bs-facts { font-family: var(--bs-sans); font-size: 1rem; margin: 0 0 1.5rem; }
.bs-facts dt { font-weight: 700; }
.bs-facts dd { margin: 0 0 0.6rem; }

/* Memories form */
.bs-form { max-width: 40rem; font-family: var(--bs-sans); }
.bs-form label { display: block; font-weight: 700; margin: 1.1rem 0 0.35rem; }
.bs-form .bs-hint { display: block; font-weight: 400; color: var(--bs-pennant); font-size: var(--bs-s-1); margin-top: 0.15rem; }
.bs-form input[type="text"], .bs-form input[type="email"], .bs-form textarea, .bs-form select { width: 100%; font: inherit; font-size: 1.05rem; padding: 0.6rem 0.7rem; border: 2px solid var(--bs-pennant-soft); border-radius: 2px; background: var(--bs-paper); color: var(--bs-ink); }
.bs-form textarea { min-height: 11rem; }
.bs-form input:focus, .bs-form textarea:focus, .bs-form select:focus { border-color: var(--bs-ink); outline: none; box-shadow: 0 0 0 3px rgba(168, 132, 58, 0.45); }
.bs-form .bs-check { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 400; }
.bs-form .bs-check input { margin-top: 0.3rem; }
.bs-form .bs-hp { position: absolute; left: -9999px; }
.bs-form button { margin-top: 1.5rem; }
.bs-notice { font-family: var(--bs-sans); padding: 1rem 1.2rem; border-left: 5px solid var(--bs-verdigris); background: var(--bs-paper); margin: 1.5rem 0; }
.bs-notice.is-error { border-left-color: var(--bs-red); }

/* Lists of posts */
.bs-list { list-style: none; margin: 0; padding: 0; }
.bs-list > li { padding: 1.1rem 0; border-top: 1px solid var(--bs-rule); }
.bs-list h2, .bs-list h3 { font-size: var(--bs-s1); margin: 0 0 0.25rem; }
.bs-list a { color: var(--bs-ink); text-decoration: none; }
.bs-list a:hover { color: var(--bs-red); text-decoration: underline; }
.bs-list p { margin: 0; color: var(--bs-pennant); }

/* Credits table */
.bs-credits { width: 100%; border-collapse: collapse; font-family: var(--bs-sans); font-size: 0.98rem; }
.bs-credits th, .bs-credits td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem 0.6rem 0; border-top: 1px solid var(--bs-rule); }
.bs-credits img { width: 88px; height: 66px; object-fit: cover; }
.bs-table-wrap { overflow-x: auto; }

/* Call to share */
.bs-share { background: var(--bs-ink); color: var(--bs-paper); padding: clamp(2rem, 5vw, 3.5rem) 0; }
.bs-share h2 { color: var(--bs-paper); }
.bs-share p { max-width: 52ch; color: #d6dbdc; }
.bs-share .bs-button { background: var(--bs-red); }
.bs-share .bs-button:hover { background: var(--bs-paper); color: var(--bs-ink); }

/* Footer */
.bs-footer { padding: 2.5rem 0 3rem; font-family: var(--bs-sans); font-size: 1rem; color: var(--bs-pennant); }
.bs-footer__grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; }
.bs-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; }
.bs-footer a { color: var(--bs-ink); }

/* WordPress alignment and block basics */
.alignwide { max-width: var(--bs-wide); }
.alignleft { float: left; margin: 0.3rem 1.5rem 1rem 0; max-width: 45%; }
.alignright { float: right; margin: 0.3rem 0 1rem 1.5rem; max-width: 45%; }
.aligncenter { margin-inline: auto; }
.wp-block-image img { height: auto; }
.bs-pagination { font-family: var(--bs-sans); margin: 2rem 0; }
.bs-pagination .page-numbers { padding: 0.3rem 0.6rem; }

@media print {
	.bs-header, .bs-footer, .bs-share, .bs-band, .bs-aside { display: none; }
	body { background: #fff; }
}
