/* ============================================================
   Magazine Library Pro v2.2 — Public Stylesheet
   Standard layout: cover LEFT, spine LEFT, advance = swipe left
   ============================================================ */
.mlp-shell *, .mlp-modal * { box-sizing: border-box; }
.mlp-shell { direction: rtl; font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; }

/* ── Library Grid ── */
.mlp-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px; margin-bottom: 28px;
}
.mlp-magazines {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 20px;
}

/* ── Cards ── */
.mlp-card {
  position: relative; background: #fff; border-radius: 8px;
  overflow: hidden; cursor: pointer; outline: none;
  transition: transform .22s ease, box-shadow .22s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,.09);
}
.mlp-card:hover, .mlp-card:focus-visible {
  transform: translateY(-5px); box-shadow: 0 14px 34px rgba(0,0,0,.16);
}
.mlp-card.is-active { box-shadow: 0 0 0 3px #3d6bff, 0 10px 28px rgba(61,107,255,.25); }
.mlp-card-media {
  position: relative; width: 100%; aspect-ratio: 335 / 459;
  background: #f0f0ee; overflow: hidden;
}
.mlp-card-media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .35s ease;
}
.mlp-card:hover .mlp-card-media img { transform: scale(1.04); }
.mlp-card-placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 48px; opacity: .25; }
.mlp-card-media::before, .mlp-card-media::after {
  content: ''; position: absolute; top: 4px; bottom: 4px; left: 0; right: 0;
  border: 1px solid rgba(0,0,0,.07); pointer-events: none; border-radius: 2px;
}
.mlp-card-media::before { transform: translateX(-3px); }
.mlp-card-media::after  { transform: translateX(-6px); }
.mlp-card-title { padding: 10px 10px 12px; font-size: 13px; line-height: 1.45; text-align: center; color: #1a1a1a; font-weight: 500; }

.mlp-loading-row, .mlp-error-row { grid-column: 1 / -1; padding: 32px; text-align: center; color: #666; }
.mlp-empty { grid-column: 1 / -1; padding: 48px 24px; text-align: center; color: #888; font-size: 16px; }
.mlp-error { color: #c00; }
.mlp-spinner-sm {
  display: inline-block; width: 28px; height: 28px;
  border: 3px solid rgba(0,0,0,.1); border-top-color: #3d6bff;
  border-radius: 50%; animation: mlp-spin .7s linear infinite;
}
@keyframes mlp-spin { to { transform: rotate(360deg); } }
.mlp-load-more-wrap { text-align: center; margin-top: 28px; }
.mlp-load-more {
  padding: 10px 30px; background: #f5f6fa; border: 1px solid #dde;
  border-radius: 6px; cursor: pointer; font-size: 14px; transition: background .18s;
}
.mlp-load-more:hover { background: #eaedf8; }

/* ── Modal overlay ── */
.mlp-no-scroll { overflow: hidden !important; }
.mlp-modal[hidden] { display: none; }
.mlp-modal { position: fixed; inset: 0; z-index: 999999; }
.mlp-modal-backdrop {
  position: absolute; inset: 0;
  background: radial-gradient(circle at center, rgba(22,25,44,.30) 0%, rgba(5,7,18,.92) 55%, rgba(2,3,9,.98) 100%);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.mlp-modal-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}

/* ── Top bar ── */
.mlp-topbar {
  position: relative; z-index: 10; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: rgba(0,0,0,.35); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.mlp-topbar-title {
  color: rgba(255,255,255,.88); font-size: 15px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: calc(100% - 280px); direction: rtl;
}
.mlp-topbar-controls { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.mlp-ctrl-btn {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px; color: rgba(255,255,255,.80); cursor: pointer; padding: 0; flex-shrink: 0;
  transition: background .18s, transform .12s, color .18s;
}
.mlp-ctrl-btn svg { width: 18px; height: 18px; }
.mlp-ctrl-btn:hover { background: rgba(255,255,255,.18); color: #fff; transform: scale(1.06); }
.mlp-ctrl-btn:active { transform: scale(.96); }
.mlp-zoom-label { color: rgba(255,255,255,.65); font-size: 12px; min-width: 38px; text-align: center; }

/* ── Stage — no overflow:hidden so flip shadows render fully ── */
.mlp-stage-wrap {
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  position: relative; padding: 0;
  overflow: visible;
}

/* ── Nav buttons — standard layout: NEXT on RIGHT, PREV on LEFT ── */
.mlp-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 20; width: 52px; height: 52px;
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%; color: #fff; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px); box-shadow: 0 6px 18px rgba(0,0,0,.28);
  transition: background .18s, transform .18s, opacity .18s; flex-shrink: 0;
}
.mlp-nav svg { width: 22px; height: 22px; }
.mlp-nav:hover { background: rgba(255,255,255,.22); transform: translateY(-50%) scale(1.08); }
.mlp-nav:disabled { opacity: .28; cursor: not-allowed; }
.mlp-nav:disabled:hover { transform: translateY(-50%) scale(1); background: rgba(255,255,255,.10); }

/* Arabic RTL: NEXT (go deeper) on LEFT, PREV (back toward cover) on RIGHT */
.mlp-nav-next { left: 14px; }
.mlp-nav-prev { right: 14px; }

/* ── Flipbook zone ── */
.mlp-flipbook-zone {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  transition: transform .2s ease;
}


/* ── Skeleton ── */
.mlp-skeleton {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; gap: 0;
}
.mlp-skeleton-page {
  flex: 0 0 calc(50% - 4px); height: 82%; max-width: 520px;
  border-radius: 4px;
  background: linear-gradient(90deg, #2a2a3a 25%, #33334a 50%, #2a2a3a 75%);
  background-size: 200% 100%; animation: mlp-shimmer 1.4s infinite;
}
.mlp-skeleton-spine { width: 8px; height: 82%; background: rgba(255,255,255,.06); flex-shrink: 0; }
@keyframes mlp-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── StPageFlip container fixes ────────────────────────────────────
   - NO overflow:hidden on stf__item  (was causing page cropping)
   - object-fit: fill on images       (no cropping)
   - Stage overflow:visible           (allows shadow to render)
   ────────────────────────────────────────────────────────────────── */
#mlp-flipbook {
  position: relative;
  width: 100%;           /* ensures StPageFlip reads correct blockWidth for 2-page layout */
  min-width: 0;
}

.stf__parent {
  margin: 0 auto;
}

.stf__item {
  background: #05070f;
  /* NO overflow:hidden — critical fix for page cropping */
}
#mlp-flipbook,
.stf__parent,
.stf__block,
.stf__wrapper,
.stf__canvas {
  background: #05070f !important;
}

.mlp-stage-wrap,
.mlp-flipbook-zone {
  background: #05070f;
}
.stf__item img {
  width: 100%; height: 100%;
  object-fit: fill;          /* fill exactly — no cropping */
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

/* ── Generation indicator — HIDDEN (removed from UX per feedback) ── */
.mlp-gen-indicator { display: none !important; }

/* ── Bottom bar ── */
.mlp-bottombar {
  position: relative; z-index: 10; flex-shrink: 0;
  background: rgba(0,0,0,.40); backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 8px 16px 10px;
}
.mlp-progress-wrap { margin-bottom: 8px; }
.mlp-progress-track { width: 100%; height: 4px; background: rgba(255,255,255,.12); border-radius: 999px; overflow: hidden; }
.mlp-progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, #5d7fff, #a5b4ff); border-radius: 999px; transition: width .35s ease; }
.mlp-bottombar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mlp-counter { color: rgba(255,255,255,.65); font-size: 13px; white-space: nowrap; }
.mlp-jump-wrap { display: flex; align-items: center; gap: 6px; }
.mlp-jump-input {
  width: 72px; padding: 5px 8px;
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px; color: #fff; font-size: 13px; text-align: center;
  outline: none; transition: border-color .16s;
}
.mlp-jump-input:focus { border-color: rgba(160,180,255,.55); }
.mlp-jump-input::placeholder { color: rgba(255,255,255,.35); }
.mlp-jump-input::-webkit-outer-spin-button,
.mlp-jump-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.mlp-jump-input[type=number] { -moz-appearance: textfield; }
.mlp-jump-btn {
  padding: 5px 12px; background: rgba(100,130,255,.25);
  border: 1px solid rgba(100,130,255,.35); border-radius: 6px; color: #fff;
  font-size: 13px; cursor: pointer; transition: background .16s;
}
.mlp-jump-btn:hover { background: rgba(100,130,255,.40); }

.mlp-viewer-error { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 340px; gap: 16px; color: rgba(255,255,255,.65); font-size: 16px; }
.mlp-btn-retry { padding: 8px 20px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 6px; color: #fff; cursor: pointer; font-size: 14px; transition: background .16s; }
.mlp-btn-retry:hover { background: rgba(255,255,255,.22); }

/* ── Fullscreen tweaks ── */
.mlp-modal.is-fullscreen .mlp-topbar { padding: 6px 12px; }
.mlp-modal.is-fullscreen .mlp-bottombar { padding: 6px 12px 8px; }
.mlp-modal.is-fullscreen .mlp-flipbook-zone { width: 100%; }

/* ============================================================ MOBILE ≤ 768px */
@media (max-width: 768px) {
  .mlp-categories { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
  .mlp-magazines  { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }

  .mlp-topbar-title { max-width: calc(100% - 160px); font-size: 13px; }
  .mlp-ctrl-btn { width: 34px; height: 34px; }
  .mlp-ctrl-btn svg { width: 15px; height: 15px; }
  .mlp-zoom-label, .mlp-btn-zoom-in, .mlp-btn-zoom-out { display: none; }

  /* Mobile: hide nav buttons entirely — use swipe only */
  .mlp-nav { display: none !important; }

  /* Mobile: full-width zone — no room wasted on hidden nav buttons */
  .mlp-flipbook-zone {
    width: 100%;
    max-width: 100%;
    padding: 0 2px;
  }

  /* Stage: full height, minimal padding */
  .mlp-stage-wrap { padding: 4px 0; }

  /* Single-page skeleton: full width */
  .mlp-skeleton-page { flex: 0 0 92%; max-width: 100%; height: 90%; }
  .mlp-skeleton-spine, .mlp-skeleton-right { display: none; }

  /* Jump to page: too small on mobile, hide */
  .mlp-jump-wrap { display: none; }

  /* Center the single-page book */
  .stf__parent { margin: 0 auto !important; }
}

/* ============================================================ TABLET 769px – 1024px */
@media (min-width: 769px) and (max-width: 1024px) {
  .mlp-flipbook-zone { width: 100%; }
  .mlp-nav { width: 46px; height: 46px; }
  .mlp-nav-next { left: 10px; }
  .mlp-nav-prev { right: 10px; }
}

/* ============================================================ DESKTOP ≥ 1025px */
@media (min-width: 1025px) {
  .mlp-flipbook-zone { width: 100%; }
  .mlp-nav-next { left: 16px; }
  .mlp-nav-prev { right: 16px; }
}
/* ===== Force all viewer layers to dark background ===== */
.mlp-modal,
.mlp-modal-inner,
.mlp-stage-wrap,
.mlp-flipbook-zone,
#mlp-flipbook,
#mlp-flipbook > div,
.stf__parent,
.stf__wrapper,
.stf__block,
.stf__item,
.stf__canvas,
canvas {
  background: #060914 !important;
}

/* Keep only the page images visible without white side areas */
.stf__item {
  box-shadow: none !important;
}

.stf__item img {
  background: transparent !important;
  display: block;
}

/* In case an inner page element is painted white by the library */
[class*="stf__"] {
  background-color: #060914 !important;
}

.mlp-modal,
.mlp-viewer,
.mlp-flipbook-zone {
    background: #000 !important;
}
/* ============================================================
   MLP Safe Visual Polish v1
   Scope: CSS-only, no RTL/page-order/zoom/pan/core transform changes.
   Added carefully after the stable RTL build to avoid rendering regressions.
   ============================================================ */

/* 1) Global Drop Shadow: soft surface shadow around the whole magazine. */
.mlp-flipbook-zone .stf__parent {
  filter: drop-shadow(0 28px 38px rgba(0, 0, 0, .28))
          drop-shadow(0 8px 14px rgba(0, 0, 0, .20));
}

/* 2) Central Gutter Shadow: subtle depth at the center fold on desktop only. */
@media (min-width: 769px) {
  #mlp-flipbook::after {
    content: "";
    position: absolute;
    top: 2.5%;
    bottom: 2.5%;
    left: 50%;
    width: 34px;
    transform: translateX(-50%);
    pointer-events: none;
    border-radius: 999px;
    background:
      linear-gradient(90deg,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, .10) 34%,
        rgba(0, 0, 0, .22) 50%,
        rgba(0, 0, 0, .10) 66%,
        rgba(0, 0, 0, 0) 100%);
    opacity: .55;
  }
}

/* Keep mobile very light: no center gutter because portrait is always single page. */
@media (max-width: 768px) {
  .mlp-flipbook-zone .stf__parent {
    filter: drop-shadow(0 16px 24px rgba(0, 0, 0, .24));
  }

  #mlp-flipbook::after {
    display: none !important;
  }
}

/* 3) Page Edge / Thickness: subtle inset edge only; no layout or transform changes. */
.stf__item {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .055),
    inset 0 0 18px rgba(0, 0, 0, .055) !important;
}

/* 4) Very light paper texture/highlight. Safe overlay, does not affect hit testing. */
.stf__item::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg,
      rgba(255,255,255,.035),
      rgba(255,255,255,0) 18%,
      rgba(0,0,0,.025) 100%),
    radial-gradient(circle at 20% 12%, rgba(255,255,255,.035), rgba(255,255,255,0) 30%);
  opacity: .36;
}

/* 5) Safer timing polish only; no new transforms or z-index changes. */
.stf__item,
.stf__block,
.stf__wrapper,
.stf__canvas {
  transition-timing-function: cubic-bezier(.4, 0, .2, 1) !important;
}

/* ============================================================
   Modern Frontend Library UI v2.5.0
   Scoped to the shortcode wrapper so it can sit safely between
   the theme header and footer without changing the WordPress theme.
   ============================================================ */
.mlp-modern-library {
  --mlp-green: #4f7448;
  --mlp-green-dark: #355a35;
  --mlp-green-soft: #eff5ec;
  --mlp-border: #e8ece6;
  --mlp-text: #2e332f;
  --mlp-muted: #8b918c;
  --mlp-bg: #ffffff;
  --mlp-card: #ffffff;
  --mlp-shadow: 0 18px 45px rgba(37, 49, 36, .08);
  --mlp-shadow-card: 0 8px 22px rgba(42, 48, 42, .075);
  direction: rtl;
  width: 100%;
  font-family: "Tajawal", "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
  color: var(--mlp-text);
  background: transparent;
  margin: 0 auto;
}

.mlp-modern-library *:not(.stf__parent):not(.stf__wrapper):not(.stf__block):not(.stf__item):not(.stf__canvas) {
  box-sizing: border-box;
}

.mlp-modern-library .mlp-modern-container {
  width: min(100%, 1280px);
  margin: 26px auto 30px;
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.94));
  border: 1px solid rgba(222, 229, 219, .95);
  box-shadow: var(--mlp-shadow);
  overflow: hidden;
}

.mlp-modern-library .mlp-modern-hero {
  width: 100%;
  margin: 0 0 24px;
  border-radius: 18px;
  overflow: hidden;
  background: #f8f2e5;
  border: 1px solid rgba(209, 202, 186, .65);
  box-shadow: 0 8px 22px rgba(43, 46, 41, .06);
}

.mlp-modern-library .mlp-hero-image {
  display: block;
  width: 100%;
  min-height: 188px;
  max-height: 240px;
  object-fit: cover;
}

.mlp-modern-library .mlp-hero-fallback {
  min-height: 210px;
  display: grid;
  grid-template-columns: 1fr minmax(320px, 1.1fr) 1fr;
  align-items: center;
  position: relative;
  padding: 24px 36px;
  background:
    radial-gradient(circle at 12% 50%, rgba(132, 99, 52, .14), transparent 34%),
    radial-gradient(circle at 88% 42%, rgba(79, 116, 72, .13), transparent 35%),
    linear-gradient(90deg, #f3ead8, #fbf6eb 45%, #f4ecd9);
  color: var(--mlp-green-dark);
}

.mlp-modern-library .mlp-hero-copy {
  text-align: center;
  z-index: 1;
}

.mlp-modern-library .mlp-hero-eyebrow {
  font-size: clamp(18px, 1.9vw, 28px);
  color: #65655f;
  font-weight: 700;
  margin-bottom: 6px;
}

.mlp-modern-library .mlp-hero-copy h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.1;
  color: var(--mlp-green);
  font-weight: 900;
}

.mlp-modern-library .mlp-hero-copy p {
  margin: 10px auto 0;
  max-width: 470px;
  font-size: clamp(15px, 1.35vw, 20px);
  line-height: 1.55;
  color: #6f716b;
  font-weight: 600;
}

.mlp-modern-library .mlp-hero-book,
.mlp-modern-library .mlp-hero-ornament {
  color: var(--mlp-green);
  opacity: .58;
}

.mlp-modern-library .mlp-hero-book svg { width: min(210px, 100%); display: block; margin-inline-start: auto; }
.mlp-modern-library .mlp-hero-ornament svg { width: min(190px, 100%); display: block; }

.mlp-modern-library .mlp-modern-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(170px, 210px);
  grid-template-areas: "search tabs sort";
  gap: 28px;
  align-items: center;
  direction: ltr;
  margin: 0 0 26px;
}

.mlp-modern-library .mlp-modern-search,
.mlp-modern-library .mlp-modern-sort,
.mlp-modern-library .mlp-tabs {
  direction: rtl;
}

.mlp-modern-library .mlp-modern-search {
  grid-area: search;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--mlp-border);
  box-shadow: 0 7px 18px rgba(45, 52, 44, .045);
}

