/* افتخارات مایسل — کارت کتاب با باز شدن جلد در هاور / فوکوس */
.mycell-honors {
  direction: rtl;
  position: relative;
  overflow: visible;
  padding: clamp(2.25rem, 5vw, 4rem) var(--header-pad-x, 1.25rem) clamp(1.35rem, 2.5vw, 2rem);
  background:
    radial-gradient(ellipse 120% 80% at 50% -25%, rgba(51, 156, 255, 0.09) 0%, transparent 55%),
    linear-gradient(180deg, #fbfcfe 0%, #f3f6fb 48%, #eef2f8 100%);
}

.mycell-honors__container {
  max-width: 1200px;
  margin: 0 auto;
}

.mycell-honors__title {
  margin: 0 0 0.65rem;
  font-size: clamp(1.85rem, 2.85vw, 2.45rem);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: #0f172a;
  text-align: center;
}

.mycell-honors__lead {
  margin: 0 auto 2.35rem;
  max-width: 42rem;
  font-size: clamp(0.95rem, 1.35vw, 1.08rem);
  line-height: 1.75;
  color: rgba(15, 23, 42, 0.72);
  text-align: center;
}

.mycell-honors__grid {
  display: flex;
  flex-wrap: nowrap;
  gap: clamp(1.85rem, 4vw, 2.75rem);
  align-items: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  padding-block: 2.9rem;
  padding-inline: clamp(0.5rem, 2vw, 1.25rem);
  scroll-snap-type: x proximity;
  scroll-padding-inline: 1.25rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(21, 42, 66, 0.4) rgba(21, 42, 66, 0.08);
}

.mycell-honors__grid::-webkit-scrollbar {
  height: 8px;
}

.mycell-honors__grid::-webkit-scrollbar-track {
  background: rgba(21, 42, 66, 0.08);
  border-radius: 999px;
}

.mycell-honors__grid::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, rgba(21, 42, 66, 0.5), rgba(51, 156, 255, 0.55));
  border-radius: 999px;
}

.mycell-honors__grid::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, rgba(21, 42, 66, 0.65), rgba(51, 156, 255, 0.75));
}

.mycell-honors__card {
  flex: 0 0 auto;
  width: clamp(220px, 26vw, 264px);
  max-width: none;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  overflow: visible;
  transition:
    opacity 0.52s ease,
    filter 0.52s ease,
    transform 0.52s ease;
}

.mycell-honors__scene {
  --book-w: clamp(172px, 34vw, 228px);
  --book-h: clamp(218px, 42vw, 292px);
  width: var(--book-w);
  height: var(--book-h);
  perspective: 1180px;
  perspective-origin: 50% 44%;
}

.mycell-honors__tilt {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateY(12deg) rotateX(-4deg);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  filter: drop-shadow(8px 16px 22px rgba(15, 23, 42, 0.14));
}

@media (hover: hover) and (pointer: fine) {
  /* فقط دسکتاپ/ترک‌پد: محو کردن بقیهٔ کارت‌ها هنگام هاور یا فوکوس کیبورد */
  .mycell-honors__grid:has(.mycell-honors__card:is(:hover, :focus-within))
    > .mycell-honors__card:not(:is(:hover, :focus-within)) {
    opacity: 0.34;
    filter: blur(7px) saturate(0.72);
    transform: scale(0.94);
    pointer-events: none;
  }

  .mycell-honors__card:hover .mycell-honors__tilt,
  .mycell-honors__card:focus-within .mycell-honors__tilt {
    transform: rotateY(8deg) rotateX(-2deg) translateY(-3px);
    filter: drop-shadow(10px 20px 26px rgba(15, 23, 42, 0.17));
  }
}

.mycell-honors__book {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  border-radius: 6px;
}

/* لبهٔ ضخامت صفحات (سمت بیرونی کتاب) */
.mycell-honors__edge {
  position: absolute;
  inset: 5px auto 5px -11px;
  width: 14px;
  border-radius: 3px 0 0 3px;
  transform: translateZ(-5px);
  transform-style: preserve-3d;
  background: repeating-linear-gradient(
    -90deg,
    #dcd6cc 0 1px,
    #ebe6dc 1px 4px,
    #e2dbd0 4px 5px
  );
  box-shadow: inset -3px 0 6px rgba(0, 0, 0, 0.12);
  pointer-events: none;
}

/* پشت کتاب و صفحهٔ تصویری */
.mycell-honors__inside {
  position: absolute;
  inset: 4px;
  border-radius: 4px;
  overflow: hidden;
  transform: translateZ(1px);
  transform-style: preserve-3d;
  background: linear-gradient(145deg, #faf7f0 0%, #f0ebe3 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.65),
    inset 0 -18px 36px rgba(80, 60, 40, 0.06);
  transition: box-shadow 0.55s ease;
}

/* سایهٔ نرم از جهت جلد بازشده — شبیه ورق روی تصویر */
.mycell-honors__inside::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s ease;
  background: linear-gradient(
    102deg,
    rgba(35, 28, 22, 0.34) 0%,
    rgba(35, 28, 22, 0.08) 38%,
    transparent 62%
  );
}

