/* =====================================================================
   LUMIORA: free interactive preview
   Used by preview.html and by the preview reader (portal/preview.php).
   Self-contained colours, because the reader page does not load styles.css.
   ===================================================================== */
:root {
  --pv-night: #0A0F1C; --pv-night-2: #111830; --pv-night-3: #18213D; --pv-line: #2E3A5E;
  --pv-ink: #F2F4FC; --pv-muted: #A6B0CB; --pv-gold: #FBBF24; --pv-gold-deep: #F59E0B;
  --pv-little: #F48FBF; --pv-explorer: #2FD6C4; --pv-creator: #A7A9FF;
  --pv-bar-h: 60px;
}

/* ---------------- buttons shared by the picker and the reader ---------------- */
.pv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border-radius: 999px; font: 700 15px/1.2 "Figtree", "Poppins", system-ui, sans-serif; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; white-space: nowrap;
}
.pv-btn:focus-visible { outline: 3px solid var(--pv-gold); outline-offset: 3px; }
.pv-btn-gold { background: var(--pv-gold); color: #1B1300; box-shadow: 0 8px 22px -10px rgba(251, 191, 36, .9); }
.pv-btn-gold:hover { background: #FFD24D; transform: translateY(-1px); }
.pv-btn-line { background: transparent; color: inherit; border-color: currentColor; }
.pv-btn-line:hover { background: rgba(255, 255, 255, .08); }

/* ---------------- the edition picker (landing page and switcher) ---------------- */
.pv-covers { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 2.6vw, 28px); max-width: 980px; }
.pv-covers li { min-width: 0; display: flex; }
.pv-cover {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; flex: 1; min-width: 0;
  padding: clamp(8px, 1.6vw, 16px) clamp(6px, 1.4vw, 14px) clamp(12px, 2vw, 18px); border-radius: 22px;
  color: var(--pv-ink); text-decoration: none; background: var(--pv-night-3); border: 2px solid var(--pv-line);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.pv-cover-little { --pv-c: var(--pv-little); } .pv-cover-explorer { --pv-c: var(--pv-explorer); } .pv-cover-creator { --pv-c: var(--pv-creator); }
.pv-cover:hover { transform: translateY(-4px) rotate(-.6deg); border-color: var(--pv-c); box-shadow: 0 22px 40px -22px var(--pv-c); }
.pv-cover:focus-visible { outline: 3px solid var(--pv-gold); outline-offset: 4px; }
.pv-cover[aria-current="true"] { border-color: var(--pv-gold); box-shadow: 0 0 0 3px rgba(251, 191, 36, .25); }
.pv-cover-art { position: relative; display: block; width: 100%; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; box-shadow: 0 16px 30px -16px rgba(0, 0, 0, .9); background: var(--pv-night-2); }
.pv-cover-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-cover-now { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); padding: 4px 10px; border-radius: 999px; background: var(--pv-gold); color: #1B1300; font: 800 12px/1.2 "Figtree", system-ui, sans-serif; white-space: nowrap; }
.pv-cover-name { margin-top: 10px; font: 700 clamp(14px, 1.9vw, 20px)/1.15 "Fraunces", Georgia, serif; }
.pv-cover-age { display: inline-block; padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--pv-c) 22%, transparent); color: var(--pv-c); font: 700 clamp(12px, 1.4vw, 14px)/1.4 "Figtree", system-ui, sans-serif; }
.pv-cover-hook { color: var(--pv-muted); font: 500 clamp(12px, 1.45vw, 15px)/1.35 "Figtree", system-ui, sans-serif; margin-top: 2px; }
.pv-cover-go { margin-top: auto; padding-top: 10px; color: var(--pv-gold); font: 800 clamp(12px, 1.5vw, 15px)/1.2 "Figtree", system-ui, sans-serif; }
.pv-cover-go::after { content: " →"; }

/* the staggered entrance: covers fly in like cards dealt onto a table. They can be tapped at once. */
.pv-covers.pv-animate li { animation: pv-deal .62s cubic-bezier(.2, .9, .25, 1.25) both; animation-delay: calc(var(--i, 0) * 110ms); }
.pv-covers.pv-animate li:nth-child(1) { --pv-r: -7deg; } .pv-covers.pv-animate li:nth-child(3) { --pv-r: 7deg; }
.pv-covers.pv-animate .pv-cover-art::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%);
  transform: translateX(-120%); animation: pv-shine 1.1s ease-out both; animation-delay: calc(var(--i, 0) * 110ms + .45s); pointer-events: none;
}
@keyframes pv-deal { from { opacity: 0; transform: translateY(46px) rotate(var(--pv-r, 0deg)) scale(.86); } to { opacity: 1; transform: none; } }
@keyframes pv-shine { to { transform: translateX(120%); } }
@media (prefers-reduced-motion: reduce) {
  .pv-covers.pv-animate li, .pv-covers.pv-animate .pv-cover-art::after { animation: none !important; }
  .pv-cover, .pv-btn { transition: none; }
  .pv-cover:hover { transform: none; }
}

