/**
 * @file
 * Node-level moderation-state visual treatment.
 *
 * Gives editorial staff an at-a-glance visual cue that they are not
 * looking at the live/published revision. Each non-published state
 * gets a soft background tint (using Drupal admin's standard status
 * message palette from Claro/Olivero) plus a thin dashed border in
 * the accent colour. Text colour is intentionally left untouched so
 * readability is not affected.
 *
 * Archived additionally gets a light D7-style diagonal-stripe overlay
 * because it is not being actively read/edited — the extra pattern
 * doubles as a strong "do not use" signal.
 *
 * State → colour mapping (progression toward publication):
 *   draft                    → warning yellow  (bg #fdf8ed / border #e29700)
 *   ready_for_review         → info blue       (bg #eaf3f9 / border #0074bd)
 *   ready_for_final_check    → info teal       (bg #e6f4f1 / border #017a6a)
 *   ready_for_publication    → success green   (bg #f3faef / border #42a877)
 *   archived                 → neutral gray + stripes
 *
 * Class placement:
 *   `moderation-state--*` lives on `.layout-container` (set from
 *   esource_public_preprocess_page() via page_path_class, rendered by
 *   page.html.twig line 49). That's the only reliable class-injection
 *   point on this theme.
 *
 * How the paint works:
 *   The `article.node` element gets a thin dashed border in the state
 *   colour and a soft tinted background. For Archived only, a
 *   `::before` pseudo-element pinned to fill it carries a light
 *   diagonal stripe pattern and sits ABOVE the content
 *   (`z-index: 2 + pointer-events: none`).
 *
 * `!important` is used deliberately so aggregated theme CSS
 * (dist/css/styles.css) cannot accidentally hide the treatment.
 */

/* --------------------------------------------------------------------
 * Shared shell — positioning context + thin dashed outline (each state
 * overrides border-color and background-color below).
 * ------------------------------------------------------------------ */
.layout-container.moderation-state--archived article.node,
.layout-container.moderation-state--draft article.node,
.layout-container.moderation-state--ready-for-review article.node,
.layout-container.moderation-state--ready-for-final-check article.node,
.layout-container.moderation-state--ready-for-publication article.node {
  position: relative !important;
  border: 1px dashed transparent !important;
}

/* --------------------------------------------------------------------
 * Archived — neutral gray tint + light D7-style diagonal slashes.
 * ------------------------------------------------------------------ */
.layout-container.moderation-state--archived article.node {
  border-color: #6b6b6b !important;
  background-color: #f2f2f2 !important;
}

.layout-container.moderation-state--archived article.node .node-detail-page--report {
  background-color: #f2f2f2 !important;
}

.layout-container.moderation-state--archived article.node::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-repeat: repeat;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(107, 107, 107, 0.22) 0,
    rgba(107, 107, 107, 0.22) 1px,
    rgba(242, 242, 242, 0) 1px,
    rgba(242, 242, 242, 0) 10px
  );
}

/* --------------------------------------------------------------------
 * Draft — Drupal admin "warning" yellow.
 * ------------------------------------------------------------------ */
.layout-container.moderation-state--draft article.node {
  background-color:#fff4f4 !important;
}

.layout-container.moderation-state--draft article.node .node-detail-page--report {
  background-color:#fff4f4 !important;
}

.layout-container.moderation-state--draft article.node::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-color: rgb(214 152 152 / 22%) !important;
}

/* --------------------------------------------------------------------
 * Ready for review — Drupal admin "info" blue.
 * ------------------------------------------------------------------ */
.layout-container.moderation-state--ready-for-review article.node,
.layout-container.moderation-state--ready-for-final-check article.node,
.layout-container.moderation-state--ready-for-publication article.node  {
  background-color: #fdf8ed !important;
}

.layout-container.moderation-state--ready-for-review article.node .node-detail-page--report,
.layout-container.moderation-state--ready-for-final-check article.node .node-detail-page--report,
.layout-container.moderation-state--ready-for-publication article.node .node-detail-page--report  {
  background-color: #fdf8ed !important;
}

.layout-container.moderation-state--ready-for-review article.node::before,
.layout-container.moderation-state--ready-for-final-check article.node::before,
.layout-container.moderation-state--ready-for-publication article.node::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-color: rgb(253 248 237 / 22%) !important;
}
