.mpg { --mpg-cols: 4; --mpg-cols-t: 3; --mpg-cols-m: 2; --mpg-gap: 10px; --mpg-radius: 6px; --mpg-ratio: 1 / 1; margin: 2rem 0; }
.mpg *, .mpg *::before, .mpg *::after { box-sizing: border-box; }
.mpg-note { margin-bottom: 1rem; padding: .6rem .9rem; border-radius: 6px; background: #fff7e6; color: #8a5a00; font-size: .875rem; }
.mpg-head { margin-bottom: 1.25rem; }
.mpg-title { margin: 0 0 .5rem; }
.mpg-desc > :last-child { margin-bottom: 0; }

.mpg-items { display: grid; grid-template-columns: repeat(var(--mpg-cols), minmax(0, 1fr)); gap: var(--mpg-gap); }
.mpg-t-masonry .mpg-items { display: block; column-count: var(--mpg-cols); column-gap: var(--mpg-gap); }
.mpg-t-masonry .mpg-item { break-inside: avoid; margin-bottom: var(--mpg-gap); }
@media (max-width: 1024px) {
    .mpg-items { grid-template-columns: repeat(var(--mpg-cols-t), minmax(0, 1fr)); }
    .mpg-t-masonry .mpg-items { column-count: var(--mpg-cols-t); }
}
@media (max-width: 640px) {
    .mpg-items { grid-template-columns: repeat(var(--mpg-cols-m), minmax(0, 1fr)); }
    .mpg-t-masonry .mpg-items { column-count: var(--mpg-cols-m); }
}

.mpg-item { position: relative; margin: 0; min-width: 0; }
.mpg-link { display: block; color: inherit; text-decoration: none; }
.mpg-media { position: relative; display: block; overflow: hidden; border-radius: var(--mpg-radius); background: rgba(127, 127, 127, .12) center / cover no-repeat; aspect-ratio: var(--mpg-ratio); }
.mpg-ratio-auto .mpg-media, .mpg-t-masonry .mpg-media { aspect-ratio: auto; }
.mpg-media picture { display: contents; }
.mpg-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease, filter .45s ease, opacity .35s ease; }
.mpg-ratio-auto .mpg-media img, .mpg-t-masonry .mpg-media img { height: auto; }
.mpg-fit-contain .mpg-media img { object-fit: contain; }

