/* Spreyton.net - "Bonfire": flat vermilion masthead, warm paper, bold Bricolage type */
:root {
  --paper: #fffcf6;
  --surface: #ffffff;
  --ink: #171310;
  --ink-soft: #665b51;
  --line: #ece4d8;
  --accent: #d63a16;
  --accent-dark: #b22b0d;
  --accent-2: #ffb100;
  --masthead: #c92f0e;
  --footer-bg: #241c16;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(120,60,20,0.05), 0 10px 30px rgba(160,70,20,0.08);
  --font-display: "Bricolage Grotesque", Inter, sans-serif;
  /* Tag palette: warm-led, AA-friendly, no collision with the accent */
  --c-pub: #a15b0a;          --c-pub-bg: #f7e6c8;
  --c-church: #8e3268;       --c-church-bg: #f6dfec;
  --c-village-hall: #2a6e41; --c-village-hall-bg: #dcefe2;
  --c-school: #46599e;       --c-school-bg: #e3e8f5;
  --c-shop: #0e7466;         --c-shop-bg: #d7eeea;
  --c-community: #74604f;    --c-community-bg: #efe6dc;
  --c-further-afield: #b03592; --c-further-afield-bg: #f8dff2;
  /* Spacing scale */
  --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.01em; }
h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin: var(--s1) 0 var(--s2); font-weight: 800; }
h2 { font-size: 1.55rem; margin: var(--s4) 0 var(--s1); font-weight: 700; }
h3 { font-size: 1.08rem; margin: 0 0 var(--s1); font-weight: 700; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }
p { margin: 0.6rem 0; }
.lede { font-size: 1.1rem; color: var(--ink-soft); }
.narrow { max-width: 720px; }