@media (hover: hover) and (pointer: fine) {
  .mycell-honors__card:is(:hover, :focus-within) .mycell-honors__inside::after {
    opacity: 1;
  }
}

.mycell-honors__inside img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  image-rendering: auto;
}

.mycell-honors__inside-lines {
  position: absolute;
  inset: 12px 14px auto 14px;
  height: 42%;
  opacity: 0.22;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    rgba(40, 35, 30, 0.35) 0 1px,
    transparent 1px 11px
  );
  transform: translateZ(2px);
  z-index: 1;
}

/* جلد — با چرخش قوی‌تر و کمی خمیدگی برای حس ورق زدن واقعی */
.mycell-honors__cover {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  transform-style: preserve-3d;
  transform-origin: right center;
  transform: rotateY(-34deg) translateZ(7px);
  transition:
    transform 0.88s cubic-bezier(0.28, 0.82, 0.22, 1),
    box-shadow 0.65s ease;
  backface-visibility: hidden;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.07) 0%, transparent 42%),
    linear-gradient(145deg, #152642 0%, #0c162c 52%, #070f1f 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset -14px 0 28px rgba(0, 0, 0, 0.35),
    4px 8px 18px rgba(0, 0, 0, 0.28);
}

/* لبهٔ کاغذ کنار لولا — زیر قاب طلایی */
.mycell-honors__cover::before {
  content: "";
  position: absolute;
  top: 10%;
  bottom: 10%;
  left: 0;
  z-index: 0;
  width: 11px;
  border-radius: 3px 0 0 3px;
  background: linear-gradient(90deg, #efe9df 0%, #ddd5c8 48%, #cfc6b8 100%);
  box-shadow:
    inset -3px 0 6px rgba(0, 0, 0, 0.12),
    2px 0 8px rgba(0, 0, 0, 0.06);
  opacity: 0.92;
  pointer-events: none;
}

.mycell-honors__cover::after {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: 2;
  border-radius: 4px;
  border: 1px solid rgba(212, 175, 105, 0.38);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 28px rgba(212, 175, 105, 0.06);
  pointer-events: none;
}

.mycell-honors__cover-spine {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 18px;
  border-radius: 0 5px 5px 0;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(255, 255, 255, 0.06) 38%,
    rgba(0, 0, 0, 0.35) 100%
  );
  pointer-events: none;
}

.mycell-honors__cover-mark {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.48rem;
  padding: 1rem 1.35rem 1rem 2rem;
  text-align: center;
}

.mycell-honors__cover-badge {
  font-size: clamp(0.68rem, 1.35vw, 0.78rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(212, 175, 105, 0.92);
  text-transform: uppercase;
}

.mycell-honors__cover-logo {
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  font-weight: 800;
  color: rgba(248, 250, 252, 0.94);
  letter-spacing: -0.03em;
  line-height: 1.25;
}

@media (hover: hover) and (pointer: fine) {
  .mycell-honors__card:hover .mycell-honors__cover,
  .mycell-honors__card:focus-within .mycell-honors__cover {
    transform: rotateY(-108deg) rotateX(8deg) translateX(-18px) translateZ(12px);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.1),
      inset -10px 0 22px rgba(0, 0, 0, 0.28),
      -14px 22px 36px rgba(0, 0, 0, 0.35);
  }
}