.mlp-modern-library .mlp-search-input {
  flex: 1;
  width: 100%;
  min-width: 0;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  color: var(--mlp-text);
  font-size: 15px;
  font-weight: 600;
  text-align: right;
  padding: 0;
}

.mlp-modern-library .mlp-search-input::placeholder { color: #aeb3ae; }

.mlp-modern-library .mlp-control-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: #9aa29b;
  flex: 0 0 auto;
}
.mlp-modern-library .mlp-control-icon svg { width: 22px; height: 22px; }

.mlp-modern-library .mlp-tabs {
  grid-area: tabs;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--mlp-border);
  box-shadow: 0 8px 20px rgba(43, 50, 42, .055);
  min-height: 54px;
}

.mlp-modern-library .mlp-tab {
  appearance: none;
  border: 0;
  height: 42px;
  min-width: 96px;
  border-radius: 11px;
  padding: 0 16px;
  background: transparent;
  color: #777d78;
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.mlp-modern-library .mlp-tab:hover { color: var(--mlp-green-dark); background: rgba(79,116,72,.07); }
.mlp-modern-library .mlp-tab.is-active {
  background: linear-gradient(180deg, #5c8355, #416b3e);
  color: #fff;
  box-shadow: 0 9px 18px rgba(65, 107, 62, .26), inset 0 1px 0 rgba(255,255,255,.16);
}

.mlp-modern-library .mlp-tab-icon { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; }
.mlp-modern-library .mlp-tab-icon svg { width: 21px; height: 21px; }

.mlp-modern-library .mlp-modern-sort {
  grid-area: sort;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--mlp-border);
  box-shadow: 0 7px 18px rgba(45, 52, 44, .045);
  padding: 0 14px;
}

.mlp-modern-library .mlp-sort-select {
  width: 100%;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  color: #6f756f;
  font-weight: 800;
  font-size: 15px;
  padding: 0 0 0 18px;
  cursor: pointer;
  min-height: 0;
}

.mlp-modern-library .mlp-magazines {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}

.mlp-modern-library .mlp-card.mlp-issue-card {
  background: var(--mlp-card);
  border: 1px solid var(--mlp-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--mlp-shadow-card);
  cursor: pointer;
  outline: none;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.mlp-modern-library .mlp-card.mlp-issue-card:hover,
.mlp-modern-library .mlp-card.mlp-issue-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(79,116,72,.24);
  box-shadow: 0 14px 34px rgba(41, 49, 40, .12);
}

.mlp-modern-library .mlp-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 335 / 459;
  background: #f6f7f5;
  overflow: hidden;
  border-bottom: 1px solid #eef1ed;
}

