/* Proxima Centauri — scoped print treatment: paper grain on every page.
   Activated by the data-course attribute that core_boot sets on <html>,
   so it only ever touches this document. */

/* ── Paper grain on every page surface ─────────────────────────── */
html[data-course="proxima_centauri"] .page { isolation: isolate; }

html[data-course="proxima_centauri"] .page::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background-repeat: repeat;
}

/* PAPER panel OFF → committed static tile (always some grain). */
html[data-course="proxima_centauri"]:not([data-paper="on"]) .page::after {
  background-image: url("/proxima_centauri/propuesta/images/paper-texture.png");
  background-size: 360px 360px;
  mix-blend-mode: multiply;
  opacity: 0.42;
}

/* PAPER panel ON → drive these pages from its live vars (the same ones the
   .cw-page reader uses), so its preset / grain / blend / colour sliders
   actually change the look. paper/apply.js sets --greb-paper-tex-0..3,
   --greb-paper-blend, --greb-paper-opacity and --greb-paper-bg on <html>. */
html[data-paper="on"][data-course="proxima_centauri"] .page {
  background-color: var(--greb-paper-bg, #f3e6bd);
}
html[data-paper="on"][data-course="proxima_centauri"] .page::after {
  background-image: var(--greb-paper-tex-0,
                        url("/proxima_centauri/propuesta/images/paper-texture.png"));
  background-size: 384px 384px;
  mix-blend-mode: var(--greb-paper-blend, overlay);
  opacity: var(--greb-paper-opacity, 0.55);
}

/* The :blocks/:hero-section templates borrow the green "limpieza/hygiene"
   chrome. Re-tint the header bar to the blue→red signature gradient so the
   document reads on-brand instead of clinical green. */
html[data-course="proxima_centauri"] .limpieza-header {
  background-image: linear-gradient(135deg,
    var(--brand-primary, #1b3a8f), var(--brand-accent, #e0411f));
}
/* The print stylesheet forces `.limpieza-header { background: var(...) !important }`
   (solid), which kills the gradient in the PDF export. Re-assert it for print. */
@media print {
  html[data-course="proxima_centauri"] .limpieza-header {
    background: linear-gradient(135deg,
      var(--brand-primary, #1b3a8f), var(--brand-accent, #e0411f)) !important;
  }
}

/* Molina's hand-drawn logo is the artist's mark — show it big on the cover,
   not at the tiny brand-logo size the template defaults to. */
html[data-course="proxima_centauri"] .portada-logo {
  height: 96px;
  width: auto;
  max-width: none;
}

/* Apuntes del Prado — the notebook facsímil photos are portrait notes; show
   them whole (contain) so the last handwritten line isn't cropped off. */
html[data-course="proxima_centauri"] #apuntes .image-card-photo {
  object-fit: contain;
  background: #efe9da;
}

/* Primeros cambios — show the annotated squad sketch large (full width). */
html[data-course="proxima_centauri"] #cambios .image-block,
html[data-course="proxima_centauri"] #cambios .image-block-img {
  width: 100%;
  max-width: 100%;
  display: block;
}

/* Section tabs in palette (override the fixed propuesta/inversion colors so
   they don't clash with the red/blue signature). */
html[data-course="proxima_centauri"] .section-tab--propuesta { background: var(--brand-primary, #1b3a8f); }
html[data-course="proxima_centauri"] .section-tab--ejecucion { background: var(--brand-secondary, #2f6fd0); }
html[data-course="proxima_centauri"] .section-tab--inversion { background: var(--brand-accent, #e0411f); }