/* موبایل: WebKit با perspective + preserve-3d روی والد/جلد اغلب جلد را رسم نمی‌کند؛ مسیر تخت با z-index */
@media (hover: none), (pointer: coarse) {
  .mycell-honors__tilt {
    filter: none;
    transform-style: flat;
    transform: rotate(-1.2deg);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .mycell-honors__scene {
    perspective: none;
    border-radius: 10px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    box-shadow:
      8px 16px 22px rgba(15, 23, 42, 0.14),
      0 2px 0 rgba(255, 255, 255, 0.4) inset;
  }

  .mycell-honors__book {
    transform-style: flat;
    transform: translateZ(0);
  }

  .mycell-honors__edge {
    transform: none;
    z-index: 0;
  }

  .mycell-honors__inside {
    transform: none;
    z-index: 0;
  }

  .mycell-honors__inside-lines {
    transform: none;
  }

  .mycell-honors__cover {
    transform: none;
    transform-origin: right center;
    transform-style: flat;
    backface-visibility: visible;
    -webkit-backface-visibility: visible;
    z-index: 2;
    transition:
      transform 0.52s cubic-bezier(0.28, 0.82, 0.22, 1),
      box-shadow 0.52s ease;
  }

  /* باز مانده: همان انیمیشن دسکتاپ (چرخش از لبهٔ راست) — فقط وقتی باز است preserve-3d */
  .mycell-honors__card--book-open .mycell-honors__scene {
    perspective: 1180px;
    perspective-origin: 50% 44%;
  }

  .mycell-honors__card--book-open .mycell-honors__tilt {
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transform: rotateY(8deg) rotateX(-2deg) translateY(-2px);
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .mycell-honors__card--book-open .mycell-honors__book {
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
  }

  .mycell-honors__card--book-open .mycell-honors__edge {
    transform: translateZ(-5px);
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
  }

  .mycell-honors__card--book-open .mycell-honors__inside {
    transform: translateZ(1px);
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    z-index: auto;
  }

  .mycell-honors__card--book-open .mycell-honors__inside-lines {
    transform: translateZ(2px);
  }

  .mycell-honors__card--book-open .mycell-honors__inside::after {
    opacity: 1;
  }

  .mycell-honors__card--book-open .mycell-honors__cover {
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    z-index: auto;
    transform: rotateY(-108deg) rotateX(8deg) translateX(-18px) translateZ(12px);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.1),
      inset -10px 0 22px rgba(0, 0, 0, 0.28),
      -14px 22px 36px rgba(0, 0, 0, 0.35);
    transition:
      transform 0.88s cubic-bezier(0.28, 0.82, 0.22, 1),
      box-shadow 0.65s ease;
  }
}

.mycell-honors__caption {
  margin: 0;
  max-width: 18rem;
  font-size: clamp(0.92rem, 1.45vw, 1.02rem);
  font-weight: 700;
  line-height: 1.55;
  color: #142042;
  text-align: center;
}

a.mycell-honors__caption-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

a.mycell-honors__caption-link:hover {
  color: #1e4fc4;
}

a.mycell-honors__caption-link:focus-visible {
  outline: 2px solid rgba(51, 156, 255, 0.65);
  outline-offset: 4px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .mycell-honors__grid:has(.mycell-honors__card:is(:hover, :focus-within))
    > .mycell-honors__card:not(:is(:hover, :focus-within)) {
    opacity: 1;
    filter: none;
    transform: none;
    pointer-events: auto;
  }

  .mycell-honors__tilt {
    transition: none;
  }

  @media (hover: hover) and (pointer: fine) {
    .mycell-honors__tilt {
      transform: rotateY(10deg) rotateX(-3deg);
    }
  }

  @media (hover: none), (pointer: coarse) {
    .mycell-honors__tilt {
      filter: none;
      transform-style: flat;
      transform: rotate(-1.2deg);
    }
  }

  @media (hover: hover) and (pointer: fine) {
    .mycell-honors__card:hover .mycell-honors__tilt,
    .mycell-honors__card:focus-within .mycell-honors__tilt {
      transform: rotateY(10deg) rotateX(-3deg);
      filter: drop-shadow(8px 16px 22px rgba(15, 23, 42, 0.14));
    }
  }

  @media (hover: hover) and (pointer: fine) {
    .mycell-honors__cover {
      transition: none !important;
      transform: rotateY(-108deg) rotateX(8deg) translateX(-18px) translateZ(12px) !important;
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset -10px 0 22px rgba(0, 0, 0, 0.28),
        -14px 22px 36px rgba(0, 0, 0, 0.35) !important;
    }
  }

  @media (hover: none), (pointer: coarse) {
    .mycell-honors__cover {
      transition: none !important;
      transform: none !important;
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset -14px 0 28px rgba(0, 0, 0, 0.35),
        4px 8px 18px rgba(0, 0, 0, 0.28) !important;
    }

    .mycell-honors__card--book-open .mycell-honors__scene {
      perspective: 1180px !important;
      perspective-origin: 50% 44% !important;
    }

    .mycell-honors__card--book-open .mycell-honors__tilt {
      transform-style: preserve-3d !important;
      -webkit-transform-style: preserve-3d !important;
      transform: rotateY(8deg) rotateX(-2deg) translateY(-2px) !important;
    }

    .mycell-honors__card--book-open .mycell-honors__book {
      transform-style: preserve-3d !important;
      -webkit-transform-style: preserve-3d !important;
    }

    .mycell-honors__card--book-open .mycell-honors__edge {
      transform: translateZ(-5px) !important;
    }

    .mycell-honors__card--book-open .mycell-honors__inside {
      transform: translateZ(1px) !important;
    }

    .mycell-honors__card--book-open .mycell-honors__inside-lines {
      transform: translateZ(2px) !important;
    }

    .mycell-honors__card--book-open .mycell-honors__cover {
      transform-style: preserve-3d !important;
      -webkit-transform-style: preserve-3d !important;
      -webkit-backface-visibility: hidden !important;
      backface-visibility: hidden !important;
      transform: rotateY(-108deg) rotateX(8deg) translateX(-18px) translateZ(12px) !important;
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset -10px 0 22px rgba(0, 0, 0, 0.28),
        -14px 22px 36px rgba(0, 0, 0, 0.35) !important;
    }
  }

  .mycell-honors__inside-lines {
    display: none;
  }

  .mycell-honors__inside::after {
    opacity: 1;
    transition: none;
  }
}
