/* t55u – article card images near-borderless + fullscreen gallery lightbox */

/* ---------- article cards: picture fills the media area (cover), minimal inset, rounded ---------- */
.mk-card .mk-media.mk-media[class*="ith-"] { padding: 6px; background: var(--card); box-shadow: none; }
.mk-card .mk-media[class*="ith-"] img[data-ith].ith-img.ith-img { padding: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; border-radius: 14px; background: var(--bg-2); }
/* portraits (book/DVD covers): keep the upper part with the title */
.mk-card .mk-media.is-portrait img[data-ith].ith-img.ith-img { object-position: 50% 22%; }
/* very tall / very wide pictures: show them whole on a subtle contrast container with a soft blurred fill (set by t55.js) */
.mk-card .mk-media.mk-media.is-contain { padding: 6px; }
.mk-card .mk-media.is-contain::before { content: ""; position: absolute; inset: 6px; border-radius: 14px; background-image: var(--mk-fill, none); background-size: cover; background-position: center; filter: blur(16px) saturate(1.1); opacity: .5; transform: scale(1.02); }
.mk-card .mk-media.mk-media.is-contain.ith-d::after, .mk-card .mk-media.mk-media.is-contain.ith-l::after, .mk-card .mk-media.mk-media.is-contain.ith-auto::after { content: ""; position: absolute; inset: 6px; border-radius: 14px; pointer-events: none; z-index: 0; }
.mk-card .mk-media.is-contain.ith-d::after { background: rgba(243, 238, 229, .45); }
.mk-card .mk-media.is-contain.ith-l::after { background: rgba(43, 39, 34, .45); }
.mk-card .mk-media.is-contain img[data-ith].ith-img.ith-img { position: relative; z-index: 1; object-fit: contain; background: transparent; border-radius: 10px; }
.mk-card .mk-media.is-contain { isolation: isolate; }
.mk-card .mk-media .mk-badge, .mk-card .mk-media .mk-flag { z-index: 2; }
.mk-card .mk-media.mk-media.is-empty { padding: 0; }

/* ---------- gallery lightbox ---------- */
html.lbx-lock { overflow: hidden; }
.lightbox.lbg { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; color: #eef2f0; overflow: hidden;
  background: radial-gradient(60% 70% at 0% 30%, rgba(31, 90, 72, .32), transparent 70%), radial-gradient(55% 65% at 100% 20%, rgba(170, 120, 50, .16), transparent 70%), #070c0a; }
.lightbox.lbg[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; place-items: stretch; }
.lightbox.lbg::backdrop { background: rgba(4, 7, 6, .96); }
.lbg-top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 12px 16px 12px 20px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.lbg-head { min-width: 0; }
.lbg-eyebrow { margin: 0 0 3px; font-size: .68rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #a9b8b1; }
.lbg-title { margin: 0; font-family: Outfit, system-ui, sans-serif; font-size: 1rem; font-weight: 600; line-height: 1.25; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbg-count { justify-self: center; padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); font-size: .8rem; font-weight: 700; letter-spacing: .04em; color: #f4f7f5; font-variant-numeric: tabular-nums; }
.lbg-btn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .2); background: rgba(10, 18, 15, .72); color: #fff; font-size: 1rem; cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
.lbg-btn:hover { background: #24332d; border-color: rgba(255, 255, 255, .45); color: #fff; }
.lbg-btn:focus-visible, .lbg-thumbs button:focus-visible { outline: 3px solid #f0c36d; outline-offset: 2px; }
.lbg-close { justify-self: end; background: transparent; border-color: transparent; font-size: 1.25rem; }
.lbg-close:hover { background: #24332d; }
.lbg-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 18px 88px; overflow: hidden; touch-action: none; }
.lbg-zoomer { display: grid; place-items: center; max-width: 100%; max-height: 100%; min-height: 0; transition: transform .2s ease; transform-origin: center; cursor: zoom-in; user-select: none; }
.lbg.is-zoomed .lbg-zoomer { cursor: grab; transition: none; }
.lightbox.lbg .lbg-zoomer img { display: block; max-width: 100%; max-height: calc(100dvh - 210px); width: auto; height: auto; object-fit: contain; border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); -webkit-user-drag: none; }
.lbg-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
.lbg-prev { left: 20px; }
.lbg-next { right: 20px; }
.lbg-thumbs { display: flex; justify-content: center; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255, 255, 255, .08); overflow-x: auto; scrollbar-width: thin; }
.lbg-thumbs button { flex: 0 0 auto; width: 60px; height: 46px; padding: 0; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: #1a2420; cursor: pointer; opacity: .6; transition: opacity .15s ease, border-color .15s ease; }
.lbg-thumbs button img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 0; box-shadow: none; }
.lbg-thumbs button:hover { opacity: 1; }
.lbg-thumbs button[aria-current="true"] { opacity: 1; border-color: #f0c36d; box-shadow: 0 0 0 2px rgba(240, 195, 109, .25); }
@media (max-width: 760px) {
  .lbg-top { grid-template-columns: minmax(0, 1fr) auto auto; padding: 10px 10px 10px 14px; gap: 8px; }
  .lbg-title { font-size: .92rem; }
  .lbg-stage { padding: 12px 10px; }
  .lightbox.lbg .lbg-zoomer img { max-height: calc(100dvh - 180px); border-radius: 12px; }
  .lbg-prev { left: 8px; }
  .lbg-next { right: 8px; }
  .lbg-thumbs { justify-content: flex-start; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .lbg-thumbs button { width: 52px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .lbg-zoomer, .lbg-btn, .lbg-thumbs button { transition: none; } }
