/* refacut.css - the look of a page drawn by refacut.js (paper, inks, stamps, typewriter and handwriting fonts).
   Taken unchanged from the first reader (web/static/styles.css, the page layers). */
.render-layer { --paper-ivory: #fcfaf4; --paper-white: #ffffff; }
.render-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  contain: strict;
}

/* PAGE CONTENT LAYERS */
.layer-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  pointer-events: none;
  z-index: 1;
}

/* MODE 2: RESTAURAT SHEET (ULTRA-AUTENTIC DEFAULT + FILDEȘ + ALB PUR) */
.render-layer.has-desk-bg {
  background: #14171e;
}
.paper-sheet-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.paper-sheet-wrap.has-shape-shadow {
  filter: drop-shadow(0 5px 14px rgba(0, 0, 0, 0.52));
}
.paper-sheet {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.paper-sheet.ultra-paper {
  background-image: url("/static/paper_grain.webp?v=5");
  background-size: 256px 256px;
  background-repeat: repeat;
  box-shadow: inset 0 0 18px rgba(56, 38, 16, 0.08), inset 0 0 2px rgba(48, 32, 12, 0.10);
}
.paper-sheet.clean-paper-ivory {
  background: var(--paper-ivory);
  background-image: radial-gradient(rgba(150, 130, 95, 0.04) 1px, transparent 0);
  background-size: 24px 24px;
}
.paper-sheet.clean-paper-white {
  background: var(--paper-white);
}

/* Subtle physical paper fold creases detected from the original scan */
.paper-crease {
  position: absolute;
  pointer-events: none;
  z-index: 3;
}
.paper-crease-v {
  top: 0;
  bottom: 0;
  width: 14px;
  transform: translateX(-50%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(48, 34, 16, calc(0.11 * var(--crease-s, 0.6))) 38%,
    rgba(255, 250, 238, calc(0.14 * var(--crease-s, 0.6))) 52%,
    rgba(48, 34, 16, calc(0.07 * var(--crease-s, 0.6))) 66%,
    transparent 100%
  );
}
.paper-crease-h {
  left: 0;
  right: 0;
  height: 14px;
  transform: translateY(-50%);
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(48, 34, 16, calc(0.10 * var(--crease-s, 0.6))) 38%,
    rgba(255, 250, 238, calc(0.13 * var(--crease-s, 0.6))) 52%,
    rgba(48, 34, 16, calc(0.06 * var(--crease-s, 0.6))) 66%,
    transparent 100%
  );
}

.cloth-spine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 4;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0,0,0,0.08) 0 1px, transparent 1px 3px),
    linear-gradient(90deg, rgba(0,0,0,0.28) 0%, rgba(255,255,255,0.06) 70%, rgba(0,0,0,0.35) 100%);
  box-shadow: 3px 0 10px rgba(35, 24, 10, 0.28);
}

.ink-blend-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
}
/* Single GPU blend pass for stamps & transparent ink cutouts -> paper fibers show naturally through them */
.paper-sheet.ultra-paper .ink-blend-layer {
  mix-blend-mode: multiply;
  opacity: 0.94;
}
/* Crisp unblended text layer so typography renders razor-sharp without multiply softening */
.crisp-text-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 6;
  pointer-events: none;
}
.crisp-text-layer .tb {
  pointer-events: auto;
}
/* Authentic mechanical typewriter ribbon weight using paint-order: stroke fill (keeps inner counters a/e/ă/ș open!) */
.paper-sheet.ultra-paper .tb.cf-typewriter {
  paint-order: stroke fill;
  -webkit-text-stroke: 0.14px currentColor;
  text-shadow: 0 0 0.32px rgba(34, 28, 20, 0.24);
}
/* Heavy 1950s mechanical inked ribbon (detected automatically from scan ink density) */
.paper-sheet.ultra-paper.heavy-typed .tb.cf-typewriter {
  paint-order: stroke fill;
  -webkit-text-stroke: 0.28px currentColor;
  text-shadow: 0 0 0.38px rgba(30, 24, 18, 0.28);
}

.top-opaque-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 8;
  pointer-events: none;
}
.top-opaque-layer .tb {
  pointer-events: auto;
}

.shape-bevel-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 11;
  pointer-events: none;
}

