.history-page {
  background: #f7f7f4;
  color: #161616;
}

.history-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: clip;
  background: #f7f7f4;
}

.history-shell > main {
  flex: 1 0 auto;
}

@font-face {
  font-family: "Allura";
  src: url("../assets/fonts/allura-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

.history-contribute {
  position: relative;
  isolation: isolate;
  width: 80%;
  margin: clamp(1.6rem, 3.2vw, 3.2rem) auto 0;
  padding: clamp(1.6rem, 2.8vw, 2.8rem) 20% clamp(2rem, 4vw, 4rem);
  overflow: hidden;
  border: 1px solid var(--gold);
  border-radius: 22px;
  background: #fbf6e9 url("../assets/images/historie/historie-oproep-achtergrond.png") center / 100% 100% no-repeat;
  box-shadow: 0 10px 28px rgb(87 64 19 / .14);
}

.history-contribute__content {
  min-width: 0;
  text-align: center;
}

.history-contribute__book {
  display: block;
  width: clamp(58px, 7.2vw, 104px);
  height: auto;
  margin: 0 auto .5rem;
  stroke: var(--gold);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.history-contribute h2 {
  width: 132%;
  margin: 0 -16% .8rem;
  color: #b77c0b;
  font: 400 clamp(2.16rem, 4.16vw, 4.32rem)/1.1 "Allura", cursive;
  text-transform: none;
  overflow-wrap: normal;
}

.history-contribute__intro {
  max-width: 44rem;
  margin: 0 auto 1.6rem;
  font: 400 clamp(1rem, 1.32vw, 1.32rem)/1.4 var(--body);
}

.history-contribute h3 {
  margin: 0 0 .4rem;
  color: var(--black);
  font: 700 clamp(1.3rem, 2vw, 2.08rem)/1.15 var(--display);
}

.history-contribute__invitation {
  margin: 0 0 1.36rem;
  font-size: clamp(1rem, 1.36vw, 1.36rem);
}

.history-contribute__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  max-width: 100%;
  min-height: 48px;
  padding: .88rem 1.6rem;
  border: 2px solid transparent;
  border-radius: 999px;
  background: #b47a12;
  color: #fff;
  box-shadow: 0 10px 20px rgb(87 64 19 / .2);
  font: 700 clamp(1.1rem, 1.6vw, 1.6rem)/1.2 var(--display);
  text-decoration: none;
}

.history-contribute__link svg {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.history-contribute__link:hover {
  border-color: var(--black);
  background: #a8710d;
}

.history-contribute__link:focus-visible {
  outline: 3px solid var(--black);
  outline-offset: 5px;
}

@media (max-width: 768px) {
  .history-contribute {
    width: 80%;
    padding: 2rem 22% 3rem;
    border-radius: 18px;
  }

  .history-contribute h2 {
    width: auto;
    margin-inline: 0;
    font-size: clamp(1.9rem, 5.2vw, 2.8rem);
  }

  .history-contribute__intro {
    margin-bottom: 1.5rem;
  }

  .history-contribute__link {
    gap: .6rem;
    padding: .9rem 1.2rem;
  }
}

@media (max-width: 767px) {
  .history-contribute {
    width: auto;
    margin-inline: 0;
  }
}

@media (max-width: 480px) {
  .history-contribute {
    padding: 1.2rem 1.2rem 9.5rem;
    background-size: 100% auto;
    background-position: center bottom;
  }

  .history-contribute::before {
    position: absolute;
    z-index: -1;
    inset: 0 0 8.5rem;
    background: #fbf6e9;
    content: "";
  }

  .history-contribute h2 {
    width: auto;
    margin-inline: 0;
    font-size: 2.2rem;
  }

  .history-contribute__book {
    width: 52px;
  }

  .history-contribute__link {
    width: 100%;
    gap: .5rem;
    padding-inline: .65rem;
    min-height: 48px;
    font-size: 1.1rem;
  }

  .history-contribute__link svg {
    flex-basis: 22px;
    width: 22px;
    height: 22px;
  }
}
.history-footer__icon {
  flex: 0 0 auto;
  width: 42px;
  height: 28px;
  fill: none;
  stroke: #050505;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.history-footer__icon circle {
  fill: #050505;
  stroke: none;
}

.history-footer__trigger { flex:0 1 auto; display:flex; align-items:center; gap:.55rem; margin:0; padding:.25rem; border:0; background:transparent; color:#050505; cursor:pointer; text-align:center; }
.history-footer__trigger > span { flex:0 1 auto; height:auto; background:transparent; font-family:Georgia,serif; font-size:1.1rem; }
.history-footer__trigger:focus-visible { outline:2px solid #050505; outline-offset:4px; }

.canon-card--add { display:grid; place-content:center; gap:.3rem; border:2px dashed #bd8210; background:#fff; color:#6d510f; font-family:var(--display); font-size:1rem; font-weight:700; cursor:pointer; text-transform:uppercase; }
.canon-card--add strong { font:2.5rem/1 var(--body); font-weight:300; }
.is-history-editor-mode .canon-card[data-history-id] { cursor:pointer; }
.is-history-editor-mode .canon-card[data-history-id] .canon-card__paper { outline:1px dashed #bd8210; outline-offset:3px; }
.is-history-editor-mode .canon-card--unpublished .canon-card__link,
.is-history-editor-mode .canon-card--unpublished .canon-card__route-year,
.is-history-editor-mode .canon-card--unpublished::before { opacity:0.25; }

.history-editor { box-sizing:border-box; width:min(40rem,calc(100vw - 1rem)); max-height:calc(100vh - 1rem); max-height:calc(100dvh - 1rem); overflow-y:auto; overscroll-behavior:contain; padding:0; border:1px solid var(--gold); border-radius:1.5rem; background:#fbfaf5; color:#17120a; box-shadow:0 24px 80px rgb(0 0 0 / .45); }
.history-editor::backdrop { background:rgb(5 5 5 / .72); backdrop-filter:blur(3px); }
.history-progress {
  box-sizing:border-box;
  width:min(38rem,calc(100vw - 1rem));
  max-height:calc(100vh - 1rem);
  max-height:calc(100dvh - 1rem);
  overflow-y:auto;
  padding:0;
  border:1px solid var(--gold);
  border-radius:1.5rem;
  background:#fbfaf5;
  color:#17120a;
  box-shadow:0 24px 80px rgb(0 0 0 / .45);
}
.history-progress::backdrop { background:rgb(5 5 5 / .72); backdrop-filter:blur(3px); }
.history-progress__panel { overflow:hidden; border-radius:inherit; }
.history-progress__header { padding:1.5rem clamp(1.25rem,4vw,2rem); background:var(--gold); color:var(--black); }
.history-progress__header p { margin:0 0 .55rem; font:700 .82rem/1 var(--display); letter-spacing:.12em; text-transform:uppercase; }
.history-progress__header h2 { margin:0; font:700 clamp(2rem,6vw,3rem)/.95 var(--display); text-transform:uppercase; overflow-wrap:anywhere; }
.history-progress__content { display:grid; justify-items:center; gap:1.25rem; padding:clamp(1.75rem,6vw,3rem) clamp(1.25rem,4vw,2rem); text-align:center; }
.history-progress__bar { width:min(100%,25rem); height:8px; overflow:hidden; border-radius:99px; background:#e8dfcc; }
.history-progress__bar[hidden] { display:none; }
.history-progress__bar span { display:block; width:38%; height:100%; border-radius:inherit; background:var(--gold); animation:history-progress-slide 1.25s ease-in-out infinite alternate; }
.history-progress__status,.history-progress__success { max-width:100%; min-height:1.4em; margin:0; color:#39352e; font:400 1.1rem/1.4 var(--body); overflow-wrap:anywhere; }
.history-progress__status.is-error { color:#9a2a18; }
.history-progress__status[hidden],.history-progress__success[hidden] { display:none; }
.history-progress__actions { display:flex; width:100%; justify-content:center; flex-wrap:wrap; gap:.75rem; }
.history-progress__actions button { min-height:46px; padding:.65rem 1rem; border:1px solid #050505; border-radius:.65rem; background:var(--gold); color:#050505; cursor:pointer; font:700 1rem/1.1 var(--display); text-transform:uppercase; }
.history-progress__actions button:hover { border-color:#b98212; background:#f0e8d5; color:#76520c; }
.history-progress__actions button:focus-visible { outline:2px solid #76520c; outline-offset:3px; }
.history-progress__actions button[hidden] { display:none; }
@keyframes history-progress-slide {
  from { transform:translateX(-100%); }
  to { transform:translateX(265%); }
}
.history-data-status { margin: 2rem 0; color: #6f5a2b; font: 600 1rem/1.4 var(--body); }
.history-editor__form { display:flex; flex-direction:column; padding:0 0 1.25rem; border-radius:inherit; background:#fbfaf5; color:#17120a; }
.history-editor__header { position:relative; display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; padding:1.75rem 1.5rem 2.5rem; border-radius:1.45rem 1.45rem 0 0; background:var(--gold); color:var(--black); }
.history-editor__header > div { box-sizing:border-box; width:100%; min-width:0; padding-right:3.5rem; container-type:inline-size; }
.history-editor__header p { margin:0 0 .3rem; color:var(--black); font:700 .82rem/1 var(--display); letter-spacing:.12em; text-transform:uppercase; }
.history-editor__header h2 { margin:0; color:var(--black); font:700 clamp(1rem,8cqi,3rem)/.95 var(--display); text-transform:uppercase; white-space:nowrap; }
.history-editor__header button { position:absolute; top:1rem; right:1rem; display:grid; width:44px; height:44px; place-items:center; border:1px solid var(--black); border-radius:.7rem; background:#fbfaf5; color:var(--black); font:700 1.8rem/1 var(--body); cursor:pointer; }
.history-editor__header button:hover { background:#f0e8d5; color:var(--black); }
.history-editor__body { position:relative; z-index:1; display:grid; grid-template-columns:minmax(0,1fr); gap:1rem; margin:0 1rem; padding:1.5rem; border-radius:0 0 1.5rem 1.5rem; background:#fbfaf5; }
.history-editor__status { grid-column:1/-1; margin:0; color:#76520c; line-height:1.35; }
.history-editor__status:empty { display:none; }
.history-editor__status.is-error { color:#9a2a18; }
.history-editor__publication { grid-area:publication; min-width:0; margin:0; padding:0; }
.history-editor__publication-control { display:flex; width:100%; min-width:0; flex-direction:column; align-items:flex-end; gap:.4rem; }
.history-editor__publication-toggle { display:inline-flex; flex:0 0 auto; align-items:center; gap:.75rem; min-height:44px; padding:0; border:0; background:transparent; color:#71551b; font:700 1.2rem/1.1 var(--display); text-align:left; cursor:pointer; }
.history-editor__publication-toggle:hover { color:#4f3b12; }
.history-editor__publication-toggle.is-published { color:#22612c; }
.history-editor__publication-track { position:relative; display:inline-flex; flex:0 0 4.75rem; align-items:center; width:4.75rem; height:2.25rem; padding:.2rem; border:1px solid #8b6a20; border-radius:999px; background:#e8dfc9; transition:background-color 140ms ease; }
.history-editor__publication-track > span { display:grid; width:1.8rem; height:1.8rem; place-items:center; border-radius:50%; background:#71551b; transition:transform 140ms ease,background-color 140ms ease; }
.history-editor__publication-track > span > svg { width:1rem; height:1rem; fill:none; stroke:#22612c; stroke-linecap:round; stroke-linejoin:round; stroke-width:2.4; opacity:0; }
.history-editor__publication-toggle.is-published .history-editor__publication-track { border-color:#3b8546; background:#3b8546; }
.history-editor__publication-toggle.is-published .history-editor__publication-track > span { background:#fbfaf5; transform:translateX(2.4rem); }
.history-editor__publication-toggle.is-published .history-editor__publication-track > span > svg { opacity:1; }
.history-editor__publication-help { max-width:100%; box-sizing:border-box; margin:0; padding:.5rem .85rem; border-radius:999px; background:#ece9dc; color:#665421; font:400 .95rem/1.25 var(--body); text-align:center; }
.history-editor__publication-help.is-published { background:#e6eddf; color:#285e31; }
.history-editor__year-row { grid-column:1/-1; display:grid; grid-template-columns:minmax(0,8rem) minmax(0,1fr); grid-template-areas:"year publication"; align-items:end; gap:1rem; }
.history-editor__year-row > .history-editor__year-field { grid-area:year; min-width:0; }
.history-editor__body > label,.history-editor__year-row > label { display:grid; min-width:0; gap:.35rem; margin:0; color:#27241f; font:700 1rem/1.1 var(--display); text-transform:uppercase; }
.history-editor__body > label { grid-column:1/-1; }
.history-editor__body > label > span,.history-upload__label > span { display:flex; align-items:center; flex-wrap:wrap; gap:.35rem; }
.history-editor__title-error:not([hidden]) { color:#9a2a18; font:400 .9rem/1.35 var(--body); text-transform:none; }
.history-editor__field-icon { width:1.2rem; height:1.2rem; flex:0 0 1.2rem; fill:var(--gold); }
.history-editor__body input,.history-editor__body textarea { width:100%; box-sizing:border-box; padding:.65rem .7rem; border:1px solid #c9c6bd; border-radius:6px; background:var(--pure-white); color:var(--ink); font:400 1rem/1.35 var(--body); text-transform:none; }
.history-editor__body input[aria-invalid="true"] { border-color:#9a2a18; }
.history-editor__year-field input { max-width:8rem; }
.history-editor__body textarea { min-height:20rem; }
.history-upload { grid-column:1/-1; min-width:0; margin:0; }
.history-upload__label { display:grid; margin:0 0 .35rem; color:#27241f; font:700 1rem/1.1 var(--display); text-transform:uppercase; }
.history-upload__count { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.history-upload__list { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); align-items:start; gap:.75rem; margin:0; padding:0; list-style:none; }
@media (max-width:620px) {
  .history-upload__list { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
.history-upload__item { position:relative; min-width:0; border:1px solid #d8d3c7; border-radius:8px; background:#fbfaf5; }
.history-upload__item[draggable="true"] { cursor:grab; }
.history-upload__item.is-dragging { opacity:.45; }
.history-upload__item.is-drop-target { outline:2px solid #bd8210; outline-offset:2px; }
.history-upload__image-wrap { position:relative; aspect-ratio:4/3; overflow:hidden; border-radius:7px 7px 0 0; background:#eee9dc; }
.history-upload__image { display:block; width:100%; height:100%; object-fit:cover; }
.history-upload__cover { position:absolute; top:.4rem; left:.4rem; padding:.24rem .4rem; border-radius:3px; background:#d59a18; color:#050505; font:700 .72rem/1 var(--display); text-transform:uppercase; }
.history-upload__item-remove { position:absolute; top:.4rem; right:.4rem; display:grid; width:1.8rem; height:1.8rem; min-width:1.8rem; min-height:1.8rem; place-items:center; padding:0; border:1px solid #d59a18; border-radius:50%; background:rgb(251 250 245 / .94); color:#8d2f23; box-shadow:0 1px 4px rgb(0 0 0 / .16); cursor:pointer; font:700 1.1rem/1 var(--body); }
.history-upload__item-remove:hover,.history-upload__item-remove:focus-visible { border-color:#a94335; background:#fbfaf5; color:#8d2f23; }
.history-upload__item .history-upload__drag-handle { display:none; }
@media (any-pointer: coarse) {
  .history-upload__item .history-upload__drag-handle { position:absolute; z-index:2; bottom:.4rem; left:.4rem; display:grid; width:1.8rem; height:1.8rem; place-items:center; border-radius:50%; background:rgb(251 250 245 / .9); color:#956a19; cursor:grab; font:700 1.15rem/1 var(--body); touch-action:none; user-select:none; }
}
.history-upload__add-item { min-width:0; aspect-ratio:4/3; container-type:inline-size; }
.history-upload__dropzone { display:grid; width:100%; height:100%; min-height:0; box-sizing:border-box; place-content:center; justify-items:center; gap:clamp(.2rem,2cqi,.45rem); padding:clamp(.35rem,6cqi,1rem); border:1px dashed #d59a18; border-radius:8px; background:#fbfaf5; color:#17120a; cursor:pointer; text-align:center; transition:background-color 140ms ease,border-color 140ms ease; }
.history-upload__dropzone:hover,.history-upload__dropzone.is-dragging { border-color:#9a6c17; background:#f8f0df; }
.history-upload__dropzone:focus-visible { outline:2px solid #76520c; outline-offset:3px; }
.history-upload__dropzone:disabled { opacity:.5; cursor:not-allowed; }
.history-upload__plus { position:relative; display:grid; width:clamp(1.8rem,18cqi,3rem); height:clamp(1.8rem,18cqi,3rem); place-items:center; border-radius:50%; background:#f3e8c1; color:transparent; font-size:0; }
.history-upload__plus::before,.history-upload__plus::after { position:absolute; top:50%; left:50%; border-radius:999px; background:#d59a18; content:""; transform:translate(-50%,-50%); }
.history-upload__plus::before { width:52%; height:3px; }
.history-upload__plus::after { width:3px; height:52%; }
.history-upload__prompt { display:grid; min-width:0; max-width:100%; gap:clamp(.1rem,1cqi,.2rem); color:#34312b; }
.history-upload__prompt strong { max-width:100%; color:#8c6519; font:700 clamp(.75rem,8cqi,1.15rem)/1.1 var(--display); overflow-wrap:anywhere; }
.history-upload__prompt > span { max-width:100%; color:#8c6519; font:700 clamp(.62rem,5.8cqi,.85rem)/1.2 var(--display); overflow-wrap:anywhere; }
@media (max-width:620px) {
  .history-upload__dropzone { gap:.05rem; padding:.08rem; }
  .history-upload__plus { width:clamp(1rem,18cqi,2rem); height:clamp(1rem,18cqi,2rem); }
  .history-upload__prompt strong { font-size:clamp(.58rem,9cqi,.8rem); line-height:1.05; }
  .history-upload__prompt > span { display:none; }
}
.history-upload__status { min-height:1.25em; margin:.45rem 0 0; color:#76520c; font:400 .88rem/1.35 var(--body); }
.history-upload__status:empty { display:none; }
.history-upload__status.is-error { color:#9a2a18; }
.history-upload__dropzone:focus-visible,.history-upload__item button:focus-visible { outline:2px solid #76520c; outline-offset:2px; }
.history-lightbox__media { position:relative; }
.history-photo-gallery__controls { position:absolute; z-index:2; bottom:.75rem; left:50%; display:flex; align-items:center; gap:.6rem; max-width:calc(100% - 6rem); padding:.25rem .4rem; border:1px solid rgb(255 255 255 / .5); border-radius:999px; background:rgb(5 5 5 / .78); color:#fff; transform:translateX(-50%); }
.history-photo-gallery__controls[hidden] { display:none; }
.history-photo-gallery__controls button { display:grid; width:2rem; height:2rem; place-items:center; padding:0; border:0; border-radius:50%; background:transparent; color:inherit; cursor:pointer; font:700 1.45rem/1 var(--body); }
.history-photo-gallery__controls button:disabled { opacity:.35; cursor:not-allowed; }
.history-photo-gallery__controls button:hover:not(:disabled) { background:#d59a18; color:#050505; }
.history-photo-gallery__controls button:focus-visible { outline:2px solid #f0b62a; outline-offset:2px; }
.history-photo-gallery__count { min-width:3.5em; color:#fff; font:700 .85rem/1 var(--display); text-align:center; white-space:nowrap; }
.history-lightbox__gallery { --history-photo-inset:10px; grid-area:gallery; position:relative; display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr); width:100%; height:100%; min-width:0; min-height:0; box-sizing:border-box; padding:var(--history-photo-inset); overflow:hidden; place-items:center; }
.history-lightbox__gallery img[data-history-photo-image] { display:block; width:100%; height:100%; max-width:100%; max-height:100%; object-fit:contain; object-position:center; }
.story-photo-gallery { position:relative; max-width:800px; }
.story-photo-gallery .story-image { max-height:510px; }
.story-figure .history-photo-gallery__controls { bottom:.6rem; }
.history-editor__actions button { min-height:48px; padding:.65rem .85rem; border:1px solid #050505; border-radius:.7rem; background:#fbfaf5; color:#050505; cursor:pointer; font:700 1.1rem/1.1 var(--display); text-transform:uppercase; }
.history-editor__actions button:hover { border-color:#b98212; background:#f0e8d5; color:#76520c; }
.history-editor__actions { display:grid; grid-template-columns:auto 1fr auto auto; gap:.65rem; align-items:center; margin:1.35rem 1.5rem 0; padding-top:1rem; border-top:1px solid #d8c58f; }
.history-editor__actions button[type="submit"] { border-color:#050505; background:#050505; color:var(--gold-light); }
.history-editor__actions button[type="submit"]:hover { border-color:var(--gold); background:var(--gold); color:#17120a; }
.history-editor__delete { border-color:#a94335!important; background:#fbfaf5!important; color:#8d2f23!important; }
.history-editor-bar{position:fixed;z-index:20;right:2rem;bottom:2rem;display:flex;align-items:center;gap:1rem;padding:.7rem 1rem;background:#111;color:#fff;box-shadow:0 8px 25px rgb(0 0 0 / .35)}.history-editor-bar p{margin:0;font-family:var(--display);font-size:1.1rem;text-transform:uppercase}.history-editor-bar button{border:1px solid #f0b62a;background:transparent;color:#f0b62a;padding:.45rem .65rem;cursor:pointer}
.history-editor-bar[hidden]{display:none}
.history-editor button:focus-visible,.history-editor input:focus-visible,.history-editor textarea:focus-visible,.history-editor-bar button:focus-visible{outline:2px solid #76520c;outline-offset:2px}
html body dialog.history-editor[open] .history-editor__publication-toggle:is(:focus, :focus-visible) { outline:none; box-shadow:none; }
.history-delete-dialog__message { margin:1.25rem 1.5rem 0; color:#27241f; font:400 1rem/1.45 var(--body); }
.history-delete-dialog .history-auth__actions .history-delete-dialog__confirm { border-color:#a94335; background:#a94335; color:#fff; font:700 1rem/1 var(--display); letter-spacing:.04em; text-transform:uppercase; }
.history-delete-dialog .history-auth__actions .history-delete-dialog__confirm:hover { border-color:#742319; background:#8d2f23; color:#fff; }
.history-delete-dialog button:focus-visible { outline:2px solid #76520c; outline-offset:3px; }
@media (max-width:800px) { .history-delete-dialog__message { margin-inline:1rem; } }
@media (max-width:800px) {
  .history-editor__publication-control { align-items:flex-start; }
}

body:has(.history-lightbox[open]) {
  overflow: hidden;
}

.history-lightbox {
  position: fixed;
  inset: 0;
  width: min(1180px, calc(100vw - 2rem));
  height: min(840px, calc(100dvh - 2rem));
  max-width: none;
  max-height: min(840px, calc(100dvh - 2rem));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d8d3c7;
  border-radius: 1rem;
  background: #f8f8f7;
  box-shadow: 0 24px 70px rgb(0 0 0 / .55);
  color: #1d1d1d;
}

.history-lightbox::backdrop { background: rgb(0 0 0 / .82); backdrop-filter: blur(3px); }

.history-lightbox__layout {
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .65fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "media content";
}

.history-lightbox__media {
  grid-area: media;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "gallery" "controls";
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: #fbfaf5;
}

.history-lightbox__photo-controls {
  grid-area: controls;
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: .4rem;
  padding: .45rem 0 .55rem;
  background: #fbfaf5;
  container-type: inline-size;
}

.history-lightbox__photo-controls .history-photo-gallery__controls {
  position: static;
  max-width: 100%;
  margin: 0;
  padding: .28rem .65rem;
  border: 0;
  background: #050505;
  transform: none;
}

.history-lightbox__gallery img[data-history-photo-image] {
  display: block;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  border-radius: .75rem;
  filter: contrast(1.05);
  object-fit: contain;
}

.history-lightbox__content {
  grid-area: content;
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-self: stretch;
  padding: clamp(1.75rem, 4vw, 3.25rem);
  padding-right: max(3.5rem, clamp(1.75rem, 4vw, 3.25rem));
}

.history-lightbox__meta { margin: 0 0 .7rem; color: #966100; font-family: var(--display); font-size: clamp(1.4rem, 2.3vw, 2.15rem); font-weight: 700; letter-spacing: .015em; line-height: .85; }
.history-lightbox h2 { margin: 0; font-family: var(--display); font-size: clamp(1.95rem, 4vw, 3.3rem); letter-spacing: -.02em; line-height: .94; overflow-wrap: anywhere; }

.history-lightbox__copy {
  min-height: 0;
  margin-top: 1.35rem;
  margin-right: -.5rem;
  padding: 1.15rem 1rem 0 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  border-top: 1px solid #dbc078;
  color: #3d3d3d;
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.history-lightbox__copy:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
html body dialog.history-lightbox[open] .history-lightbox__copy:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}
.history-lightbox__copy p { margin: 0 0 1.1rem; }
.history-lightbox__navigation { display: contents; }
.history-lightbox__count { display: none; }
.history-lightbox__thumbnails {
  --history-thumbnail-width: clamp(2.8rem, 8.75vw, 7.5rem);
  --history-thumbnail-gap: clamp(.45rem, 1vw, .85rem);
  align-self: end;
  display: flex;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  max-width: 100%;
  justify-self: center;
  align-items: center;
  justify-content: flex-start;
  gap: var(--history-thumbnail-gap);
  margin: 0;
  padding: .15rem 0;
  height: calc(var(--history-thumbnail-width) * .75 + .3rem);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}

/* Match the reference strip's visible slots when the history photo column is narrower. */
@media (min-width: 768px) {
  .history-lightbox__thumbnails {
    --history-thumbnail-slots: 5.25;
    --history-thumbnail-width: calc((100cqw + var(--history-thumbnail-gap)) / var(--history-thumbnail-slots) - var(--history-thumbnail-gap));
  }
}

@media (min-width: 768px) and (max-width: 1023px) and (any-pointer: fine) and (not (any-pointer: coarse)) {
  .history-lightbox__thumbnails { --history-thumbnail-slots: 7.2; }
}

@media (min-width: 1367px) {
  .history-lightbox__thumbnails { --history-thumbnail-slots: 5.7; }
}
.history-lightbox__thumbnails::-webkit-scrollbar { display: none; }
.history-lightbox__thumbnails::before,
.history-lightbox__thumbnails::after {
  flex: 0 0 max(0px, calc((100% - var(--history-thumbnail-width)) / 2 - var(--history-thumbnail-gap)));
  height: 1px;
  content: "";
}
.history-lightbox__thumbnail {
  position: relative;
  display: block;
  width: var(--history-thumbnail-width);
  aspect-ratio: 4 / 3;
  flex: 0 0 auto;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: #050505;
  cursor: pointer;
  scroll-snap-align: center;
}
.history-lightbox__thumbnails.is-dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
dialog.history-lightbox[open] .history-lightbox__thumbnail[aria-pressed="true"],
dialog.history-lightbox[open] .history-lightbox__thumbnail[aria-pressed="true"]:hover {
  outline: 2px solid #d59a18;
  outline-offset: 1px;
}
dialog.history-lightbox[open] .history-lightbox__thumbnail:not([aria-pressed="true"]):hover:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}
dialog.history-lightbox[open] .history-lightbox__thumbnail:not([aria-pressed="true"]):focus-visible {
  outline: 3px solid #050505;
  outline-offset: 2px;
}
dialog.history-lightbox[open] .history-lightbox__thumbnail[aria-pressed="true"]:focus-visible {
  outline: 2px solid #d59a18;
  outline-offset: 1px;
  box-shadow: 0 0 0 5px #050505;
}
.history-lightbox__thumbnail img { display: block; width: 100%; height: 100%; object-fit: cover; }
.history-lightbox__photo-entering {
  position: absolute;
  z-index: 1;
  top: var(--history-photo-inset);
  left: var(--history-photo-inset);
  width: calc(100% - var(--history-photo-inset) - var(--history-photo-inset));
  height: calc(100% - var(--history-photo-inset) - var(--history-photo-inset));
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  border-radius: .75rem;
  filter: contrast(1.05);
  object-fit: contain;
  object-position: center;
  pointer-events: none;
}

.history-lightbox__close,.history-lightbox__navigate { position: absolute; z-index: 2; border: 1px solid rgb(255 255 255 / .58); background: rgb(5 5 5 / .82); color: #fff; cursor: pointer; }
.history-lightbox__close { top: .7rem; right: .7rem; width: 42px; height: 42px; border-radius: 50%; font-size: 2rem; line-height: 1; }
.history-lightbox__navigate { top: 50%; width: 46px; height: 62px; font-size: 3rem; line-height: 1; transform: translateY(-50%); }
.history-lightbox__navigate--previous { left: 0; border-left: 0; border-radius: 0 5px 5px 0; }
.history-lightbox__navigate--next { right: 0; border-right: 0; border-radius: 5px 0 0 5px; }
.history-lightbox__navigate svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 3; }
.history-lightbox__close:hover,.history-lightbox__navigate:hover:not(:disabled) { background: #d59a18; color: #050505; }
.history-lightbox__navigate:disabled { opacity: .28; cursor: not-allowed; }
.history-lightbox__close:focus-visible,.history-lightbox__navigate:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.history-lightbox__year-panel {
  display: flex;
  flex: 1;
  min-height: 0;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  overflow: hidden;
  padding: 3rem 4rem;
  background: var(--black);
  color: var(--gold);
  text-align: center;
}

.history-lightbox__document {
  width: 64px;
  height: 86px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.history-lightbox__year {
  max-width: 100%;
  font: 700 clamp(5rem, 24vw, 22rem)/0.85 var(--display);
  letter-spacing: -0.035em;
}

.history-lightbox__year--long {
  font-size: clamp(3rem, 8vw, 8rem);
}

.history-lightbox__club {
  color: var(--pure-white);
  font: 700 clamp(0.8rem, 1.6vw, 1.15rem)/1.3 var(--display);
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.history-lightbox__layout.history-lightbox--no-image .history-lightbox__media {
  display: flex;
  flex-direction: column;
}

.history-canon {
  min-height: 100vh;
  padding: clamp(2rem, 3.8vw, 4rem) 0 2.4rem;
  background-color: #f9ead1;
  background-image:
    linear-gradient(to bottom, transparent min(85vw, 1346px), #f9ead1 min(175vw, 2772px)),
    url("../assets/images/historie/historie-achtergrond-klok-links-zacht.png");
  background-position: left top;
  background-repeat: no-repeat;
  background-size: 100% 100%, 100% auto;
}

@media (min-width: 768px) {
  .history-canon {
    background-image:
      linear-gradient(to bottom, transparent min(85vw, 1346px), #f9ead1 min(175vw, 2772px)),
      url("../assets/images/historie/historie-achtergrond-klok-desktop.png");
  }
}

.story-year {
  margin: 0 0 0.35rem;
  color: #b87908;
  font-family: var(--display);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.14em;
}

.canon-route {
  position: relative;
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 clamp(1.2rem, 3vw, 3rem);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(var(--canon-row-count, 4), 350px);
  gap: 0 clamp(0.65rem, 1.5vw, 1.5rem);
  isolation: isolate;
}

.canon-route__intro {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  z-index: 0;
  align-self: start;
  width: max-content;
  padding: clamp(0.5rem, 1.6vw, 1.25rem) 0;
  isolation: isolate;
}

.canon-route__watermark {
  display: none;
}

.canon-route__intro h1 {
  margin: 0;
  color: #050505;
  font-family: var(--display);
  font-size: clamp(4.1rem, 6vw, 5.8rem);
  font-weight: 700;
  letter-spacing: 0.015em;
  line-height: 0.8;
  text-transform: uppercase;
}

.canon-route__intro > p {
  margin: 0.44rem 0 0;
  color: #b17d15;
  font-family: var(--display);
  font-size: clamp(1.1rem, 1.7vw, 1.28rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.canon-route__intro > .canon-route__description {
  max-width: 16rem;
  margin: 0.9rem 0 0;
  color: #302d26;
  font-family: var(--body);
  font-size: clamp(0.9rem, 1vw, 1rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none;
  white-space: normal;
}

.canon-route__description::before {
  display: block;
  width: 4rem;
  height: 3px;
  margin-bottom: 0.75rem;
  background: var(--gold);
  content: "";
}

.canon-route__mobile-break { display: none; }

.canon-route__line {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.canon-route__line path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.canon-route__halo {
  stroke: var(--gold);
  stroke-width: 6px;
  opacity: 0.32;
  filter: blur(1.15px);
}

.canon-route__path {
  stroke: var(--gold);
  stroke-width: 3.6px;
}

.canon-route__end {
  stroke: var(--gold);
  stroke-width: 3.8px;
}

.canon-card {
  --canon-card-offset-x: 0px;
  position: relative;
  z-index: 0;
  width: min(100%, 202px);
  height: 198px;
  min-width: 0;
  align-self: start;
  justify-self: center;
  overflow: visible;
  translate: var(--canon-card-offset-x) 0;
  grid-column: var(--canon-grid-column);
  grid-row: var(--canon-grid-row);
}

.canon-card:not(.canon-card--no-image):not(.canon-card--jubilee) { height: auto; aspect-ratio: auto; }
.canon-card--no-image { height: 174px; }

.canon-card__paper {
  position: relative;
  z-index: 1;
  height: 100%;
  border: 0;
  border-bottom: 5px solid var(--gold);
  background: var(--canon-paper-color);
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 0 100%);
  -webkit-mask: url("../assets/images/historie/historie-kaartvorm-afgerond.svg") center / 100% 100% no-repeat;
  mask: url("../assets/images/historie/historie-kaartvorm-afgerond.svg") center / 100% 100% no-repeat;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.canon-card:not(.canon-card--jubilee):not(.canon-card--add) .canon-card__paper {
  border-bottom: 7px solid var(--gold);
}

.canon-card:not(.canon-card--no-image):not(.canon-card--jubilee) .canon-card__paper {
  display: flow-root;
}

.canon-card__link {
  --canon-paper-color: #fff;
  position: relative;
  display: block;
  height: 100%;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  filter:
    drop-shadow(0 2px 3px rgb(67 57 43 / 0.16))
    drop-shadow(6px 11px 19px rgb(53 45 33 / 0.24));
  transition: filter 160ms ease;
}

.canon-card__link::before,
.canon-card__link::after {
  position: absolute;
  right: 50%;
  z-index: 2;
  content: "";
  pointer-events: none;
  transform: translateX(50%);
}

.canon-card__link::before {
  bottom: -8px;
  width: 27px;
  height: 10px;
  background: var(--gold);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.canon-card__link::after {
  bottom: -5px;
  z-index: 3;
  width: 17px;
  height: 7px;
  background: var(--gold);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.canon-card:hover .canon-card__link,
.canon-card:focus-within .canon-card__link {
  --canon-paper-color: #f2efe7;
}

.canon-card__link:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}

.canon-card::after {
  position: absolute;
  right: 50%;
  bottom: -69px;
  width: 14px;
  height: 14px;
  border: 3px solid var(--gold);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px #f7f7f4, 0 1px 4px rgb(91 66 20 / 0.18);
  content: "";
  transform: translateX(50%);
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.canon-card::before {
  position: absolute;
  right: 50%;
  bottom: -52px;
  z-index: -1;
  width: 3px;
  height: 52px;
  background: var(--gold);
  content: "";
  transform: translateX(50%);
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.canon-card__route-highlight {
  position: absolute;
  z-index: -1;
  right: 50%;
  bottom: -61px;
  width: 62px;
  height: 4px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 8px rgb(213 154 24 / 0.6);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translateX(50%);
  transition: opacity 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

@media (min-width: 1367px) {
  .canon-route > .canon-card:nth-of-type(odd):not(.canon-card--jubilee):not(.canon-card--add) { --canon-card-offset-y: -12px; }
  .canon-route > .canon-card:nth-of-type(even):not(.canon-card--jubilee):not(.canon-card--add) { --canon-card-offset-y: 12px; }
  .canon-card:not(.canon-card--jubilee):not(.canon-card--add) .canon-card__link { translate: 0 var(--canon-card-offset-y, 0px); }
  .canon-card::after { top: 253px; bottom: auto; }
  .canon-card::before { top: calc(100% + var(--canon-card-offset-y, 0px)); bottom: calc(100% - 260px); height: auto; }
  .canon-card__route-highlight { top: 258px; bottom: auto; }
}

.canon-card:hover .canon-card__route-highlight,
.canon-card:focus-within .canon-card__route-highlight {
  opacity: 1;
}

.canon-card:hover::before,
.canon-card:focus-within::before {
  background: var(--gold);
  box-shadow: 0 0 7px rgb(213 154 24 / 0.6);
}

.canon-card:hover::after,
.canon-card:focus-within::after {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: 0 0 0 3px #f7f7f4, 0 0 9px rgb(213 154 24 / 0.72);
}

.canon-card__image-frame {
  position: relative;
  --image-corner-cut: 22px;
  width: calc(100% - 0.7rem - 4px);
  height: 110px;
  margin: calc(0.35rem + 2px) calc(0.35rem + 2px) 0;
  clip-path: polygon(0 0, calc(100% - var(--image-corner-cut)) 0, 100% var(--image-corner-cut), 100% 100%, 0 100%);
  overflow: hidden;
}

.canon-card__photo-count { position:absolute; right:.42rem; bottom:.42rem; z-index:1; padding:.22rem .42rem; border:1px solid rgb(255 255 255 / .75); border-radius:4px; background:rgb(5 5 5 / .78); color:#fff; font:700 .72rem/1 var(--display); }

.canon-card:not(.canon-card--no-image):not(.canon-card--jubilee) .canon-card__image-frame { margin-bottom: 0; }

.canon-card img {
  width: 100%;
  height: 100%;
  margin: 0;
  display: block;
  filter: contrast(1.04);
  object-fit: cover;
  object-position: var(--image-position, center);
  transform: scale(var(--image-scale, 1));
  transition: transform 180ms ease;
}

/* Volledige pagina-scans worden in het kleine kaartvenster als leesbare bronpassage getoond. */
.canon-card--2 img,
.canon-card--3 img,
.canon-card--4 img,
.canon-card--5 img,
.canon-card--7 img,
.canon-card--9 img,
.canon-card--10 img,
.canon-card--12 img,
.canon-card--13 img,
.canon-card--14 img {
  --image-scale: 1.48;
  --image-position: center 44%;
}

/* Bij scans met een archieffoto krijgt de foto voorrang boven de omliggende tekst. */
.canon-card--6 img,
.canon-card--8 img,
.canon-card--11 img {
  --image-position: center bottom;
  --image-scale: 1.24;
}

.canon-card:hover img {
  transform: scale(calc(var(--image-scale, 1) + 0.04));
}

.canon-card__body {
  height: calc(100% - 121px);
  padding: 0.52rem 0.7rem 0.62rem;
  display: flex;
  flex-direction: column;
}

.canon-card:not(.canon-card--no-image) .canon-card__body {
  padding-bottom: 0.35rem;
}

.canon-card__route-year {
  position: absolute;
  right: calc(50% + 15px);
  top: 244px;
  z-index: 1;
  margin: 0;
  padding: 0.28rem 0.55rem;
  border-radius: 4px;
  background: var(--gold);
  box-shadow: 0 2px 5px rgb(91 66 20 / 0.2);
  color: var(--pure-white);
  font-family: var(--display);
  font-size: clamp(0.94rem, 1.35vw, 1.14rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateY(-100%);
}

.canon-card h2 {
  min-height: 2.08em;
  margin: 0;
  overflow: hidden;
  color: #1b1a18;
  font-family: var(--display);
  font-size: clamp(1rem, 1.25vw, 1.13rem);
  font-weight: 700;
  letter-spacing: 0.012em;
  line-height: 0.98;
}

.canon-card:not(.canon-card--no-image):not(.canon-card--jubilee) .canon-card__body { height: auto; padding-block: calc(0.4rem + 2px); }
.canon-card:not(.canon-card--no-image):not(.canon-card--jubilee) .canon-card__body > h2 { margin-block: 0; }
.canon-card:not(.canon-card--no-image):not(.canon-card--jubilee) h2 {
  min-height: 0;
  overflow: visible;
  overflow-wrap: anywhere;
  line-height: 1.1;
}
.canon-card--title-only .canon-card__body > h2 { margin-top: auto; }

.canon-card--no-image .canon-card__link {
  --canon-paper-color: #fff;
}

.canon-card--no-image:hover .canon-card__link,
.canon-card--no-image:focus-within .canon-card__link {
  --canon-paper-color: #f2efe7;
}

.canon-card--no-image .canon-card__note {
  position: relative;
  container-type: inline-size;
  height: 100%;
  padding: 0.95rem 0.7rem 0.75rem;
}

.canon-card--no-image .canon-card__note > :not(.canon-card__year-watermark) {
  position: relative;
  z-index: 1;
}

.canon-card__eyebrow {
  flex-shrink: 0;
  margin: 0 0 0.4rem;
  padding-right: 0.6rem;
  color: #b87908;
  font: 700 0.55rem/1.2 var(--display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.canon-card__title-rule {
  height: 1px;
  flex-shrink: 0;
  margin: 0.35rem 0;
  background: var(--gold);
}

.canon-card--no-image h2 {
  flex-shrink: 0;
  min-height: 0;
  overflow-wrap: anywhere;
  line-height: 1.05;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.canon-card__excerpt {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0 0 0.6rem;
}

.canon-card__year-watermark {
  position: absolute;
  top: 15%;
  left: 29%;
  right: 0.55rem;
  z-index: 0;
  color: rgb(213 154 24 / 0.15);
  font: 700 clamp(3.5rem, 62cqw, 8.5rem)/0.8 var(--display);
  letter-spacing: -0.04em;
  pointer-events: none;
  text-align: right;
  user-select: none;
}

.canon-card__text-preview {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  color: #3d3d3d;
  font-family: var(--body);
  font-size: 0.8rem;
  line-height: 1.4;
}

.story-back {
  display: inline-block;
  margin-top: auto;
  color: #6d510f;
  font-family: var(--body);
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.canon-card--jubilee .canon-card__link {
  cursor: default;
}

.canon-card--jubilee .canon-card__paper {
  background: #fffdf7;
}

.canon-card--jubilee:hover .canon-card__link {
  --canon-paper-color: #fffdf7;
}

.canon-card__jubilee-body {
  height: 100%;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 0.65rem 0.68rem;
  text-align: center;
}

.canon-card__century {
  margin: 0;
  color: transparent;
  font-family: var(--display);
  font-size: clamp(3.4rem, 5vw, 4.9rem);
  font-weight: 700;
  letter-spacing: -0.075em;
  line-height: 0.78;
  -webkit-text-stroke: 1.5px #c28614;
}

.canon-card__jubilee-year {
  margin: 0.5rem 0 0;
  color: #c28614;
  font-family: var(--display);
  font-size: clamp(1.25rem, 1.8vw, 1.58rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
}

.canon-card__jubilee-body h2 {
  min-height: 0;
  margin-top: 0.25rem;
  font-size: clamp(0.95rem, 1.15vw, 1.06rem);
}

.history-canon__source {
  max-width: 1560px;
  margin: 1rem auto 0;
  padding: 0 clamp(1.2rem, 3vw, 3rem);
  color: #706c64;
  font-size: 0.85rem;
  font-style: italic;
}

.history-story {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1.25rem, 5vw, 4rem) 5rem;
}

.story-back {
  margin-bottom: 2rem;
}

.story-header {
  max-width: 760px;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #d8d3c7;
}

.story-kicker {
  margin: 0 0 0.55rem;
  color: #8b661c;
  font-family: var(--body);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.history-story h1 {
  max-width: 740px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3rem, 7vw, 5.7rem);
  letter-spacing: 0.018em;
  line-height: 0.87;
}

.story-figure {
  max-width: 800px;
  margin: 2rem 0 2.1rem;
}

.story-image {
  width: 100%;
  max-height: 510px;
  margin: 0;
  display: block;
  border-bottom: 5px solid #d59a18;
  filter: contrast(1.05);
  object-fit: cover;
}

.story-figure figcaption {
  margin-top: 0.55rem;
  color: #706c64;
  font-family: var(--body);
  font-size: 0.78rem;
  font-style: italic;
}

.story-copy {
  max-width: 700px;
  font-size: 1.08rem;
  line-height: 1.7;
}

.story-copy p {
  margin: 0 0 1.15rem;
}

.story-source {
  max-width: 700px;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #d8d3c7;
  color: #706c64;
  font-size: 0.88rem;
  font-style: italic;
}

@media (max-width: 1366px) and (min-width: 768px) {
  .history-canon { padding-top: 2rem; }
  .canon-route { padding: 0 1rem; gap: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(var(--canon-row-count, 4), 286px); }
  .canon-route__intro { width: 100%; padding: 0.5rem 0; }
  .canon-route__watermark { top: -3.75rem; left: -3.25rem; width: clamp(17rem, 27vw, 21rem); }
  .canon-route__intro h1 { font-size: clamp(3.7rem, 7.2vw, 4.8rem); }
  .canon-route__intro > p { font-size: clamp(0.9rem, 1.5vw, 1rem); }
  .canon-card { width: min(88%, 190px); height: 166px; }
  .canon-card:not(.canon-card--no-image):not(.canon-card--jubilee) { height: auto; }
  .canon-card--no-image { height: 146px; }
  .canon-card__link {
    filter:
      drop-shadow(0 1px 2px rgb(67 57 43 / 0.15))
      drop-shadow(4px 7px 13px rgb(53 45 33 / 0.23));
  }
  .canon-card__image-frame { width: calc(100% - 0.45rem - 4px); height: 82px; margin: calc(0.35rem + 2px) calc(0.225rem + 2px) 0; }
  .canon-card__body { height: calc(100% - 98px); padding: 0.38rem 0.5rem 0.46rem; }
  .canon-card:not(.canon-card--no-image):not(.canon-card--jubilee) .canon-card__body { height: auto; padding: calc(0.35rem + 2px) 0.5rem; }
  .canon-card h2 { min-height: 2.08em; font-size: 0.95rem; }
  .canon-card--no-image .canon-card__note { padding: 0.75rem 0.6rem 0.6rem; }
  .canon-card__eyebrow { font-size: 0.5rem; }
  .canon-card--no-image .canon-card__text-preview { font-size: 0.77rem; }
  .canon-card__title-rule { margin-block: 0.22rem; }
  .canon-card__excerpt { margin-block: 0.35rem 0.4rem; }
  .canon-card--jubilee .canon-card__jubilee-body { height: 100%; align-items: center; justify-content: center; padding: 0.8rem 0.65rem 0.68rem; text-align: center; }
  .canon-card--jubilee .canon-card__jubilee-body h2 { width: 100%; min-height: 0; margin-top: 0.25rem; text-align: center; }
  .canon-card__link::before { bottom: -7px; width: 21px; height: 9px; }
  .canon-card__link::after { bottom: -4px; width: 13px; height: 5px; }
  .canon-card::before { top: 100%; bottom: calc(100% - 212.46px); height: auto; }
  .canon-card::after { top: 206.46px; bottom: auto; width: 12px; height: 12px; border-width: 2px; }
  .canon-card__route-highlight { top: 210.46px; bottom: auto; }
  .canon-card__route-year { top: 196.46px; right: calc(50% + 13px); font-size: 0.84rem; }
}

@media (max-width: 767px) {
  .canon-card:not(.canon-card--jubilee):not(.canon-card--add) .canon-card__paper {
    border-bottom: 0;
    border-left: 7px solid var(--gold);
  }

  .history-lightbox__year-panel {
    min-height: 0;
    height: 100%;
    padding: 1rem 3rem;
    gap: 0.6rem;
  }
  .history-lightbox__document { width: 36px; height: 48px; }
  .history-lightbox__year { font-size: clamp(3rem, 18vw, 6rem); }
  .history-lightbox__year--long { font-size: clamp(2.5rem, 15vw, 5rem); }
  .history-lightbox__club { font-size: 0.85rem; letter-spacing: 0.2em; }

  .history-canon {
    padding: 2.5rem calc(1.15rem - 8px) 3rem 1.15rem;
  }
  .canon-route { margin-left: 0; padding: 0 0 0 calc(4.125rem + 24px); display: grid; grid-template-columns: 1fr; grid-template-rows: none; grid-auto-rows: auto; gap: 2rem; }
  .canon-route__intro { grid-column: 1; grid-row: auto; margin: 0 0 1.25rem calc(-4.125rem - 24px); padding: 0; text-align: left; }
  .canon-route__intro h1 { font-size: clamp(3.25rem, 14.5vw, 4rem); }
  .canon-route__intro > p { font-size: clamp(0.9rem, 4.4vw, 1.02rem); }
  .canon-route__intro > .canon-route__description {
    display: block;
    max-width: 32rem;
    margin-top: 1rem;
    font-size: clamp(1rem, 4.5vw, 1.2rem);
    line-height: 1.4;
  }
  .canon-route__mobile-break { display: initial; }
  .canon-route::before { display: none; }
  .canon-route__line { display: none; }
  .canon-card[class*="canon-card--"] { --canon-card-offset-x: 0px; grid-column: 1; grid-row: auto; }
  .canon-card { z-index: 1; width: min(94%, 218px); height: auto; aspect-ratio: 202 / 174; justify-self: start; }
  .canon-card__link {
    filter:
      drop-shadow(0 1px 2px rgb(67 57 43 / 0.14))
      drop-shadow(3px 7px 13px rgb(53 45 33 / 0.22));
  }
  .canon-card__link::before,
  .canon-card__link::after { display: none; }
  .canon-card__paper { z-index: 1; }
  .canon-card::before { top: calc(2.2rem + 5.5px); right: auto; bottom: auto; left: calc(-3.62rem - 27px); z-index: 0; width: calc(3.62rem + 27px); height: 3px; transform: none; }
  .canon-card::after { top: 2.2rem; right: auto; bottom: auto; left: calc(-4.35rem - 29.5px); z-index: 2; width: 14px; height: 14px; box-shadow: 0 1px 4px rgb(91 66 20 / 0.18); transform: none; }
  .canon-card:hover::after,
  .canon-card:focus-within::after { box-shadow: 0 0 9px rgb(213 154 24 / 0.72); }
  .canon-card__route-highlight { top: calc(2.2rem + 5.5px); right: auto; bottom: auto; left: calc(-3.62rem - 27px); z-index: 0; width: calc(3.62rem + 27px); height: 3px; transform: none; }
  .canon-card--0 .canon-card__route-highlight { top: calc(2.2rem + 7px); left: calc(-4.35rem - 24px); width: 3px; height: var(--canon-mobile-line-height); opacity: 1; background: var(--gold); box-shadow: 0 0 2px rgb(213 154 24 / 0.32); }
  .canon-card--0:hover .canon-card__route-highlight,
  .canon-card--0:focus-within .canon-card__route-highlight { background: var(--gold); box-shadow: 0 0 7px rgb(213 154 24 / 0.6); }
  .canon-card__route-year {
    top: calc(2.2rem + 7px);
    right: calc(100% + 0.6rem + 24px);
    left: auto;
    z-index: 3;
    width: max-content;
    min-width: 2.5rem;
    padding: 0.27rem 0.2rem;
    border-radius: 4px;
    background: var(--gold);
    box-shadow: 0 2px 5px rgb(91 66 20 / 0.2);
    color: var(--pure-white);
    font-size: 0.82rem;
    text-align: center;
    transform: translateY(-50%);
  }
  .canon-card__image-frame { width: calc(100% - 0.7rem - 4px); height: 108px; margin: calc(0.35rem + 2px) calc(0.35rem + 2px) 0; }
  .canon-card__body { height: calc(100% - 114px); padding: 0.7rem 1rem 0.8rem; }
  .canon-card:not(.canon-card--no-image):not(.canon-card--jubilee) .canon-card__body { height: auto; padding: calc(0.45rem + 2px) 0.7rem; }
  .canon-card:not(.canon-card--no-image):not(.canon-card--jubilee) h2 { font-size: 1.08rem; }
  .canon-card--no-image .canon-card__note { padding: 1.2rem 1rem 1rem; }
  .canon-card__eyebrow { font-size: 0.65rem; }
  .canon-card--no-image h2 { font-size: 1.05rem; }
  .canon-card--no-image .canon-card__text-preview { font-size: 0.95rem; }
  .canon-card__title-rule { margin-block: 0.28rem; }
  .canon-card__excerpt { margin-block: 0.35rem 0.5rem; }
  .canon-card--jubilee .canon-card__jubilee-body { height: 100%; padding: 1.25rem 1rem 1rem; }
  .canon-card--jubilee .canon-card__century { font-size: clamp(3.1rem, 16vw, 4.25rem); }
  .canon-card--jubilee .canon-card__jubilee-year { margin-top: 0.4rem; font-size: clamp(1.2rem, 6vw, 1.5rem); }
  .canon-card--jubilee .canon-card__jubilee-body h2 { margin-top: 0.35rem; font-size: clamp(1rem, 5vw, 1.22rem); }
  .history-canon__source { margin-top: 1.75rem; padding: 0; }
  .history-footer__icon { width: 28px; height: 19px; }
  .history-footer__trigger > span { font-family:var(--body); font-size:clamp(.7rem,3.1vw,.95rem); }
  .history-lightbox {
    --history-card-width: min(620px, calc(100vw - 1rem));
    --history-card-gap: 1rem;
    width: min(calc(100vw - 1rem), 620px);
    height: calc(100dvh - 1rem);
    max-height: calc(100dvh - 1rem);
    background: #fbfaf5;
  }
  .history-lightbox__carousel { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; }
  .history-lightbox__track {
    position: absolute;
    top: 0;
    left: calc(50% - var(--history-card-width) / 2 - var(--history-card-width) - var(--history-card-gap) - var(--history-card-width) - var(--history-card-gap));
    display: flex;
    height: 100%;
    align-items: stretch;
    gap: var(--history-card-gap);
    width: max-content;
  }
  .history-lightbox__layout {
    display: block;
    position: relative;
    top: auto;
    left: auto;
    flex: 0 0 var(--history-card-width);
    width: var(--history-card-width);
    box-sizing: border-box;
    height: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: #fbfaf5;
    box-shadow: none;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
    transform: none;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, min(42dvh, 340px)) minmax(0, 1fr);
    grid-template-areas: "media" "content";
  }
  /* Reserve the photo area so portrait and landscape photos keep the strip in place. */
  .history-lightbox__media { height: min(42dvh, 340px); min-height: 0; max-height: min(42dvh, 340px); }
  .history-lightbox__gallery { --history-photo-inset: 0px; }
  .history-lightbox__gallery img[data-history-photo-image] { max-height: 100%; }
  .history-lightbox__layout.history-lightbox--no-image .history-lightbox__media { min-height: min(30dvh, 220px); }
  .history-lightbox__content { display: block; min-height: 0; overflow: visible; padding: 1.25rem 1.25rem 0; }
  .history-lightbox__thumbnails {
    --history-thumbnail-width: clamp(4rem, 20vw, 5.5rem);
    --history-thumbnail-gap: clamp(.45rem, 1.6vw, .75rem);
    width: 100%;
    margin-bottom: 0;
  }
  .history-lightbox__meta { margin-bottom: .45rem; }
  .history-lightbox h2 { padding-right: 0; line-height: .98; }
  .history-lightbox__copy {
    overflow: visible;
    margin: 1rem 0 0;
    padding: 1.2rem 0 0;
    border-top: 0;
    scrollbar-gutter: auto;
  }
  .history-lightbox__copy::before { display: block; width: 2.8rem; height: 2px; margin: -1.2rem 0 1.2rem; background: var(--gold); content: ""; }
  .history-lightbox__navigation {
    position: absolute;
    z-index: 3;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .3rem 1rem calc(.3rem + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0 0 calc(1rem - 1px) calc(1rem - 1px);
    background: rgb(239 216 170 / .48);
  }
  .history-lightbox__navigate,
  .history-lightbox__navigate--previous,
  .history-lightbox__navigate--next {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    isolation: isolate;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    transform: none;
  }
  .history-lightbox__navigate::before {
    position: absolute;
    z-index: -1;
    inset: 5px;
    border-radius: 50%;
    background: #ad7d24;
    box-shadow: 0 1px 3px rgb(70 48 15 / .25);
    content: "";
  }
  .history-lightbox__navigate svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 3.5; }
  .history-lightbox__navigate:hover:not(:disabled) { background: transparent; color: #fff; }
  .history-lightbox__navigate:hover:not(:disabled)::before { background: #966916; }
  html body dialog.history-lightbox[open] .history-lightbox__navigate:focus:not(:focus-visible) { outline: none; box-shadow: none; }
  html body dialog.history-lightbox[open] .history-lightbox__navigate:focus-visible { outline: 2px solid #050505; outline-offset: 2px; }
  .history-lightbox__close { top: .8rem; right: .8rem; width: 44px; height: 44px; }
  .history-editor__actions{grid-template-columns:1fr 1fr}.history-editor__actions>span{display:none}.history-editor__delete{grid-column:1 / -1}.history-editor-bar{right:1rem;bottom:1rem;left:1rem;justify-content:space-between}
}

@media (max-height: 600px) {
  .history-lightbox__content { padding-block: 1rem; }
  .history-lightbox h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
  .history-lightbox__copy { margin-top: .75rem; padding-top: .75rem; }
  .history-lightbox__year-panel { flex-direction: row; gap: .75rem; padding: .75rem 3rem; }
  .history-lightbox__document { width: 24px; height: 32px; }
  .history-lightbox__year { font-size: clamp(2rem, 8vw, 4rem); }
  .history-lightbox__year--long { font-size: clamp(1.5rem, 6vw, 3rem); }
  .history-lightbox__club { font-size: .65rem; letter-spacing: .1em; }
}

@media (max-width: 767px) and (max-height: 600px) {
  .history-lightbox__media { height: min(36dvh, 220px); max-height: min(36dvh, 220px); }
  .history-lightbox__gallery img[data-history-photo-image] { max-height: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .canon-card, .canon-card img, .canon-card__link, .canon-card__paper { transition: none; }
  .history-editor__publication-track,.history-editor__publication-track > span { transition:none; }
  .history-progress__bar span { animation:none; }
  .history-lightbox__thumbnails { scroll-snap-type: none; }
}

/* Keep authentication controls and editor fields consistent across breakpoints. */
.history-auth input:not([type="file"]):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
  box-sizing: border-box;
  height: 40px;
  min-height: 40px;
  padding-block: 0.3rem;
  line-height: 1.2;
}

.history-editor__body input:not([type="file"]):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.history-editor__body select {
  box-sizing: border-box;
  height: 36px;
  min-height: 36px;
  padding-block: 0.3rem;
  line-height: 1.2;
}

@media (max-width: 800px) {
  .history-auth input:not([type="file"]):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
    height: 32px;
    min-height: 32px;
    padding-block: 0.2rem;
  }

  .history-editor__header { padding:1.2rem 1rem 2rem; }
  .history-editor__header > div { padding-right:3rem; }
  .history-editor__header h2 { font-size:clamp(1rem,8cqi,2.5rem); }
  .history-editor__header button { top:1rem; right:1rem; width:40px; height:40px; }
  .history-editor__body { grid-template-columns:minmax(0,1fr); gap:.85rem; margin:0 .5rem; padding:1.25rem; }
  .history-editor__year-row { grid-template-columns:minmax(0,1fr); grid-template-areas:"publication" "year"; gap:.85rem; }
  .history-editor__year-field input { max-width:none; }
  .history-editor__body > label:nth-of-type(1),
  .history-editor__body > label:nth-of-type(2),
  .history-editor__body > label:nth-of-type(3) { grid-column:1/-1; }
  .history-editor__actions { margin-inline:1rem; }
}

@media (max-width: 480px) {
  .history-editor__actions { grid-template-columns:minmax(0,1fr); }
  .history-editor__actions > span { display:none; }
  .history-editor__actions button { width:100%; min-width:0; }
}

@media (min-width: 768px) {
  .history-lightbox {
    height: min(740px, 75dvh);
    max-height: min(740px, 75dvh);
    border-color: var(--gold-light);
    border-radius: 16px;
  }

  .history-lightbox .history-lightbox__layout {
    position: relative;
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
    column-gap: 8px;
  }

  .history-lightbox .history-lightbox__media {
    box-sizing: border-box;
    padding: clamp(8px, 1vw, 16px);
    padding-bottom: clamp(8px, 1vw, 16px);
  }

  .history-lightbox .history-lightbox__gallery {
    --history-photo-inset: 0px;
    width: auto;
    height: auto;
    margin-block-start: calc(10px - clamp(8px, 1vw, 16px));
    margin-block-end: 10px;
    margin-inline: calc(10px - clamp(8px, 1vw, 16px));
  }

  .history-lightbox .history-photo-gallery__controls {
    bottom: calc(.75rem - 10px);
  }

  .history-lightbox__layout.history-lightbox--no-image .history-lightbox__year-panel {
    box-sizing: border-box;
    width: 100%;
    min-height: min(30dvh, 220px);
    height: auto;
    max-height: min(calc(75dvh - 220px), 480px);
    flex: 1 1 auto;
    border-radius: 14px;
    gap: clamp(0.6rem, 1.5vw, 1rem);
    padding: clamp(1rem, 2.5vw, 2rem);
  }

  .history-lightbox__layout:not(.history-lightbox--no-image) .history-lightbox__gallery img[data-history-photo-image] {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 14px;
    filter: contrast(1.05);
    object-fit: contain;
    clip-path: inset(0 round 14px);
  }

  .history-lightbox .history-lightbox__content {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding: clamp(1.75rem, 4vw, 3.25rem) 0 0 clamp(16px, 1.75vw, 24px);
    overflow: hidden;
    background: #fbfaf5;
  }

  .history-lightbox .history-lightbox__meta {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    margin: 0 0 1rem;
    background: #fbfaf5;
    font-size: clamp(1.2rem, 1.7vw, 1.5rem);
    letter-spacing: 0.06em;
    line-height: 1;
  }

  .history-lightbox h2 {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    padding-bottom: 12px;
    background: #fbfaf5;
  }

  .history-lightbox h2::after {
    position: absolute;
    top: calc(100% + clamp(8px, 1.25vw, 20px));
    left: 0;
    width: 2.8rem;
    height: 2px;
    background: var(--gold);
    content: "";
  }

  .history-lightbox .history-lightbox__copy {
    min-height: 0;
    flex: 1 1 auto;
    margin: 12px 0 0;
    padding: clamp(16px, 2.5vw, 40px) clamp(20px, 2.5vw, 32px) 112px 0;
    overflow-x: hidden;
    overflow-y: auto;
    border-top: 0;
    scrollbar-color: #ad7d24 #eee8db;
    scrollbar-width: thin;
    scroll-padding-bottom: 112px;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18px);
    mask-image: linear-gradient(to bottom, transparent, #000 18px);
  }

  .history-lightbox .history-lightbox__copy::before {
    display: none;
  }

  .history-lightbox .history-lightbox__text-fade {
    position: absolute;
    z-index: 2;
    right: 0;
    bottom: 46px;
    left: 0;
    height: 48px;
    pointer-events: none;
    background: linear-gradient(to bottom, rgb(251 250 245 / 0), #fbfaf5);
  }

  .history-lightbox .history-lightbox__text-fade[hidden] {
    display: none;
  }

  .history-lightbox .history-lightbox__navigation {
    position: absolute;
    z-index: 4;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    height: 46px;
    min-height: 46px;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    box-sizing: border-box;
    padding: 0 clamp(16px, 2vw, 28px);
    border-top: 1px solid rgb(173 125 36 / 0.18);
    background: #f8f0df;
    box-shadow: 0 -5px 16px rgb(48 37 18 / 0.12);
  }

  .history-lightbox .history-lightbox__navigate {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    transform: none;
  }

  .history-lightbox .history-lightbox__navigate::before {
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: #ad7d24;
    box-shadow: 0 1px 3px rgb(70 48 15 / 0.25);
    content: "";
  }

  .history-lightbox .history-lightbox__navigate--previous {
    justify-self: start;
  }

  .history-lightbox .history-lightbox__navigate--next {
    justify-self: end;
  }

  .history-lightbox .history-lightbox__navigate svg {
    position: relative;
    z-index: 1;
    width: 12px;
    height: 12px;
    stroke-width: 3.5;
  }

  .history-lightbox .history-lightbox__navigate:focus-visible {
    outline: 2px solid #050505;
    outline-offset: -2px;
  }

  .history-lightbox .history-lightbox__navigate:hover:not(:disabled) {
    background: transparent;
    color: #fff;
  }

  .history-lightbox .history-lightbox__navigate:hover:not(:disabled)::before {
    background: #966916;
  }

  .history-lightbox .history-lightbox__count {
    display: block;
    color: #302411;
    font: 700 1.1rem/1 var(--display);
    font-variant-numeric: tabular-nums;
  }

  .history-lightbox .history-lightbox__close {
    border-color: rgb(240 182 42 / 0.8);
    border-radius: 50%;
    background: rgb(5 5 5 / 0.88);
  }

  .history-lightbox .history-lightbox__close:hover {
    background: var(--gold);
    color: #050505;
  }
}

@media (min-width: 768px) and (max-width: 1100px) {
  .history-lightbox {
    height: min(650px, calc(100dvh - 2rem));
    max-height: min(650px, calc(100dvh - 2rem));
  }

  .history-lightbox .history-lightbox__layout {
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  }
}

html body dialog.history-lightbox[open] .history-lightbox__navigate:focus {
  outline: none;
  box-shadow: none;
}

.history-lightbox__peek { display: none; }
  .history-lightbox__layout { touch-action: pan-y; }
.history-lightbox__carousel { z-index: 1; }
.history-lightbox__carousel.is-dragging,
.history-lightbox__carousel.is-dragging .history-lightbox__media {
  cursor: grabbing;
  user-select: none;
  -webkit-user-select: none;
}
.history-lightbox__media img { -webkit-user-drag: none; }
.history-lightbox__layout--empty { visibility: hidden; pointer-events: none; }

@media (min-width: 768px) {
  .history-lightbox {
    --history-card-width: min(1300px, calc(100vw - 12rem));
    --history-card-gap: 64px;
    --history-preview-arrow-size: min(44px, calc(50vw - var(--history-card-width) / 2 - var(--history-card-gap)));
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .history-lightbox__carousel { position: absolute; inset: 0; overflow: visible; }
  .history-lightbox__track {
    position: absolute;
    top: 0;
    left: calc(50% - var(--history-card-width) / 2 - var(--history-card-width) - var(--history-card-gap) - var(--history-card-width) - var(--history-card-gap));
    display: flex;
    height: 100%;
    align-items: center;
    gap: var(--history-card-gap);
    width: max-content;
  }

  .history-lightbox .history-lightbox__layout {
    position: relative;
    top: auto;
    left: auto;
    flex: 0 0 var(--history-card-width);
    min-width: 0;
    width: var(--history-card-width);
    height: min(740px, 75dvh);
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--gold-light);
    border-radius: 16px;
    background: #fbfaf5;
    box-shadow: 0 24px 70px rgb(0 0 0 / .55);
    touch-action: pan-y;
    transform: none;
  }

  .history-lightbox .history-lightbox__media {
    padding-bottom: clamp(8px, 1vw, 16px);
  }

  .history-lightbox .history-lightbox__navigation { display: none; }
  .history-lightbox .history-lightbox__copy { padding-bottom: 48px; }
  .history-lightbox .history-lightbox__text-fade { bottom: 0; }

  .history-lightbox .history-lightbox__close {
    top: calc(50% - min(740px, 75dvh) / 2 + 12px);
    right: calc(50% - var(--history-card-width) / 2 + 12px);
    z-index: 6;
  }

  .history-lightbox__peek {
    position: absolute;
    z-index: 4;
    top: 50%;
    display: block;
    width: var(--history-preview-arrow-size);
    height: var(--history-preview-arrow-size);
    box-sizing: border-box;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    color: #966100;
    cursor: pointer;
    text-align: left;
    transform: translateY(-50%);
  }

  .history-lightbox__peek::before {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    width: var(--history-preview-arrow-size);
    height: var(--history-preview-arrow-size);
    border: 1px solid rgb(255 255 255 / .42);
    border-radius: 50%;
    background: #ad7d24;
    box-shadow: 0 2px 8px rgb(0 0 0 / .28);
    content: "";
    pointer-events: none;
    transform: translate(-50%, -50%);
  }

  .history-lightbox__peek::after {
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    border: solid #fff;
    border-width: 0 3px 3px 0;
    content: "";
    pointer-events: none;
    transform: translate(-70%, -50%) rotate(-45deg);
  }

  .history-lightbox__peek[hidden] { display: none; }
  .history-lightbox__peek--previous { left: calc(25vw - var(--history-card-width) / 4 - var(--history-card-gap) / 2 - var(--history-preview-arrow-size) / 2); }
  .history-lightbox__peek--next { right: calc(25vw - var(--history-card-width) / 4 - var(--history-card-gap) / 2 - var(--history-preview-arrow-size) / 2); }
  .history-lightbox__peek--previous::after { transform: translate(-30%, -50%) rotate(135deg); }
  .history-lightbox__peek:hover { background: transparent; box-shadow: none; }
  .history-lightbox__peek:hover::before { background: #966916; }
  html body dialog.history-lightbox[open] .history-lightbox__peek:focus,
  html body dialog.history-lightbox[open] .history-lightbox__peek:focus-visible { outline: none; box-shadow: none; }
  .history-lightbox__peek:focus-visible::before { outline: 3px solid #fff; outline-offset: 3px; }
}

@media (min-width: 768px) and (max-width: 1366px) and (any-pointer: coarse) {
  .history-lightbox {
    --history-card-width: calc(71.4286vw - 22.857px);
    --history-card-gap: 16px;
  }

  .history-lightbox .history-lightbox__layout { box-shadow: none; }
  .history-lightbox__peek { display: block; }
}

@media (min-width: 1367px) {
  .history-lightbox { --history-card-gap: 16px; }
  .history-lightbox .history-lightbox__layout { box-shadow: none; }
}

@media (min-width: 768px) and (max-width: 1100px) and (any-pointer: coarse) {
  .history-lightbox .history-lightbox__layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "media" "content";
  }

  .history-lightbox .history-lightbox__media {
    padding: clamp(8px, 1vw, 16px);
  }

  .history-lightbox .history-lightbox__content {
    padding: 1rem clamp(1rem, 3vw, 2rem);
  }
}

@media (min-width: 768px) and (max-width: 1100px) {
  .history-lightbox .history-lightbox__layout { height: min(650px, calc(100dvh - 2rem)); }
  .history-lightbox .history-lightbox__close { top: calc(50% - min(650px, calc(100dvh - 2rem)) / 2 + 12px); }
}

@media (prefers-reduced-motion: reduce) {
  .history-lightbox__peek { transition: none; }
}

@media (min-width: 768px) {
  .history-lightbox .history-lightbox__layout[role="button"] {
    cursor: pointer;
  }

  .history-lightbox .history-lightbox__layout[role="button"]:focus-visible {
    outline: 3px solid #f0b62a;
    outline-offset: 3px;
  }
}

/* Vergroting van de geselecteerde foto in de historiemoment-popup. */
.history-lightbox__gallery .history-lightbox__zoom {
  position: absolute;
  z-index: 3;
  right: var(--history-zoom-photo-right, 12px);
  bottom: var(--history-zoom-photo-bottom, 12px);
  display: inline-flex;
  width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: rgb(5 5 5 / 60%);
  box-shadow: none;
  color: #fbfaf5;
  font-family: var(--display);
  font-size: .95rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.history-lightbox__gallery .history-lightbox__zoom[hidden] { display: none !important; }
.history-lightbox__gallery .history-lightbox__zoom:hover { background: rgb(5 5 5 / 80%); }
.history-lightbox__gallery .history-lightbox__zoom:focus-visible { outline: 3px solid #f0b62a; outline-offset: 2px; }
.history-lightbox__gallery .history-lightbox__zoom svg { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }

dialog.history-photo-viewer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #050505;
  color: #fbfaf5;
}

dialog.history-photo-viewer::backdrop { background: #050505; }

html.mobile-phone-history-photo-viewer dialog.history-photo-viewer[open] {
  display: block;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  animation: history-photo-viewer-enter 160ms ease-out both;
}

.history-photo-viewer__stage { position: relative; width: 100%; height: 100%; overflow: hidden; background: #050505; touch-action: pan-y; }
.history-photo-viewer__image {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  transform: translate(-50%, -50%);
  transition: transform 150ms ease-out;
  user-select: none;
  -webkit-user-drag: none;
}

.history-photo-viewer--pannable .history-photo-viewer__image {
  width: auto;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: initial;
  transform: translate(calc(-50% + var(--history-photo-viewer-pan-x, 0px)), -50%);
}

html.mobile-phone-history-photo-viewer dialog.history-photo-viewer[open] .history-photo-viewer__image {
  width: auto;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: initial;
}

.history-photo-viewer--pannable .history-photo-viewer__stage { touch-action: none; cursor: grab; }
.history-photo-viewer--pannable .history-photo-viewer__stage.is-panning { cursor: grabbing; }
.history-photo-viewer--pannable .history-photo-viewer__stage.is-panning .history-photo-viewer__image { transition: none; }

.history-photo-viewer__close,
.history-photo-viewer__navigate {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgb(213 154 24 / 80%);
  border-radius: 50%;
  background: rgb(5 5 5 / 78%);
  color: #fbfaf5;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.history-photo-viewer__close {
  top: calc(.8rem + env(safe-area-inset-top));
  right: calc(.8rem + env(safe-area-inset-right));
  left: auto;
  width: 44px;
  height: 44px;
  border-color: rgb(240 182 42 / 80%);
  background: rgb(5 5 5 / 88%);
  color: var(--pure-white);
  font-family: revert;
  font-size: 2rem;
  font-weight: revert;
  line-height: 1;
}

.history-photo-viewer__count {
  position: absolute;
  z-index: 2;
  top: calc(1rem + env(safe-area-inset-top));
  left: 50%;
  min-width: 3.6em;
  padding: .45rem .8rem;
  border-radius: 999px;
  background: rgb(5 5 5 / 78%);
  color: #fbfaf5;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  font-variant-numeric: tabular-nums;
  transform: translateX(-50%);
}

.history-photo-viewer__navigate { top: 50%; width: 3rem; height: 3rem; transform: translateY(-50%); }
.history-photo-viewer__navigate--previous { left: calc(.8rem + env(safe-area-inset-left)); }
.history-photo-viewer__navigate--next { right: calc(.8rem + env(safe-area-inset-right)); }
.history-photo-viewer__navigate svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5; }
.history-photo-viewer__close:hover,.history-photo-viewer__navigate:hover:not(:disabled) { background: #d59a18; color: #050505; }
.history-photo-viewer__navigate:disabled { opacity: .42; cursor: default; }
dialog.history-photo-viewer .history-photo-viewer__navigate[hidden] { display: none; }
.history-photo-viewer__close:focus-visible,.history-photo-viewer__navigate:focus-visible { outline: 3px solid #f0b62a; outline-offset: 3px; }

.history-photo-viewer__hint {
  position: absolute;
  z-index: 2;
  right: 1rem;
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  left: 1rem;
  display: flex;
  width: max-content;
  max-width: calc(100% - 2rem);
  align-items: center;
  justify-content: center;
  gap: .65rem;
  margin: 0 auto;
  padding: .65rem 1rem;
  border-radius: 999px;
  background: rgb(5 5 5 / 78%);
  color: #fbfaf5;
  font-size: .9rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(.35rem);
  transition: opacity 180ms ease, transform 180ms ease;
}

.history-photo-viewer__hint.is-visible { opacity: 1; transform: translateY(0); }
.history-photo-viewer__hint svg { width: 1.4rem; height: 1.4rem; flex: 0 0 auto; fill: none; stroke: #f0b62a; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
@keyframes history-photo-viewer-enter { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  html.mobile-phone-history-photo-viewer dialog.history-photo-viewer[open],
  .history-photo-viewer__hint,
  .history-photo-viewer__image { animation: none; transition: none; }
}
