.zmpg { --a: var(--zm-accent, #ff7a00); --m: var(--zm-muted, #555); --c: var(--zm-card, #f1f1f2); font-family: inherit; }
.zmpg * { box-sizing: border-box; }
.zmpg-hint { text-align: center; color: var(--m); font-size: 14px; padding: 20px; background: var(--zm-surface, #fff); border-radius: 14px; }

/* filters */
.zmpg-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 26px; }
.zmpg-filters button { border: 0; cursor: pointer; font: inherit; font-size: 14px; font-weight: 500; padding: 8px 20px; border-radius: 999px; background: var(--zm-surface, #fff); color: var(--zm-text, #222); box-shadow: 3px 3px 9px rgba(0,0,0,.08); transition: background .2s, color .2s, transform .2s; }
.zmpg-filters button:hover { transform: translateY(-2px); }
.zmpg-filters button.is-on { background: var(--a); color: #fff; box-shadow: 0 8px 18px color-mix(in srgb, var(--a) 30%, transparent); }

/* portfolio grid */
.zmpg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.zmpg-item { -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%); border: 1px solid var(--zm-line, transparent); background: var(--zm-surface, #fff); border-radius: 20px; overflow: hidden; box-shadow: var(--zm-shadow, 5px 5px 14px rgba(0,0,0,.08), -4px -4px 12px rgba(255,255,255,.9)); display: flex; flex-direction: column; transition: transform .3s ease, box-shadow .3s ease; }
.zmpg-item:hover { transform: translateY(-5px); box-shadow: var(--zm-shadow-hover, 10px 14px 26px rgba(0,0,0,.12), -4px -4px 12px rgba(255,255,255,.9)); }
.zmpg-item.is-hide { display: none; }
.zmpg-item.zmpg-pop { animation: zmpgPop .45s ease both; }
@keyframes zmpgPop { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
.zmpg-thumb { display: block; position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--c); }
.zmpg-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; transition: object-position 3.5s ease, transform .6s ease; }
.zmpg-item:hover .zmpg-thumb img { object-position: bottom; }
.zmpg-noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 48px; font-weight: 700; color: var(--a); }
.zmpg-ov { position: absolute; inset: 0; background: color-mix(in srgb, var(--a) 18%, transparent); opacity: 0; transition: opacity .3s; display: flex; align-items: center; justify-content: center; }
.zmpg-ov i { width: 48px; height: 48px; border-radius: 50%; background: var(--a); color: #fff; font-style: normal; font-size: 22px; display: flex; align-items: center; justify-content: center; transform: scale(.6); transition: transform .35s cubic-bezier(.3,1.6,.5,1); }
.zmpg-item:hover .zmpg-ov { opacity: 1; }
.zmpg-item:hover .zmpg-ov i { transform: scale(1); }
.zmpg-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.zmpg-body h3 { font-size: 18px; font-weight: 600; line-height: 1.3; margin: 0; color: inherit; }
.zmpg-body p { font-size: 14px; color: var(--m); margin: 0; line-height: 1.5; }
.zmpg-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.zmpg-chips span { font-size: 11.5px; padding: 3px 10px; border-radius: 999px; background: var(--c); color: var(--zm-muted, #444); }
.zmpg-link { margin-top: auto; padding-top: 8px; font-size: 14px; font-weight: 600; color: var(--a); text-decoration: none; }
.zmpg-link:hover { text-decoration: underline; }

/* gallery (masonry) */
.zmpg-gallery { column-width: 230px; column-gap: 16px; }
.zmpg-g { border: 1px solid var(--zm-line, transparent); break-inside: avoid; margin: 0 0 16px; border-radius: 18px; overflow: hidden; position: relative; background: var(--zm-surface, #fff); box-shadow: var(--zm-shadow, 5px 5px 14px rgba(0,0,0,.08), -4px -4px 12px rgba(255,255,255,.9)); }
.zmpg-g a { display: block; position: relative; }
.zmpg-g img { width: 100%; height: auto; display: block; transition: transform .6s ease; }
.zmpg-g:hover img { transform: scale(1.06); }
.zmpg-g figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 12px; color: #fff; font-size: 13.5px; background: linear-gradient(transparent, rgba(0,0,0,.65)); opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; }
.zmpg-g:hover figcaption { opacity: 1; transform: none; }

/* reveal (added by JS) */
.zmpg-pre { opacity: 0; transform: translateY(24px); }
.zmpg-in { opacity: 1; transform: none; transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); transition-delay: var(--zd, 0ms); }

/* lightbox */
.zmpg-lb { position: fixed; inset: 0; z-index: 99999; background: rgba(10,10,14,.92); display: none; align-items: center; justify-content: center; flex-direction: column; padding: 30px 60px; }
.zmpg-lb.is-open { display: flex; animation: zmpgFade .25s ease; }
@keyframes zmpgFade { from { opacity: 0; } to { opacity: 1; } }
.zmpg-lb img { max-width: 100%; max-height: 82vh; border-radius: 12px; display: block; }
.zmpg-lb p { color: #ddd; margin: 12px 0 0; font-size: 14px; text-align: center; }
.zmpg-lb button { position: absolute; border: 0; background: rgba(255,255,255,.12); color: #fff; width: 44px; height: 44px; border-radius: 50%; font-size: 26px; line-height: 1; cursor: pointer; transition: background .2s; }
.zmpg-lb button:hover { background: var(--a, #ff7a00); }
.zmpg-lb-x { top: 18px; right: 18px; }
.zmpg-lb-p { left: 12px; top: 50%; margin-top: -22px; }
.zmpg-lb-n { right: 12px; top: 50%; margin-top: -22px; }

@media (max-width: 600px) {
  .zmpg-grid { grid-template-columns: 1fr; }
  .zmpg-gallery { column-width: 150px; column-gap: 10px; }
  .zmpg-lb { padding: 20px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .zmpg-pre, .zmpg-in { opacity: 1 !important; transform: none !important; transition: none !important; }
  .zmpg-item, .zmpg-thumb img, .zmpg-g img { transition: none !important; }
}