.vector-grid-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.clean-artifact {
  position: absolute;
  z-index: 3;
  pointer-events: none;
}
.clean-artifact img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.clean-artifact.kind-photo {
  border: none;
  box-shadow: 0 2px 7px rgba(34, 24, 12, 0.32), 0 0 0 0.5px rgba(72, 58, 38, 0.24);
  background: transparent;
}
.clean-artifact.kind-redaction {
  background: #161513;
  border-radius: 1.5px;
  box-shadow: 0 0 1.5px rgba(18, 16, 14, 0.4);
}
.clean-artifact.kind-redaction.redaction-white {
  background: #faf9f5;
  border: 1px solid rgba(42, 38, 32, 0.42);
  box-shadow: 0 0.5px 2px rgba(24, 20, 14, 0.16);
}
.clean-artifact.kind-barcode {
  background: #fcfbf8;
  border: 1px solid #d5d0c5;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
  color: #151515;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 6% 7% 5%;
  overflow: hidden;
}
.bar-bars {
  width: 100%;
  height: 44%;
  display: flex;
  align-items: stretch;
}
.bar-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.bar-txt {
  width: 100%;
  text-align: center;
  font-family: "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: 0.02em;
}
.bar-l0 {
  display: inline-block;
  font-family: Consolas, "Courier New", monospace;
  letter-spacing: 0.14em;
  font-weight: 700;
}
.bar-l1 {
  display: inline-block;
  font-weight: 700;
}
.clean-artifact.kind-vstamp {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--stamp-color, #2f3b58);
  background: transparent;
  overflow: visible;
  opacity: 0.84;
}
.clean-artifact.kind-vstamp .vstamp-inner {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.08;
  white-space: nowrap;
  transform-origin: center center;
  text-shadow: 0 0 0.45px currentColor;
}
.clean-artifact.kind-vstamp.vstamp-multiline .vstamp-inner {
  white-space: normal;
  width: 100%;
  line-height: 1.14;
}
.clean-artifact.kind-vstamp.vstamp-boxed .vstamp-inner {
  padding: 2px 6px;
  border: 1.5px solid currentColor;
  border-radius: 1.5px;
  box-shadow: inset 0 0 0 0.5px currentColor;
}
.clean-artifact.kind-vstamp.vstamp-font-numeric .vstamp-inner {
  font-family: "Courier Prime", "Courier New", Consolas, monospace;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.clean-artifact.kind-vstamp.vstamp-font-condensed .vstamp-inner {
  font-family: "Oswald", "Bahnschrift Condensed", "Arial Narrow", sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.clean-artifact.kind-vstamp.vstamp-font-serif .vstamp-inner {
  font-family: "Old Standard TT", "PT Serif", Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* EXACT 1:1 TEXT BLOCKS (SHARED IDENTICALLY BY RESTAURAT & EDIȚIE CURATĂ!) */
.tb {
  position: absolute;
  z-index: 6;
  overflow: visible;
  word-wrap: normal;
  overflow-wrap: normal;
  word-break: normal;
  white-space: normal;
  transform-origin: center center;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}
.tb.is-rotated {
  display: flex;
  align-items: center;
  justify-content: center;
}
.tb-inner { display: block; width: 100%; }

/* THE 2 STANDARD FONTS (Fallback) */
.med-typed, .med-printed {
  font-family: "Source Serif 4", "PT Serif", "Georgia", "Times New Roman", serif;
  font-style: normal;
}
.med-handwritten {
  font-family: "Kalam", "Caveat", "Segoe Print", cursive;
  font-style: normal;
}
.inline-hw {
  font-family: "Kalam", "Caveat", "Segoe Print", cursive;
  font-style: normal;
  font-weight: 400;
  font-size: 1.04em;
  line-height: 0.95;
}

/* PERIOD-AUTHENTIC SELF-HOSTED ARCHIVAL FONTS (100% ROMANIAN DIACRITICS) */
.mode-restored .tb.cf-typewriter {
  font-family: "Courier Prime", "Courier New", Consolas, monospace;
  font-style: normal;
  font-weight: 400;
  letter-spacing: -0.022em;
}
.mode-restored .tb.cf-display {
  font-family: "Oswald", "Bahnschrift Condensed", "Arial Narrow", sans-serif;
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0.02em;
}
.mode-restored .tb.cf-cover {
  font-family: "Old Standard TT", "PT Serif", Georgia, "Times New Roman", serif;
  font-style: normal;
}
.mode-restored .tb.cf-news-head {
  font-family: "Old Standard TT", "PT Serif", Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-style: normal;
  letter-spacing: -0.014em;
}
.mode-restored .tb.cf-news {
  font-family: "Source Serif 4", "PT Serif", "Times New Roman", Georgia, serif;
  font-style: normal;
  letter-spacing: -0.012em;
}
.mode-restored .tb.cf-serif {
  font-family: "Source Serif 4", "PT Serif", Georgia, "Times New Roman", serif;
  font-style: normal;
}
.mode-restored .tb.cf-hw-neat {
  font-family: "Kalam", "Caveat", "Segoe Print", cursive;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0.008em;
}
.mode-restored .tb.cf-hw-script {
  font-family: "Kalam", "Caveat", "Segoe Print", cursive;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0.01em;
}

/* DELICATE PAPER-COLORED SEPARATION WHEN TEXT CROSSES STAMPS / SIGNATURES / OVERWRITES */
.tb.over-artifact {
  z-index: 9;
}
.tb.over-artifact .tb-inner {
  paint-order: stroke fill;
  -webkit-text-stroke: 2.2px var(--halo, #f6f0e2);
  text-shadow:
    0 0 1.8px var(--halo, #f6f0e2),
    0.8px 0 0 var(--halo, #f6f0e2),
    -0.8px 0 0 var(--halo, #f6f0e2),
    0 0.8px 0 var(--halo, #f6f0e2),
    0 -0.8px 0 var(--halo, #f6f0e2);
}

.is-bold { font-weight: 700; }
.is-ul, .ul {
  text-decoration: underline;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  text-decoration-skip-ink: auto;
  text-decoration-color: color-mix(in srgb, currentColor 58%, transparent);
}
.is-ul2, .ul2 {
  text-decoration: underline double;
  text-underline-offset: 0.22em;
  text-decoration-skip-ink: auto;
  text-decoration-color: color-mix(in srgb, currentColor 62%, transparent);
}
.is-strike, .strike { text-decoration: line-through; }
.is-spaced, .spaced { letter-spacing: 0.22em; }

.align-left { text-align: left; }
.align-center { text-align: center; }
.align-right { text-align: right; }
.align-justify { text-align: justify; }

.redacted-inline {
  display: inline-block;
  background: #171614;
  color: transparent !important;
  text-shadow: none !important;
  -webkit-text-stroke-width: 0px !important;
  -webkit-text-stroke-color: transparent !important;
  padding: 0 7px;
  margin: 0 0.24em;
  min-width: 3.8em;
  border-radius: 1.5px;
  box-shadow: 0 0 1px rgba(18, 16, 14, 0.45);
  font-size: 0.88em;
  line-height: 1.04;
}
.redacted-inline::selection {
  color: transparent;
  background: #2f2d29;
  text-shadow: none;
}
.illegible-inline {
  opacity: 0.62;
  font-size: 0.78em;
  font-style: italic;
  font-family: "PT Serif", Georgia, serif;
  letter-spacing: -0.01em;
}

/* Search term highlight inside rendered page */
.hit-mark {
  background: rgba(250, 204, 21, 0.45);
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(202, 138, 4, 0.55);
}

/* Optional visual distinction toggle for Handwritten vs Typed blocks */
.show-media-hints .tb.med-handwritten {
  background: rgba(59, 130, 246, 0.09);
  outline: 1px dashed rgba(37, 99, 235, 0.45);
}
.show-media-hints .tb.med-typed,
.show-media-hints .tb.med-printed {
  background: rgba(217, 119, 6, 0.07);
  outline: 1px dashed rgba(180, 83, 9, 0.38);
}

/* Search highlight layer on Original scan */
.orig-search-box {
  position: absolute;
  z-index: 7;
  background: rgba(250, 204, 21, 0.32);
  border: 1.5px solid rgba(234, 179, 8, 0.9);
  border-radius: 2px;
  pointer-events: none;
}