/* ---------------- preview.html ---------------- */
.pv-hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.pv-eyebrow { display: inline-block; margin-bottom: 16px; padding: 6px 14px; border-radius: 999px; background: rgba(251, 191, 36, .12); border: 1px solid rgba(251, 191, 36, .4); color: var(--pv-gold); font-weight: 700; font-size: 14px; }
.pv-tries { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0 26px; }
.pv-tries li { display: grid; gap: 2px; padding: 14px; border-radius: 18px; background: rgba(255, 255, 255, .05); border: 1px solid var(--pv-line); }
.pv-tries b { font-size: 16px; line-height: 1.25; }
.pv-tries li > span:last-child { color: var(--pv-muted); font-size: 14px; }
.pv-try-ico { font-size: 26px; line-height: 1; margin-bottom: 4px; }
.pv-other { margin-top: 18px; color: var(--pv-muted); font-size: 15px; }
.pv-other a { color: #A7A9FF; }
.pv-hero-covers { position: relative; height: clamp(300px, 34vw, 440px); }
.pv-hero-covers img { position: absolute; width: 52%; height: auto; border-radius: 8px; box-shadow: 0 30px 50px -24px rgba(0, 0, 0, .95); }
.pv-hero-covers img:nth-child(1) { left: 0; top: 14%; transform: rotate(-8deg); }
.pv-hero-covers img:nth-child(2) { left: 24%; top: 0; z-index: 2; }
.pv-hero-covers img:nth-child(3) { right: 0; top: 16%; transform: rotate(8deg); }

.pv-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.pv-card { display: flex; flex-direction: column; border-radius: 26px; overflow: hidden; background: var(--pv-night-3); border: 1px solid var(--pv-line); }
.pv-card-little { --pv-c: var(--pv-little); } .pv-card-explorer { --pv-c: var(--pv-explorer); } .pv-card-creator { --pv-c: var(--pv-creator); }
.pv-card-cover { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; border-bottom: 3px solid var(--pv-c); }
.pv-card-body { display: flex; flex-direction: column; gap: 8px; padding: 20px 22px 24px; flex: 1; }
.pv-card-body h3 { font-size: 24px; }
.pv-card-body .ages { align-self: flex-start; padding: 3px 12px; border-radius: 999px; background: color-mix(in srgb, var(--pv-c) 20%, transparent); color: var(--pv-c); font-weight: 700; font-size: 14px; }
.pv-card-teaser { color: var(--pv-muted); }
.pv-card-in { font-weight: 700; font-size: 14px; margin-top: 4px; }
.pv-card-list { list-style: none; display: grid; gap: 6px; margin-bottom: 10px; }
.pv-card-list li { font-size: 15px; }
.pv-tag { display: inline-block; min-width: 82px; padding: 1px 8px; margin-right: 4px; border-radius: 8px; background: rgba(255, 255, 255, .07); color: var(--pv-c, var(--pv-gold)); font-weight: 700; font-size: 12.5px; text-align: center; }
.pv-card .btn { margin-top: auto; align-self: flex-start; }

.pv-pick { grid-template-columns: repeat(4, 1fr); }
.pv-form-grid .form-status:empty { display: none; }
.pv-form-grid .form-status.is-error { padding: 12px 14px; border-radius: 12px; background: rgba(255, 138, 138, .1); border: 1px solid rgba(255, 138, 138, .4); }

.pv-picker-section { padding: clamp(48px, 7vw, 88px) var(--gutter, 16px); text-align: center; background: radial-gradient(ellipse at top, #1D2752 0%, var(--pv-night) 70%); scroll-margin-top: 80px; }
.pv-picker-section h2 { font-size: clamp(28px, 4.4vw, 46px); margin-bottom: 10px; }
.pv-picker-intro { color: var(--pv-muted); max-width: 620px; margin: 0 auto 32px; }
body.pv-unlocked #try .form-panel { opacity: .7; }

/* ---------------- preview reader (portal/preview.php) ---------------- */
.pv-reader-page { margin: 0; background: #FFF9EE; }
.pv-bar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; min-height: var(--pv-bar-h); padding: 8px 16px;
  padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right));
  background: var(--pv-night); color: var(--pv-ink); font-family: "Figtree", "Poppins", system-ui, sans-serif; box-shadow: 0 2px 14px rgba(0, 0, 0, .3);
}
.pv-logo img { display: block; height: 34px; width: auto; }
.pv-badge { padding: 5px 12px; border-radius: 999px; background: var(--pv-gold); color: #1B1300; font-weight: 800; font-size: 13px; letter-spacing: .02em; white-space: nowrap; }
.pv-now { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-now small { color: var(--pv-muted); font-weight: 600; margin-left: 4px; }
.pv-bar-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.pv-bar .pv-btn { min-height: 42px; padding: 8px 16px; font-size: 14.5px; }
.pv-reader-page .lr { overflow-x: clip; }
.pv-reader-page .lr-skip { top: -9999px; }                 /* keyboard "skip" link: hidden until focused */
.pv-reader-page .lr-skip:focus { top: calc(var(--pv-bar-h) + 8px); position: fixed; }
.pv-reader-page .lr-locked > img { width: 140px; max-width: 40%; height: auto; margin: 0 auto 6px; filter: none; }          /* lets the magazine header stick under the preview bar */
.pv-reader-page .lr-top { top: var(--pv-bar-h); }

@media (max-width: 860px) {
  .pv-now { display: none; }
}
@media (max-width: 600px) {
  :root { --pv-bar-h: 104px; }
  .pv-bar { flex-wrap: wrap; gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .pv-logo img { height: 28px; }
  .pv-bar-actions { width: 100%; margin-left: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .pv-bar .pv-btn { min-height: 40px; padding: 6px 10px; font-size: 13.5px; white-space: normal; text-align: center; line-height: 1.15; }
  .pv-badge { margin-left: auto; }
  .pv-reader-page .lr-top { position: relative; top: 0; }   /* on phones only the preview bar stays on screen */
}

/* switcher dialog */
.pv-dialog {
  width: min(980px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 26px; overflow: auto;
  background: radial-gradient(ellipse at top, #1D2752 0%, var(--pv-night) 75%); color: var(--pv-ink); font-family: "Figtree", "Poppins", system-ui, sans-serif;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .9);
}
.pv-dialog::backdrop { background: rgba(6, 10, 24, .72); backdrop-filter: blur(4px); }
.pv-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.pv-dialog-head h2 { margin: 0; font: 700 clamp(22px, 3.4vw, 32px)/1.15 "Fraunces", Georgia, serif; }
.pv-x { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .1); color: inherit; font-size: 28px; line-height: 1; cursor: pointer; }
.pv-x:focus-visible { outline: 3px solid var(--pv-gold); outline-offset: 2px; }
.pv-dialog-intro { margin: 6px 22px 18px; color: var(--pv-muted); }
.pv-dialog .pv-covers { padding: 0 clamp(10px, 2.4vw, 22px); }
.pv-dialog-foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding: 20px 22px 24px; }

/* free pages, "Members only" pages and the end of the preview */
.pv-contents-free { background: #FFF6DC; border-radius: 16px; padding: 12px 14px; }
.pv-freelist { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.pv-chip { display: inline-block; text-align: left; line-height: 1.35; min-height: 40px; padding: 6px 14px; border-radius: 999px; background: #fff; border: 2px solid #F1DFA9; color: #1E1B4B; font-weight: 600; font-size: 14.5px; text-decoration: none; }
.pv-chip b { color: #8A5A00; }
.pv-chip:hover { border-color: #E5A100; }
.pv-chip:focus-visible { outline: 3px solid #E5A100; outline-offset: 2px; }
.lr-locked .pv-free-hint { margin-top: 14px; font-weight: 700; }
.pv-next { margin-top: 18px; }
.pv-next-row { display: flex; flex-wrap: wrap; gap: 10px; }
.pv-reader-page .pv-next .pv-btn-line, .pv-reader-page .pv-end .pv-btn-line { color: #2B2470; }
.pv-end {
  margin: 26px auto 0; max-width: 760px; padding: 26px 24px; border-radius: 26px; text-align: center;
  background: linear-gradient(160deg, #1D2752, #0A0F1C); color: var(--pv-ink); font-family: "Figtree", "Poppins", system-ui, sans-serif;
  box-shadow: 0 24px 50px -28px rgba(11, 22, 64, .8);
}
.pv-end h2 { margin: 0 0 8px; font: 700 clamp(22px, 3vw, 28px)/1.2 "Fraunces", Georgia, serif; color: #fff; }
.pv-end p { color: var(--pv-muted); margin: 0 0 4px; }
.pv-end .pv-next-row { justify-content: center; }
.pv-reader-page .pv-end .pv-btn-line { color: var(--pv-ink); }

/* ---------------- phones ---------------- */
@media (max-width: 900px) {
  .pv-hero-grid { grid-template-columns: 1fr; }
  .pv-hero-covers { display: none; }
  .pv-cards { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; }
  .pv-card { flex-direction: row; }
  .pv-card-cover { width: 34%; aspect-ratio: auto; object-fit: cover; border-bottom: 0; border-right: 3px solid var(--pv-c); }
}
@media (max-width: 640px) {
  .pv-tries { grid-template-columns: 1fr; }
  .pv-pick { grid-template-columns: 1fr 1fr; }
  .pv-card { flex-direction: column; }
  .pv-card-cover { width: 100%; aspect-ratio: 16 / 10; border-right: 0; border-bottom: 3px solid var(--pv-c); }
  .pv-cover { border-radius: 16px; }
  .pv-cover-hook { display: none; }
  .pv-cover-go::after { content: ""; }
}