.mpg-media video { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; background: #111; }
.mpg-ratio-auto .mpg-media video, .mpg-t-masonry .mpg-media video { height: auto; aspect-ratio: 16 / 9; }
.mpg-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: .25rem; width: 100%; height: 100%; min-height: 140px; padding: 1rem; background: linear-gradient(135deg, #1f2937, #111827); color: #fff; text-align: center; font-size: .85rem; }
.mpg-ratio-auto .mpg-placeholder, .mpg-t-masonry .mpg-placeholder { aspect-ratio: 16 / 9; height: auto; }
.mpg-placeholder > span { opacity: .7; text-transform: uppercase; letter-spacing: .05em; font-size: .7rem; }
.mpg-placeholder strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mpg-play { position: absolute; top: 50%; left: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: rgba(0, 0, 0, .6); box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); transition: transform .2s, background .2s; }
.mpg-play::after { content: ""; position: absolute; top: 50%; left: 50%; margin: -11px 0 0 -7px; border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent #fff; }
.mpg-link:hover .mpg-play { transform: scale(1.08); background: rgba(0, 0, 0, .8); }
.mpg-placeholder ~ .mpg-play { top: 42%; }
.mpg-hover-zoom .mpg-link:hover img { transform: scale(1.06); }
.mpg-hover-darken .mpg-link:hover img { filter: brightness(.7); }
.mpg-hover-grayscale .mpg-media img { filter: grayscale(1); }
.mpg-hover-grayscale .mpg-link:hover img { filter: none; }
.mpg-link:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: var(--mpg-radius); }

.mpg-cap { padding: .5rem .1rem 0; font-size: .9rem; line-height: 1.4; }
.mpg-cap strong { display: block; }
.mpg-cap span { display: block; opacity: .75; }
.mpg-cap-hover .mpg-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: .75rem; border-radius: 0 0 var(--mpg-radius) var(--mpg-radius); background: linear-gradient(transparent, rgba(0, 0, 0, .75)); color: #fff; opacity: 0; transition: opacity .3s; pointer-events: none; }
.mpg-cap-hover .mpg-item:hover .mpg-cap, .mpg-cap-hover .mpg-link:focus-visible + .mpg-cap { opacity: 1; }
.mpg-t-masonry.mpg-cap-hover .mpg-cap { bottom: 0; }

/* Satır doldurma (justified): her satır aynı yükseklikte, genişlik görselin oranına göre */
.mpg-t-justified .mpg-items { display: flex; flex-wrap: wrap; gap: var(--mpg-gap); }
.mpg-t-justified .mpg-items::after { content: ""; flex-grow: 999999; }
.mpg-t-justified .mpg-item { flex: var(--mpg-ar) 1 calc(var(--mpg-ar) * var(--mpg-row)); }
.mpg-t-justified .mpg-media { aspect-ratio: var(--mpg-ar); }
@media (max-width: 1024px) { .mpg-t-justified .mpg-item { flex-basis: calc(var(--mpg-ar) * var(--mpg-row) * .8); } }
@media (max-width: 640px) { .mpg-t-justified .mpg-item { flex-basis: calc(var(--mpg-ar) * var(--mpg-row) * .55); } }

/* Kaydırıcı */
.mpg-track { position: relative; }
.mpg-t-slider .mpg-items { display: flex; gap: var(--mpg-gap); overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; overscroll-behavior-x: contain; }
.mpg-t-slider .mpg-items::-webkit-scrollbar { display: none; }
.mpg-t-slider .mpg-item { flex: 0 0 calc((100% - (var(--mpg-cols) - 1) * var(--mpg-gap)) / var(--mpg-cols)); scroll-snap-align: start; }
@media (max-width: 1024px) { .mpg-t-slider .mpg-item { flex-basis: calc((100% - (var(--mpg-cols-t) - 1) * var(--mpg-gap)) / var(--mpg-cols-t)); } }
@media (max-width: 640px) { .mpg-t-slider .mpg-item { flex-basis: calc((100% - (var(--mpg-cols-m) - 1) * var(--mpg-gap)) / var(--mpg-cols-m)); } }
.mpg-nav { position: absolute; top: 50%; z-index: 2; width: 40px; height: 40px; margin-top: -20px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.mpg-nav:hover { background: rgba(0, 0, 0, .8); }
.mpg-prev { left: 8px; }
.mpg-next { right: 8px; }
.mpg-nav[disabled] { opacity: 0; pointer-events: none; }
.mpg-t-slider .mpg-cap { min-height: 2.6em; }

/* Büyük görsel + şerit */
.mpg-stage { margin-bottom: var(--mpg-gap); }
.mpg-stage-open { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: var(--mpg-radius); overflow: hidden; background: rgba(127, 127, 127, .12); cursor: zoom-in; aspect-ratio: var(--mpg-ratio, 16 / 9); }
.mpg-ratio-auto .mpg-stage-open { aspect-ratio: 16 / 9; }
.mpg-stage-open img { display: block; width: 100%; height: 100%; object-fit: contain; }
.mpg-stage-cap { padding: .6rem .1rem 0; line-height: 1.45; }
.mpg-stage-cap strong { display: block; }
.mpg-stage-cap span { opacity: .75; }
.mpg-stage-cap:empty { display: none; }
.mpg-t-strip .mpg-items { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.mpg-t-strip .mpg-item { flex: 0 0 110px; }
.mpg-t-strip .mpg-media { aspect-ratio: 1 / 1; opacity: .6; transition: opacity .2s; }
.mpg-t-strip .mpg-item.is-on .mpg-media, .mpg-t-strip .mpg-link:hover .mpg-media { opacity: 1; }
.mpg-t-strip .mpg-item.is-on .mpg-media { box-shadow: 0 0 0 2px currentColor inset; }
.mpg-t-strip .mpg-play { transform: scale(.6); }
@media (max-width: 640px) { .mpg-t-strip .mpg-item { flex-basis: 80px; } }

/* Liste */
.mpg-t-list .mpg-items { grid-template-columns: 1fr !important; }
.mpg-t-list .mpg-item { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: calc(var(--mpg-gap) * 2); align-items: center; }
.mpg-t-list .mpg-cap { position: static; padding: 0; opacity: 1; background: none; color: inherit; font-size: 1rem; }
.mpg-t-list .mpg-cap strong { font-size: 1.15em; margin-bottom: .35rem; }
@media (max-width: 640px) { .mpg-t-list .mpg-item { grid-template-columns: 1fr; gap: .5rem; } }

/* Önce / sonra */
.mpg-t-compare .mpg-items { display: grid; grid-template-columns: 1fr; gap: calc(var(--mpg-gap) * 2); }
.mpg-compare-item { margin: 0; }
.mpg-compare { --mpg-pos: 50%; position: relative; overflow: hidden; border-radius: var(--mpg-radius); background: rgba(127, 127, 127, .12); -webkit-user-select: none; user-select: none; touch-action: pan-y; }
.mpg-compare img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.mpg-cmp-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--mpg-pos)) 0 0); }
.mpg-cmp-handle { position: absolute; top: 0; bottom: 0; left: var(--mpg-pos); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 6px rgba(0, 0, 0, .5); pointer-events: none; }
.mpg-cmp-handle::after { content: "\2194"; position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: #fff; color: #111; font-size: 20px; line-height: 40px; text-align: center; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.mpg-cmp-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; }
.mpg-cmp-range:focus-visible + .mpg-cmp-handle, .mpg-compare:focus-within .mpg-cmp-handle { background: #4f46e5; }
.mpg-cmp-label { position: absolute; top: 10px; padding: 3px 10px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: .8rem; pointer-events: none; }
.mpg-cmp-l { left: 10px; }
.mpg-cmp-r { right: 10px; }

/* Koruma */
.mpg-protect img { -webkit-user-drag: none; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }

/* Ön yükleyiciler */
.mpg-media.mpg-loading img { opacity: 0; }
.mpg-pre-none .mpg-media.mpg-loading img { opacity: 1; }
.mpg-pre-skeleton .mpg-media.mpg-loading { background-image: linear-gradient(100deg, rgba(127, 127, 127, .10) 30%, rgba(127, 127, 127, .26) 50%, rgba(127, 127, 127, .10) 70%); background-size: 300% 100%; animation: mpg-shine 1.3s linear infinite; }
.mpg-pre-skeleton.mpg-ratio-auto .mpg-media.mpg-loading, .mpg-pre-skeleton.mpg-t-masonry .mpg-media.mpg-loading { min-height: 140px; }
.mpg-pre-spinner .mpg-media.mpg-loading::after { content: ""; position: absolute; top: 50%; left: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border: 3px solid rgba(127, 127, 127, .3); border-top-color: rgba(127, 127, 127, .9); border-radius: 50%; animation: mpg-spin .8s linear infinite; }
.mpg-pre-spinner.mpg-ratio-auto .mpg-media.mpg-loading, .mpg-pre-spinner.mpg-t-masonry .mpg-media.mpg-loading { min-height: 140px; }
.mpg-pre-blur .mpg-media { background-size: cover; }
.mpg-pre-blur .mpg-media.mpg-loading { filter: blur(12px); transform: scale(1.03); }
.mpg-pre-blur .mpg-media { transition: filter .4s, transform .4s; }
@keyframes mpg-shine { to { background-position: -150% 0; } }
@keyframes mpg-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mpg-pre-skeleton .mpg-media.mpg-loading, .mpg-pre-spinner .mpg-media.mpg-loading::after { animation: none; } }

/* Sayfalama */
.mpg-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; margin-top: 1.5rem; }
.mpg-pager a, .mpg-pager span { min-width: 2.4rem; padding: .45rem .7rem; border: 1px solid rgba(127, 127, 127, .35); border-radius: 6px; color: inherit; text-align: center; text-decoration: none; line-height: 1.2; }
.mpg-pager a:hover { border-color: currentColor; }
.mpg-pager .mpg-current { background: rgba(127, 127, 127, .25); font-weight: 700; }
.mpg-pager .mpg-gap { border-color: transparent; }
.mpg-more-wrap { margin-top: 1.5rem; text-align: center; }
.mpg-more { display: inline-block; padding: .65rem 1.4rem; border: 1px solid rgba(127, 127, 127, .45); border-radius: 6px; background: transparent; color: inherit; font: inherit; cursor: pointer; text-decoration: none; }
.mpg-more:hover { border-color: currentColor; }
.mpg-more[disabled] { opacity: .6; cursor: wait; }
.mpg-sentinel { height: 1px; }
.mpg-busy .mpg-items { opacity: .55; transition: opacity .2s; }

