/* Beckenham & Bromley Historical Association — site styles */

:root {
  --ha-navy: #093261; /* from the Historical Association logo */
  --unsaved-bg: #ffe5a3; --unsaved-border: #c07d12; --unsaved-ink: #4a3000;
  --diff-add-ink: #1f6b3a; --diff-add-bg: #eaf5ec; --diff-add-bg-strong: #cdebd5;
  --diff-del-ink: #a3261f; --diff-del-bg: #fbecea; --diff-del-bg-strong: #f6d2ce;
  --paper: #f6f1e7;
  --paper-2: #ede5d5;
  --card: #fffdf8;
  --ink: #1f2a24;
  --ink-2: #4a544d;
  --muted: #6d7369;
  --rule: #dcd2bf;
  --accent: #8b2e2a;      /* oxblood */
  --accent-ink: #fff;
  --brass: #b08d57;
  --green: #2f4a3c;
  --shadow: 0 1px 2px rgb(31 42 36 / 6%), 0 8px 24px -12px rgb(31 42 36 / 18%);
  --radius: 14px;
  --serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --sans: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ha-navy: #b9cbea; /* the logo's navy, lightened so it shows on a dark background */
    --unsaved-bg: #3a2c0f; --unsaved-border: #c9922e; --unsaved-ink: #ffe2a8;
    --diff-add-ink: #7fd69a; --diff-add-bg: #17291e; --diff-add-bg-strong: #1f4a2e;
    --diff-del-ink: #ff9b92; --diff-del-bg: #2e1816; --diff-del-bg-strong: #5a2420;
    --paper: #151a17;
    --paper-2: #1b221e;
    --card: #1f2723;
    --ink: #ece6d8;
    --ink-2: #c9c2b2;
    --muted: #9da293;
    --rule: #323b35;
    --accent: #d0675f;
    --accent-ink: #1a0f0e;
    --brass: #c9a56b;
    --green: #a9c4b2;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 10px 30px -14px rgb(0 0 0 / 60%);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.1; letter-spacing: -0.01em; margin: 0 0 .5em; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; border-radius: 4px; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px; }
.skip:focus { top: 12px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(48px, 8vw, 96px); }
.section--tight { padding-top: 0; }
.section__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 28px; }
.section__title { margin: 0; }
.band { background: var(--paper-2); border-block: 1px solid var(--rule); }
.muted { color: var(--muted); font-size: .95rem; }
.lead { font-size: 1.2rem; color: var(--ink); }

.eyebrow {
  font: 700 .78rem/1 var(--sans);
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--brass);
  margin: 0 0 14px;
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ''; width: 28px; height: 1px; background: currentColor; }
.eyebrow--dark { color: var(--accent); }

/* ---------- Masthead ---------- */
.masthead {
  position: fixed; inset: 0 0 auto; z-index: 50;
  color: #fff;
  transition: background-color .3s, box-shadow .3s, color .3s;
}
.masthead.is-solid {
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--rule);
}
.masthead__inner {
  max-width: var(--wrap); margin-inline: auto; padding: 14px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand__logo {
  /* The official logo, used as a stencil so it can be drawn in whatever colour suits the background. */
  flex: none; width: 46px; height: 49px;
  background: currentColor;
  -webkit-mask: url('/images/ha-logo.png') center / contain no-repeat;
  mask: url('/images/ha-logo.png') center / contain no-repeat;
  transition: background-color .3s;
}
/* Official HA navy once the header has a light background. */
.masthead.is-solid .brand__logo, .masthead.is-open .brand__logo { background: var(--ha-navy); }
@media (forced-colors: active) { .brand__logo { forced-color-adjust: none; background: CanvasText !important; } }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font: 600 1.3rem/1.1 var(--serif); }
.brand__sub { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; opacity: .8; }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.nav a {
  display: block; padding: 8px 14px; border-radius: 999px;
  color: inherit; text-decoration: none; font-weight: 600; font-size: .95rem;
  transition: background-color .2s;
}
.nav a:hover { background: rgb(255 255 255 / 14%); }
.masthead.is-solid .nav a:hover { background: var(--paper-2); }
.nav a[aria-current='page'] { background: rgb(255 255 255 / 18%); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 35%); }
.masthead.is-solid .nav a[aria-current='page'] { background: var(--ink); color: var(--paper); box-shadow: none; }

.nav-toggle { display: none; }

