/* ANDALUS_PHOTOS_V1 (19 Oct 2026) — one photo engine for the whole site (see andalus-photos-v1.js).
   Card gallery (.anp-gal) + full-screen viewer (.anp-lb). Text never under 13px.
   Pages tune it with custom properties on the gallery or its parent:
     --anp-ratio (box shape, default 1/1), --anp-bg (box background), --anp-radius, --anp-fit. */

/* ---------- Card gallery ---------- */
.anp-gal{position:relative;min-width:0}
.anp-gal__box{
  position:relative;aspect-ratio:var(--anp-ratio,1/1);overflow:hidden;
  background:var(--anp-bg,#f7f4f0);border-radius:var(--anp-radius,0);cursor:zoom-in;
}
.anp-gal__track{
  display:flex;width:100%;height:100%;overflow-x:auto;overflow-y:hidden;
  scroll-snap-type:x mandatory;scrollbar-width:none;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;
}
.anp-gal__track::-webkit-scrollbar{display:none}
.anp-gal.is-single .anp-gal__track{overflow:hidden}
/* overflow:hidden keeps any hover zoom on the photo from showing the next photo's edge */
.anp-gal__slide{position:relative;flex:0 0 100%;width:100%;height:100%;margin:0;overflow:hidden;scroll-snap-align:center;scroll-snap-stop:always}
.anp-gal__slide img:not(.anp-gal__bg){position:relative;z-index:1}
/* Optional blurred copy behind the photo (data-anp-backdrop), so mixed photo shapes fill the box. */
.anp-gal .anp-gal__slide .anp-gal__bg{position:absolute!important;z-index:0;inset:-12%;width:124%!important;height:124%!important;max-width:none;padding:0;object-fit:cover;filter:blur(22px) saturate(1.05);opacity:.6;pointer-events:none}
.anp-gal__slide img{display:block;width:100%!important;height:100%!important;max-width:none!important;object-fit:var(--anp-fit,contain);padding:var(--anp-pad,6px)}
.anp-gal__empty{display:grid;place-items:center;width:100%;height:100%;padding:16px;font-size:14px;font-weight:700;color:#7a675d;text-align:center}
.anp-gal__count{
  /* "1 / 6" reads left to right; logical insets follow the element's own direction, so the
     corner is a physical side (the site is right to left). */
  position:absolute;z-index:3;right:10px;bottom:10px;direction:ltr;pointer-events:none;
  font-size:13px;font-weight:800;line-height:1;color:#fff;background:rgba(20,18,24,.72);border-radius:999px;padding:6px 10px;
}
.anp-gal__zoom{
  position:absolute;z-index:3;left:10px;bottom:10px;display:inline-flex;align-items:center;gap:6px;
  min-height:34px;padding:0 11px;border:0;border-radius:999px;background:rgba(255,255,255,.94);color:#231713;
  font-family:inherit;font-size:13px;font-weight:800;line-height:1;cursor:pointer;box-shadow:0 4px 14px rgba(0,0,0,.14);
}
.anp-gal__zoom svg{width:15px;height:15px;flex:0 0 15px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.anp-gal__nav{display:none}
/* Dots sit on the photo (bottom middle), so every card keeps the same height. */
.anp-gal__dots{
  position:absolute;z-index:3;left:50%;bottom:20px;transform:translateX(-50%);pointer-events:none;
  display:flex;justify-content:center;gap:5px;padding:5px 7px;border-radius:999px;background:rgba(20,18,24,.38);
}
.anp-gal__dots span{width:6px;height:6px;border-radius:999px;background:rgba(255,255,255,.6);transition:width .2s ease,background-color .2s ease}
.anp-gal__dots span.is-on{width:16px;background:#fff}
@media (max-width:330px){.anp-gal__dots{display:none}}
[data-anp-gallery]:not(.anp-gal){cursor:zoom-in}

/* ---------- Full-screen viewer ---------- */
html.anp-lock,html.anp-lock body{overflow:hidden!important}
.anp-lb{
  position:fixed;inset:0;z-index:2147483000;display:flex;flex-direction:column;
  background:#111014;color:#fff;font-family:inherit;direction:rtl;
}
.anp-lb[hidden]{display:none!important}
.anp-lb:focus{outline:0}
.anp-lb *{box-sizing:border-box}
.anp-lb [hidden]{display:none!important}
/* Only the photo shrinks on short screens; the strip and the buttons keep their size. */
.anp-lb__top,.anp-lb__thumbs,.anp-lb__bottom{flex:0 0 auto}
.anp-lb__top{display:flex;align-items:center;gap:12px;padding:calc(env(safe-area-inset-top,0px) + 10px) 14px 10px}
.anp-lb .anp-lb__close{
  flex:0 0 44px;width:44px;height:44px;padding:0;border-radius:50%;border:0!important;box-shadow:none!important;outline:0;cursor:pointer;
  background:rgba(255,255,255,.14)!important;color:#fff!important;font-size:20px;font-family:inherit;line-height:1;
}
.anp-lb__title{flex:1 1 auto;min-width:0;margin:0;line-height:1.35}
.anp-lb__title strong{display:block;font-size:17px;font-weight:900}
.anp-lb__title span{display:block;font-size:13px;font-weight:700;opacity:.75}
.anp-lb__counter{flex:0 0 auto;font-size:15px;font-weight:800;opacity:.9;direction:ltr}
.anp-lb__stage{position:relative;flex:1 1 auto;min-height:0}
.anp-lb__track{display:flex;width:100%;height:100%;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scrollbar-width:none;overscroll-behavior:contain}
.anp-lb__track::-webkit-scrollbar{display:none}
.anp-lb__slide{
  flex:0 0 100%;width:100%;height:100%;display:flex;align-items:center;justify-content:center;
  overflow:hidden;scroll-snap-align:center;scroll-snap-stop:always;touch-action:manipulation;cursor:zoom-in;
}
.anp-lb__slide img{display:block;max-width:100%;max-height:100%;object-fit:contain;-webkit-user-select:none;user-select:none;-webkit-user-drag:none}
.anp-lb__slide.is-zoomed{display:block;overflow:auto;direction:ltr;overscroll-behavior:contain;touch-action:pan-x pan-y;cursor:zoom-out}
.anp-lb__slide.is-zoomed img{max-width:none;max-height:none;width:220%;height:auto}
.anp-lb__nav{display:none}
/* Photo strip: whole photos (contain), never cropped and never cut at the bottom. */
.anp-lb__thumbs{display:flex;gap:8px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;padding:10px 14px 8px;scroll-padding-inline:14px}
.anp-lb__thumbs::-webkit-scrollbar{display:none}
.anp-lb .anp-lb__thumb{
  flex:0 0 60px;width:60px;height:60px;padding:2px;border:0;border-radius:10px;overflow:hidden;cursor:pointer;
  background:#24222a;opacity:.6;box-shadow:inset 0 0 0 2px transparent;transition:opacity .15s ease,box-shadow .15s ease;
}
.anp-lb__thumb img{display:block;width:100%;height:100%;object-fit:contain;border-radius:8px}
/* Centered when they fit, still scrollable from the first photo when they don't. */
.anp-lb__thumb:first-child{margin-inline-start:auto}
.anp-lb__thumb:last-child{margin-inline-end:auto}
.anp-lb .anp-lb__thumb.is-on{opacity:1;box-shadow:inset 0 0 0 2px #fff}
.anp-lb__bottom{display:grid;justify-items:center;gap:8px;padding:6px 14px calc(env(safe-area-inset-bottom,0px) + 12px)}
.anp-lb__hint{margin:0;font-size:13px;line-height:1.5;text-align:center;opacity:.72}
.anp-only-mouse{display:none}
.anp-lb__action{
  display:flex;align-items:center;justify-content:center;gap:8px;width:100%;max-width:440px;min-height:52px;padding:0 16px;
  border-radius:14px;border:0;font-family:inherit;font-size:17px;font-weight:900;text-decoration:none!important;cursor:pointer;
}
.anp-lb__action--wa{background:#128c4a;color:#fff!important}
.anp-lb__action--wa svg{width:22px;height:22px;flex:0 0 22px;fill:currentColor}
.anp-lb__action--toggle{background:#fff;color:#24160f}
.anp-lb__action--toggle[aria-pressed="true"]{background:#128c4a;color:#fff}
.anp-lb button:focus-visible,.anp-lb a:focus-visible{outline:3px solid #f0b75a;outline-offset:2px}

@media (hover:hover) and (pointer:fine){
  .anp-gal__nav{
    display:grid;place-items:center;position:absolute;top:50%;z-index:4;transform:translateY(-50%);
    width:40px;height:40px;padding:0;border:0;border-radius:50%;cursor:pointer;
    background:rgba(255,255,255,.94);color:#231713;box-shadow:0 6px 18px rgba(0,0,0,.16);opacity:0;transition:opacity .15s ease;
  }
  .anp-gal:hover .anp-gal__nav,.anp-gal__nav:focus-visible{opacity:1}
  .anp-gal__nav:disabled{opacity:0!important;pointer-events:none}
  .anp-gal__nav--prev{right:10px}
  .anp-gal__nav--next{left:10px}
  .anp-gal__nav svg,.anp-lb__nav svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
  .anp-lb__nav{
    display:grid;place-items:center;position:absolute;top:50%;z-index:4;transform:translateY(-50%);
    width:48px;height:48px;padding:0;border:0;border-radius:50%;cursor:pointer;background:rgba(255,255,255,.16);color:#fff;
  }
  .anp-lb__nav:disabled{opacity:0;pointer-events:none}
  .anp-lb__nav--prev{right:14px}
  .anp-lb__nav--next{left:14px}
  .anp-only-touch{display:none}
  .anp-only-mouse{display:inline}
}
@media (min-width:1101px){
  .anp-gal__zoom{font-size:15px;min-height:38px}
  .anp-lb__title span,.anp-lb__hint{font-size:15px}
  .anp-lb .anp-lb__thumb{flex-basis:68px;width:68px;height:68px}
}
@media (prefers-reduced-motion:reduce){
  .anp-gal__track,.anp-lb__track{scroll-behavior:auto}
  .anp-gal__dots span,.anp-lb .anp-lb__thumb{transition:none}
}
