/* Brochure request (brochure.py): band with the button, and the enquiry dialog */
/* full-width strip: art | copy | button */
.brochure-cta {
  position: relative; overflow: hidden; margin-block: clamp(32px, 5vw, 64px);
  padding: clamp(22px, 3vw, 34px) var(--site-gutter);
  display: grid; grid-template-columns: minmax(180px, 250px) 1fr auto; align-items: center; gap: 20px clamp(24px, 4vw, 56px);
  border-block: 1px solid var(--line);
  background:
    radial-gradient(color-mix(in srgb, var(--accent) 22%, transparent) 1px, transparent 1.4px) 0 0 / 14px 14px,
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 12%, var(--bg)), var(--bg) 70%);
}
main.wrap > .brochure-cta { margin-inline: calc(-1 * var(--site-gutter)); }
.brochure-cta-copy { max-width: 60ch; }
.brochure-cta h2 { margin: 0; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.2; }
.brochure-cta p { margin: 8px 0 0; color: var(--muted); font-size: 15.5px; line-height: 1.6; max-width: none; }
@media (max-width: 760px) {
  .brochure-cta { grid-template-columns: 1fr; justify-items: start; }
  .brochure-art { max-width: 210px; }
}

/* the art: colours follow the theme */
.brochure-art { width: 100%; height: auto; display: block; overflow: visible; }
.brochure-art .ba-cover-dark { fill: color-mix(in srgb, var(--fg) 14%, var(--bg)); stroke: var(--line); }
.brochure-art .ba-paper, .brochure-art .ba-page { fill: color-mix(in srgb, var(--fg) 88%, var(--bg)); }
.brochure-art .ba-page { stroke: color-mix(in srgb, var(--fg) 40%, var(--bg)); stroke-width: .6; }
.brochure-art .ba-accent { fill: var(--accent); }
.brochure-art .ba-accent-soft { fill: color-mix(in srgb, var(--accent) 45%, var(--fg)); }
.brochure-art .ba-ink, .brochure-art .ba-ink-light, .brochure-art .ba-env-line, .brochure-art .ba-trail {
  fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
}
.brochure-art .ba-ink { stroke: color-mix(in srgb, var(--bg) 70%, var(--fg)); }
.brochure-art .ba-ink-light { stroke: color-mix(in srgb, var(--fg) 75%, transparent); stroke-width: 2.5; }
.brochure-art .ba-chip .ba-ink-light { stroke: #fff; }
.brochure-art .ba-env { fill: color-mix(in srgb, var(--fg) 8%, var(--bg)); stroke: var(--accent); stroke-width: 2; }
.brochure-art .ba-env-line { stroke: var(--accent); stroke-width: 2; }
.brochure-art .ba-flap { fill: color-mix(in srgb, var(--accent) 30%, var(--bg)); stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.brochure-art .ba-trail { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 3 7; opacity: .8; }
.brochure-art :is(.ba-book, .ba-page, .ba-flap, .ba-chip) { transform-box: fill-box; }

@media (prefers-reduced-motion: no-preference) {
  .brochure-art .ba-book-a { animation: ba-float 6s ease-in-out infinite; }
  .brochure-art .ba-book-b { animation: ba-float 6s ease-in-out -3s infinite; }
  .brochure-art .ba-page { transform-origin: left center; animation: ba-turn 4.8s ease-in-out infinite; }
  .brochure-art .ba-trail { animation: ba-march 1.2s linear infinite; }
  .brochure-art .ba-chip { animation: ba-send 4.8s ease-in-out infinite; }
  .brochure-art .ba-flap { transform-origin: center bottom; animation: ba-flap 4.8s ease-in-out infinite; }
}
@keyframes ba-float { 50% { transform: translateY(-6px); } }
@keyframes ba-turn { 0%, 20% { transform: scaleX(1); } 45%, 70% { transform: scaleX(-.15); opacity: .55; } 95%, 100% { transform: scaleX(1); } }
@keyframes ba-march { to { stroke-dashoffset: -10; } }
@keyframes ba-send {
  0%, 25% { transform: translate(-60px, 6px) scale(.6); opacity: 0; }
  40% { transform: translate(-20px, -6px) scale(1); opacity: 1; }
  60% { transform: translate(0, 0) scale(1); opacity: 1; }
  78% { transform: translate(-2px, 40px) scale(.5); opacity: 0; }
  100% { opacity: 0; }
}
@keyframes ba-flap { 0%, 55% { transform: scaleY(1); } 70%, 85% { transform: scaleY(-1); } 100% { transform: scaleY(1); } }

:root body .brochure-open, :root body .brochure-dialog .brochure-form .bf-submit {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 12px 22px;
  border: 0; border-radius: 10px; background: color-mix(in srgb, var(--accent) 68%, #000); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
:root body .brochure-open:hover, :root body .brochure-dialog .brochure-form .bf-submit:hover { filter: brightness(1.08); }
.brochure-open:focus-visible, .bf-submit:focus-visible, .bf-close:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
:root body .brochure-dialog .brochure-form .bf-submit:disabled { opacity: .6; cursor: progress; }

.brochure-dialog {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line);
  border-radius: 16px; background: var(--bg); color: var(--fg); overflow: auto;
}
.brochure-dialog::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(3px); }
.brochure-form { padding: clamp(20px, 3vw, 30px); }
.bf-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bf-head h2 { margin: 0; font-size: 24px; }
:root body .bf-close {
  /* padding/float reset: edition.css gives every dialog button 11px 17px padding, which pushed the icon right */
  width: 44px; height: 44px; display: grid; place-items: center; padding: 0; float: none; border: 1px solid var(--line); border-radius: 10px;
  background: transparent; color: var(--fg); cursor: pointer;
}
.bf-close svg { width: 20px; height: 20px; }
.bf-intro { margin: 6px 0 18px; color: var(--muted); font-size: 15px; }
.bf-body { display: grid; gap: 14px; }
.bf-field { display: grid; gap: 6px; }
.bf-field label { font-size: 14.5px; font-weight: 500; }
.bf-hint { margin-left: 6px; color: var(--muted); font-weight: 400; font-size: 13px; }
.bf-field input:not([type="checkbox"]), .bf-field select {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: color-mix(in srgb, var(--fg) 3%, var(--bg)); color: var(--fg); font: inherit; font-size: 16px;
}
.bf-field input:focus-visible, .bf-field select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.bf-field [aria-invalid="true"] { border-color: #e5484d; }
.bf-error { margin: 0; color: #f2777a; font-size: 13.5px; }
[data-theme="light"] .bf-error { color: #c62a2f; }
.bf-check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-weight: 400 !important; line-height: 1.5; }
.bf-check a { display: inline; padding: 0; min-height: 0; color: inherit; text-decoration: underline; text-underline-offset: .2em; }
.bf-check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); }
.bf-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.bf-status { margin: 0; min-height: 1.4em; color: var(--muted); font-size: 14px; }
.bf-done { display: grid; gap: 10px; justify-items: start; outline: none; }
.bf-done[hidden] { display: none; }
.bf-done-title { margin: 0; font-size: 20px; font-weight: 600; }
.bf-done-text { margin: 0 0 8px; color: var(--muted); line-height: 1.6; }

/* interest choices: tap-to-pick chips in two short groups instead of one long dropdown */
.bf-choices { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 8px; }
.bf-choices legend { padding: 0; margin-bottom: 4px; font-size: 14.5px; font-weight: 500; }
.bf-group { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; }
.bf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bf-chip { position: relative; display: inline-flex; margin: 0; }
.bf-chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.bf-chip span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; border: 1px solid var(--line);
  border-radius: 999px; font-size: 14.5px; line-height: 1.2; background: color-mix(in srgb, var(--fg) 3%, var(--bg));
  transition: border-color .15s, background-color .15s;
}
.bf-chip:hover span { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.bf-chip input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, var(--bg)); font-weight: 600; }
.bf-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.bf-choices[aria-invalid="true"] .bf-chip span { border-color: #e5484d; }

/* homepage note after an expired or retired brochure link */
.brochure-note {
  display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; margin: 16px var(--site-gutter) 0;
  padding: 12px 12px 12px 18px; border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line)); border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 12%, var(--bg)); color: var(--fg);
}
main.wrap > .brochure-note { margin-inline: 0; }
.brochure-note p { margin: 0; flex: 1 1 260px; color: var(--fg); font-size: 15.5px; max-width: none; }
:root body .brochure-note-go {
  display: inline-flex; align-items: center; min-height: 44px; padding: 10px 18px; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 68%, #000); color: #fff; font-weight: 600;
}
:root body .brochure-note-x {
  width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line);
  border-radius: 10px; background: transparent; color: var(--fg); font-size: 22px; line-height: 1; cursor: pointer;
}
.brochure-note-go:focus-visible, .brochure-note-x:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