@media (max-width: 880px) {
  .brand__sub { display: none; }
  .nav-toggle {
    display: grid; place-items: center;
    width: 46px; height: 46px; border: 0; border-radius: 50%;
    background: rgb(255 255 255 / 14%); color: inherit; cursor: pointer;
  }
  .masthead.is-solid .nav-toggle, .masthead.is-open .nav-toggle { background: var(--paper-2); }
  .nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
    display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px;
    transition: transform .25s, opacity .25s;
  }
  .nav-toggle__bars { position: relative; }
  .nav-toggle__bars::before, .nav-toggle__bars::after { content: ''; position: absolute; left: 0; }
  .nav-toggle__bars::before { top: -6px; }
  .nav-toggle__bars::after { top: 6px; }
  .masthead.is-open .nav-toggle__bars { background: transparent; }
  .masthead.is-open .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
  .masthead.is-open .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

  .nav {
    position: fixed; inset: 74px 12px auto; border-radius: var(--radius);
    background: var(--card); color: var(--ink); box-shadow: var(--shadow);
    padding: 8px; transform-origin: top right;
    opacity: 0; transform: scale(.96) translateY(-6px); pointer-events: none;
    transition: opacity .2s, transform .2s;
  }
  .masthead.is-open { background: var(--paper); color: var(--ink); }
  .masthead.is-open .nav { opacity: 1; transform: none; pointer-events: auto; }
  .nav ul { flex-direction: column; }
  .nav a { padding: 14px 16px; border-radius: 10px; font-size: 1.05rem; }
  .nav a:hover { background: var(--paper-2); }
  .nav a[aria-current='page'], .masthead.is-solid .nav a[aria-current='page'] { background: var(--ink); color: var(--paper); box-shadow: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(380px, 58vh, 560px);
  display: flex; align-items: flex-end;
  color: #fff; background: #2a2219;
}
.hero--large { min-height: min(92vh, 820px); }
.hero__img {
  position: absolute; inset: -2%; z-index: -2;
  background-size: cover; background-position: center 40%;
  filter: sepia(.55) contrast(1.05) brightness(.9);
  animation: drift 28s ease-in-out infinite alternate;
}
.hero__shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgb(20 16 10 / 55%) 0%, rgb(20 16 10 / 10%) 28%, rgb(20 16 10 / 45%) 50%, rgb(20 16 10 / 88%) 100%),
    radial-gradient(120% 90% at 50% 40%, transparent 50%, rgb(20 16 10 / 45%) 100%);
}
.hero__content {
  width: 100%; max-width: var(--wrap); margin-inline: auto;
  padding: 120px var(--gutter) clamp(40px, 7vw, 72px);
}
.hero h1 {
  font-size: clamp(2.6rem, 7vw, 5.4rem); font-weight: 600;
  margin: 0 0 .3em; max-width: 16ch;
  text-shadow: 0 2px 24px rgb(0 0 0 / 35%);
}
.hero .eyebrow { color: #f1e2c2; text-shadow: 0 1px 10px rgb(0 0 0 / 70%); }
.hero h1 em { font-style: italic; font-weight: 500; color: #ecd9b4; }
.hero:not(.hero--large) h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); }
.hero__lede { font-size: clamp(1.1rem, 2vw, 1.35rem); max-width: 46ch; opacity: .92; margin: 0; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero__caption {
  position: absolute; right: var(--gutter); bottom: 14px;
  font: italic 500 .95rem/1.2 var(--serif); color: rgb(255 255 255 / 72%);
  text-decoration: none;
}
.hero__caption:hover { color: #fff; }
@media (max-width: 640px) {
  .hero__caption { left: var(--gutter); right: auto; bottom: 10px; font-size: .85rem; }
  .hero__content { padding-bottom: 52px; }
}
@keyframes drift { from { transform: scale(1.02) translate3d(0, 0, 0); } to { transform: scale(1.1) translate3d(-1.5%, -1%, 0); } }
@media (prefers-reduced-motion: reduce) { .hero__img { animation: none; } html { scroll-behavior: auto; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 0;
  background: var(--accent); color: var(--accent-ink);
  font: 700 1rem/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform .15s, background-color .2s, box-shadow .2s;
  box-shadow: 0 6px 18px -8px rgb(139 46 42 / 60%);
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn--ghost { background: rgb(255 255 255 / 12%); color: #fff; box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / 60%); backdrop-filter: blur(6px); }
.btn--outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.link-arrow { font-weight: 700; text-decoration: none; white-space: nowrap; }
.link-arrow::after { content: ' →'; transition: margin .2s; }
.link-arrow:hover::after { margin-left: 4px; }

/* ---------- Home intro ---------- */
.intro { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.intro__text { max-width: 62ch; }
.stats { margin: 0; display: grid; gap: 0; border-left: 1px solid var(--rule); }
.stats div { padding: 18px 0 18px 28px; border-bottom: 1px solid var(--rule); }
.stats div:last-child { border-bottom: 0; }
.stats dt { font: 600 3rem/1 var(--serif); color: var(--accent); }
.stats dd { margin: 6px 0 0; color: var(--ink-2); }
@media (max-width: 820px) {
  .intro { grid-template-columns: 1fr; }
  .stats { border-left: 0; border-top: 1px solid var(--rule); grid-template-columns: repeat(3, 1fr); }
  .stats div { padding: 18px 12px 0 0; border-bottom: 0; }
  .stats dt { font-size: 2.2rem; }
  .stats dd { font-size: .9rem; line-height: 1.35; }
}

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: clamp(20px, 3vw, 32px); box-shadow: var(--shadow);
}
.card > :last-child { margin-bottom: 0; }
.card__title { font-size: 1.6rem; }
.card h3 { font: 700 .8rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 20px 0 6px; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.info-grid--two { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .info-grid, .info-grid--two { grid-template-columns: 1fr; } }

/* ---------- Events ---------- */
.event-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 960px) { .event-grid { grid-template-columns: 1fr; } }
.event-list { display: grid; gap: 14px; }

.event {
  display: grid; grid-template-columns: 92px 1fr; gap: 0;
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.event:hover { transform: translateY(-2px); }
.event__date {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px 8px; background: var(--green); color: #f4ecd9; text-align: center;
}
@media (prefers-color-scheme: dark) { .event__date { background: #2a3a31; } }
.event--visit .event__date { background: #6e5530; }
.event--social .event__date { background: var(--accent); color: #fff; }
.event__day { font: 600 2.6rem/1 var(--serif); }
.event__month { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .85; margin-top: 4px; }
.event__body { padding: 18px 22px 20px; min-width: 0; }
.event__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .88rem; color: var(--muted); margin-bottom: 8px; }
.event__kicker { font-size: .85rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin: 0 0 4px; }
.event__title { font-size: 1.45rem; margin: 0 0 6px; }
.event__speaker { font-weight: 600; color: var(--ink-2); margin: 0; }
.event__location { font-style: italic; margin: 2px 0 0; color: var(--ink-2); }
.event__desc { margin: 10px 0 0; color: var(--ink-2); font-size: .98rem; }
.event__note {
  display: inline-block; margin: 12px 0 0; padding: 4px 10px; border-radius: 6px;
  background: color-mix(in srgb, var(--brass) 18%, transparent); color: var(--ink);
  font-size: .85rem; font-weight: 600;
}
.event-grid .event { grid-template-columns: 1fr; }
.event-grid .event__date { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 12px 22px; }
.event-grid .event__day { font-size: 1.8rem; }
.event-grid .event__month { margin: 0; }
.event-grid .event__meta time { display: none; }
@media (max-width: 520px) {
  .event { grid-template-columns: 72px 1fr; }
  .event__day { font-size: 2rem; }
  .event__body { padding: 14px 16px 16px; }
  .event__title { font-size: 1.25rem; }
  .event__meta time { display: none; }
}
.event[hidden] { display: none; }

.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: var(--paper-2); color: var(--ink-2); }
.tag--lecture { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.tag--visit { background: color-mix(in srgb, var(--brass) 22%, transparent); color: #7a5b2c; }
.tag--social { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
@media (prefers-color-scheme: dark) { .tag--visit { color: var(--brass); } }

.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button {
  min-height: 40px; padding: 6px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--rule); background: var(--card); color: var(--ink);
  font: 600 .92rem/1 var(--sans);
}
.filters button[aria-pressed='true'] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.past { margin-top: 40px; }
.past summary { cursor: pointer; font-weight: 700; color: var(--muted); padding: 8px 0; }
.past .event-list { margin-top: 14px; opacity: .7; }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 16px; }
.gallery__item { margin: 0; position: relative; border-radius: var(--radius); overflow: hidden; height: clamp(240px, 26vw, 320px); background: #2a2219; }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; filter: sepia(.4); transition: transform .6s, filter .6s; }
.gallery__item:hover img { transform: scale(1.04); filter: sepia(.1); }
.gallery__item figcaption {
  position: absolute; inset: auto 0 0; padding: 40px 16px 14px;
  background: linear-gradient(transparent, rgb(20 16 10 / 80%));
  color: #fff; font: italic 500 1.05rem/1.25 var(--serif);
}
@media (max-width: 820px) {
  .gallery { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 82%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
  .gallery__item { scroll-snap-align: start; }
}

/* ---------- Split (prose + form) ---------- */
.split { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.prose { max-width: 62ch; }
.prose h2 { margin-top: 1.4em; }
.compare { list-style: none; padding: 0; margin: 0 0 1em; display: grid; gap: 10px; }
.compare li { padding: 14px 18px; border-left: 3px solid var(--brass); background: var(--paper-2); border-radius: 0 10px 10px 0; }
.price { display: flex; align-items: center; gap: 18px; padding: 20px 0; margin: 8px 0 4px; border-block: 1px solid var(--rule); }
.price__amount { font: 600 3.4rem/1 var(--serif); color: var(--accent); }
.price__label { color: var(--ink-2); }
.postal { font-style: normal; font-variant-numeric: lining-nums; font-family: var(--serif); font-size: 1.25rem; padding: 14px 18px; background: var(--paper-2); border-radius: 10px; margin-bottom: 1em; }

/* ---------- Form ---------- */
.form-card { position: sticky; top: 96px; }
@media (max-width: 900px) { .form-card { position: static; } }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { grid-column: 1 / -1; display: grid; gap: 6px; }
.field--half { grid-column: span 1; }
@media (max-width: 520px) { .field--half { grid-column: 1 / -1; } }
.field label { font-weight: 600; font-size: .95rem; }
.optional { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; min-height: 48px;
  border: 1px solid var(--rule); border-radius: 10px;
  background: var(--paper); color: var(--ink);
  font: inherit; font-size: 1rem;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brass) 25%, transparent); }
.field [aria-invalid='true'] { border-color: var(--accent); }
.form .btn { grid-column: 1 / -1; justify-self: start; min-width: 160px; }
.form__error { grid-column: 1 / -1; margin: 0; color: var(--accent); font-weight: 600; }
.notice { padding: 14px 16px; border-radius: 10px; background: color-mix(in srgb, var(--green) 14%, transparent); border: 1px solid color-mix(in srgb, var(--green) 35%, transparent); margin-bottom: 20px; }

/* ---------- Links ---------- */
.link-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 760px) { .link-list { grid-template-columns: 1fr; } }
.link-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: start; height: 100%;
  padding: 24px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--rule);
  color: inherit; text-decoration: none; box-shadow: var(--shadow);
  transition: transform .2s, border-color .2s;
}
.link-card:hover { transform: translateY(-2px); border-color: var(--brass); }
.link-card__num { font: 600 2rem/1 var(--serif); color: var(--brass); }
.link-card__body { display: grid; gap: 4px; }
.link-card__name { font: 600 1.5rem/1.15 var(--serif); color: var(--ink); }
.link-card__desc { color: var(--ink-2); }
.link-card__arrow { font-size: 1.3rem; color: var(--accent); transition: transform .2s; }
.link-card:hover .link-card__arrow { transform: translate(2px, -2px); }

/* ---------- Map ---------- */
.map-layout { display: grid; grid-template-columns: 1fr 1.6fr; gap: 20px; }
@media (max-width: 900px) { .map-layout { grid-template-columns: 1fr; } }
.map { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--rule); min-height: 380px; box-shadow: var(--shadow); }
.map iframe { width: 100%; height: 100%; min-height: 380px; border: 0; display: block; }

/* ---------- Footer ---------- */
.site-footer { background: #1a201c; color: #cfc8b8; padding-block: 48px; font-size: .95rem; }
.site-footer a { color: #ecd9b4; }
.site-footer__inner { display: grid; grid-template-columns: 1.4fr 1.4fr 1fr; gap: 28px; }
.site-footer__name { font: 600 1.4rem/1.2 var(--serif); color: #fff; margin-bottom: 6px; display: flex; align-items: center; gap: 12px; }
.site-footer__logo { width: 38px; height: 41px; color: #fff; }
.site-footer__social { display: inline-flex; align-items: center; gap: 8px; }
.site-footer__small { font-size: .82rem; opacity: .7; }
.site-footer__credit { font-size: .82rem; opacity: .8; margin-top: 28px; padding-top: 18px; text-align: center; border-top: 1px solid rgba(255, 255, 255, .12); }
@media (max-width: 820px) { .site-footer__inner { grid-template-columns: 1fr; } }

/* ---------- Print (bulletin postal form) ---------- */
@media print {
  .masthead, .hero, .site-footer, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .split { grid-template-columns: 1fr; }
  .card { box-shadow: none; border-color: #999; }
}

/* ---------- Editor ---------- */
.hero--compact { min-height: 240px; }
.hero--compact .hero__content { padding-bottom: 32px; }
.hero--compact h1 { font-size: clamp(2.2rem, 5vw, 3.4rem) !important; }
.section--editor { padding-top: 28px; max-width: 900px; }
.login-card { max-width: 480px; }
.notice { margin-bottom: 16px; }
.notice--warn { background: color-mix(in srgb, var(--brass) 18%, transparent); border-color: color-mix(in srgb, var(--brass) 55%, transparent); }
.notice--error { background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.link-button { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.link-button--danger { color: var(--accent); }

.editor__intro { font-size: 1.1rem; color: var(--ink-2); }
.editor__bar {
  position: sticky; top: 72px; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding: 12px 0; margin-bottom: 8px; background: var(--paper); border-bottom: 1px solid var(--rule);
}
.editor__status { flex: 1; min-width: 160px; font-weight: 600; color: var(--muted); }
.editor__banner { flex-basis: 100%; display: flex; gap: 12px; align-items: flex-start; }
.editor__banner p { margin: 0; font-size: 1.08rem; line-height: 1.5; color: var(--unsaved-ink); }
.editor__banner-icon { flex: none; width: 28px; height: 28px; margin-top: 1px; color: var(--unsaved-ink); }
.editor__bar--unsaved {
  background: var(--unsaved-bg); border: 3px solid var(--unsaved-border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: 0 8px 24px -12px rgb(0 0 0 / 35%);
  transition: background-color .2s, border-color .2s;
}
.editor__bar--unsaved .editor__status { display: none; }
.editor__bar--unsaved [data-save] { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent), 0 6px 18px -8px rgb(139 46 42 / 60%); }
@media (prefers-reduced-motion: no-preference) {
  .editor__bar--unsaved [data-save] { animation: save-nudge 2.4s ease-in-out infinite; }
}
@keyframes save-nudge { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 18%, transparent), 0 6px 18px -8px rgb(139 46 42 / 60%); } }
.editor__status[data-tone='warn'] { color: #8a6420; }
@media (prefers-color-scheme: dark) { .editor__status[data-tone='warn'] { color: var(--brass); } }
.editor__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.editor__actions .btn { min-height: 44px; padding: 10px 18px; }
.btn[disabled] { opacity: .45; cursor: default; transform: none; box-shadow: none; }

.editor__group { margin-top: 28px; }
.editor__group-title { font-size: 1.7rem; margin-bottom: 12px; }
.editor__group--past > summary { cursor: pointer; }
.editor__count { font-family: var(--sans); font-size: 1rem; font-weight: 600; color: var(--muted); }
.editor__list { display: grid; gap: 14px; }
.editor__logout { margin-top: 40px; }

.ecard {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow);
}
.ecard { scroll-margin-top: 150px; }
.ecard--open { border-color: var(--brass); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brass) 22%, transparent), var(--shadow); }
.ecard--raw { border-color: color-mix(in srgb, var(--brass) 60%, transparent); background: color-mix(in srgb, var(--brass) 8%, var(--card)); }
.ecard__preview .event { box-shadow: none; }
.ecard__preview .event:hover { transform: none; }
.ecard__placeholder { margin: 0; padding: 18px; border: 2px dashed var(--rule); border-radius: 10px; color: var(--muted); font-weight: 600; text-align: center; }
.ecard__problems { margin: 12px 0 0; padding: 10px 14px 10px 32px; border-radius: 10px; background: color-mix(in srgb, var(--brass) 18%, transparent); font-size: .95rem; }
.ecard__problems li + li { margin-top: 6px; }
.ecard__toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 12px; }
.ecard__spacer { flex: 1; }
.ecard__badge { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #8a6420; background: color-mix(in srgb, var(--brass) 20%, transparent); padding: 3px 9px; border-radius: 999px; }
.ecard__confirm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-weight: 600; }
.ecard__ok { color: var(--green); font-weight: 700; }
.btn--small { min-height: 40px; padding: 8px 16px; font-size: .95rem; box-shadow: none; }
.btn--small.btn--outline { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn--danger { background: var(--accent); }

.ecard__form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--rule); }
.ecard__fields { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 14px 16px; }
.ecard__fields .field { display: grid; gap: 6px; grid-column: span 1; }
.ecard__fields .field--wide { grid-column: 1 / -1; }
.ecard .field > span { font-weight: 700; font-size: .95rem; }
.ecard .field > span em { font-style: normal; font-weight: 600; font-size: .78rem; color: var(--accent); margin-left: 4px; }
.ecard .field > span small { font-weight: 400; color: var(--muted); }
.ecard .field input, .ecard .field select, .ecard .field textarea {
  width: 100%; min-height: 48px; padding: 10px 12px;
  border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); color: var(--ink);
  font: inherit; font-size: 1.05rem;
}
.ecard .field textarea { resize: vertical; line-height: 1.5; }
.ecard--raw .field textarea { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 1rem; margin-top: 12px; }
.ecard .field input:focus, .ecard .field select:focus, .ecard .field textarea:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brass) 25%, transparent); }
.ecard__form-actions { margin-top: 14px; display: flex; justify-content: flex-end; }

@media (max-width: 640px) {
  .editor__bar { top: 64px; }
  .editor__actions { width: 100%; }
  .editor__actions .btn { flex: 1; }
  .ecard__fields { grid-template-columns: 1fr 1fr; }
  .ecard__fields .field--date { grid-column: 1 / -1; }
}

/* ---------- Calendar subscribe ---------- */
.cal-box {
  background: var(--card); border: 1px solid var(--rule); border-left: 6px solid var(--green);
  border-radius: var(--radius); padding: clamp(20px, 3.5vw, 36px); box-shadow: var(--shadow);
}
.cal-box__intro { display: flex; gap: 18px; align-items: flex-start; }
.cal-box__icon { flex: none; width: 52px; height: 52px; color: var(--green); margin-top: 4px; }
.cal-box__title { font-size: clamp(1.7rem, 3.4vw, 2.2rem); margin-bottom: .3em; }
.cal-box__lede { font-size: 1.15rem; color: var(--ink-2); max-width: 60ch; }
.cal-box__prompt { font-weight: 700; font-size: 1.15rem; margin: 8px 0 12px; }
.cal-box__options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cal-option {
  display: grid; gap: 4px; padding: 18px 20px; min-height: 76px;
  border-radius: 12px; background: var(--green); color: #fff; text-decoration: none;
  transition: transform .15s, filter .2s;
}
@media (prefers-color-scheme: dark) { .cal-option { background: #2f5a45; } }
.cal-option:hover { transform: translateY(-1px); filter: brightness(1.1); text-decoration: none; }
.cal-option__name { font-size: 1.2rem; font-weight: 700; }
.cal-option__name::after { content: ' →'; }
.cal-option__hint { font-size: .95rem; opacity: .88; }
.cal-box__more { margin-top: 18px; border-top: 1px solid var(--rule); padding-top: 14px; font-size: 1.05rem; }
.cal-box__more summary { cursor: pointer; font-weight: 700; color: var(--accent); padding: 4px 0; }
.cal-box__more[open] summary { margin-bottom: 8px; }
.cal-box__more li + li { margin-top: 8px; }
.cal-box__copy { display: flex; gap: 10px; margin-bottom: 12px; }
.cal-box__copy input {
  flex: 1; min-width: 0; min-height: 48px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 10px;
  background: var(--paper); color: var(--ink); font: inherit; font-size: 1rem;
}
@media (max-width: 760px) {
  .cal-box__options { grid-template-columns: 1fr; }
  .cal-box__intro { flex-direction: column; gap: 8px; }
  .cal-box__icon { width: 40px; height: 40px; }
}

/* ---------- Formatting editor ---------- */
.rte { display: grid; gap: 6px; }
.rte__label { font-weight: 700; font-size: .95rem; }
.rte__label small { font-weight: 400; color: var(--muted); }
.rte__toolbar { display: flex; flex-wrap: wrap; gap: 6px; }
.rte__toolbar button {
  min-height: 40px; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--rule); background: var(--card); color: var(--ink);
  font: 600 .92rem/1 var(--sans);
}
.rte__toolbar button:hover { border-color: var(--brass); }
.rte__toolbar button[aria-pressed='true'] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.rte__toolbar b, .rte__toolbar i, .rte__toolbar u { font-family: var(--serif); font-size: 1.1rem; margin-right: 2px; }
.rte__area {
  min-height: 48px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 10px;
  background: var(--paper); color: var(--ink); font-size: 1.05rem; line-height: 1.55; overflow-wrap: anywhere;
}
.rte__area--tall { min-height: 110px; }
.rte__area:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brass) 25%, transparent); }
.rte__area:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.rte__area a { color: var(--accent); text-decoration: underline; }
.rte__hint { margin: 0; padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, var(--brass) 18%, transparent); font-weight: 600; font-size: .95rem; }
.rte__link { display: grid; gap: 10px; padding: 12px; border-radius: 10px; background: var(--paper-2); }
.rte__link-field { display: grid; gap: 6px; font-weight: 700; font-size: .95rem; }
.rte__link-field input { min-height: 48px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; font-size: 1.05rem; font-weight: 400; }
.rte__link-actions { display: flex; align-items: center; gap: 14px; }
.event__desc a, .event__note a { color: var(--accent); }

