/* MOFT works made to order: the Deco picture frame (chocolate wood, salty caramel gilt rule, Intertítulo fans in the corners),
   its picture light and brass plaque, and the story's facts. Shared by Encargar (the gallery, paged) and Home (the two newest).
   Cards are drawn by works.js */
/* 1, 2 or 4 per row (never 3); a page with fewer works than the row holds sits centred */
.gal{display:flex;flex-wrap:wrap;justify-content:center;gap:var(--moft-space-7) var(--moft-space-5);margin:var(--moft-space-6) 0 0;padding:0;list-style:none}
.gal [hidden]{display:none !important}
.gal__item{display:flex;width:100%}
@media (min-width:600px){.gal__item{width:calc((100% - var(--moft-space-5)) / 2)}}
@media (min-width:1024px){.gal__item{width:calc((100% - 3 * var(--moft-space-5)) / 4)}}
/* pager: four works at a time; small arrows and a count, only when there are more */
.gal-pager{display:flex;align-items:center;justify-content:center;gap:var(--moft-space-4);margin-top:var(--moft-space-6)}
.gal-pager[hidden]{display:none}
.gal-pager__btn{display:grid;place-items:center;width:44px;height:44px;padding:0;border:2px solid var(--moft-cacao);border-radius:50%;background:var(--moft-salty-caramel);color:var(--moft-tiramisu);box-shadow:var(--sh-btn) var(--moft-chocolate-deep);cursor:pointer}
.gal-pager__btn svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
@media (hover:hover){.gal-pager__btn:hover{background:var(--moft-cacao);color:var(--moft-salty-caramel)}}
.gal-pager__btn:active{transform:translate(2px,4px);box-shadow:none}
.gal-pager__btn:disabled{background:transparent;border-color:var(--moft-chocolate-light);color:var(--moft-chocolate-light);box-shadow:none;cursor:default}
.gal-pager__btn:focus-visible{outline:3px solid var(--moft-caramelo);outline-offset:3px}
.gal-pager__n{min-width:5ch;text-align:center;font-family:var(--font-display);font-style:italic;font-weight:600;font-variation-settings:"SOFT" 100,"WONK" 1;font-size:18px;color:var(--moft-text-brand-on-light)}
.gal-card{position:relative;display:flex;flex-direction:column;align-items:center;width:100%;height:100%;padding-top:28px}

/* picture light: a hood on a short arm; off until the frame arrives, then it flickers on and the photo turns from sepia to colour */
.gal-card__lamp{position:absolute;z-index:3;top:0;left:50%;width:46%;height:16px;transform:translateX(-50%);background:var(--moft-cacao);border-radius:var(--moft-radius-pill)}
.gal-card__lamp::before{content:"";position:absolute;top:100%;left:calc(50% - 3px);width:6px;height:15px;background:var(--moft-cacao)}
.gal-card__lamp::after{content:"";position:absolute;left:8px;right:8px;bottom:3px;height:4px;border-radius:var(--moft-radius-pill);background:var(--moft-galleta-deep)}
.gal-card.is-lit .gal-card__lamp::after{background:var(--moft-crema);animation:enc-flick .5s steps(1)}
@keyframes enc-flick{0%,40%{background:var(--moft-galleta-deep)}20%,60%{background:var(--moft-crema)}}

/* the frame: chocolate wood, a salty caramel gilt rule, the Intertítulo fans in the corners, the photo on top */
.gal-card__frame{position:relative;display:block;width:100%;padding:20px;border:3px solid var(--moft-cacao);border-radius:var(--moft-radius-card);background:var(--moft-chocolate);box-shadow:var(--sh-panel) var(--moft-chocolate-deep);font:inherit;cursor:pointer;transition:transform .2s var(--moft-ease-out),box-shadow .2s var(--moft-ease-out)}
.gal-card__frame::before{content:"";position:absolute;inset:6px;border:2px solid var(--moft-salty-caramel);border-radius:14px;pointer-events:none}
.gal-fan{position:absolute;z-index:1;width:46px;height:46px;overflow:visible}
.gal-fan--tl{top:6px;left:6px}
.gal-fan--tr{top:6px;right:6px;transform:scaleX(-1)}
.gal-fan--bl{bottom:6px;left:6px;transform:scaleY(-1)}
.gal-fan--br{bottom:6px;right:6px;transform:scale(-1,-1)}
.gal-card__ph{position:relative;z-index:2;aspect-ratio:4/5;padding:0;border:3px solid var(--moft-cacao);border-radius:var(--moft-radius-small)}
.gal-card__ph img{filter:sepia(1) saturate(.7);transition:filter 1.2s var(--moft-ease-out) .15s}
.gal-card.is-lit .gal-card__ph img{filter:saturate(1.12)}
@media (hover:hover){.gal-card__frame:hover{transform:translate(-2px,-3px);box-shadow:7px 9px 0 var(--moft-chocolate-deep)}}
.gal-card__frame:active{transform:translate(5px,6px);box-shadow:none}
.gal-card__frame:focus-visible{outline:3px solid var(--moft-caramelo);outline-offset:4px}

