/* ==========================================================================
   portal.css: what the prototype's build step does that Blade pages need in CSS.
   (The prototype CSS itself lives in public/portal, synced from the UI repo.)
   ========================================================================== */

/* Direction icons (arrows, chevrons) carry data-mirror. The prototype's
   src/build.js flips their drawing on the LTR pages; here the same flip is
   done in CSS: each shape is mirrored around the centre of the icon's
   viewBox, like the build's matrix(-1 0 0 1 <width> 0). Templates cloned by
   the scripts get it too. */
html[dir="ltr"] svg[data-mirror] > * {
  transform: scaleX(-1);
  transform-box: view-box;
  transform-origin: 50% 50%;
}

/* Content page: 5–12 translations are all chips on wide screens, so the
   "all languages" button is for phones only (the design's sheet breakpoint). */
@media (min-width: 641px) {
  .mp-trbtn.is-phone-only {
    display: none;
  }
}

/* Content page reader with a PDF (public/js/portal-reader.js): the pages, drawn
   by PDF.js, in the design's page column. */
.pdf-body {
  padding-block: 16px;
}

.pdf-pages {
  display: flex;
  flex-direction: column;
  align-items: safe center;   /* a zoomed page wider than the column stays scrollable on both sides */
  gap: 16px;
  overflow-x: auto;          /* zoomed in: the pages scroll sideways */
}

.pdf-page {
  flex: none;
  max-width: none;
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: 6px;
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.06);
  overflow: hidden;
}

.pdf-page__canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.pdf-status {
  margin: 24px 0;
  text-align: center;
  color: var(--color-text-muted, var(--color-brand-dark-muted));
}

.pdf-status a {
  font-weight: 700;
  text-decoration: underline;
}

.mp-tocb--sub {
  padding-inline-start: 2.25em;
  font-size: 0.92em;
}

/* a long bookmark title wraps instead of scrolling the list sideways */
.mp-toclist {
  overflow-x: hidden;
}
.mp-tocb {
  overflow-wrap: anywhere;
}

/* an article read as text has no contents column */
.mp-reader.is-text .mp-page {
  grid-column: 1 / -1;
}

/* video page: a video with only a YouTube link (same 16:9 frame as the player) */
.vp-yt {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

/* video series: the audio page's track list under the player */
.vp-list {
  margin-top: 18px;
}

/* search results (content view on /search): the count under the title, and each
   card names its language on the cover (results come from every language) */
.pg-search-count {
  margin: -4px 0 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-ink-600);
}
.mcard__cover { position: relative; }
.mcard__lang {
  position: absolute;
  inset-block-end: 6px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 8px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(20, 36, 59, .86);
  color: var(--color-white);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  backdrop-filter: blur(4px);
}
html[dir="rtl"] .mcard__lang { transform: translateX(50%); }

/* A tenant site's own logo in the dark footer: on a white panel, so a dark or
   white-backed logo still shows (the portal's logo has a white version). */
.ft__logo--site {
  box-sizing: content-box;
  height: 60px;
  max-width: 220px;
  object-fit: contain;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--color-white);
}

/* Card window: the note after a network button sent the picture by clipboard/download */
.shm-note {
  margin: 4px 0 0;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--color-blue-600);
}
.shm-note[hidden] { display: none; }
