.history-memories .section-head{margin-bottom:clamp(24px,4vw,40px)}
.history-memories .section-head h2{color:var(--green)}
.history-gallery{columns:3;column-gap:clamp(12px,2vw,22px)}
.history-gallery-card{
  position:relative;
  display:block;
  width:100%;
  margin:0 0 clamp(12px,2vw,22px);
  padding:0;
  overflow:hidden;
  break-inside:avoid;
  border:1px solid rgba(91,58,43,.18);
  border-radius:16px;
  background:var(--green);
  box-shadow:0 10px 28px rgba(11,29,58,.14);
  cursor:zoom-in;
  opacity:0;
  transform:translateY(18px);
  transition:transform .6s cubic-bezier(.22,.68,0,1.05),opacity .5s ease,box-shadow .35s ease;
  transition-delay:var(--history-gallery-delay,0ms);
}
.history-gallery-card.is-visible{opacity:1;transform:translateY(0)}
.history-gallery-card img{display:block;width:100%;height:auto;transform:scale(1);transition:transform .6s cubic-bezier(.2,.7,.2,1)}
.history-gallery-overlay{
  position:absolute;
  inset:0;
  background:linear-gradient(to bottom,transparent 36%,rgba(11,29,58,.18) 58%,rgba(11,29,58,.86) 100%);
  opacity:0;
  transition:opacity .4s ease;
  pointer-events:none;
}
.history-gallery-copy{
  position:absolute;
  right:18px;
  bottom:18px;
  left:18px;
  display:grid;
  gap:5px;
  color:var(--paper);
  text-align:left;
  opacity:0;
  transform:translateY(12px);
  transition:opacity .4s ease,transform .4s cubic-bezier(.22,.68,0,1);
  pointer-events:none;
}
.history-gallery-caption{
  width:fit-content;
  max-width:100%;
  font-family:'Playfair Display',serif;
  font-size:clamp(1rem,1.6vw,1.2rem);
  line-height:1.28;
  text-wrap:pretty;
}
.history-gallery-caption::after{
  display:block;
  width:42px;
  height:1px;
  margin-top:8px;
  background:rgba(231,220,207,.75);
  content:"";
  transform:scaleX(0);
  transform-origin:left;
  transition:transform .4s ease .08s;
}
.history-gallery-place{font-size:.76rem;letter-spacing:.035em;color:rgba(231,220,207,.8)}
.history-gallery-place:empty{display:none}
.history-gallery-zoom{
  position:absolute;
  top:14px;
  right:14px;
  display:grid;
  width:36px;
  height:36px;
  place-items:center;
  border:1px solid rgba(231,220,207,.65);
  border-radius:50%;
  background:rgba(11,29,58,.38);
  color:var(--paper);
  font:300 1.5rem/1 'DM Sans',sans-serif;
  opacity:0;
  transform:scale(.88);
  transition:opacity .3s ease,transform .3s ease;
  pointer-events:none;
}
.history-gallery-card:focus-visible{outline:3px solid var(--paper);outline-offset:4px}
.history-gallery-card:focus-visible .history-gallery-overlay{opacity:1}
.history-gallery-card:focus-visible .history-gallery-copy{opacity:1;transform:translateY(0)}
.history-gallery-card:focus-visible .history-gallery-caption::after{transform:scaleX(1)}
.history-gallery-card:focus-visible .history-gallery-zoom{opacity:1;transform:scale(1)}
@media(hover:hover) and (pointer:fine){
  .history-gallery-card:hover{box-shadow:0 18px 38px rgba(11,29,58,.24)}
  .history-gallery-card:hover img{transform:scale(1.08)}
  .history-gallery-card:hover .history-gallery-overlay{opacity:1}
  .history-gallery-card:hover .history-gallery-copy{opacity:1;transform:translateY(0)}
  .history-gallery-card:hover .history-gallery-caption::after{transform:scaleX(1)}
  .history-gallery-card:hover .history-gallery-zoom{opacity:1;transform:scale(1)}
}
@media(max-width:850px){.history-gallery{columns:2}}
@media(hover:none),(pointer:coarse){
  .history-gallery-card{opacity:1;transform:none}
  .history-gallery-card img{transform:none}
  .history-gallery-overlay{inset:auto 0 0;height:clamp(58px,18vw,82px);opacity:1}
  .history-gallery-copy{right:12px;bottom:10px;left:12px;gap:0;opacity:1;transform:none}
  .history-gallery-caption{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1;font-size:.95rem}
  .history-gallery-caption::after{display:none}
  .history-gallery-place{font-size:.68rem}
  .history-gallery-zoom{top:9px;right:9px;width:32px;height:32px;opacity:.9;transform:none}
}
.history-lightbox{
  position:fixed;
  inset:0;
  display:flex;
  width:100vw;
  height:100vh;
  height:100dvh;
  max-width:none;
  max-height:none;
  margin:0;
  padding:clamp(20px,4vh,42px) clamp(18px,4vw,56px);
  overflow:hidden;
  border:0;
  border-radius:0;
  background:transparent;
  color:var(--paper);
  opacity:0;
  transform:scale(.985);
  transition:opacity .28s ease,transform .38s cubic-bezier(.22,.68,0,1);
}
.history-lightbox:not([open]){display:none}
.history-lightbox[open]{opacity:1;transform:scale(1)}
.history-lightbox[open].is-entering,
.history-lightbox[open].is-closing{opacity:0;transform:scale(.985)}
.history-lightbox::backdrop{background:rgba(11,29,58,.84)}
.history-lightbox-shade{position:absolute;inset:0;width:100%;height:100%;background:radial-gradient(ellipse at center,rgba(22,58,99,.32),rgba(11,29,58,.94));pointer-events:none}
.history-lightbox-close,.history-lightbox-nav{
  z-index:2;
  display:grid;
  place-items:center;
  flex:none;
  border:1px solid rgba(231,220,207,.42);
  background:rgba(11,29,58,.42);
  color:var(--paper);
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.history-lightbox-close{
  position:absolute;
  top:max(16px,env(safe-area-inset-top));
  right:max(18px,env(safe-area-inset-right));
  width:48px;
  height:48px;
  border-radius:50%;
  font:300 2rem/1 'DM Sans',sans-serif;
  transition:transform .3s ease,background .3s ease;
}
.history-lightbox-close:hover{transform:rotate(90deg);background:rgba(231,220,207,.18)}
.history-lightbox-close:focus-visible,.history-lightbox-nav:focus-visible,.history-lightbox-thumbnails button:focus-visible{outline:2px solid var(--paper);outline-offset:3px}
.history-lightbox-content{position:relative;z-index:1;display:flex;width:min(100%,1280px);height:100%;min-height:0;margin:auto;flex-direction:column;align-items:center;justify-content:center;gap:14px}
.history-lightbox-stage{position:relative;display:flex;width:100%;min-height:0;flex:1;align-items:center;justify-content:center}
.history-lightbox-image{display:block;width:auto;height:auto;max-width:92vw;max-height:78vh;object-fit:contain;border:1px solid rgba(231,220,207,.5);border-radius:12px;background:transparent;box-shadow:0 20px 70px rgba(0,0,0,.32);transition:transform .28s cubic-bezier(.22,.68,0,1),opacity .25s ease}
.history-lightbox-image.is-entering-next{opacity:0;transform:translateX(22px)}
.history-lightbox-image.is-entering-prev{opacity:0;transform:translateX(-22px)}
.history-lightbox-nav{position:absolute;top:50%;width:48px;height:48px;border-radius:50%;font:300 2.2rem/1 'DM Sans',sans-serif;transform:translateY(-50%);transition:transform .25s ease,background .25s ease}
.history-lightbox-prev{left:clamp(0px,2vw,26px)}
.history-lightbox-next{right:clamp(0px,2vw,26px)}
.history-lightbox-prev:hover{transform:translateY(-50%) scale(1.08);background:rgba(231,220,207,.18)}
.history-lightbox-next:hover{transform:translateY(-50%) scale(1.08);background:rgba(231,220,207,.18)}
.history-lightbox-info{position:relative;display:grid;width:min(100%,760px);min-height:66px;grid-template-columns:1fr auto;align-items:center;column-gap:18px;padding:12px 20px;border:1px solid rgba(231,220,207,.2);border-radius:14px;background:rgba(231,220,207,.1);backdrop-filter:blur(14px);transition:opacity .2s ease,transform .2s ease}
.history-lightbox-info.is-changing{opacity:0;transform:translateY(8px)}
.history-lightbox-caption{grid-column:1;margin:0;color:var(--paper);font:500 clamp(1.1rem,2vw,1.45rem)/1.3 'Playfair Display',serif}
.history-lightbox-place{grid-column:1;margin:4px 0 0;color:rgba(231,220,207,.8);font-size:.82rem}
.history-lightbox-place:empty{display:none}
.history-lightbox-count{grid-column:2;grid-row:1 / span 2;color:rgba(231,220,207,.84);font-size:.84rem;font-variant-numeric:tabular-nums;white-space:nowrap}
.history-lightbox-thumbnails{display:flex;width:min(100%,760px);min-height:62px;align-items:center;justify-content:center;gap:8px;overflow-x:auto;padding:2px 4px;scroll-behavior:smooth;scrollbar-width:thin;scrollbar-color:rgba(231,220,207,.55) transparent}
.history-lightbox-thumbnails button{width:54px;height:54px;flex:none;padding:0;overflow:hidden;border:1px solid rgba(231,220,207,.25);border-radius:8px;background:transparent;opacity:.62;cursor:pointer;transition:opacity .25s ease,transform .25s ease,border-color .25s ease}
.history-lightbox-thumbnails button:hover{opacity:1;transform:scale(1.06)}
.history-lightbox-thumbnails button[aria-current="true"]{border:2px solid var(--paper);opacity:1}
.history-lightbox-thumbnails img{width:100%;height:100%;object-fit:cover}
@media(min-width:901px){
  .history-lightbox-content{gap:22px}
  .history-lightbox-stage{flex:1 1 0;max-height:70vh}
  .history-lightbox-image{max-height:min(70vh,100%)}
  .history-lightbox-info{width:min(100%,720px);padding:16px 24px}
  .history-lightbox-caption{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3}
  .history-lightbox-thumbnails{min-height:78px;gap:11px;padding:8px 4px}
}
@media(max-width:700px){
  .history-lightbox{padding:calc(16px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left))}
  .history-lightbox-content{gap:10px}
  .history-lightbox-stage{flex:0 1 70dvh;min-height:0}
  .history-lightbox-image{max-width:94vw;max-height:70dvh;border-radius:10px}
  .history-lightbox-close{top:calc(8px + env(safe-area-inset-top));right:calc(10px + env(safe-area-inset-right));width:50px;height:50px}
  .history-lightbox-nav{width:44px;height:44px;background:rgba(11,29,58,.55)}
  .history-lightbox-prev{left:0}
  .history-lightbox-next{right:0}
  .history-lightbox-info{width:100%;min-height:0;max-height:22dvh;overflow-y:auto;grid-template-columns:1fr auto;column-gap:10px;padding:12px 14px}
  .history-lightbox-caption{font-size:1.08rem}
  .history-lightbox-place{font-size:.76rem}
  .history-lightbox-count{font-size:.78rem}
  .history-lightbox-thumbnails{display:none}
}
@media(max-width:380px){
  .history-gallery{column-gap:10px}
  .history-gallery-card{margin-bottom:10px;border-radius:12px}
  .history-gallery-copy{right:9px;bottom:8px;left:9px}
  .history-gallery-caption{font-size:.85rem}
  .history-gallery-zoom{width:28px;height:28px;font-size:1.25rem}
  .history-lightbox-nav{width:42px;height:42px}
}
@media(max-width:900px){
  .history-gallery-overlay,.history-gallery-copy,.history-gallery-zoom{display:none}
}
@media(prefers-reduced-motion:reduce){
  .history-gallery-card,.history-gallery-card img,.history-gallery-overlay,.history-gallery-copy,.history-gallery-caption::after,.history-gallery-zoom,
  .history-lightbox,.history-lightbox-close,.history-lightbox-nav,.history-lightbox-image,.history-lightbox-info,.history-lightbox-thumbnails button{
    transition:none!important;
    animation:none!important;
  }
}