/* brass plaque under the frame, two screws */
.gal-card__plaque{position:relative;z-index:3;flex:1;display:flex;flex-direction:column;align-items:center;gap:4px;width:calc(100% - 44px);margin-top:-26px;padding:12px 24px 14px;background:var(--moft-salty-caramel);border:3px solid var(--moft-cacao);border-radius:var(--moft-radius-small);box-shadow:var(--sh-pill) var(--moft-chocolate-deep);text-align:center}
.gal-card__plaque::before,.gal-card__plaque::after{content:"";position:absolute;top:10px;width:7px;height:7px;border-radius:50%;background:var(--moft-cacao)}
.gal-card__plaque::before{left:9px}.gal-card__plaque::after{right:9px}
.gal-card__plaque .t-label{color:var(--moft-chocolate)}
.gal-card__t{font-weight:900;font-size:19px;line-height:1.2;color:var(--moft-tiramisu);text-wrap:balance}
.gal-card__plaque .t-small{color:var(--moft-chocolate)}
.gal-card__more{margin-top:auto;padding-top:var(--moft-space-2);color:var(--moft-tiramisu)}

/* the news inside the window: the facts as small pills, then the story */
.work-facts{display:flex;flex-wrap:wrap;gap:var(--moft-space-2);margin:0;padding:0;list-style:none}
.work-facts li{padding:6px 12px;border:2px solid var(--moft-galleta-deep);border-radius:var(--moft-radius-pill);background:var(--moft-galleta-light);font-size:var(--moft-size-small);font-weight:700;line-height:1.3}
.work-facts b{margin-right:4px;font-size:var(--moft-size-label);font-weight:900;letter-spacing:.08em;text-transform:uppercase;color:var(--moft-chocolate)}
.work-lead{font-family:var(--font-display);font-style:italic;font-weight:600;font-variation-settings:"SOFT" 100,"WONK" 1;font-size:19px;line-height:1.45;color:var(--moft-text-brand-on-light)}

/* Home: the four newest works in a rail that slides sideways. The rail never shows part of a frame: each frame is
   exactly half of it (one whole frame on phones), it snaps frame by frame, and the strip on the right (narrower than the
   gap, so the next frame never shows there) only leaves room for the frames' hard shadow.
   Phones and tablets: title, rail, arrows, the button. From 1024px the title, line and button take the left column and
   the rail and its arrows the right. The arrows turn it one frame at a time (works.js) */
.gal-home{display:grid;grid-template-areas:"intro" "list" "nav" "more";align-items:start}
.gal-home__intro{grid-area:intro;margin-bottom:var(--moft-space-5)}
.gal-home__lead{margin-top:var(--moft-space-2);max-width:36ch;font-family:var(--font-display);font-style:italic;font-weight:600;font-variation-settings:"SOFT" 100,"WONK" 1;font-size:19px;line-height:1.45;color:var(--moft-text-brand-on-light)}
.gal--home{--gap:var(--moft-space-5);grid-area:list;flex-wrap:nowrap;justify-content:flex-start;gap:var(--gap);margin:0;padding:0 10px var(--moft-space-3) 0;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;overscroll-behavior-x:contain}
.gal--home::-webkit-scrollbar{display:none}
.gal--home .gal__item{flex:0 0 auto;width:100%;scroll-snap-align:start}
.gal-home__nav{grid-area:nav;display:flex;justify-content:center;gap:var(--moft-space-3);margin-top:var(--moft-space-4)}
.gal-home__nav[hidden]{display:none}
.gal-home__more{grid-area:more;display:flex;justify-content:center;margin-top:var(--moft-space-5)}
@media (min-width:600px){.gal--home .gal__item{width:calc((100% - var(--gap)) / 2)}}
@media (min-width:1024px){
  .gal-home{grid-template-columns:minmax(0,1fr) minmax(0,2fr);grid-template-rows:1fr auto auto 1fr auto;grid-template-areas:". list" "intro list" "more list" ". list" ". nav";column-gap:var(--moft-space-7)}
  .gal-home__intro{margin:0}
  .gal-home__more{justify-content:flex-start}
}

@media (prefers-reduced-motion:reduce){
  .gal-card__ph img{filter:saturate(1.12);transition:none}
  .gal-card__frame{transition:none}
  .gal-card.is-lit .gal-card__lamp::after{animation:none}
}
