/* Edromos PDF viewer: the print pages on a quiet stage, one floating toolbar, a paper page turn. */
.edpv {
  --edpv-stage: #efedea;
  --edpv-line: #dcd8d2;
  --edpv-fg: #1b1a19;
  --edpv-muted: #5c5852;
  --edpv-accent: #d0121b;
  --edpv-accent-dark: #a80e15;
  --edpv-ease: cubic-bezier(.2, .8, .2, 1);
  position: relative;
  container-type: inline-size;
  max-inline-size: var(--edpv-max-w, none);
  margin: 0 auto 1.75em;
  padding: 12px clamp(8px, 2.5vw, 28px) 10px;
  border-radius: 12px;
  background: var(--edpv-stage);
  color: var(--edpv-fg);
  font: 14px/1.3 Roboto, system-ui, sans-serif;
}
.edpv ::selection { background: rgb(208 18 27 / .18); }
/* Phones: pages edge to edge (bigger to read, and no earlier lazy-loading of pages further along). */
@media (max-width: 600px) { .edpv { padding-inline: 0; border-radius: 0; } }
.edpv-sr {
  position: absolute !important;
  inline-size: 1px; block-size: 1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* Controls that need the script stay invisible (but keep their space) until it has run. */
.edpv:not(.is-ready) :is([data-edpv="prev"], [data-edpv="next"], [data-edpv="zoom"], [data-edpv="fullscreen"], .edpv-goto, .edpv-thumbs button) { visibility: hidden; }

/* Toolbar: one white pill floating over the stage */
.edpv-bar {
  position: relative; z-index: 4; /* above a page in mid-turn */
  display: flex; align-items: center; gap: 2px;
  inline-size: fit-content; max-inline-size: 100%;
  margin: 0 auto 14px;
  padding: 4px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(27 26 25 / .06), 0 6px 18px -4px rgb(27 26 25 / .14);
}
.edpv-sep { flex: none; inline-size: 1px; block-size: 22px; margin-inline: 6px; background: var(--edpv-line); }
.edpv-count {
  min-inline-size: 5.2em; padding-inline: 4px;
  text-align: center; font-size: 15px; font-weight: 500;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.edpv-count-of { color: var(--edpv-muted); font-weight: 400; }
.edpv .edpv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-inline-size: 40px; min-block-size: 40px;
  margin: 0; padding: 0 8px;
  border: 0; border-radius: 999px;
  background: transparent; color: inherit;
  cursor: pointer; touch-action: manipulation;
  font: inherit; font-weight: 500; line-height: 1;
  text-decoration: none; box-shadow: none;
  transition: background-color .15s, color .15s, transform .15s var(--edpv-ease);
}
@media (pointer: coarse) { .edpv .edpv-btn { min-inline-size: 44px; min-block-size: 44px; } }
@media (hover: hover) { .edpv .edpv-btn:hover { background: #f1efeb; } }
.edpv .edpv-btn:active:not([aria-disabled="true"]) { transform: scale(.94); }
.edpv .edpv-btn[aria-pressed="true"] { background: var(--edpv-fg); color: #fff; }
.edpv .edpv-btn[aria-disabled="true"] { opacity: .3; cursor: default; }
/* The one action that matters most: the download, in the masthead red. */
.edpv .edpv-btn--primary { margin-inline-start: 4px; padding: 0 16px 0 12px; background: var(--edpv-accent); color: #fff; }
@media (hover: hover) { .edpv .edpv-btn--primary:hover { background: var(--edpv-accent-dark); color: #fff; } }
.edpv .edpv-btn--primary[aria-expanded="true"] { background: var(--edpv-accent-dark); }
@container (max-width: 440px) {
  .edpv-btn-text { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
  .edpv .edpv-btn--primary { padding: 0 10px; }
  .edpv-sep { margin-inline: 2px; }
  .edpv-goto { display: none; }
}
.edpv .edpv-btn:focus-visible,
.edpv-thumbs button:focus-visible,
.edpv-track:focus-visible,
.edpv-goto input:focus-visible,
.edpv-menu a:focus-visible { outline: 2px solid var(--edpv-accent); outline-offset: 2px; }
.edpv-goto input {
  inline-size: 3.6em; min-block-size: 32px; margin: 0 2px; padding: 0 .4em;
  border: 1px solid var(--edpv-line); border-radius: 999px;
  background: #faf9f7; color: inherit; font: inherit; text-align: center;
}
.edpv-goto input::placeholder { color: var(--edpv-muted); }

/* Download menu (popover, anchored to its button) */
.edpv-menu {
  margin: 6px 0 0; padding: 6px;
  border: 0; border-radius: 12px;
  background: #fff; color: var(--edpv-fg);
  box-shadow: 0 0 0 1px rgb(27 26 25 / .06), 0 12px 32px -6px rgb(27 26 25 / .28);
  font: 14px/1.3 Roboto, system-ui, sans-serif;
}
.edpv-menu[popover] {
  inset: auto;
  position-area: block-end span-inline-start;
  position-try-fallbacks: flip-block, flip-inline;
}
@supports not (position-area: block-end) { .edpv-menu[popover] { position: fixed; } }
.edpv-menu:not([popover]) { position: absolute; inset-inline-end: .5rem; z-index: 5; }
.edpv-menu a { display: block; padding: .7rem 1rem; border-radius: 8px; color: inherit; text-decoration: none; white-space: nowrap; }
.edpv-menu a[hidden] { display: none; }
@media (hover: hover) { .edpv-menu a:hover { background: #f4f2ef; color: inherit; } }
@media (prefers-reduced-motion: no-preference) {
  .edpv-menu[popover] {
    opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top right;
    transition: opacity .16s, transform .2s var(--edpv-ease), display .2s, overlay .2s;
    transition-behavior: allow-discrete;
  }
  .edpv-menu[popover]:popover-open {
    opacity: 1; transform: none;
    @starting-style { opacity: 0; transform: translateY(-4px) scale(.98); }
  }
}

/* Pages: native scroll-snap track. One page per view, two from 800px (adaptive).
   The block padding leaves room for the paper's shadow inside the scroller. */
.edpv-track {
  --edpv-cols: 1;
  position: relative;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  touch-action: manipulation;
  max-inline-size: calc(var(--edpv-max-h, 100000px) * var(--edpv-ratio) * var(--edpv-cols));
  margin-inline: auto;
  padding-block: 2px 18px;
  user-select: none; -webkit-user-select: none;
}
.edpv-track::-webkit-scrollbar { display: none; }
@container (min-width: 800px) { .edpv--adaptive .edpv-track { --edpv-cols: 2; } }
.edpv--double .edpv-track { --edpv-cols: 2; }

.edpv-pad { display: none; }
.edpv .edpv-page {
  position: relative;
  flex: 0 0 calc(100% / var(--edpv-cols));
  margin: 0; padding: 0;
  aspect-ratio: var(--edpv-ratio);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #fff;
  box-shadow: 0 10px 22px -12px rgb(27 26 25 / .45), 0 2px 4px rgb(27 26 25 / .06);
}
.edpv .edpv-page picture { display: contents; }
.edpv .edpv-page img { display: block; inline-size: 100%; block-size: auto; max-inline-size: none; margin: 0; -webkit-user-drag: none; }
.edpv-zoom-on .edpv-page { cursor: zoom-in; }
.edpv.is-dragging, .edpv.is-dragging .edpv-page { cursor: grabbing; }

/* Loading: a soft sheen on the blank sheet until its image has arrived (page 1 is never hidden: it is the LCP). */
.edpv.is-ready .edpv-page:not(.is-loaded) {
  background: linear-gradient(100deg, #fff 30%, #f3f1ee 50%, #fff 70%) 0 0 / 300% 100%;
}
.edpv.is-ready .edpv-page:not(.is-loaded, [data-page="1"]) img { opacity: 0; }
.edpv.is-ready .edpv-page img { transition: opacity .35s ease-out; }
@media (prefers-reduced-motion: no-preference) {
  .edpv.is-ready .edpv-page:not(.is-loaded) { animation: edpv-sheen 1.4s linear infinite; }
}
@keyframes edpv-sheen { to { background-position: -150% 0; } }

/* Two pages: [blank | 1] [2 | 3] ... snap on the left page of each spread.
   Children: the pad is child 1, page p is child p+1, so left pages are odd children and right pages even. */
@container (min-width: 800px) {
  .edpv--adaptive .edpv-pad { display: block; flex: 0 0 50%; scroll-snap-align: start; }
  .edpv--adaptive .edpv-pad-end { scroll-snap-align: none; }
  .edpv--adaptive .edpv-page { scroll-snap-align: none; }
  .edpv--adaptive .edpv-page:nth-child(odd) { scroll-snap-align: start; }
}
.edpv--double .edpv-pad { display: block; flex: 0 0 50%; scroll-snap-align: start; }
.edpv--double .edpv-pad-end { scroll-snap-align: none; }
.edpv--double .edpv-page { scroll-snap-align: none; }
.edpv--double .edpv-page:nth-child(odd) { scroll-snap-align: start; }

/* Spine: the fold where the two pages meet, a deep crease with a faint highlight beside it. */
@container (min-width: 800px) {
  .edpv--adaptive .edpv-page::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
  .edpv--adaptive .edpv-page:nth-child(odd)::after { background: linear-gradient(to left, rgb(27 26 25 / .22), rgb(27 26 25 / .06) 1.2%, rgb(255 255 255 / .12) 2.4%, rgb(27 26 25 / 0) 6%); }
  .edpv--adaptive .edpv-page:nth-child(even)::after { background: linear-gradient(to right, rgb(27 26 25 / .18), rgb(27 26 25 / .04) 1.5%, rgb(27 26 25 / 0) 4.5%); }
}
.edpv--double .edpv-page::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.edpv--double .edpv-page:nth-child(odd)::after { background: linear-gradient(to left, rgb(27 26 25 / .22), rgb(27 26 25 / .06) 1.2%, rgb(255 255 255 / .12) 2.4%, rgb(27 26 25 / 0) 6%); }
.edpv--double .edpv-page:nth-child(even)::after { background: linear-gradient(to right, rgb(27 26 25 / .18), rgb(27 26 25 / .04) 1.5%, rgb(27 26 25 / 0) 4.5%); }

/* The outer corner lifts a little under the mouse: a hint that the page can be dragged over. */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  @container (min-width: 800px) {
    .edpv--adaptive.is-ready .edpv-page::before {
      content: ""; position: absolute; z-index: 1; inset-block-end: 0;
      inline-size: 0; block-size: 0;
      transition: inline-size .25s var(--edpv-ease), block-size .25s var(--edpv-ease);
      pointer-events: none;
    }
    .edpv--adaptive.is-ready .edpv-page:nth-child(even)::before { inset-inline-end: 0; background: linear-gradient(135deg, #fbfaf8 0 48%, #d9d4cd 50%, var(--edpv-stage) 52%); box-shadow: -3px -3px 6px -3px rgb(27 26 25 / .3); }
    .edpv--adaptive.is-ready .edpv-page:nth-child(odd)::before { inset-inline-start: 0; background: linear-gradient(225deg, #fbfaf8 0 48%, #d9d4cd 50%, var(--edpv-stage) 52%); box-shadow: 3px -3px 6px -3px rgb(27 26 25 / .3); }
    .edpv--adaptive.is-ready:not(.is-dragging) .edpv-page:hover::before { inline-size: 30px; block-size: 30px; }
  }
}

/* Page turn (two-page view): the old spread is drawn on an overlay and a leaf turns over the spine,
   catching the light on its way up and casting its shadow on the page it uncovers. */
.edpv-flip { position: absolute; z-index: 3; pointer-events: none; perspective: 2600px; }
.edpv-flip-half, .edpv-leaf { position: absolute; inset-block: 0; inline-size: 50%; }
.edpv-flip-half { background: #fff center / 100% 100% no-repeat; overflow: hidden; }
.edpv-flip-half.edpv-flip-empty { background: transparent; }
.edpv-flip-l { inset-inline-start: 0; }
.edpv-flip-r { inset-inline-start: 50%; }
.edpv-leaf { transform-style: preserve-3d; }
.edpv-leaf-r { inset-inline-start: 50%; transform-origin: left center; }
.edpv-leaf-l { inset-inline-start: 0; transform-origin: right center; }
.edpv-leaf .edpv-flip-half { inset-inline-start: 0; inline-size: 100%; backface-visibility: hidden; box-shadow: 0 0 18px rgb(27 26 25 / .22); }
.edpv-leaf .edpv-flip-back { transform: rotateY(180deg); }
.edpv-flip-shade { position: absolute; inset: 0; opacity: 0; }
.edpv-leaf .edpv-flip-shade { background: rgb(27 26 25); }
.edpv-leaf-r .edpv-flip-front .edpv-flip-shade, .edpv-leaf-l .edpv-flip-back .edpv-flip-shade { background: linear-gradient(to right, rgb(27 26 25 / .9), rgb(27 26 25 / .5)); }
.edpv-leaf-l .edpv-flip-front .edpv-flip-shade, .edpv-leaf-r .edpv-flip-back .edpv-flip-shade { background: linear-gradient(to left, rgb(27 26 25 / .9), rgb(27 26 25 / .5)); }
.edpv-flip > .edpv-flip-r .edpv-flip-shade { transform-origin: left center; background: linear-gradient(to right, rgb(27 26 25 / .55), rgb(27 26 25 / 0) 70%); }
.edpv-flip > .edpv-flip-l .edpv-flip-shade { transform-origin: right center; background: linear-gradient(to left, rgb(27 26 25 / .55), rgb(27 26 25 / 0) 70%); }
.edpv-flip-gloss { position: absolute; inset: 0; opacity: 0; background: linear-gradient(100deg, rgb(255 255 255 / 0) 30%, rgb(255 255 255 / .75) 50%, rgb(255 255 255 / 0) 70%) 100% 0 / 200% 100% no-repeat; }
.edpv-flip > .edpv-flip-half > .edpv-flip-gloss { display: none; }

/* Thumbnails */
.edpv-thumbs {
  display: flex; gap: 6px;
  overflow-x: auto; overscroll-behavior-x: contain;
  margin-block-start: 2px;
  padding: 6px 2px 8px;
  scrollbar-width: thin;
  scrollbar-color: #bdb8b0 transparent;
}
.edpv .edpv-thumbs button {
  flex: none;
  display: grid; justify-items: center; gap: 5px;
  margin: 0; padding: 4px 4px 3px;
  border: 0; border-radius: 6px;
  background: transparent; color: var(--edpv-muted); cursor: pointer;
  font: inherit; font-size: 12px; line-height: 1; font-variant-numeric: tabular-nums;
  transition: background-color .15s, color .15s;
}
.edpv-thumbs img {
  display: block; inline-size: 76px; block-size: auto; max-inline-size: none;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgb(27 26 25 / .08), 0 3px 6px -3px rgb(27 26 25 / .35);
  transition: transform .2s var(--edpv-ease), box-shadow .2s;
}
@media (hover: hover) {
  .edpv .edpv-thumbs button:hover { background: rgb(255 255 255 / .6); color: var(--edpv-fg); }
  .edpv .edpv-thumbs button:hover img { transform: translateY(-2px); }
}
.edpv .edpv-thumbs button[aria-current="true"] { background: #fff; color: var(--edpv-accent); font-weight: 700; }
.edpv .edpv-thumbs button[aria-current="true"] img { box-shadow: 0 0 0 2px var(--edpv-accent), 0 4px 10px -4px rgb(27 26 25 / .4); }

/* Full screen (native :fullscreen, or the fixed fallback on iPhone): the same stage, dark. */
.edpv:fullscreen, .edpv.is-fs {
  --edpv-stage: #1b1a19;
  --edpv-muted: #bdb7ae;
  position: fixed; inset: 0; z-index: 2147483000;
  display: flex; flex-direction: column; justify-content: center;
  max-inline-size: none; margin: 0; border-radius: 0;
  overflow: auto;
  color: #f4f2ef;
}
.edpv:fullscreen .edpv-bar, .edpv.is-fs .edpv-bar { color: var(--edpv-fg); }
.edpv:fullscreen .edpv-thumbs, .edpv.is-fs .edpv-thumbs { scrollbar-color: #57534d transparent; }
@media (hover: hover) {
  .edpv:fullscreen .edpv-thumbs button:hover, .edpv.is-fs .edpv-thumbs button:hover { background: rgb(255 255 255 / .08); color: #fff; }
}
.edpv:fullscreen .edpv-thumbs button[aria-current="true"], .edpv.is-fs .edpv-thumbs button[aria-current="true"] { background: rgb(255 255 255 / .1); color: #ff6b70; }
.edpv--fit-fs:is(:fullscreen, .is-fs) .edpv-track {
  max-inline-size: min(100%, calc((100dvh - 11rem) * var(--edpv-ratio) * var(--edpv-cols)));
}
.edpv-lock, .edpv-lock body { overflow: hidden; }

/* Zoom dialog: the page large, pan by scrolling/dragging */
.edpv-zoom {
  inline-size: 100vw; block-size: 100dvh;
  max-inline-size: none; max-block-size: none;
  margin: 0; padding: 0; border: 0;
  background: #1b1a19;
}
.edpv-zoom::backdrop { background: rgb(27 26 25 / .85); }
@media (prefers-reduced-motion: no-preference) {
  .edpv-zoom[open] { animation: edpv-zoom-in .28s var(--edpv-ease); }
}
@keyframes edpv-zoom-in { from { opacity: 0; transform: scale(.97); } }
.edpv-zoom-pan { inline-size: 100%; block-size: 100%; overflow: auto; overscroll-behavior: contain; scrollbar-color: #57534d transparent; }
.edpv-zoom-pan img { display: block; max-inline-size: none; block-size: auto; margin: 0 auto; cursor: zoom-out; }
.edpv .edpv-zoom-close {
  position: fixed; inset-block-start: 12px; inset-inline-end: 12px; z-index: 1;
  min-inline-size: 44px; min-block-size: 44px;
  background: #fff; color: var(--edpv-fg);
  box-shadow: 0 6px 18px -4px rgb(0 0 0 / .45);
}
@media (hover: hover) { .edpv .edpv-zoom-close:hover { background: #f1efeb; } }
.edpv-error { color: #b00; }

/* Teaser for readers without access: the cover lifted on the same stage, the issue facts,
   one red action. The stacked edges behind the cover are the issue's other pages. */
.edpv-teaser {
  display: grid;
  grid-template-columns: minmax(0, 38rem);
  gap: 1.5rem 2.25rem;
  align-items: center;
  margin: 0 0 2rem;
  padding: clamp(18px, 4vw, 36px);
  border-radius: 12px;
  background: #efedea;
  color: #1b1a19;
  font: 16px/1.55 Roboto, system-ui, sans-serif;
}
.edpv-teaser--cover { grid-template-columns: minmax(0, 15rem) minmax(0, 32rem); }
@media (max-width: 600px) {
  .edpv-teaser--cover { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .edpv-teaser-cover { max-inline-size: 13rem; }
}
.edpv-teaser-cover { margin: 0 10px 10px 0; }
.edpv-teaser-cover img {
  display: block; inline-size: 100%; block-size: auto; margin: 0;
  box-shadow:
    3px 3px 0 -1px #fff, 3px 3px 0 0 #d4cfc8,
    6px 6px 0 -1px #fff, 6px 6px 0 0 #d4cfc8,
    0 18px 34px -12px rgb(27 26 25 / .45);
}
/* The theme sets its own font on post paragraphs; the teaser keeps the viewer's. */
body .edpv-teaser :is(p, a, span, strong) { font-family: Roboto, system-ui, sans-serif; }
.edpv-teaser-body > :first-child { margin-block-start: 0; }
.edpv-teaser-facts { margin: 0 0 .5rem; font-size: 1.35rem; line-height: 1.2; font-weight: 700; font-variant-numeric: tabular-nums; text-wrap: balance; }
.edpv-teaser-lead { margin: 0 0 1rem; color: #3d3a36; }
.edpv-teaser-more { margin: 1.25rem 0 0; }
/* Links in ink, so the subscribe button stays the only red here. */
.edpv-teaser-body a:not([href*="/register"]) { color: #1b1a19; text-decoration: underline; text-decoration-color: rgb(27 26 25 / .35); text-underline-offset: 3px; }
@media (hover: hover) { .edpv-teaser-body a:not([href*="/register"]):hover { color: #d0121b; text-decoration-color: currentColor; } }
.edpv-teaser-body a:not([href*="/register"]):focus-visible { outline: 2px solid #d0121b; outline-offset: 2px; }
.edpv-teaser-more a { font-weight: 500; }
/* The membership message's sign-up link is the one action that matters here. */
.edpv-teaser-body a[href*="/register"] {
  display: inline-block;
  padding: .75em 1.4em;
  border-radius: 999px;
  background: #d0121b;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 16px -6px rgb(208 18 27 / .6);
  transition: background-color .15s, transform .15s cubic-bezier(.2, .8, .2, 1);
}
@media (hover: hover) { .edpv-teaser-body a[href*="/register"]:hover { background: #a80e15; color: #fff; transform: translateY(-1px); } }
.edpv-teaser-body a[href*="/register"]:focus-visible { outline: 2px solid #d0121b; outline-offset: 3px; }