/* ---------- Version history ---------- */
.link-arrow--back::after { content: none; }
.link-arrow--back::before { content: '← '; }
.history { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.hcard { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.hcard--live { border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 20%, transparent), var(--shadow); }
.hcard--backup { background: color-mix(in srgb, var(--brass) 8%, var(--card)); }
.hcard__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 16px; }
.hcard__when { font: 600 1.3rem/1.25 var(--serif); margin: 0; }
.hcard__ago { font: 400 .95rem var(--sans); color: var(--muted); }
.hcard__label { margin: 4px 0 0; color: var(--ink-2); }
.hcard__live { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 5px 12px; border-radius: 999px; background: var(--green); color: #fff; }
.hcard__details { margin-top: 12px; }
.hcard__details summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.hcard__restore { margin-top: 14px; }
.hcard__restore > summary { list-style: none; display: inline-flex; cursor: pointer; }
.hcard__restore > summary::-webkit-details-marker { display: none; }
.hcard__restore .when-open, .hcard__restore[open] .when-closed { display: none; }
.hcard__restore[open] .when-open { display: inline; }
.hcard__restore[open] > summary { margin-bottom: 10px; }
.hcard__confirm { padding: 14px 16px; border-radius: 10px; background: var(--paper-2); }
.hcard__confirm p { margin-top: 0; }

/* ---------- Version comparison ---------- */
.hcard__details summary { padding: 4px 0; }
.vdiff { margin-top: 12px; display: grid; gap: 18px; }
.vdiff__legend { margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--paper-2); line-height: 1.9; }
.vdiff__group { display: grid; gap: 12px; }
.vdiff__title { font: 700 1.15rem/1.2 var(--sans); margin: 0; }
.vdiff__title--added { color: var(--diff-add-ink); }
.vdiff__title--removed { color: var(--diff-del-ink); }
.vdiff__group > .muted { margin: -6px 0 0; }
.vdiff__same { margin: 0; color: var(--muted); font-weight: 600; }