.mlp-modern-library .mlp-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}

.mlp-modern-library .mlp-card:hover .mlp-card-media img { transform: scale(1.025); }

.mlp-modern-library .mlp-card-media::before,
.mlp-modern-library .mlp-card-media::after { display: none !important; }

.mlp-modern-library .mlp-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 42px;
  color: rgba(79,116,72,.34);
  background: linear-gradient(180deg, #f8faf6, #eef4eb);
}

.mlp-modern-library .mlp-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 13px 12px 14px;
  min-height: 138px;
}

.mlp-modern-library .mlp-card-title {
  margin: 0;
  padding: 0;
  width: 100%;
  color: #444a45;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 900;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mlp-modern-library .mlp-card-date,
.mlp-modern-library .mlp-card-pages {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #899189;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.mlp-modern-library .mlp-card-date svg,
.mlp-modern-library .mlp-card-pages svg {
  width: 15px;
  height: 15px;
  color: #78936f;
}

.mlp-modern-library .mlp-open-issue {
  width: 100%;
  height: 38px;
  margin-top: auto;
  border: 1px solid #d9e5d6;
  background: linear-gradient(180deg, #fff, #fcfdfb);
  color: var(--mlp-green);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.mlp-modern-library .mlp-open-issue svg { width: 18px; height: 18px; }
.mlp-modern-library .mlp-open-issue:hover {
  background: var(--mlp-green);
  color: #fff;
  border-color: var(--mlp-green);
  box-shadow: 0 9px 18px rgba(79, 116, 72, .18);
}

.mlp-modern-library .mlp-loading-row,
.mlp-modern-library .mlp-error-row,
.mlp-modern-library .mlp-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 190px;
  text-align: center;
  color: #7b827b;
  font-size: 15px;
  font-weight: 700;
}

.mlp-modern-library .mlp-spinner-sm {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(79,116,72,.16);
  border-top-color: var(--mlp-green);
}

.mlp-modern-library .mlp-load-more-wrap {
  text-align: center;
  margin: 28px 0 0;
}

.mlp-modern-library .mlp-load-more {
  min-width: 230px;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 34px;
  border-radius: 12px;
  border: 1px solid #dce7d8;
  background: #fff;
  color: var(--mlp-green);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(45, 52, 44, .06);
  transition: background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.mlp-modern-library .mlp-load-more svg { width: 20px; height: 20px; }
.mlp-modern-library .mlp-load-more:hover {
  background: var(--mlp-green);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(79,116,72,.18);
}

.mlp-modern-library .mlp-info-bar {
  margin: 28px -28px -28px;
  padding: 24px 34px;
  background: linear-gradient(90deg, #eff5ec, #f7faf5 50%, #eff5ec);
  border-top: 1px solid #e4ebdf;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}

.mlp-modern-library .mlp-info-item {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 68px;
  text-align: right;
  color: var(--mlp-green);
  padding: 0 22px;
}

.mlp-modern-library .mlp-info-item + .mlp-info-item { border-right: 1px solid #dde7d7; }

.mlp-modern-library .mlp-info-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  color: var(--mlp-green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mlp-modern-library .mlp-info-icon svg { width: 38px; height: 38px; }

.mlp-modern-library .mlp-info-item h3 {
  margin: 0 0 4px;
  font-size: 17px;
  line-height: 1.35;
  color: var(--mlp-green);
  font-weight: 900;
}

.mlp-modern-library .mlp-info-item p {
  margin: 0;
  color: #7f867f;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 700;
}

.mlp-modern-library .mlp-btn-retry-lib {
  border: 1px solid #dce7d8;
  background: #fff;
  color: var(--mlp-green);
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 1180px) {
  .mlp-modern-library .mlp-magazines { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mlp-modern-library .mlp-modern-toolbar { gap: 16px; }
}

@media (max-width: 940px) {
  .mlp-modern-library .mlp-modern-container { margin: 18px auto 24px; padding: 20px; border-radius: 24px; }
  .mlp-modern-library .mlp-modern-toolbar {
    grid-template-columns: 1fr minmax(160px, 210px);
    grid-template-areas:
      "search search"
      "tabs sort";
    gap: 14px;
  }
  .mlp-modern-library .mlp-tabs { justify-content: flex-start; overflow-x: auto; max-width: 100%; }
  .mlp-modern-library .mlp-tab { min-width: 86px; padding: 0 13px; }
  .mlp-modern-library .mlp-magazines { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .mlp-modern-library .mlp-info-bar { margin: 24px -20px -20px; padding: 20px; }
}

@media (max-width: 720px) {
  .mlp-modern-library .mlp-modern-container { padding: 14px; border-radius: 22px; margin: 14px auto 20px; }
  .mlp-modern-library .mlp-modern-hero { border-radius: 15px; margin-bottom: 18px; }
  .mlp-modern-library .mlp-hero-image { min-height: 132px; max-height: 180px; }
  .mlp-modern-library .mlp-hero-fallback { min-height: 156px; grid-template-columns: 1fr; padding: 22px 18px; }
  .mlp-modern-library .mlp-hero-ornament,
  .mlp-modern-library .mlp-hero-book { display: none; }
  .mlp-modern-library .mlp-modern-toolbar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "search"
      "tabs"
      "sort";
    gap: 12px;
  }
  .mlp-modern-library .mlp-modern-search,
  .mlp-modern-library .mlp-modern-sort { height: 50px; }
  .mlp-modern-library .mlp-tabs { min-height: 50px; justify-content: flex-start; }
  .mlp-modern-library .mlp-tab { height: 38px; min-width: auto; white-space: nowrap; }
  .mlp-modern-library .mlp-magazines { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .mlp-modern-library .mlp-card-body { padding: 11px 10px 12px; min-height: 132px; }
  .mlp-modern-library .mlp-card-title { font-size: 15px; }
  .mlp-modern-library .mlp-open-issue { height: 36px; font-size: 13px; }
  .mlp-modern-library .mlp-info-bar { grid-template-columns: 1fr; margin: 22px -14px -14px; padding: 18px 16px; }
  .mlp-modern-library .mlp-info-item { justify-content: flex-start; padding: 16px 6px; }
  .mlp-modern-library .mlp-info-item + .mlp-info-item { border-right: 0; border-top: 1px solid #dde7d7; }
}

@media (max-width: 390px) {
  .mlp-modern-library .mlp-magazines { gap: 12px; }
  .mlp-modern-library .mlp-card-title { font-size: 14px; }
  .mlp-modern-library .mlp-card-date,
  .mlp-modern-library .mlp-card-pages { font-size: 12px; }
}

/* ============================================================
   MLP Production UX Refinement — clean embedded shortcode + cover cards
   ============================================================ */
.mlp-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
}

.mlp-modern-library .mlp-modern-container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  overflow: visible;
}

.mlp-modern-library .mlp-modern-hero {
  margin: 0 0 24px;
}

.mlp-modern-library .mlp-modern-toolbar {
  margin: 0 0 24px;
}

.mlp-modern-library .mlp-info-bar {
  margin: 30px 0 0;
  border-radius: 16px;
  overflow: hidden;
}

.mlp-modern-library .mlp-magazines {
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 24px;
  align-items: start;
}

.mlp-modern-library .mlp-card.mlp-issue-card,
.mlp-modern-library .mlp-card.mlp-issue-card:hover,
.mlp-modern-library .mlp-card.mlp-issue-card:focus-visible {
  display: block;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  outline: none;
  transform: none;
  cursor: pointer;
}

.mlp-modern-library .mlp-card.mlp-issue-card:focus-visible .mlp-card-media {
  outline: 3px solid rgba(79, 116, 72, .42);
  outline-offset: 4px;
}

.mlp-modern-library .mlp-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 210 / 297;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background: #f7f7f4;
  box-shadow: 0 6px 16px rgba(22, 27, 22, .12);
  transform-origin: center center;
  transition: transform .22s ease, box-shadow .22s ease;
}

.mlp-modern-library .mlp-card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #f7f7f4;
  transform: none;
  transition: none;
}

.mlp-modern-library .mlp-card:hover .mlp-card-media,
.mlp-modern-library .mlp-card:focus-visible .mlp-card-media {
  transform: scale(1.025);
  box-shadow: 0 15px 32px rgba(22, 27, 22, .18);
}

.mlp-modern-library .mlp-card:hover .mlp-card-media img,
.mlp-modern-library .mlp-card:focus-visible .mlp-card-media img {
  transform: none;
}

.mlp-modern-library .mlp-cover-gradient {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 44%;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(to top, rgba(0,0,0,.76) 0%, rgba(0,0,0,.42) 42%, rgba(0,0,0,0) 100%);
}

.mlp-modern-library .mlp-cover-meta {
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 13px;
  z-index: 2;
  color: #fff;
  text-align: left;
  direction: rtl;
  text-shadow: 0 2px 8px rgba(0,0,0,.34);
}

.mlp-modern-library .mlp-card-title {
  display: block;
  width: auto;
  margin: 0 0 4px;
  padding: 0;
  color: #fff;
  font-size: clamp(14px, 1.15vw, 17px);
  line-height: 1.25;
  font-weight: 900;
  text-align: left;
  overflow: visible;
  -webkit-line-clamp: initial;
  -webkit-box-orient: initial;
}

.mlp-modern-library .mlp-card-date {
  display: block;
  margin: 0;
  padding: 0;
  color: rgba(255,255,255,.92);
  font-size: 13px;
  line-height: 1.3;
  font-weight: 800;
  text-align: left;
}

.mlp-modern-library .mlp-card-pages {
  position: absolute;
  left: 13px;
  bottom: 64px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.46);
  color: #fff;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
  opacity: 0;
  transform: translateY(7px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}

.mlp-modern-library .mlp-card:hover .mlp-card-pages,
.mlp-modern-library .mlp-card:focus-visible .mlp-card-pages {
  opacity: 1;
  transform: translateY(0);
}

.mlp-modern-library .mlp-card-body,
.mlp-modern-library .mlp-open-issue {
  display: none !important;
}

.mlp-single-card-shell {
  display: block;
}

.mlp-single-card-wrap {
  display: grid;
  grid-template-columns: minmax(150px, 230px);
  align-items: start;
  justify-content: start;
  width: 100%;
  margin: 0;
  padding: 0;
}

.mlp-flipbook-zone.mlp-is-zoomed {
  cursor: grab;
  touch-action: none !important;
  user-select: none;
  -webkit-user-select: none;
}

.mlp-flipbook-zone.mlp-is-zoomed *,
.mlp-flipbook-zone.mlp-is-zoomed .stf__parent,
.mlp-flipbook-zone.mlp-is-zoomed .stf__wrapper,
.mlp-flipbook-zone.mlp-is-zoomed .stf__block,
.mlp-flipbook-zone.mlp-is-zoomed .stf__canvas {
  touch-action: none !important;
}

.mlp-flipbook-zone.mlp-is-panning {
  cursor: grabbing;
}

@media (max-width: 940px) {
  .mlp-modern-library .mlp-modern-container {
    margin: 0;
    padding: 0;
    border-radius: 0;
  }
}

@media (max-width: 720px) {
  .mlp-modern-library .mlp-modern-container {
    margin: 0;
    padding: 0;
    border-radius: 0;
  }
  .mlp-modern-library .mlp-magazines {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 390px) {
  .mlp-modern-library .mlp-magazines {
    gap: 12px;
  }
}
