/*
Theme Name: Littlemore Local History Society
Description: Bespoke classic theme for the Littlemore Local History Society, laid out after the Prototype1 design (itself modelled on farnhammuseumsociety.org.uk). Responsive from phone to wide desktop.
Version: 1.0
Text Domain: llhs
*/

:root {
	--maroon: #8e143d;
	--maroon-dark: #6d0f2f;
	--maroon-light: #f6e9ee;
	--grey-btn: #7b7b7b;
	--ink: #222;
	--muted: #5c5c5c;
	--line: #e4e0e1;
	--paper: #fff;
	--paper-alt: #faf7f8;
	--radius: 4px;
	--wrap: 1200px;
	--gutter: clamp(16px, 4vw, 40px);
	--font: "Jost", "Segoe UI", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--maroon); }
a:hover { color: var(--maroon-dark); }
h1, h2, h3 { line-height: 1.2; font-weight: 500; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; width: auto; height: auto; clip: auto; z-index: 1000; background: #fff; padding: 8px 12px; }

/* ---------- Top bar ---------- */
.topbar { background: var(--maroon); color: #fff; }
.topbar .wrap { display: flex; align-items: stretch; justify-content: space-between; min-height: 48px; gap: 12px; }
.topbar a { color: #fff; text-decoration: none; }
.topbar__contact { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.topbar__contact .bubble { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.85); display: grid; place-items: center; color: var(--maroon); }
.topbar__menu { display: flex; list-style: none; margin: 0; padding: 0; gap: 2px; }
.topbar__menu a { display: flex; align-items: center; height: 100%; padding: 0 18px; background: var(--grey-btn); font-weight: 600; transition: background .15s; }
.topbar__menu a:hover, .topbar__menu .current-menu-item a { background: #5d5d5d; }

/* ---------- Header / main nav ---------- */
.site-header { border-bottom: 1px solid var(--line); background: #fff; position: relative; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 14px; padding-bottom: 14px; }
.brand img { width: 165px; height: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 26px; }
.main-nav a { color: var(--ink); text-decoration: none; font-weight: 500; padding: 6px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current_page_item > a { border-bottom-color: var(--maroon); color: var(--maroon); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; cursor: pointer; color: var(--ink); font: inherit; align-items: center; gap: 8px; }
.nav-toggle .bars, .nav-toggle .bars::before, .nav-toggle .bars::after { display: block; width: 22px; height: 2px; background: currentColor; position: relative; transition: transform .2s; }
.nav-toggle .bars::before, .nav-toggle .bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle .bars::before { top: -7px; }
.nav-toggle .bars::after { top: 7px; }
.nav-open .nav-toggle .bars { background: transparent; }
.nav-open .nav-toggle .bars::before { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle .bars::after { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Rotating hero gallery ---------- */
.hero-strip { position: relative; overflow: hidden; background: #f2efe9; height: clamp(170px, 26vw, 300px); }
.hero-strip__track { display: flex; height: 100%; width: max-content; will-change: transform; }
.hero-strip__track figure { margin: 0 4px 0 0; height: 100%; flex: none; position: relative; }
.hero-strip__track img { height: 100%; width: auto; object-fit: cover; }
.hero-strip__track figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 6px; font-size: .8rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.6)); opacity: 0; transition: opacity .2s; }
.hero-strip figure:hover figcaption { opacity: 1; }
.hero-strip__pause { position: absolute; right: 10px; bottom: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; display: grid; place-items: center; }
.hero-strip__pause:hover, .hero-strip__pause:focus-visible { background: var(--maroon); }
.hero-strip.is-static { overflow-x: auto; }

/* ---------- Welcome band ---------- */
.welcome { background: var(--maroon); color: #fff; }
.welcome .wrap { padding-top: clamp(32px, 6vw, 64px); padding-bottom: clamp(32px, 6vw, 64px); }
.welcome h1 { font-size: clamp(1.8rem, 4.4vw, 3rem); margin-bottom: .4em; }
.welcome h1 small { display: block; font-size: .55em; font-weight: 400; opacity: .9; }
.welcome p { font-size: clamp(1.05rem, 2vw, 1.3rem); max-width: 46ch; margin: 0 0 1.4em; }
.btn { display: inline-block; padding: 12px 26px; border-radius: var(--radius); background: #fff; color: var(--maroon); font-weight: 600; text-decoration: none; border: 2px solid #fff; }
.btn:hover { background: transparent; color: #fff; }
.btn--maroon { background: var(--maroon); color: #fff; border-color: var(--maroon); }
.btn--maroon:hover { background: #fff; color: var(--maroon); }

/* ---------- Feature cards ---------- */
.features { padding: clamp(28px, 5vw, 56px) 0; }
.features__grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.feature { text-align: center; padding: 28px 24px; text-decoration: none; color: var(--ink); border-left: 1px solid var(--line); transition: background .15s; }
.feature:first-child { border-left: 0; }
.feature:hover { background: var(--paper-alt); color: var(--ink); }
.feature svg { width: 64px; height: 64px; color: var(--ink); margin: 0 auto 14px; }
.feature h2 { color: var(--maroon); font-size: 1.6rem; margin-bottom: .25em; }
.feature p { margin: 0; color: var(--muted); }

/* ---------- Next / past event panels ---------- */
.events-band { padding-bottom: clamp(32px, 6vw, 64px); }
.events-band__grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.panel { background: var(--maroon); color: #fff; padding: clamp(20px, 3vw, 32px); border-radius: var(--radius); text-decoration: none; display: flex; gap: 24px; }
.panel h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.05; margin: 0; }
.panel a { color: #fff; }
.panel--next .panel__text { flex: 0 0 34%; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.panel--next .panel__meta { font-size: 1rem; }
.panel--next .panel__meta strong { display: block; font-size: 1.1rem; }
.panel--next .panel__poster { flex: 1; background: #fff; border-radius: 2px; overflow: hidden; align-self: flex-start; }
.panel--past { flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; min-height: 260px; color: #fff; }
.panel--past:hover { background: var(--maroon-dark); color: #fff; }
.panel--past .stack { position: relative; height: 170px; }
.panel--past .stack img { position: absolute; width: 46%; box-shadow: 0 4px 14px rgba(0,0,0,.35); border: 3px solid #fff; transition: transform .25s; }
.panel--past .stack img:nth-child(1) { left: 6%; top: 18px; transform: rotate(-8deg); }
.panel--past .stack img:nth-child(2) { left: 28%; top: 6px; transform: rotate(3deg); z-index: 1; }
.panel--past .stack img:nth-child(3) { left: 50%; top: 22px; transform: rotate(10deg); }
.panel--past:hover .stack img:nth-child(1) { transform: rotate(-12deg) translateX(-6px); }
.panel--past:hover .stack img:nth-child(3) { transform: rotate(14deg) translateX(6px); }
.panel .more { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Generic page ---------- */
.page-head { background: var(--paper-alt); border-bottom: 1px solid var(--line); }
.page-head .wrap { padding-top: clamp(24px, 4vw, 44px); padding-bottom: clamp(20px, 3vw, 32px); }
.page-head h1 { margin: 0; color: var(--maroon); }
.entry { padding: clamp(24px, 4vw, 48px) 0 clamp(40px, 6vw, 72px); }
.entry .wrap > * { max-width: 780px; }
.entry .wrap > .is-wide, .entry .wrap > .llhs-gallery, .entry .wrap > .wp-block-gallery, .entry .wrap > .talk-list, .entry .wrap > .next-talk { max-width: none; }
.entry figure { margin: 1.5em 0; }
.entry figcaption { font-size: .9rem; color: var(--muted); text-align: center; margin-top: 6px; }
.lead { font-size: 1.2rem; }
.notice { border-left: 4px solid var(--maroon); background: var(--maroon-light); padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0; }

/* Merchandise grid */
.merch { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; list-style: none; padding: 0; margin: 1.5em 0; }
.merch li { background: var(--paper-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; text-align: center; }
.merch img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; }
.merch span { display: block; margin-top: 8px; font-weight: 500; }

/* ---------- Galleries ---------- */
.llhs-gallery { margin: 2em 0; }
.llhs-gallery figure { margin: 0; }
.llhs-gallery button.thumb { all: unset; cursor: zoom-in; display: block; width: 100%; border-radius: var(--radius); overflow: hidden; }
.llhs-gallery button.thumb:focus-visible { outline: 3px solid var(--maroon); outline-offset: 3px; }
.llhs-gallery figcaption { text-align: center; font-size: .95rem; margin-top: 8px; color: var(--ink); }

.llhs-gallery--grid .llhs-gallery__items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 22px; }
.llhs-gallery--grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .3s; }
.llhs-gallery--grid button.thumb:hover img { transform: scale(1.04); }

.llhs-gallery--scroller { position: relative; }
.llhs-gallery--scroller .llhs-gallery__items { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding: 6px 2px 18px; scrollbar-width: thin; scrollbar-color: var(--maroon) var(--line); }
.llhs-gallery--scroller figure { flex: 0 0 clamp(220px, 28vw, 300px); scroll-snap-align: start; }
.llhs-gallery--scroller img { width: 100%; aspect-ratio: 17 / 22; object-fit: cover; object-position: top; border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.scroller-nav { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 10px; }
.scroller-nav button { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--maroon); background: #fff; color: var(--maroon); cursor: pointer; display: grid; place-items: center; }
.scroller-nav button:hover:not(:disabled) { background: var(--maroon); color: #fff; }
.scroller-nav button:disabled { opacity: .35; cursor: default; }
.gallery-year { margin-top: 1.6em; color: var(--maroon); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(15,10,12,.93); display: none; align-items: center; justify-content: center; padding: 56px 64px; }
.lightbox.is-open { display: flex; }
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 140px); width: auto; object-fit: contain; }
.lightbox figcaption { color: #fff; margin-top: 12px; text-align: center; }
.lightbox button { position: absolute; background: rgba(255,255,255,.12); border: 0; color: #fff; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.lightbox button:hover, .lightbox button:focus-visible { background: var(--maroon); }
.lightbox .lb-close { top: 12px; right: 12px; }
.lightbox .lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 10px; top: 50%; transform: translateY(-50%); }

/* ---------- Events page ---------- */
.next-talk { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(20px, 4vw, 40px); align-items: start; background: var(--paper-alt); border: 1px solid var(--line); border-top: 5px solid var(--maroon); border-radius: var(--radius); padding: clamp(18px, 3vw, 32px); margin: 0 0 2.5em; }
.next-talk__label { text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; font-weight: 600; color: var(--maroon); }
.next-talk h2 { margin: .2em 0 .4em; }
.next-talk dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 1em 0; }
.next-talk dt { font-weight: 600; }
.next-talk dd { margin: 0; }
.next-talk__poster img { width: 100%; border: 1px solid var(--line); }
.talk-list { list-style: none; margin: 0 0 2em; padding: 0; border-top: 1px solid var(--line); }
.talk-list li { display: grid; grid-template-columns: 92px 1fr; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.talk-date { background: var(--maroon); color: #fff; text-align: center; border-radius: var(--radius); padding: 8px 4px; line-height: 1.15; align-self: start; }
.talk-date .d { display: block; font-size: 1.8rem; font-weight: 600; }
.talk-date .m { display: block; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.talk-list h3 { margin: 0 0 .2em; }
.talk-list .who { color: var(--muted); margin: 0 0 .4em; }
.talk-list p { margin: 0; }
.talk-list--past .talk-date { background: #9a9a9a; }
.talk-list--past li { opacity: .85; }

/* ---------- Footer ---------- */
.site-footer { background: #2a2326; color: #ddd; margin-top: 0; }
.site-footer a { color: #fff; }
.footer-menu { background: #fff; border-top: 1px solid var(--line); }
.footer-menu ul { list-style: none; margin: 0; padding: 18px 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 30px; }
.footer-menu a { color: var(--ink); text-decoration: none; font-weight: 500; }
.footer-menu a:hover { color: var(--maroon); }
.footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding-top: 40px; padding-bottom: 32px; }
.footer-cols h3 { color: #fff; font-size: 1.1rem; }
.footer-cols p { margin: 0 0 .8em; font-size: .95rem; }
.footer-logo { background: #fff; display: inline-block; padding: 6px 10px; border-radius: var(--radius); margin-bottom: 14px; }
.footer-logo img { width: 130px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); font-size: .85rem; }
.footer-bottom .wrap { padding-top: 14px; padding-bottom: 14px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
	.nav-toggle { display: inline-flex; }
	.main-nav { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 3px solid var(--maroon); box-shadow: 0 10px 20px rgba(0,0,0,.08); display: none; }
	.nav-open .main-nav { display: block; }
	.main-nav ul { flex-direction: column; gap: 0; padding: 6px var(--gutter) 12px; }
	.main-nav li a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
	.main-nav li:last-child a { border-bottom: 0; }
	.events-band__grid { grid-template-columns: 1fr; }
	.footer-cols { grid-template-columns: 1fr 1fr; }
	.footer-cols > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
	body { font-size: 16px; }
	.topbar__contact .label { display: none; }
	.topbar__menu { flex: 1; justify-content: flex-end; }
	.topbar__menu a { padding: 0 12px; font-size: .95rem; }
	.brand img { width: 130px; }
	.features__grid { grid-template-columns: 1fr; }
	.feature { border-left: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 56px 1fr; text-align: left; gap: 0 16px; padding: 20px 4px; }
	.feature:first-child { border-top: 0; }
	.feature svg { width: 48px; height: 48px; margin: 0; grid-row: span 2; }
	.feature h2 { font-size: 1.35rem; }
	.panel--next { flex-direction: column; }
	.panel--next .panel__text { flex: none; }
	.next-talk { grid-template-columns: 1fr; }
	.talk-list li { grid-template-columns: 70px 1fr; gap: 14px; }
	.talk-date .d { font-size: 1.4rem; }
	.footer-cols { grid-template-columns: 1fr; }
	.lightbox { padding: 56px 8px 72px; }
	.lightbox .lb-prev, .lightbox .lb-next { top: auto; bottom: 12px; transform: none; }
	.lightbox .lb-prev { left: calc(50% - 60px); }
	.lightbox .lb-next { right: calc(50% - 60px); }
}
@media (max-width: 400px) {
	.topbar__menu a { padding: 0 9px; font-size: .9rem; }
}
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; scroll-behavior: auto !important; }
}

/* Maps: show the whole map (no cropping) in a grid of larger tiles */
.llhs-gallery--set-maps .llhs-gallery__items { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.llhs-gallery--set-maps img { aspect-ratio: 4 / 3; object-fit: contain; background: var(--paper-alt); border: 1px solid var(--line); }
.llhs-gallery--set-maps button.thumb:hover img { transform: none; border-color: var(--maroon); }

/* Top bar buttons fill the bar height */
.topbar nav, .topbar__menu li { display: flex; }
.panel--next .panel__poster { max-width: 440px; background: none; }
.panel--next .panel__poster img { width: 100%; }
.next-talk__poster.llhs-gallery { margin: 0; }
.panel--past .stack { height: 215px; margin: 8px 0 12px; }
.panel--past .stack img { width: min(46%, 140px); }
.panel--past .stack img:nth-child(2) { left: calc(50% - min(23%, 70px)); }
.panel--past .stack img:nth-child(3) { left: auto; right: 6%; }
.panel--past .more { position: relative; z-index: 2; }

/* ---------- Contact form ---------- */
.contact-form { max-width: 640px; background: var(--paper-alt); border: 1px solid var(--line); border-top: 5px solid var(--maroon); border-radius: var(--radius); padding: clamp(18px, 3vw, 32px); margin: 1.5em 0; }
.contact-form label { display: block; font-weight: 600; margin-bottom: 6px; }
.contact-form input[type="text"], .contact-form input[type="email"], .contact-form textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #b9b2b4; border-radius: var(--radius); background: #fff; color: var(--ink); }
.contact-form textarea { resize: vertical; min-height: 160px; }
.contact-form input:focus, .contact-form textarea:focus { outline: 3px solid rgba(142, 20, 61, .25); border-color: var(--maroon); }
.contact-form .cf-field { margin: 0 0 18px; }
.contact-form .has-error input, .contact-form .has-error textarea { border-color: #b3261e; }
.contact-form .cf-error { color: #b3261e; margin: 6px 0 0; font-size: .95rem; }
.contact-form .cf-summary { background: #fdecea; border-left: 4px solid #b3261e; padding: 10px 14px; margin-bottom: 18px; }
.contact-form .btn { cursor: pointer; font: inherit; font-weight: 600; }
.contact-form .cf-privacy { color: var(--muted); font-size: .9rem; margin: 0; }
.contact-form .cf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-form--sent h2 { color: var(--maroon); }
