/* UltraKit Advanced Gallery — premium (agl) */
.ultrakit-agl { --a: #6c5ce7; --b: #00cec9; --ink: #14142b; --cols: 3; --cols-t: 2; --cols-m: 1; --gap: 16px; --r: 18px; --ratio: 4 / 3; --rowh: 250px; width: 100%; box-sizing: border-box; color: var(--ink); }
.ultrakit-agl *, .ultrakit-agl *::before, .ultrakit-agl *::after { box-sizing: border-box; }

/* ---------- Filter ---------- */
.agl-filter { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 34px; }
.ultrakit-agl .agl-filter button { appearance: none; border: 0; cursor: pointer; font: 700 14px/1 inherit; padding: 12px 22px; border-radius: 40px; background: #fff; color: var(--ink) !important; box-shadow: 0 6px 16px -8px rgba(20, 20, 60, .35), inset 0 0 0 1.5px #ececf6; transition: all .3s cubic-bezier(.22, .9, .3, 1); }
.ultrakit-agl .agl-filter button:hover { transform: translateY(-2px); }
.ultrakit-agl .agl-filter button.is-active { background: var(--ink); color: #fff !important; box-shadow: 0 12px 24px -10px rgba(20, 20, 60, .5); }
.ultrakit-agl .agl-fs-gradient button.is-active { color: #fff !important; background: linear-gradient(120deg, var(--a), var(--b)); box-shadow: 0 14px 26px -10px color-mix(in srgb, var(--a) 70%, transparent); }
.agl-fs-line { gap: 30px; }
.ultrakit-agl .agl-fs-line button { background: none; box-shadow: none; border-radius: 0; padding: 10px 2px; position: relative; opacity: .6; }
.ultrakit-agl .agl-fs-line button::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--a), var(--b)); transform: scaleX(0); transition: transform .35s cubic-bezier(.22, .9, .3, 1); }
.ultrakit-agl .agl-fs-line button.is-active { background: none; color: var(--ink) !important; opacity: 1; box-shadow: none; }
.ultrakit-agl .agl-fs-line button.is-active::after { transform: scaleX(1); }
.ultrakit-agl.is-dark .agl-filter button, .agl-on-dark .agl-filter button { }

/* ---------- Item / hit ---------- */
.agl-item { position: relative; margin: 0; min-width: 0; }
.agl-hit { appearance: none; display: block; position: relative; width: 100%; height: 100%; padding: 0; margin: 0; border: 0; background: none; text-align: left; font: inherit; color: inherit; text-decoration: none; cursor: zoom-in; border-radius: var(--r); overflow: hidden; outline: none; transition: transform .45s cubic-bezier(.22, .9, .3, 1), box-shadow .45s; -webkit-tap-highlight-color: transparent; }
.agl-item[data-link] .agl-hit { cursor: pointer; }
.agl-hit:focus-visible { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--a); }
.agl-media { display: block; width: 100%; height: 100%; overflow: hidden; border-radius: inherit; background: #ececf6; }
.agl-media img { display: block; width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; transition: transform .8s cubic-bezier(.22, .9, .3, 1), filter .5s; }

/* Layouts */
.agl-grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: var(--gap); }
.agl-l-grid .agl-media, .agl-l-film .agl-media, .agl-l-polaroid .agl-media { aspect-ratio: var(--ratio); height: auto; }
.agl-l-masonry .agl-grid { display: block; column-count: var(--cols); column-gap: var(--gap); }
.agl-l-masonry .agl-item { break-inside: avoid; margin-bottom: var(--gap); }
.agl-l-masonry .agl-media { height: auto; }
.agl-l-masonry .agl-media img { height: auto !important; }
.agl-l-justified .agl-grid { display: flex; flex-wrap: wrap; gap: var(--gap); }
.agl-l-justified .agl-grid::after { content: ""; flex-grow: 1000000; }
.agl-l-justified .agl-item { --ar: 1.5; flex: calc(var(--ar) * 100) 1 calc(var(--ar) * var(--rowh)); height: var(--rowh); }
.agl-l-bento .agl-grid { grid-auto-rows: clamp(150px, 15vw, 240px); grid-auto-flow: dense; }
.agl-l-bento .agl-item.is-big { grid-column: span 2; grid-row: span 2; }
.agl-l-film .agl-grid { display: flex; gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 10px 4px 24px; margin: -10px -4px -24px; cursor: grab; }
.agl-l-film .agl-grid::-webkit-scrollbar { display: none; }
.agl-l-film .agl-grid.is-grab { cursor: grabbing; scroll-snap-type: none; }
.agl-l-film .agl-item { flex: 0 0 clamp(240px, 30vw, 400px); scroll-snap-align: start; }
.agl-l-polaroid .agl-grid { gap: calc(var(--gap) + 10px); padding: 10px; }
.agl-l-polaroid .agl-hit { background: #fff; padding: 12px 12px 0; border-radius: 6px; box-shadow: 0 16px 34px -14px rgba(20, 20, 60, .4); }
.agl-l-polaroid .agl-media { border-radius: 3px; }
.agl-l-polaroid .agl-cap { position: absolute; left: 0; right: 0; bottom: 0; height: 62px; display: flex; align-items: center; justify-content: center; padding: 0 12px; pointer-events: none; }
.agl-l-polaroid .agl-cap b { font: 700 18px/1.2 "Segoe Print", "Bradley Hand", "Chalkboard SE", cursive; color: #33334f; }
.agl-l-polaroid .agl-hit { padding-bottom: 62px; }
.agl-l-polaroid .agl-item { transform: rotate(-1.8deg); transition: transform .4s cubic-bezier(.22, .9, .3, 1); }
.agl-l-polaroid .agl-item:nth-child(3n+2) { transform: rotate(1.6deg); }
.agl-l-polaroid .agl-item:nth-child(3n) { transform: rotate(-.6deg); }
.agl-l-polaroid .agl-item:hover { transform: rotate(0) scale(1.04); z-index: 3; }
.agl-l-polaroid .agl-ov, .agl-l-polaroid .agl-zoom { display: none; }

/* ---------- Hover effects ---------- */
.agl-ov { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 22px; color: #fff; pointer-events: none; }
.agl-tag { font-style: normal; align-self: flex-start; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 5px 11px; border-radius: 20px; background: linear-gradient(120deg, var(--a), var(--b)); margin-bottom: 6px; }
.agl-t { font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.agl-d { font-size: 13.5px; opacity: .85; line-height: 1.45; }
.agl-zoom { position: absolute; z-index: 2; right: 16px; top: 16px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .95); color: #14142b; display: flex; align-items: center; justify-content: center; pointer-events: none; opacity: 0; transform: scale(.6); transition: all .4s cubic-bezier(.22, .9, .3, 1); box-shadow: 0 10px 22px -6px rgba(0, 0, 0, .4); }

.agl-h-zoom .agl-ov { background: linear-gradient(180deg, transparent 35%, rgba(10, 10, 30, .85)); opacity: 0; transition: opacity .45s; }
.agl-h-zoom .agl-ov > * { transform: translateY(14px); transition: transform .5s cubic-bezier(.22, .9, .3, 1); }
.agl-h-zoom .agl-hit:hover .agl-ov, .agl-h-zoom .agl-hit:focus-visible .agl-ov { opacity: 1; }
.agl-h-zoom .agl-hit:hover .agl-ov > *, .agl-h-zoom .agl-hit:focus-visible .agl-ov > * { transform: none; }
.agl-h-zoom .agl-hit:hover img { transform: scale(1.09); }
.agl-h-zoom .agl-hit:hover .agl-zoom { opacity: 1; transform: none; }

.agl-h-panel .agl-ov { justify-content: flex-end; padding: 12px; }
.agl-h-panel .agl-ov::before { content: ""; position: absolute; left: 12px; right: 12px; bottom: 12px; height: 0; border-radius: calc(var(--r) - 6px); background: rgba(20, 20, 40, .55); -webkit-backdrop-filter: blur(14px) saturate(1.5); backdrop-filter: blur(14px) saturate(1.5); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); transition: height .5s cubic-bezier(.22, .9, .3, 1); }
.agl-h-panel .agl-ov > * { position: relative; margin-left: 14px; margin-right: 14px; opacity: 0; transform: translateY(20px); transition: all .5s cubic-bezier(.22, .9, .3, 1); }
.agl-h-panel .agl-tag { margin-top: 14px; }
.agl-h-panel .agl-ov > :last-child { margin-bottom: 14px; }
.agl-h-panel .agl-hit:hover .agl-ov::before { height: calc(100% - 24px); max-height: 130px; }
.agl-h-panel .agl-hit:hover .agl-ov > * { opacity: 1; transform: none; }
.agl-h-panel .agl-hit:hover img { transform: scale(1.05); }
.agl-h-panel .agl-zoom { display: none; }

.agl-h-center .agl-ov { align-items: center; justify-content: center; text-align: center; background: color-mix(in srgb, var(--a) 45%, rgba(10, 10, 30, .55)); opacity: 0; transition: opacity .4s; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.agl-h-center .agl-ov .agl-tag { align-self: center; background: rgba(255, 255, 255, .22); }
.agl-h-center .agl-d { display: none; }
.agl-h-center .agl-zoom { right: auto; top: auto; left: 50%; bottom: 18px; margin-left: -22px; }
.agl-h-center .agl-hit:hover .agl-ov { opacity: 1; }
.agl-h-center .agl-hit:hover .agl-zoom { opacity: 1; transform: none; }
.agl-h-center .agl-hit:hover img { transform: scale(1.08); }
.agl-h-center .agl-ov { padding-bottom: 60px; }

.agl-h-color .agl-media img { filter: grayscale(1) contrast(1.05); }
.agl-h-color .agl-hit:hover img, .agl-h-color .agl-hit:focus-visible img { filter: none; transform: scale(1.05); }
.agl-h-color .agl-ov { background: linear-gradient(180deg, transparent 55%, rgba(10, 10, 30, .75)); }
.agl-h-color .agl-d, .agl-h-color .agl-tag { display: none; }
.agl-h-color .agl-zoom { display: none; }

.agl-h-lift .agl-hit { box-shadow: 0 10px 24px -14px rgba(20, 20, 60, .35); }
.agl-h-lift .agl-hit:hover { transform: translateY(-8px); box-shadow: 0 30px 50px -18px rgba(20, 20, 60, .5); }
.agl-h-lift .agl-hit:hover img { transform: scale(1.04); }
.agl-h-lift .agl-ov { background: linear-gradient(180deg, transparent 60%, rgba(10, 10, 30, .7)); }
.agl-h-lift .agl-d, .agl-h-lift .agl-tag { display: none; }
.agl-h-lift .agl-zoom { display: none; }

.agl-h-below .agl-cap { display: flex; flex-direction: column; gap: 3px; padding: 14px 4px 4px; }
.agl-h-below .agl-cap b { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.agl-h-below .agl-cap span { font-size: 13.5px; color: #6b6b85; }
.agl-h-below .agl-hit:hover img { transform: scale(1.06); }
.agl-h-below .agl-hit { height: auto; }
.agl-h-below.agl-l-justified .agl-item { display: flex; flex-direction: column; height: auto; }
.agl-h-below.agl-l-justified .agl-media { height: var(--rowh); }
.agl-h-none .agl-hit { cursor: zoom-in; }

/* ---------- Reveal / filter / more ---------- */
.agl-ready.agl-reveal .agl-item { opacity: 0; transform: translateY(28px) scale(.98); }
.agl-ready.agl-reveal .agl-item.is-in { opacity: 1; transform: none; transition: opacity .7s ease, transform .8s cubic-bezier(.22, .9, .3, 1); transition-delay: calc(var(--i) * 55ms); }
.agl-ready.agl-reveal.agl-l-polaroid .agl-item, .agl-ready.agl-reveal.agl-l-polaroid .agl-item.is-in { transform: rotate(-1.8deg); }
.agl-ready.agl-reveal.agl-l-polaroid .agl-item:nth-child(3n+2), .agl-ready.agl-reveal.agl-l-polaroid .agl-item.is-in:nth-child(3n+2) { transform: rotate(1.6deg); }
.agl-ready.agl-reveal.agl-l-polaroid .agl-item:nth-child(3n), .agl-ready.agl-reveal.agl-l-polaroid .agl-item.is-in:nth-child(3n) { transform: rotate(-.6deg); }
.agl-ready.agl-reveal.agl-l-polaroid .agl-item.is-in:hover { transform: rotate(0) scale(1.04); }
.agl-item.is-hide, .agl-item.is-more { display: none !important; }
.agl-item.is-pop { animation: aglPop .55s cubic-bezier(.22, .9, .3, 1) both; animation-delay: calc(var(--n, 0) * 50ms); }
@keyframes aglPop { from { opacity: 0; transform: translateY(20px) scale(.96); } to { opacity: 1; transform: none; } }
.agl-more { display: flex; justify-content: center; margin-top: 38px; }
.agl-more.is-gone { display: none; }
.agl-more-btn { appearance: none; border: 0; cursor: pointer; font: 800 15px/1 inherit; color: #fff; padding: 17px 36px; border-radius: 40px; background: linear-gradient(120deg, var(--a), var(--b)); box-shadow: 0 18px 34px -14px color-mix(in srgb, var(--a) 70%, transparent); transition: transform .3s, box-shadow .3s; }
.agl-more-btn:hover { transform: translateY(-3px); box-shadow: 0 24px 40px -14px color-mix(in srgb, var(--a) 80%, transparent); }

/* ---------- Lightbox ---------- */
.agl-lb { --a: #6c5ce7; --b: #00cec9; position: fixed; inset: 0; z-index: 999999; display: flex; flex-direction: column; background: rgba(8, 8, 22, .94); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s; color: #fff; font-family: inherit; }
.agl-lb.is-open { opacity: 1; visibility: visible; }
.agl-lb *, .agl-lb *::before, .agl-lb *::after { box-sizing: border-box; }
.agl-lb-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; }
.agl-lb-count { font-size: 14px; font-weight: 800; letter-spacing: .08em; opacity: .8; }
.agl-lb-btn { appearance: none; border: 0; cursor: pointer; width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; display: flex; align-items: center; justify-content: center; transition: background .25s, transform .25s; padding: 0; }
.agl-lb-btn:hover { background: linear-gradient(135deg, var(--a), var(--b)); transform: scale(1.08); }
.agl-lb-btn svg { width: 22px; height: 22px; }
.agl-lb-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 84px; overflow: hidden; touch-action: pan-y; }
.agl-lb-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 14px; box-shadow: 0 40px 90px -20px rgba(0, 0, 0, .7); cursor: zoom-in; transition: transform .35s cubic-bezier(.22, .9, .3, 1), opacity .3s; user-select: none; -webkit-user-drag: none; }
.agl-lb-img.is-out { opacity: 0; transform: scale(.96); }
.agl-lb-img.is-zoom { transform: scale(1.9); cursor: zoom-out; }
.agl-lb-nav { position: absolute; top: 50%; margin-top: -23px; z-index: 2; }
.agl-lb-prev { left: 20px; } .agl-lb-next { right: 20px; }
.agl-lb-cap { text-align: center; padding: 14px 24px 6px; min-height: 66px; }
.agl-lb-cap b { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.agl-lb-cap span { display: block; margin-top: 3px; font-size: 14px; opacity: .7; }
.agl-lb-thumbs { display: flex; gap: 10px; justify-content: center; padding: 10px 24px 20px; overflow-x: auto; scrollbar-width: none; }
.agl-lb-thumbs::-webkit-scrollbar { display: none; }
.agl-lb-thumbs button { appearance: none; flex: 0 0 auto; width: 72px; height: 54px; padding: 0; border: 0; border-radius: 10px; overflow: hidden; cursor: pointer; opacity: .5; transition: opacity .25s, transform .25s, box-shadow .25s; background: #222; }
.agl-lb-thumbs button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.agl-lb-thumbs button:hover { opacity: .85; }
.agl-lb-thumbs button.is-active { opacity: 1; transform: translateY(-3px); box-shadow: 0 0 0 2.5px var(--b); }
body.agl-lb-lock { overflow: hidden; }

@media (max-width: 1024px) {
	.agl-grid { grid-template-columns: repeat(var(--cols-t), minmax(0, 1fr)); }
	.agl-l-masonry .agl-grid { display: block; column-count: var(--cols-t); }
	.agl-l-justified .agl-grid, .agl-l-film .agl-grid { display: flex; }
}
@media (max-width: 767px) {
	.agl-grid { grid-template-columns: repeat(var(--cols-m), minmax(0, 1fr)); }
	.agl-l-masonry .agl-grid { display: block; column-count: var(--cols-m); }
	.agl-l-justified .agl-grid, .agl-l-film .agl-grid { display: flex; }
	.agl-l-justified { --rowh: 170px !important; }
	.agl-l-bento .agl-grid { grid-auto-rows: 150px; }
	.agl-l-bento .agl-item.is-big { grid-column: span 2; grid-row: span 2; }
	.agl-l-film .agl-item { flex-basis: 78%; }
	.agl-filter { gap: 8px; } .agl-filter button { padding: 10px 16px; font-size: 13px; }
	.agl-lb-stage { padding: 0 12px; }
	.agl-lb-nav { top: auto; bottom: 8px; margin: 0; } .agl-lb-prev { left: 12px; } .agl-lb-next { right: 12px; }
	.agl-lb-thumbs { display: none; }
	.agl-hit .agl-zoom { display: none; }
	.agl-h-zoom .agl-ov, .agl-h-center .agl-ov { opacity: 1; }
	.agl-h-zoom .agl-ov > * { transform: none; }
	.agl-h-center .agl-ov { background: linear-gradient(180deg, transparent 50%, rgba(10, 10, 30, .75)); backdrop-filter: none; -webkit-backdrop-filter: none; justify-content: flex-end; align-items: flex-start; text-align: left; padding-bottom: 22px; }
}
@media (prefers-reduced-motion: reduce) { .agl-media img, .agl-hit, .agl-ov, .agl-ov > * { transition: none !important; } .agl-ready.agl-reveal .agl-item { opacity: 1; transform: none; } .agl-item.is-pop { animation: none; } }