/* Lightbox */
.mpg-lb { position: fixed; inset: 0; z-index: 2147483000; display: flex; flex-direction: column; background: rgba(10, 10, 12, .94); color: #fff; font-family: inherit; -webkit-user-select: none; user-select: none; }
.mpg-lb[hidden], .mpg-lb [hidden] { display: none !important; }
.mpg-lb-top { display: flex; align-items: center; gap: .5rem; padding: .75rem 1rem; }
.mpg-lb-count { flex: 1; font-size: .9rem; opacity: .8; }
.mpg-lb button, .mpg-lb a.mpg-lb-btn { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; text-decoration: none; }
.mpg-lb button:hover, .mpg-lb a.mpg-lb-btn:hover { background: rgba(255, 255, 255, .22); }
.mpg-lb button:focus-visible, .mpg-lb a.mpg-lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.mpg-lb-stage { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 64px; touch-action: pan-y; }
.mpg-lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; transition: opacity .25s; }
.mpg-lb-stage img.mpg-lb-wait { opacity: .25; }
.mpg-lb-frame { width: min(100%, calc((100vh - 220px) * 16 / 9)); aspect-ratio: 16 / 9; max-height: 100%; border: 0; border-radius: 4px; background: #000; }
video.mpg-lb-frame { aspect-ratio: auto; width: auto; max-width: 100%; }
.mpg-lb-thumbs button.mpg-lb-vthumb { position: relative; color: #fff; font-size: 16px; }
.mpg-lb-prev, .mpg-lb-next { position: absolute; top: 50%; margin-top: -21px; }
.mpg-lb .mpg-lb-prev { left: 12px; }
.mpg-lb .mpg-lb-next { right: 12px; }
.mpg-lb-cap { padding: .6rem 1rem 0; text-align: center; font-size: .95rem; line-height: 1.45; min-height: 1.4rem; }
.mpg-lb-cap strong { display: block; }
.mpg-lb-cap span { opacity: .8; }
.mpg-lb-thumbs { display: flex; gap: 6px; padding: .75rem 1rem 1rem; overflow-x: auto; justify-content: center; scrollbar-width: thin; }
.mpg-lb-thumbs button { flex: 0 0 auto; width: 64px; height: 48px; padding: 0; border-radius: 4px; overflow: hidden; opacity: .5; background: #222; }
.mpg-lb-thumbs button.on { opacity: 1; outline: 2px solid #fff; }
.mpg-lb-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.mpg-lb-noscroll { overflow: hidden !important; }
.mpg-lb-top { position: relative; }
.mpg-lb-sharemenu { position: absolute; top: 60px; right: 16px; z-index: 3; display: flex; flex-direction: column; min-width: 200px; padding: 6px; border-radius: 10px; background: #1f2937; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.mpg-lb .mpg-lb-sharemenu a, .mpg-lb .mpg-lb-sharemenu button { display: block; width: auto; height: auto; padding: 9px 12px; border-radius: 6px; background: transparent; color: #fff; font-size: .9rem; text-align: left; text-decoration: none; }
.mpg-lb .mpg-lb-sharemenu a:hover, .mpg-lb .mpg-lb-sharemenu button:hover { background: rgba(255, 255, 255, .12); }
@media (max-width: 640px) {
    .mpg-lb-stage { padding: 0 8px; }
    .mpg-lb-prev, .mpg-lb-next { background: rgba(0, 0, 0, .45) !important; }
    .mpg-lb-thumbs { justify-content: flex-start; }
}

/* Albüm */
.mpg-album { margin: 2rem 0; }
.mpg-album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.mpg-album-card { display: block; color: inherit; text-decoration: none; }
.mpg-album-cover { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 8px; background: rgba(127, 127, 127, .15); }
.mpg-album-cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.mpg-album-card:hover .mpg-album-cover img { transform: scale(1.05); }
.mpg-album-card strong { display: block; margin-top: .55rem; }
.mpg-album-card small { opacity: .7; }
.mpg-album-back { display: inline-block; margin-bottom: .75rem; color: inherit; }
