/* E-Magazine (20 Nov 2026): the flipbook page (e-magazine.php) and the magazine section on the homepage */
.mg-eyebrow { margin: 0 0 10px; font: 700 13px/1.2 var(--cleenhearts-font); letter-spacing: .14em; text-transform: uppercase; color: #d65501; }
.mg-title { margin: 0 0 16px; font: 700 clamp(28px, 3.2vw, 42px)/1.15 var(--cleenhearts-heading-font); color: var(--cleenhearts-base); }
.mg-intro__text .mg-eyebrow, .mg-home__text .mg-eyebrow { color: #d65501; font-size: 13px; line-height: 1.2; margin: 0 0 10px; }
.mg-show-sm { display: none; }
.mg-btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; font-weight: 600; }
.mg-btn:hover { background-color: var(--cleenhearts-base); color: #fff; }

/* Cover: tilted like a real magazine, lifts on hover */
.mg-cover { display: block; position: relative; max-width: 340px; margin: 0 auto; transform: rotate(-4deg); transition: transform .35s ease; }
.mg-cover img { display: block; width: 100%; height: auto; border-radius: 4px 10px 10px 4px; box-shadow: 0 2px 4px rgba(0,0,0,.12), 0 22px 40px -12px rgba(53,28,66,.45); }
.mg-cover::before { content: ""; position: absolute; inset: 8px -8px -8px 8px; z-index: -1; border-radius: 4px 10px 10px 4px; background: #efe7f2; box-shadow: 0 10px 24px -10px rgba(0,0,0,.25); }
.mg-cover:hover, .mg-cover:focus-visible { transform: rotate(-2deg) translateY(-6px); }

/* Flipbook page: intro */
.mg-intro__inner { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 60px; align-items: center; max-width: 1060px; margin: 0 auto; }
.mg-intro__text p { color: var(--cleenhearts-text); font-size: 17px; line-height: 1.75; }
.mg-intro__text .mg-meta { margin: 6px 0 24px; font-size: 15px; color: var(--cleenhearts-base); font-weight: 600; }
.mg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.mg-link { font-weight: 600; color: var(--cleenhearts-base); text-decoration: underline; text-underline-offset: 4px; }
.mg-link:hover { color: #d65501; }

/* Flipbook page: reader */
.mg-reader { scroll-margin-top: 90px; }
.mg-stage { background: #f4eff6; border-radius: 20px; padding: 16px 16px 12px; }
.mg-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-bottom: 16px; }
.mg-bar__gap { flex: 1 1 auto; }
.mg-ctl { min-width: 42px; height: 40px; padding: 0 14px; border: 1px solid rgba(53,28,66,.18); border-radius: 10px; background: #fff; color: var(--cleenhearts-base); font: 600 15px/1 var(--cleenhearts-font); cursor: pointer; transition: background .2s, color .2s; }
.mg-ctl:hover:not(:disabled) { background: var(--cleenhearts-base); color: #fff; }
.mg-ctl:disabled { opacity: .4; cursor: default; }
.mg-pageno { margin: 0 6px; font: 600 15px/1 var(--cleenhearts-font); color: var(--cleenhearts-base); white-space: nowrap; }
.mg-pageno input { width: 64px; height: 40px; margin: 0 4px; border: 1px solid rgba(53,28,66,.18); border-radius: 10px; text-align: center; font: inherit; }
.mg-book-wrap { display: flex; justify-content: center; }
.mg-book { width: 100%; max-width: min(1120px, calc((100vh - 170px) * 1.545)); margin: 0 auto; }
.mg-page { background: #fff; overflow: hidden; }
.mg-page img { display: block; width: 100%; height: 100%; object-fit: contain; background: #fff; user-select: none; -webkit-user-drag: none; }
.mg-page:not(.is-loaded) { background: #fff linear-gradient(90deg, #f6f2f7 0%, #fff 50%, #f6f2f7 100%) 0 0 / 200% 100%; animation: mg-shimmer 1.4s linear infinite; }
@keyframes mg-shimmer { to { background-position: -200% 0; } }
.mg-tip { margin: 12px 0 0; text-align: center; font-size: 14px; color: var(--cleenhearts-text); }

/* Full screen */
.mg-stage:fullscreen { display: flex; flex-direction: column; justify-content: center; border-radius: 0; padding: 14px; background: #2b1636; }
.mg-stage:fullscreen .mg-tip { color: #d8c8e0; }
.mg-stage:fullscreen .mg-book { max-width: min(100%, calc((100vh - 110px) * var(--mg-ratio, 1.545))); }

/* Homepage section */
.mg-home__card { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 64px; align-items: center; max-width: 1040px; margin: 0 auto; padding: 48px 56px; border-radius: 24px; background: linear-gradient(120deg, #fbf4ee 0%, #f4edf6 100%); }
.mg-home__card .mg-cover { max-width: 280px; }
.mg-home__text p { color: var(--cleenhearts-text); font-size: 17px; line-height: 1.75; margin-bottom: 24px; }

@media (max-width: 991px) {
  .mg-intro__inner, .mg-home__card { grid-template-columns: 1fr; gap: 36px; text-align: center; }
  .mg-actions { justify-content: center; }
  .mg-home__card { padding: 36px 24px; }
  .mg-cover { max-width: 260px; }
  .mg-home__card .mg-cover { max-width: 230px; }
}
@media (max-width: 575px) {
  .mg-stage { padding: 12px 8px 10px; border-radius: 14px; }
  .mg-hide-sm, .mg-bar [data-mg="first"], .mg-bar [data-mg="last"], .mg-bar__gap { display: none; }
  .mg-show-sm { display: inline; }
  .mg-bar { flex-wrap: nowrap; gap: 6px; }
  .mg-ctl { min-width: 40px; padding: 0 10px; }
  .mg-pageno { margin: 0 2px; }
  .mg-pageno input { width: 54px; }
  .mg-cover, .mg-home__card .mg-cover { max-width: 210px; }
  .mg-book { max-width: min(100%, calc((100vh - 200px) * .773)); }
  .mg-btn { width: 100%; justify-content: center; }
}
