/* Avyukta Collection Grid */
.acg-grid{
  --c:var(--acg-cols);
  display:grid;
  grid-template-columns:repeat(var(--c),minmax(0,1fr));
  gap:calc(var(--acg-gap) * 1.2) var(--acg-gap);
  align-items:start;
  margin:0;padding:0;
}
.acg-grid *,.acg-grid *::before,.acg-grid *::after{box-sizing:border-box}
.acg-item{min-width:0;margin:0;padding:0;list-style:none}
.acg-link{display:block;color:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent}
.acg-link:focus-visible{outline:2px solid var(--acg-border);outline-offset:4px;border-radius:6px}

/* ---- image stack: frame (border) > mat (gap) > img ---- */
.acg-media{display:block}
.acg-frame,.acg-mat,.acg-img{display:grid;min-width:0;min-height:0}
.acg-frame{aspect-ratio:var(--acg-ratio);padding:var(--acg-bw);background:var(--acg-frame-bg,var(--acg-border));width:100%}
.acg-mat{padding:var(--acg-pad);background:var(--acg-mat-bg,var(--acg-bg))}
.acg-img{position:relative;overflow:hidden;background:#efe9dc}
.acg-img img{
  position:absolute;inset:0;width:100%;height:100%;max-width:none;
  object-fit:cover;object-position:var(--acg-focus);
  margin:0!important;border-radius:0!important;
  transition:transform .5s ease;
}

/* ---- shapes (applied to all three layers so the border follows the shape) ---- */
.acg-shape-arch .acg-frame,.acg-shape-arch .acg-mat,.acg-shape-arch .acg-img{border-radius:999px 999px 6px 6px}
.acg-shape-tombstone .acg-frame,.acg-shape-tombstone .acg-mat,.acg-shape-tombstone .acg-img{border-radius:999px 999px 22px 22px}
.acg-shape-circle .acg-frame,.acg-shape-circle .acg-mat,.acg-shape-circle .acg-img{border-radius:50%}
.acg-shape-oval .acg-frame,.acg-shape-oval .acg-mat,.acg-shape-oval .acg-img{border-radius:50%}
.acg-shape-pill .acg-frame,.acg-shape-pill .acg-mat,.acg-shape-pill .acg-img{border-radius:999px}
.acg-shape-rounded .acg-frame,.acg-shape-rounded .acg-mat,.acg-shape-rounded .acg-img{border-radius:clamp(14px,12%,36px)}
.acg-shape-square .acg-frame,.acg-shape-square .acg-mat,.acg-shape-square .acg-img{border-radius:0}
.acg-shape-leaf .acg-frame,.acg-shape-leaf .acg-mat,.acg-shape-leaf .acg-img{border-radius:0 62% 0 62%}
.acg-shape-blob .acg-frame,.acg-shape-blob .acg-mat,.acg-shape-blob .acg-img{border-radius:63% 37% 54% 46% / 55% 48% 52% 45%}
.acg-shape-hexagon .acg-frame,.acg-shape-hexagon .acg-mat,.acg-shape-hexagon .acg-img{clip-path:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%)}
.acg-shape-octagon .acg-frame,.acg-shape-octagon .acg-mat,.acg-shape-octagon .acg-img{clip-path:polygon(30% 0,70% 0,100% 30%,100% 70%,70% 100%,30% 100%,0 70%,0 30%)}
.acg-shape-diamond .acg-frame,.acg-shape-diamond .acg-mat,.acg-shape-diamond .acg-img{clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%)}

/* ---- caption ---- */
.acg-caption{display:block;margin-top:12px;text-align:center;color:var(--acg-title,inherit);line-height:1.3}
.acg-align-left .acg-caption{text-align:left}
.acg-title{
  display:block;font-size:var(--acg-ts);line-height:1.3;font-family:var(--acg-font,inherit);font-style:var(--acg-fs,normal);font-weight:var(--acg-tw,400);text-transform:var(--acg-tt,none);
  overflow-wrap:anywhere;word-break:normal;hyphens:auto;text-wrap:balance;
}
.acg-sub{display:block;margin-top:3px;font-size:.72em;opacity:var(--acg-sub-op,.65);letter-spacing:.04em;color:var(--acg-sub,inherit);font-family:var(--acg-font,inherit)}
.acg-shape-diamond .acg-caption,.acg-shape-hexagon .acg-caption{margin-top:14px}

/* ---- designs ---- */
.acg-style-shadow .acg-media{filter:drop-shadow(0 10px 14px rgba(0,0,0,.22))}
.acg-style-card .acg-item{background:#fff;padding:10px 10px 14px;border-radius:18px;box-shadow:0 6px 22px rgba(60,40,10,.10)}
.acg-style-card .acg-caption{margin-top:10px}
.acg-style-overlay .acg-caption{
  position:absolute;left:0;right:0;bottom:0;margin:0;padding:34px 12px 14px;
  color:#fff;background:linear-gradient(to top,rgba(0,0,0,.65),rgba(0,0,0,0));
}
.acg-style-overlay .acg-sub{opacity:var(--acg-sub-op,.85)}
.acg-style-overlay.acg-shape-diamond .acg-caption,
.acg-style-overlay.acg-shape-hexagon .acg-caption{padding-bottom:22%}

/* ---- hover (only on devices that can hover) ---- */
@media (hover:hover) and (prefers-reduced-motion:no-preference){
  .acg-hover-zoom .acg-link:hover .acg-img img{transform:scale(1.07)}
  .acg-hover-lift .acg-item{transition:transform .3s ease}
  .acg-hover-lift .acg-item:hover{transform:translateY(-6px)}
}

/* ---- responsive ---- */
@media (max-width:1024px){
  .acg-grid{--c:var(--acg-cols-t)}
}
@media (max-width:640px){
  .acg-grid{--c:var(--acg-cols-m);gap:calc(var(--acg-gap) * .7) calc(var(--acg-gap) * .55)}
  .acg-title{font-size:var(--acg-tsm)}
  .acg-caption{margin-top:9px}
  .acg-m-scroll{
    grid-template-columns:none;
    grid-auto-flow:column;
    grid-auto-columns:calc((100% - (var(--c) - 1) * var(--acg-gap) * .55) / var(--c));
    overflow-x:auto;overflow-y:hidden;
    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-x:contain;
    scrollbar-width:none;
    padding-bottom:6px;
  }
  .acg-m-scroll::-webkit-scrollbar{display:none}
  .acg-m-scroll .acg-item{scroll-snap-align:start}
}

/* ---- forced device widths (used by the admin live preview only) ---- */
.acg-grid.acg-preview-t{--c:var(--acg-cols-t)}
.acg-grid.acg-preview-m{--c:var(--acg-cols-m);gap:calc(var(--acg-gap) * .7) calc(var(--acg-gap) * .55)}
.acg-preview-m .acg-title{font-size:var(--acg-tsm)}
.acg-preview-m .acg-caption{margin-top:9px}
.acg-m-scroll.acg-preview-m{
  grid-template-columns:none;
  grid-auto-flow:column;
  grid-auto-columns:calc((100% - (var(--c) - 1) * var(--acg-gap) * .55) / var(--c));
  overflow-x:auto;overflow-y:hidden;
  scroll-snap-type:x mandatory;
  scrollbar-width:none;
  padding-bottom:6px;
}
.acg-m-scroll.acg-preview-m .acg-item{scroll-snap-align:start}
