/* fx/m-security.css — phone layer for the Security magazine (fx/m-flipbook.js GL reader + tilting covers,
   fx/flipbook-lite.js on no-GL phones). See fx/README.md. Every rule targets classes the modules add, scoped to
   html.fx-phone, so desktop and the page at rest are unchanged.
   Stacking on phones: sticky nav 80 < reader / lite viewer 90 < zoom-rects 95 < transitions 100. */

/* ------------------------------------------------------------ covers: CSS-3D magazines */
.msec-mag { display: none; }
html.fx-phone .msec-tilt.is-visible.msec-ready {
  overflow: visible;
  background: transparent;
}
html.fx-phone .msec-tilt.is-visible.msec-ready > img { visibility: hidden; }
html.fx-phone .msec-tilt.is-visible.msec-ready > .msec-mag {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  perspective: 820px;
  pointer-events: none;
}
.msec-mag__body {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}
.msec-mag__face {
  position: absolute;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.msec-mag__front {
  inset: 0;
  overflow: hidden;
  background: #e6e6e6;
  transform: translateZ(calc(var(--t, 10px) / 2));
}
.msec-mag__front > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.msec-mag__shade {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
}
.msec-mag__back {
  inset: 0;
  background: #ececec;
  transform: rotateY(180deg) translateZ(calc(var(--t, 10px) / 2));
}
/* spine: the cover wrapping round the binding, a shade darker */
.msec-mag__spine {
  top: 0;
  left: calc(50% - var(--t, 10px) / 2);
  width: var(--t, 10px);
  height: 100%;
  background: #555 left center / auto 100% no-repeat;
  box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.32);
  transform: rotateY(-90deg) translateZ(calc(var(--w, 200px) / 2));
}
/* page block: fine stripes of paper (as the desktop book's stack edges) */
.msec-mag__block--r {
  top: 0;
  left: calc(50% - var(--t, 10px) / 2);
  width: var(--t, 10px);
  height: 100%;
  background: repeating-linear-gradient(90deg, #f3f3f3 0 1px, #c4c4c4 1px 2px);
  transform: rotateY(90deg) translateZ(calc(var(--w, 200px) / 2));
}
.msec-mag__block--t,
.msec-mag__block--b {
  left: 0;
  top: calc(50% - var(--t, 10px) / 2);
  width: 100%;
  height: var(--t, 10px);
  background: repeating-linear-gradient(0deg, #f3f3f3 0 1px, #c4c4c4 1px 2px);
}
.msec-mag__block--t { transform: rotateX(90deg) translateZ(calc(var(--h, 300px) / 2)); }
.msec-mag__block--b { transform: rotateX(-90deg) translateZ(calc(var(--h, 300px) / 2)); }
/* contact shadow on the white page: darkening only */
.msec-mag__shadow {
  position: absolute;
  inset: 4% 3% 1%;
  background: rgba(0, 0, 0, 0.2);
  filter: blur(9px);
  transform: translate(0, 6px);
}

/* ------------------------------------------------------------ zoom rectangles (reader open / close) */
.sec-zoom {
  position: fixed;
  inset: 0;
  z-index: 95;
  pointer-events: none;
  overflow: hidden;
}
.sec-zoom__rect {
  position: absolute;
  display: none;
  box-sizing: border-box;
  border: 1px solid #000ca9;
}

/* ------------------------------------------------------------ no-GL phones: lite viewer above the sticky nav */
html.fx-phone .sec-lite { z-index: 90; }

/* ------------------------------------------------------------ GL reader */
.msec {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  background: #fff;
  font-family: 'Pixelify Sans', sans-serif;
  color: #000ca9;
  outline: none;
  touch-action: none;
  overscroll-behavior: contain;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.msec.is-open { display: block; }
.msec__stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.msec__canvas { display: block; width: 100%; height: 100%; }
.msec__hit {
  position: absolute;
  inset: 0;
  z-index: 1;
  touch-action: none;
}

.msec__bar,
.msec__foot {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  background: #fff;
}
.msec__bar {
  top: 0;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px 0 12px;
  border-bottom: 1px solid #000ca9;
}
.msec__name {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.msec__foot {
  bottom: 0;
  height: 52px;
  border-top: 1px solid #000ca9;
}
.msec__prog {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 5px;
  display: flex;
  gap: 2px;
  height: 4px;
}
.msec__prog > i { flex: 1 1 0; background: #e3e4f4; }
.msec__prog > i.on { background: #000ca9; }
.msec__nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.msec__count {
  min-width: 17ch;
  font-size: 14px;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.msec button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  min-width: 44px;
  height: 40px;
  padding: 0 10px;
  border: 0;
  background: none;
  color: #000ca9;
  font: inherit;
  font-size: 15px;
  line-height: 1;
}
.msec button:active { background: #000ca9; color: #fff; }
.msec button:disabled { opacity: 0.25; background: none; color: #000ca9; }
.msec button:focus { outline: none; }
.msec button:focus-visible { outline: 1px dotted #000ca9; outline-offset: -4px; }

/* landscape spreads: slimmer chrome */
.msec.is-land .msec__bar { height: 34px; }
.msec.is-land .msec__foot { height: 40px; }
.msec.is-land .msec__nav { height: 34px; }
.msec.is-land .msec__prog { top: 3px; height: 3px; }
.msec.is-land .msec__name,
.msec.is-land .msec__count { font-size: 13px; }

/* tap in the middle: page only */
.msec.is-bare .msec__bar,
.msec.is-bare .msec__foot { display: none; }
.msec.is-zoomed .msec__bar,
.msec.is-zoomed .msec__foot { background: rgba(255, 255, 255, 0.92); }

/* first-open hint: a Win-style tooltip, hard cut in and out */
.msec__tip {
  position: absolute;
  right: 10px;
  bottom: 62px;
  z-index: 3;
  display: none;
  padding: 5px 7px;
  background: #fff;
  border: 1px solid #000ca9;
  box-shadow: 2px 2px 0 #000ca9;
  font-size: 12px;
  line-height: 1.3;
  text-align: right;
  pointer-events: none;
}
.msec.has-tip .msec__tip { display: block; }
.msec.is-land .msec__tip { bottom: 48px; }