/* --- Masthead: flat, compact, two rows --- */
.masthead { position: relative; background: var(--masthead); }
.masthead::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: linear-gradient(90deg, var(--accent-2), #ff7a3c, #e8401c); }
.mast-grid { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; padding-top: 1.05rem; padding-bottom: 0.95rem; }
.brand { font-size: 1.6rem; font-weight: 800; color: #fff; text-decoration: none; letter-spacing: -0.02em; }
.brand-dot { color: #ffd08a; font-weight: 500; }
.nav { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.nav a { color: rgba(255,255,255,0.92); text-decoration: none; font-weight: 600; font-size: 0.94rem; padding: 0.4rem 0.9rem; border-radius: 999px; }
.nav a:hover { background: rgba(255,255,255,0.16); color: #fff; }
.nav a.active { background: #fff; color: var(--accent); }
.nav-sep { width: 1px; align-self: stretch; margin: 0.45rem 0.4rem; background: rgba(255,255,255,0.3); }
.nav a.place { font-weight: 500; font-size: 0.9rem; color: rgba(255,255,255,0.82); }
.nav a.place:hover { color: #fff; }
.nav a.place.active { background: #fff; color: var(--accent); }
main.wrap { padding-top: var(--s4); }

/* --- Home layout: posts sit on the paper, no wrapper card --- */
.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: 1fr; gap: var(--s3); } }
.feed { min-width: 0; }
.post { margin: 0 0 var(--s4); }
.post-meta { font-size: 0.8rem; color: var(--ink-soft); display: flex; gap: var(--s1); align-items: center; flex-wrap: wrap; }
.post h2 { margin: 0.35rem 0; font-size: 1.5rem; }
.post h2 a, .post h3 a { color: var(--ink); text-decoration: none; }
.post h2 a:hover, .post h3 a:hover { color: var(--accent); }
.post-lead .lead-title { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; margin: 0.3rem 0 0.6rem; }
.post-lead .post-img { margin-bottom: var(--s2); }
.post-condensed { margin: 0 0 var(--s4); }
.post-condensed h3 { margin: 0.2rem 0; font-size: 1.3rem; }
.rule { border: 0; margin: 0; }
.more { font-weight: 600; font-size: 0.9rem; }

/* --- Post 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: pastel bg, dark coloured text, 0.8rem floor --- */
.chip { display: inline-block; padding: 0.12rem 0.6rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; border: none; }
.tag-pub { background: var(--c-pub-bg); color: var(--c-pub); }
.tag-church { background: var(--c-church-bg); color: var(--c-church); }
.tag-village-hall { background: var(--c-village-hall-bg); color: var(--c-village-hall); }
.tag-school { background: var(--c-school-bg); color: var(--c-school); }
.tag-shop { background: var(--c-shop-bg); color: var(--c-shop); }
.tag-community { background: var(--c-community-bg); color: var(--c-community); }
.tag-further-afield { background: var(--c-further-afield-bg); color: var(--c-further-afield); }
/* Date-block tints */
.tagbg-pub { background: var(--c-pub-bg); color: var(--c-pub); }
.tagbg-church { background: var(--c-church-bg); color: var(--c-church); }
.tagbg-village-hall { background: var(--c-village-hall-bg); color: var(--c-village-hall); }
.tagbg-school { background: var(--c-school-bg); color: var(--c-school); }
.tagbg-shop { background: var(--c-shop-bg); color: var(--c-shop); }
.tagbg-community { background: var(--c-community-bg); color: var(--c-community); }
.tagbg-further-afield { background: var(--c-further-afield-bg); color: var(--c-further-afield); }
/* Legacy left-border accents (used by week/day event detail) */
.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); }

/* --- Rail --- */
.rail { display: flex; flex-direction: column; gap: var(--s3); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; }

/* --- Event rows with date blocks --- */
.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: 10px; line-height: 1.05; }
.db-dow { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.06em; }
.db-day { font-family: var(--font-display); font-size: 1.15rem; font-weight: 800; }
.db-mon { font-size: 0.62rem; font-weight: 700; 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.85rem; color: var(--ink-soft); }

/* --- Buttons & forms --- */
button, .btn { font: inherit; font-weight: 600; font-size: 0.92rem; cursor: pointer; background: var(--accent); color: #fff; border: none; border-radius: 999px; padding: 0.55rem 1.1rem; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { background: var(--accent-dark); }
.newsletter { background: linear-gradient(135deg, #fff8ec, #ffece1); border: 1px solid #f6ddc8; }
.newsletter form { display: flex; gap: var(--s1); }
.newsletter input { flex: 1; min-width: 0; padding: 0.55rem 0.8rem; border: 1px solid var(--line); border-radius: 999px; font: inherit; background: #fff; }
.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 var(--line); border-radius: 10px; font: inherit; margin-top: 0.25rem; background: #fff; }
.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: 1px solid var(--line); }
.btn-secondary:hover { background: var(--paper); color: var(--ink); }
.dismiss-form { margin-top: 0.4rem; }
.suggestion { margin: var(--s2) 0; }
.notice { background: #fdeee2; border: 1px solid #f6d7bd; border-radius: 10px; padding: 0.7rem 1rem; }

/* --- Section pages: full-bleed tinted band + two columns --- */
.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)); }
.band-pub { background: color-mix(in srgb, var(--c-pub-bg) 45%, var(--paper)); }
.band-church { background: color-mix(in srgb, var(--c-church-bg) 45%, var(--paper)); }
.band-village-hall { background: color-mix(in srgb, var(--c-village-hall-bg) 45%, var(--paper)); }
.band-school { background: color-mix(in srgb, var(--c-school-bg) 45%, var(--paper)); }
.band-shop { background: color-mix(in srgb, var(--c-shop-bg) 45%, var(--paper)); }
.crumb { font-size: 0.82rem; color: var(--ink-soft); margin: 0 0 var(--s2); }
.crumb a { color: var(--ink-soft); }
.section-head { display: flex; gap: 1.1rem; align-items: center; }
.section-head .strap { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); margin: 0; }
.section-head h1 { margin: 0.1rem 0 0; }
.icon { display: inline-flex; flex-shrink: 0; }
.icon svg { width: 27px; height: 27px; display: block; }
.icon-lg svg { width: 48px; height: 48px; }
.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: var(--s1); flex-wrap: wrap; margin: var(--s2) 0; }
.ext-links a { font-weight: 600; font-size: 0.88rem; text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 0.95rem; }
.ext-links a:hover { border-color: var(--accent); }
.link-list li { margin: 0.6rem 0; }
.map-panel { padding-bottom: 0.9rem; }
.map iframe { width: 100%; height: 260px; border: 0; border-radius: 10px; 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.35rem; }
.cal-views button, .cal-nav button { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.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.32rem 0.85rem; font-size: 0.82rem; }
.filter-chip[aria-pressed="false"] { opacity: 0.3; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-head { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.5rem 0.55rem; color: var(--ink-soft); border-bottom: 1px solid var(--line); }
.cal-cell { min-height: 100px; 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: #b5a996; background: #faf6ee; }
.cal-cell.today { background: #fff6ec; }
.cal-cell.today .cal-daynum { background: var(--accent); color: #fff; }
.cal-daynum { display: inline-block; min-width: 1.6em; text-align: center; font-weight: 700; cursor: pointer; border-radius: 999px; }
.cal-pill { display: block; width: 100%; text-align: left; margin: 2px 0; padding: 2px 8px; border-radius: 6px; font-family: inherit; font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; border: none; }
.cal-daylist .day-block { background: var(--surface); border: 1px solid var(--line); border-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: var(--paper); }
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(23,19,16,0.5); backdrop-filter: blur(3px); 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: 5px solid var(--accent); padding: 1.5rem 1.75rem; max-width: 480px; width: 100%; position: relative; box-shadow: 0 24px 70px rgba(0,0,0,0.28); }
.modal-close { position: absolute; top: 0.6rem; right: 0.6rem; background: var(--paper); 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.4rem; margin: 0.6rem 0 0.3rem; }

/* --- Misc --- */
.subscribe { margin-top: var(--s4); box-shadow: var(--shadow); }
.small { font-size: 0.82rem; color: var(--ink-soft); }
.small code { background: #f4ede2; padding: 0.1rem 0.35rem; border-radius: 6px; }
.disclaimer { font-size: 0.84rem; color: var(--ink-soft); max-width: 46rem; }

/* --- Footer: dark band bookending the masthead --- */
.footer { position: relative; background: var(--footer-bg); color: #cbbfb2; margin-top: 4rem; padding: 2.2rem 0 2.5rem; }
.footer::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: linear-gradient(90deg, var(--accent-2), #ff7a3c, #e8401c); }
.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; }
.footer h4 { color: #fff; margin: 0 0 var(--s1); font-size: 0.95rem; }
.footer p { margin: 0.35rem 0; }
.footer a { color: #f0e6da; }
.footer a:hover { color: #ffd08a; }
.footer .disclaimer { color: #97897b; }
.credit { font-size: 0.82rem; margin-top: var(--s2); color: #97897b; }
.credit a { color: #cbbfb2; }

/* A broken/blocked image hides itself entirely (onerror sets hidden) */
[hidden] { display: none !important; }