.vevent { border: 1px solid var(--rule); border-left-width: 6px; border-radius: 10px; padding: 12px 14px; background: var(--card); }
.vevent--added { border-left-color: var(--diff-add-ink); background: var(--diff-add-bg); }
.vevent--removed { border-left-color: var(--diff-del-ink); background: var(--diff-del-bg); }
.vevent--changed { border-left-color: var(--brass); }
.vevent__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 8px; font-size: 1.05rem; }
.vevent__date { color: var(--muted); }
.vbadge { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; color: #fff; }
.vbadge--added { background: var(--diff-add-ink); }
.vbadge--removed { background: var(--diff-del-ink); }
.vbadge--changed { background: #8a6420; }
.vfields { margin: 0; display: grid; gap: 4px; }
.vfields div { display: grid; grid-template-columns: 7.5em 1fr; gap: 10px; }
.vfields dt { font-weight: 700; color: var(--ink-2); }
.vfields dd { margin: 0; }
.vevent--removed .vfields dd { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--diff-del-ink) 60%, transparent); }

.vchange { padding-top: 10px; margin-top: 10px; border-top: 1px dashed var(--rule); }
.vchange:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.vchange__label { font-weight: 700; margin: 0 0 6px; }
.vchange__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vchange__col { padding: 10px 12px; border-radius: 8px; background: var(--paper-2); }
.vchange__col p { margin: 0; overflow-wrap: anywhere; }
.vchange__head { font-size: .78rem !important; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px !important; }
.vchange__empty { color: var(--muted); font-style: italic; }
.vchange__note { margin: 6px 0 0; font-size: .95rem; color: var(--muted); }
.vdiff del, .vdiff ins { padding: 1px 3px; border-radius: 4px; }
.vdiff del { background: var(--diff-del-bg-strong); color: var(--diff-del-ink); text-decoration: line-through; text-decoration-thickness: 2px; }
.vdiff ins { background: var(--diff-add-bg-strong); color: var(--diff-add-ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; font-weight: 600; }
@media (max-width: 640px) {
  .vchange__cols { grid-template-columns: 1fr; }
  .vfields div { grid-template-columns: 1fr; gap: 0; }
}

/* Cookie consent */
.cookie-box { position: fixed; left: 16px; bottom: 16px; z-index: 100; max-width: 380px; background: var(--card); color: var(--ink); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; font-size: .92rem; }
.cookie-box[hidden] { display: none; }
.cookie-box p { margin: 0 0 8px; }
.cookie-box__actions { display: flex; gap: 10px; margin-top: 12px; }
.cookie-box .btn { padding: 8px 18px; font-size: .9rem; }
.map__placeholder { display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; min-height: 380px; padding: 24px; background: var(--paper-2); }
.map__placeholder[hidden], .map iframe[hidden] { display: none; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: #ecd9b4; text-decoration: underline; cursor: pointer; }
@media print { .cookie-box { display: none !important; } }

/* ---------- Editor navigation ---------- */
.editor-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; padding: 6px; border-radius: 16px; background: var(--paper-2); width: fit-content; max-width: 100%; }
.editor-nav a { padding: 10px 18px; border-radius: 999px; font-weight: 700; text-decoration: none; color: var(--ink); }
.editor-nav a:hover { background: var(--card); }
.editor-nav a[aria-current='page'] { background: var(--ink); color: var(--paper); }

/* ---------- Page text editor ---------- */
.section--wide { max-width: 1320px; }
.pedit__tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.pedit__tabs button {
  position: relative; min-height: 46px; padding: 8px 18px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--rule); background: var(--card); color: var(--ink); font: 700 1rem/1 var(--sans);
}
.pedit__tabs button[aria-selected='true'] { background: var(--green); border-color: var(--green); color: #fff; }
.pedit__dot { display: inline-block; width: 10px; height: 10px; margin-left: 8px; border-radius: 50%; background: var(--unsaved-border); vertical-align: middle; }
.pedit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 24px; align-items: start; }
.pedit__fields { display: grid; gap: 14px; }
.pfield { padding: 16px 18px; }
.pfield__control { display: grid; gap: 6px; }
.pfield__label { font-weight: 700; font-size: .95rem; margin: 0 0 6px; }
.pfield__control .pfield__label { margin: 0; }
.pfield__label small, .pfield .rte__label small { font-weight: 400; color: var(--muted); }
.pfield input, .pfield textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 10px;
  background: var(--paper); color: var(--ink); font: inherit; font-size: 1.05rem; line-height: 1.5;
}
.pfield input:focus, .pfield textarea:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brass) 25%, transparent); }
.pfield__problem { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, var(--brass) 20%, transparent); font-weight: 600; }
.pedit__preview { position: sticky; top: 180px; }
.pedit__preview-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 14px; }
.pedit__frame { position: relative; height: 72vh; overflow: hidden; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.pedit__frame iframe { position: absolute; inset: 0 auto auto 0; border: 0; transform-origin: 0 0; background: var(--paper); }

.plinks { display: grid; gap: 12px; margin-bottom: 12px; }
.plink { padding: 12px; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper-2); }
.plink__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plink__fields label { display: grid; gap: 4px; font-weight: 700; font-size: .9rem; }
.plink__wide { grid-column: 1 / -1; }
.plink__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 10px; }
.plink__actions .link-button[disabled] { opacity: .35; cursor: default; text-decoration: none; }
@media (max-width: 1000px) {
  .pedit { grid-template-columns: 1fr; }
  .pedit__preview { position: static; }
}
@media (max-width: 560px) { .plink__fields { grid-template-columns: 1fr; } }
.history-tab { display: inline-flex; align-items: center; min-height: 46px; padding: 8px 18px; border-radius: 10px; border: 1px solid var(--rule); background: var(--card); color: var(--ink); font-weight: 700; text-decoration: none; }
.history-tab[aria-current='page'] { background: var(--green); border-color: var(--green); color: #fff; }
.vchange__text { white-space: pre-line; }
@media (max-width: 560px) {
  .editor-nav { width: 100%; }
  .editor-nav a { flex: 1 1 auto; text-align: center; padding: 10px 12px; }
}
