/* Look: "Signal v2" - modern magazine. Black and white structure, colour in the highlights, Instrument Sans display. */
:root {
  --paper: #ffffff;
  --surface: #ffffff;
  --ink: #0e0e0e;
  --ink-soft: #555555; /* darker grey: easier to read for everyone */
  --line: #e6e6e6;
  --accent: #ff4d17;
  --accent-dark: #d93a0a;
  --accent-2: #ff4d17;
  --btn: #0e0e0e;
  --btn-hover: #333333;
  --footer-bg: #0e0e0e;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
  --font-display: "Instrument Sans", Inter, sans-serif;
  /* Vivid tag palette: full-strength colour, used small */
  --c-pub: #ff7a00;
  --c-church: #6e4cf5;
  --c-village-hall: #00a85c;
  --c-school: #2a63f0;
  --c-shop: #00b3c6;
  --c-community: #ffc700;
  --c-further-afield: #ff3e8a;
  --s1: 0.5rem; --s2: 1rem; --s3: 1.5rem; --s4: 2.5rem;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, system-ui, sans-serif; font-size: 16px; line-height: 1.65; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 1.25rem; }
h1, h2, h3, h4, .brand { font-family: var(--font-display); line-height: 1.08; letter-spacing: -0.015em; }
h1 { font-size: clamp(2rem, 4.2vw, 2.8rem); margin: var(--s1) 0 var(--s2); font-weight: 600; }
h2 { font-size: 1.5rem; margin: var(--s4) 0 var(--s1); font-weight: 600; }
h3 { font-size: 0.85rem; margin: 0 0 var(--s2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; }
a { color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--accent); }
a:hover { color: var(--accent); }
p { margin: 0.6rem 0; }
.lede { font-size: 1.12rem; color: #222; }
.narrow { max-width: 720px; }

/* --- Masthead: white, black type, rainbow hairline signature --- */
.masthead { position: relative; background: #fff; border-bottom: 3px solid var(--ink); }
.masthead::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--accent); }
.mast-grid { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; padding-top: 1.3rem; padding-bottom: 1rem; }
.brand { font-size: 1.7rem; font-weight: 650; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.brand-dot { color: var(--accent); font-weight: 700; }
.nav { display: flex; gap: 0.15rem; flex-wrap: wrap; align-items: center; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 0.92rem; padding: 0.38rem 0.85rem; border-radius: 999px; }
.nav a:hover { background: #f1f1f1; }
.nav a.active { background: var(--ink); color: #fff; }
.nav-sep { width: 1px; align-self: stretch; margin: 0.45rem 0.4rem; background: var(--line); }
.nav a.place { font-weight: 500; font-size: 0.9rem; color: #555; }
.nav a.place:hover { color: var(--ink); background: #f1f1f1; }
.nav a.place.active { background: var(--ink); color: #fff; }
main.wrap { padding-top: var(--s4); }

/* --- Home --- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 3rem; align-items: start; }
@media (max-width: 900px) { .home-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s3); } }
.feed { min-width: 0; }
.post { margin: 0 0 var(--s4); }
.post-meta { font-size: 0.92rem; color: #444; display: flex; gap: var(--s1); align-items: center; flex-wrap: wrap; font-weight: 500; }
.post h2 { margin: 0.35rem 0; font-size: 1.5rem; text-transform: none; letter-spacing: -0.02em; }
.post h2 a, .post h3 a { color: var(--ink); text-decoration: none; }
.post h2 a:hover, .post h3 a:hover { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; }
.post-lead .lead-title { font-size: clamp(1.9rem, 4.2vw, 2.7rem); font-weight: 600; margin: 0.35rem 0 0.7rem; letter-spacing: -0.02em; }
.post-lead .post-img { margin-bottom: var(--s2); }
.post-condensed { margin: 0 0 var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); }
.post-condensed h3 { margin: 0.2rem 0; font-size: 1.28rem; text-transform: none; letter-spacing: -0.015em; font-weight: 600; }
.rule { border: 0; margin: 0; }
.more { font-weight: 700; font-size: 0.9rem; color: var(--accent); text-decoration-color: var(--accent); }
.more:hover { color: var(--accent-dark); }

/* --- Images --- */
.post-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); margin: 0 0 0.9rem; display: block; }
.post-condensed.has-thumb { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: var(--s2); align-items: start; }
.post-thumb { width: 130px; height: 98px; object-fit: cover; border-radius: var(--radius); display: block; }
@media (max-width: 520px) { .post-condensed.has-thumb { grid-template-columns: 1fr; } .post-thumb { width: 100%; height: auto; aspect-ratio: 16 / 9; } }

/* --- Chips: full-strength colour, small doses --- */
.chip { display: inline-block; padding: 0.14rem 0.6rem; border-radius: 4px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em; color: #fff; border: none; text-transform: uppercase; }
.tag-pub { background: var(--c-pub); }
.tag-church { background: var(--c-church); }
.tag-village-hall { background: var(--c-village-hall); }
.tag-school { background: var(--c-school); }
.tag-shop { background: var(--c-shop); }
.tag-community { background: var(--c-community); color: #111; }
.tag-further-afield { background: var(--c-further-afield); }
.tagb-pub { border-left: 4px solid var(--c-pub); }
.tagb-church { border-left: 4px solid var(--c-church); }
.tagb-village-hall { border-left: 4px solid var(--c-village-hall); }
.tagb-school { border-left: 4px solid var(--c-school); }
.tagb-shop { border-left: 4px solid var(--c-shop); }
.tagb-community { border-left: 4px solid var(--c-community); }
.tagb-further-afield { border-left: 4px solid var(--c-further-afield); }
.tagbg-pub { background: var(--c-pub); color: #fff; }
.tagbg-church { background: var(--c-church); color: #fff; }
.tagbg-village-hall { background: var(--c-village-hall); color: #fff; }
.tagbg-school { background: var(--c-school); color: #fff; }
.tagbg-shop { background: var(--c-shop); color: #fff; }
.tagbg-community { background: var(--c-community); color: #111; }
.tagbg-further-afield { background: var(--c-further-afield); color: #fff; }

/* --- Rail: black-ruled magazine panels --- */
.rail { display: flex; flex-direction: column; gap: var(--s3); }
.panel { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--ink); border-radius: 0 0 var(--radius) var(--radius); padding: 1.1rem 1.25rem; }
.section-cards { display: grid; gap: 0.5rem; }
.section-card { display: flex; align-items: center; gap: 0.9rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem 1rem; text-decoration: none; color: var(--ink); }
.section-card:hover { border-color: var(--ink); }
.section-card strong { font-family: var(--font-display); font-weight: 600; }
.section-card span { font-size: 0.85rem; color: var(--ink-soft); }
.sc-text { display: flex; flex-direction: column; }
.event-list { list-style: none; margin: 0; padding: 0; }
.event-row { display: flex; gap: 0.8rem; align-items: flex-start; padding: var(--s1) 0; }
.date-block { display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0;
  width: 3rem; padding: 0.3rem 0; border-radius: 6px; line-height: 1.05; }
.db-dow { font-size: 0.6rem; font-weight: 800; letter-spacing: 0.06em; }
.db-day { font-family: var(--font-display); font-size: 1.15rem; font-weight: 650; }
.db-mon { font-size: 0.6rem; font-weight: 800; letter-spacing: 0.06em; }
.event-what { display: flex; flex-direction: column; min-width: 0; }
.event-what strong { font-size: 0.95rem; }
.event-where { font-size: 0.92rem; color: #444; }

/* --- Buttons & forms --- */
button, .btn { font: inherit; font-weight: 700; font-size: 0.9rem; cursor: pointer; background: var(--btn); color: #fff; border: none; border-radius: 999px; padding: 0.55rem 1.15rem; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { background: var(--btn-hover); }
.newsletter { background: var(--ink); border: none; border-radius: var(--radius); color: #fff; }
.newsletter h3 { color: #fff; }
.newsletter p { color: #b5b5b5; }
.newsletter form { display: flex; gap: var(--s1); }
.newsletter input { flex: 1; min-width: 0; padding: 0.55rem 0.85rem; border: none; border-radius: 999px; font: inherit; background: #fff; color: var(--ink); }
.newsletter button { background: var(--accent); }
.newsletter button:hover { background: var(--accent-dark); }
.form-msg { font-size: 0.85rem; min-height: 1.2em; }
.hp { position: absolute; left: -9999px; height: 0; width: 0; overflow: hidden; }
.stdform label { display: block; margin: 0.75rem 0; font-weight: 600; font-size: 0.9rem; }
.stdform input, .stdform textarea, .stdform select { display: block; width: 100%; padding: 0.55rem 0.8rem; border: 1px solid #cfcfcf; border-radius: 8px; font: inherit; margin-top: 0.25rem; background: #fff; }
.stdform input:focus, .stdform textarea:focus { outline: 2px solid var(--ink); }
.stdform .field-row { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.stdform .field-row label { flex: 1; min-width: 130px; }
.stdform button { margin-top: 0.6rem; }
.stdform label.check { font-weight: 500; }
.stdform label.check input { display: inline; width: auto; margin-right: 0.45rem; }
.btn-secondary { background: transparent; color: var(--ink-soft); border: 1.5px solid #cfcfcf; }
.btn-secondary:hover { background: #f1f1f1; color: var(--ink); }
.dismiss-form { margin-top: 0.4rem; }
.suggestion { margin: var(--s2) 0; }
.notice { background: #f7f7f7; border-left: 4px solid var(--accent); border-radius: 0 8px 8px 0; padding: 0.7rem 1rem; }

/* --- Section pages --- */
.section-band { margin-inline: calc(50% - 50vw); padding-inline: calc(50vw - 50%); padding-top: var(--s2); padding-bottom: var(--s3); margin-bottom: var(--s4); margin-top: calc(-1 * var(--s4)); border-bottom: 1px solid var(--line); }
.band-pub { box-shadow: inset 0 6px 0 var(--c-pub); }
.band-church { box-shadow: inset 0 6px 0 var(--c-church); }
.band-village-hall { box-shadow: inset 0 6px 0 var(--c-village-hall); }
.band-school { box-shadow: inset 0 6px 0 var(--c-school); }
.band-shop { box-shadow: inset 0 6px 0 var(--c-shop); }
.crumb { font-size: 0.78rem; color: var(--ink-soft); margin: 0.6rem 0 var(--s2); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.crumb a { color: var(--ink-soft); text-decoration: none; }
.crumb a:hover { color: var(--ink); }
.section-head { display: flex; gap: 1.1rem; align-items: center; }
.section-head .strap { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; font-weight: 800; margin: 0; }
.band-pub .strap { color: var(--c-pub); }
.band-church .strap { color: var(--c-church); }
.band-village-hall .strap { color: var(--c-village-hall); }
.band-school .strap { color: var(--c-school); }
.band-shop .strap { color: var(--c-shop); }
.section-head h1 { margin: 0.1rem 0 0; font-weight: 600; letter-spacing: -0.02em; }
.icon { display: inline-flex; flex-shrink: 0; }
.icon svg { width: 27px; height: 27px; display: block; }
.icon-lg svg { width: 46px; height: 46px; }
.icon-pub { color: var(--c-pub); }
.icon-church { color: var(--c-church); }
.icon-village-hall { color: var(--c-village-hall); }
.icon-school { color: var(--c-school); }
.icon-shop { color: var(--c-shop); }
.ext-links { display: flex; gap: 1.1rem; flex-wrap: wrap; margin: var(--s2) 0; }
.ext-links a { font-weight: 600; font-size: 0.92rem; color: var(--ink); }
.link-list li { margin: 0.6rem 0; }
.map-panel { padding-bottom: 0.9rem; }
.map iframe { width: 100%; height: 260px; border: 0; border-radius: var(--radius); display: block; }

/* --- Calendar --- */
.cal-controls { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin: var(--s2) 0 var(--s1); }
.cal-controls h2 { margin: 0; font-size: 1.3rem; }
.cal-views button, .cal-nav button { background: #fff; color: var(--ink); border: 1.5px solid #cfcfcf; }
.cal-views button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.cal-filters { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.6rem 0 var(--s3); }
.filter-chip { cursor: pointer; padding: 0.34rem 0.85rem; font-size: 0.78rem; }
.filter-chip[aria-pressed="false"] { opacity: 0.22; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--ink); border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }
.cal-head { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; padding: 0.5rem 0.55rem; color: var(--ink-soft); border-bottom: 1px solid var(--line); }
.cal-cell { min-height: 100px; min-width: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); padding: 0.35rem 0.4rem; font-size: 0.82rem; }
.cal-cell:nth-child(7n+1) { border-left: none; }
.cal-cell.dim { color: #b8b8b8; background: #fafafa; }
.cal-cell.today { background: #fff8f5; }
.cal-cell.today .cal-daynum { background: var(--ink); color: #fff; }
.cal-daynum { display: inline-block; min-width: 1.6em; text-align: center; font-weight: 800; cursor: pointer; border-radius: 999px; }
.cal-pill { display: block; width: 100%; text-align: left; margin: 2px 0; padding: 2px 8px; border-radius: 4px; font-family: inherit; font-size: 0.78rem; font-weight: 600; line-height: 1.3; white-space: normal; overflow-wrap: break-word; cursor: pointer; border: none; }
.cal-daylist .day-block { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--ink); border-radius: 0 0 var(--radius) var(--radius); padding: 0.9rem 1.1rem; margin: 0.7rem 0; }
.cal-daylist h3 { margin: 0 0 0.4rem; }
.cal-empty { color: var(--ink-soft); font-size: 0.9rem; }
button.event-detail { display: block; width: 100%; text-align: left; background: transparent; color: inherit; border: none; border-left: 4px solid transparent; border-radius: 0; font: inherit; cursor: pointer; padding: var(--s1) 0 var(--s1) 0.75rem; margin: 0.4rem 0; }
button.event-detail:hover { background: #f7f7f7; }
button.event-detail p { margin: 0.15rem 0; font-size: 0.92rem; }
.event-detail.tagb-pub { border-left-color: var(--c-pub); }
.event-detail.tagb-church { border-left-color: var(--c-church); }
.event-detail.tagb-village-hall { border-left-color: var(--c-village-hall); }
.event-detail.tagb-school { border-left-color: var(--c-school); }
.event-detail.tagb-shop { border-left-color: var(--c-shop); }
.event-detail.tagb-community { border-left-color: var(--c-community); }
.event-detail.tagb-further-afield { border-left-color: var(--c-further-afield); }

/* --- Modal --- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: var(--s2); }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: var(--radius); border-top: 4px solid var(--ink); padding: 1.5rem 1.75rem; max-width: 480px; width: 100%; position: relative; box-shadow: 0 24px 70px rgba(0,0,0,0.3); }
.modal-close { position: absolute; top: 0.6rem; right: 0.6rem; background: #f1f1f1; color: var(--ink-soft); font-size: 1.2rem; line-height: 1; padding: 0.25rem 0.6rem; border-radius: 999px; }
.modal-card h3 { font-size: 1.35rem; margin: 0.6rem 0 0.3rem; text-transform: none; letter-spacing: -0.015em; font-weight: 600; }

/* --- Misc --- */
.subscribe { margin-top: var(--s4); }
.small { font-size: 0.82rem; color: var(--ink-soft); }
.small code { background: #f1f1f1; padding: 0.1rem 0.35rem; border-radius: 4px; }
.disclaimer { font-size: 0.84rem; color: var(--ink-soft); max-width: 46rem; }
.pin-chip { background: var(--accent); color: #fff; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: #fff; }

/* --- Footer: black block, rainbow hairline bookend --- */
.footer { position: relative; background: var(--footer-bg); color: #b5b5b5; margin-top: 4rem; padding: 2.2rem 0 2.5rem; }
.footer::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--accent); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) 1fr 1fr; gap: var(--s4); font-size: 0.9rem; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; gap: var(--s3); } }
.footer strong { color: #fff; font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.footer h4 { color: #fff; margin: 0 0 var(--s1); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; }
.footer p { margin: 0.35rem 0; }
.footer a { color: #eee; text-decoration-color: var(--accent); }
.footer a:hover { color: #fff; }
.footer .disclaimer { color: #bdbdbd; }
.credit { font-size: 0.82rem; margin-top: var(--s2); color: #8a8a8a; }
.credit a { color: #b5b5b5; }

/* Event image in the calendar popup */
.modal-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; margin-bottom: 0.8rem; display: block; }

/* Local services listings */
.service { border: 1px solid var(--line); border-top: 3px solid var(--ink); border-radius: 0 0 var(--radius) var(--radius); padding: 0.9rem 1.1rem; margin: 0.8rem 0; }
.service-head { margin: 0; display: flex; gap: 0.7rem; align-items: baseline; flex-wrap: wrap; }
.service-contact { color: var(--ink-soft); font-size: 0.9rem; }
.service blockquote { margin: 0.4rem 0; font-style: italic; color: #333; }
.service-rec { margin: 0.2rem 0 0; font-size: 0.8rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

/* Temporary development banner (text lives in src/content.js) */
.dev-banner { background: var(--accent); color: #fff; text-align: center; font-weight: 700; font-size: 0.85rem; letter-spacing: 0.03em; padding: 0.45rem 1rem; }

/* Devon flag beside the wordmark */
.devon-flag { display: inline-flex; margin-left: 0.55rem; vertical-align: baseline; }
.devon-flag svg { width: 28px; height: 17px; border-radius: 3px; display: block; box-shadow: 0 0 0 1px var(--line); }

/* Calendar filter chips read as ticked/unticked */
.filter-chip[aria-pressed="true"]::before { content: "\2713\00a0"; }
.filter-chip[aria-pressed="false"] { opacity: 0.28; }
.filter-chip[aria-pressed="false"]::before { content: ""; }
.cal-hint { margin: 0.3rem 0 1rem; }

/* Coming-up rows are clickable */
.event-row-click { cursor: pointer; border-radius: 8px; margin: 0 -0.5rem; padding-left: 0.5rem; padding-right: 0.5rem; }
.event-row-click:hover { background: #f7f7f7; }
.event-row-click:hover .event-what strong { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.modal-card h3 { margin-top: 0.5rem; }

/* Markdown elements inside post bodies */
.md-h { text-transform: none; letter-spacing: -0.015em; font-weight: 650; margin: 1.4rem 0 0.4rem; }
h3.md-h { font-size: 1.25rem; }
h4.md-h { font-size: 1.05rem; }
.post ul, .post ol { margin: 0.6rem 0; padding-left: 1.4rem; }
.post li { margin: 0.25rem 0; }

/* Opening-hours tables on section pages */
.hours { border-collapse: collapse; margin: 0.6rem 0 0.8rem; width: 100%; max-width: 430px; }
.hours td { padding: 0.42rem 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; vertical-align: top; }
.hours td:first-child { font-weight: 600; padding-right: 2rem; white-space: nowrap; width: 1%; }
.hours-closed { color: var(--ink-soft); }

/* Section-page sub-nav: anchor links under the title */
html { scroll-behavior: smooth; }
.section-subnav { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 1rem; }
.section-subnav a { font-weight: 600; font-size: 0.85rem; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid #d9d9d9; border-radius: 999px; padding: 0.3rem 0.85rem; }
.section-subnav a:hover { border-color: var(--ink); }
.section-grid h2[id], #news { scroll-margin-top: 1.2rem; }

/* Pub quiz next-date line */
.quiz-next { font-size: 1.05rem; }

/* External links: quiet text links with a small new-tab arrow */
a[target="_blank"]::after { content: "\2197"; display: inline-block; margin-left: 0.18em; font-size: 0.78em; opacity: 0.65; text-decoration: none; }
.footer a[target="_blank"]::after, .cal-pill::after { content: none; }

/* Community section colour hooks */
.icon-community { color: var(--c-community); }
.band-community { box-shadow: inset 0 6px 0 var(--c-community); }
.band-community .strap { color: var(--c-community); }

/* Bottom calendar navigation */
.cal-nav-bottom { display: flex; gap: 0.5rem; justify-content: center; margin: 1.2rem 0 0.4rem; }
.cal-nav-bottom button { background: #fff; color: var(--ink); border: 1.5px solid #cfcfcf; }
.cal-nav-bottom button:hover { border-color: var(--ink); background: #fff; }

.icon-further-afield { color: var(--c-further-afield); }
.band-further-afield { box-shadow: inset 0 6px 0 var(--c-further-afield); }
.band-further-afield .strap { color: var(--c-further-afield); }

/* Calendar call-to-action in the nav */
.nav a.nav-cta { background: var(--accent); color: #fff; }
.nav a.nav-cta:hover { background: var(--accent-dark); color: #fff; }
.nav a.nav-cta.active { background: var(--ink); color: #fff; }

/* Mobile burger menu */
button.nav-toggle { display: none; -webkit-appearance: none; appearance: none; background: #fff; border: 2px solid var(--ink); border-radius: 8px; padding: 0.4rem 0.5rem; cursor: pointer; color: var(--ink); }
button.nav-toggle:hover, button.nav-toggle:active { background: #f1f1f1; color: var(--ink); }
.nav-toggle svg { width: 20px; height: 20px; display: block; }
@media (max-width: 760px) {
  button.nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: calc(100% + 8px); right: 1.25rem; left: auto; width: min(280px, calc(100vw - 2.5rem)); z-index: 60; background: #fff; flex-direction: column; align-items: stretch; gap: 0.15rem; padding: 0.6rem; border: 2px solid var(--ink); border-radius: 14px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25); }
  .mast-grid.nav-open .nav { display: flex; transform-origin: top right; animation: navPop 0.14s ease-out; }
  .mast-grid.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(14, 14, 14, 0.28); z-index: 55; }
  .mast-grid.nav-open button.nav-toggle { position: relative; z-index: 61; }
  .nav a { padding: 0.55rem 0.75rem; border-radius: 10px; }
  .nav-sep { width: auto; height: 1px; align-self: stretch; margin: 0.4rem 0; }
}
@keyframes navPop {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
}

/* This-week event strip on the homepage */
.week-strip { display: flex; align-items: center; gap: 0.45rem; overflow-x: auto; padding-bottom: 0.9rem; margin-bottom: var(--s3); border-bottom: 1px solid var(--line); -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.week-strip::-webkit-scrollbar { display: none; }
.week-label { flex: 0 0 auto; font-weight: 800; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; margin-right: 0.2rem; }
a.week-chip { flex: 0 0 auto; white-space: nowrap; font-size: 0.82rem; font-weight: 600; padding: 0.34rem 0.8rem; border-radius: 999px; text-decoration: none; }
a.week-chip b { font-weight: 800; font-size: 0.72rem; letter-spacing: 0.05em; margin-right: 0.45rem; opacity: 0.9; }
a.week-chip:hover { filter: brightness(0.92); color: #fff; }
a.week-chip.tagbg-community:hover { color: #111; }
.week-empty { flex: 0 0 auto; font-size: 0.88rem; color: #666; }
.week-all { flex: 0 0 auto; margin-left: auto; white-space: nowrap; padding-left: 0.5rem; }


/* Suggest something: homepage panel, nav link, page tabs */
.panel-suggest { border-top-color: var(--accent); }
.suggest-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.suggest-btns .btn, .suggest-tabs .btn { font-size: 0.92rem; }
.suggest-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0 0 1.5rem; }
.nav a.nav-suggest { border: 1.5px solid var(--ink); }
.nav a.nav-suggest:hover { background: var(--ink); color: #fff; }

/* "Also in the village" list */
.village-list { list-style: none; margin: 0; padding: 0; }
.village-list li + li { border-top: 1px solid var(--line); }
.village-list a { display: flex; gap: 0.8rem; align-items: center; padding: 0.6rem 0; text-decoration: none; }
.village-list a:hover strong { color: var(--accent); }
.village-list strong { display: block; font-weight: 650; }
.vl-strap { display: block; color: var(--ink-soft); font-size: 0.88rem; }

/* "Get this calendar on your phone" */
.subscribe { border-top-color: var(--accent); }
.cal-phone-link { margin: -0.4rem 0 1rem; }
.sub-step { display: flex; gap: 0.6rem; align-items: center; font-weight: 650; margin: 1.1rem 0 0.6rem; }
.sub-num { flex: 0 0 auto; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 0.9rem; }
.sub-choices { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sub-choice { display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; padding: 0.3rem 0.6rem 0.3rem 0.45rem; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; }
.sub-choice input { width: 1.15rem; height: 1.15rem; accent-color: var(--ink); margin: 0; }
.sub-choice:has(input:not(:checked)) .chip { opacity: 0.35; }
.sub-btn { font-size: 1rem; padding: 0.75rem 1.5rem; background: var(--accent); }
.sub-btn:hover { background: var(--accent-dark); }
.sub-btn.is-disabled { opacity: 0.4; cursor: not-allowed; }
.sub-help { margin-top: 0.8rem; } .sub-help summary { cursor: pointer; color: var(--ink-soft); }
.sub-help code { word-break: break-all; }

/* ---- Readable tag colours: dark text on the bright ones ---- */
.tag-pub, .tag-village-hall, .tag-shop, .tag-further-afield,
.tagbg-pub, .tagbg-village-hall, .tagbg-shop, .tagbg-further-afield { color: #111; }
.week-chip.tagbg-pub:hover, .week-chip.tagbg-village-hall:hover, .week-chip.tagbg-shop:hover, .week-chip.tagbg-further-afield:hover { color: #111; }
.new-chip { background: var(--ink); color: #fff; }
.cancel-chip { background: #b00020; color: #fff; }
.feed-head { margin-top: 0; }

/* ---- Homepage: "This week" strip on big screens (wraps, never cut off) ---- */
.week-strip { flex-wrap: wrap; overflow: visible; row-gap: 0.5rem; }
.week-chip.is-cancelled { text-decoration: line-through; opacity: 0.7; }

/* ---- Homepage on phones: "What's on" comes first ---- */
.wo-phone { display: none; }
@media (max-width: 900px) {
  .week-strip { display: none; }
  .wo-phone { display: block; border-bottom: 3px solid var(--ink); padding-bottom: var(--s2); margin-bottom: var(--s3); }
  .wo-phone h2 { margin: 0.4rem 0 0.4rem; font-size: 1.7rem; }
  .wo-day { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em; margin: 1rem 0 0.2rem; color: var(--ink); }
  .wo-phone .event-row { padding: 0.55rem 0; }
  .wo-cta { margin: 1rem 0 0.4rem; }
  .wo-cta .btn { display: block; text-align: center; padding: 0.85rem 1rem; font-size: 1.02rem; background: var(--accent); }
  .wo-suggest { margin: 0.4rem 0 0; font-size: 0.98rem; }
  .wo-empty { color: #444; }
}
.event-repeat { display: block; font-size: 0.88rem; color: #444; font-weight: 600; }
.event-row.is-cancelled strong { text-decoration: line-through; }

/* ---- Phone menu also lists Shop and School ---- */
.nav a.phone-only { display: none; }
@media (max-width: 760px) { .nav a.phone-only { display: block; } }

/* ---- Event page ---- */
.event-page h1 { margin-top: 0.6rem; }
.ev-when { font-size: 1.25rem; font-weight: 650; margin: 0 0 0.3rem; }
.ev-where { font-size: 1.08rem; margin: 0 0 1rem; }
.ev-map { margin-left: 0.4rem; font-weight: 700; }
.ev-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: flex-start; margin: 1.4rem 0; }
.ev-actions .btn { font-size: 1rem; padding: 0.75rem 1.4rem; }
.ev-actions > .btn { background: var(--accent); }
.ev-more { margin-top: 1.6rem; }
.is-cancelled { text-decoration: line-through; }
.cancel-banner { background: #fde8eb; border-left: 4px solid #b00020; color: #6d0014; font-weight: 700; padding: 0.7rem 1rem; border-radius: 0 8px 8px 0; }
.map-open { margin: 0.5rem 0 0; font-size: 0.92rem; }

/* ---- Share ---- */
.share { position: relative; display: inline-block; }
.share .share-btn { font-size: 1rem; padding: 0.75rem 1.4rem; }
.share-menu { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; min-width: 210px; background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 0.4rem; box-shadow: 0 14px 30px rgba(0,0,0,0.18); }
.share-menu a, .share-menu button { display: block; width: 100%; text-align: left; padding: 0.6rem 0.8rem; border-radius: 8px; font-weight: 600; text-decoration: none; color: var(--ink); background: none; border: none; font-size: 1rem; }
.share-menu a:hover, .share-menu button:hover { background: #f1f1f1; }
.share-menu a::after { content: none !important; }
.share-row { margin: 1.4rem 0; }

/* ---- Calendar: "Coming up" view, folded filters ---- */
.cal-filter-box { margin: 0.4rem 0 var(--s2); }
.cal-filter-box summary { cursor: pointer; font-weight: 650; padding: 0.5rem 0; }
.cal-filter-box .cal-filters { margin-bottom: 0.4rem; }
body.cal-is-upcoming .cal-controls .cal-nav, body.cal-is-upcoming .cal-nav-bottom { display: none; }
.cal-upcoming .day-block h3 { font-size: 1.05rem; }
.event-detail .chip { margin-bottom: 0.25rem; }
.event-detail.is-cancelled p strong, .cal-pill.is-cancelled { text-decoration: line-through; }
.cal-more { text-align: center; margin: 1.2rem 0 0.4rem; }
#cal-more { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); font-size: 1rem; padding: 0.7rem 1.3rem; }
@media (max-width: 640px) {
  .share { display: block; width: 100%; }
  .share .share-btn { width: 100%; }
  .share-menu { position: static; margin-top: 0.4rem; box-shadow: none; }
  .ev-actions > .btn { width: 100%; text-align: center; }
}

/* Homepage splash when there's no pinned or fresh story: the next event */
.feature-event { border-left: 6px solid var(--ink); padding: 0 0 0 1.4rem; margin-bottom: var(--s4); }
.feature-event .post-img { margin-bottom: 1.2rem; }
.fe-body { display: flex; gap: 1.4rem; align-items: flex-start; }
.fe-date { transform: scale(1.5); transform-origin: top left; margin: 0.2rem 2.4rem 3rem 0; }
.fe-kicker { margin: 0 0 0.4rem; font-weight: 650; font-size: 0.95rem; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.fe-when { font-size: 1.15rem; font-weight: 650; margin: 0.2rem 0 0.6rem; }
.fe-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.fe-actions .btn { background: var(--accent); font-size: 0.98rem; padding: 0.7rem 1.3rem; }
.feature-event.tagb-pub { border-left-color: var(--c-pub); }
.feature-event.tagb-church { border-left-color: var(--c-church); }
.feature-event.tagb-village-hall { border-left-color: var(--c-village-hall); }
.feature-event.tagb-school { border-left-color: var(--c-school); }
.feature-event.tagb-shop { border-left-color: var(--c-shop); }
.feature-event.tagb-community { border-left-color: var(--c-community); }
.feature-event.tagb-further-afield { border-left-color: var(--c-further-afield); }
/* Phones already open on "What's on", so the event splash would repeat it */
@media (max-width: 900px) { .feature-event { display: none; } }

/* Sticky slim bar on phones: Calendar + Suggest + menu always in reach (5 Oct) */
.mob-quick { display: none; }
@media (max-width: 760px) {
  html { scroll-padding-top: 4.5rem; }
  .masthead { position: sticky; top: 0; z-index: 45; }
  .mast-grid { flex-wrap: nowrap; gap: 0.4rem; padding-top: 0.75rem; padding-bottom: 0.55rem; }
  .brand { font-size: 1.3rem; white-space: nowrap; min-width: 0; }
  .devon-flag { margin-left: 0.4rem; }
  .devon-flag svg { width: 22px; height: 13px; }
  .mob-quick { display: flex; gap: 0.3rem; margin-left: auto; }
  .mob-quick a { text-decoration: none; font-weight: 700; font-size: 0.84rem; line-height: 1; padding: 0.55rem 0.7rem; border-radius: 999px; white-space: nowrap; }
  .mob-quick .mq-cal { background: var(--accent); color: #fff; border: 1.5px solid var(--accent); }
  .mob-quick .mq-sug { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); }
  .mob-quick a.active { background: var(--ink); color: #fff; border-color: var(--ink); }
  /* Already on the bar, so not repeated in the pop-out menu */
  .nav a.nav-cta, .nav a.nav-suggest, .nav .nav-sep:last-of-type { display: none; }
}
@media (max-width: 380px) {
  .devon-flag { display: none; }
  .brand { font-size: 1.2rem; }
  .mob-quick a { padding: 0.55rem 0.6rem; font-size: 0.8rem; }
}
@media (max-width: 345px) {
  .brand-dot { display: none; }
  .brand { font-size: 1.12rem; }
  .mast-grid { gap: 0.25rem; }
  .mob-quick { gap: 0.2rem; }
  .mob-quick a { padding: 0.5rem 0.5rem; font-size: 0.76rem; }
  button.nav-toggle { padding: 0.35rem 0.4rem; }
}
