/* =====================================================================
   News & Events — page-specific styles only — theme tokens come from
   design-system.css (mobile boundary: 900px — see --eralux-mobile-breakpoint)
   ===================================================================== */

.eralux-news-page #main,
.eralux-news-page #main-content,
.eralux-news-page .site-content,
.eralux-news-page #main .fusion-row,
.eralux-news-page #content,
.eralux-news-page .post-content {
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  width: 100% !important;
}

.eralux-news-page .fusion-page-title-bar,
.eralux-news-page .fusion-page-title-wrapper {
  display: none !important;
}

.eralux-news-main {
  display: block;
  width: calc(100vw - var(--ews-scrollbar, 0px)) !important;
  max-width: none !important;
  margin: 0 calc(50% - 50vw + var(--ews-scrollbar, 0px) / 2) !important;
  padding: 0 !important;
  overflow-x: hidden;
}

.eralux-news {
  --ink: var(--ews-ink);
  --paper: var(--ews-paper);
  --muted: var(--ews-muted);
  --line: var(--ews-line);
  --accent: var(--ews-accent);
  --gut: var(--ews-gutter);
  --ink-soft: var(--ews-ink-lifted);
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
}

.eralux-news-heading {
  display: flex;
  align-items: center;
}

.eralux-news-content {
  width: 100%;
  margin: 0;
  padding: 0 var(--gut) 72px;
}

.eralux-news-toolbar {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.eralux-news-categories {
  display: flex;
  column-gap: clamp(22px, 3.2vw, 48px);
  row-gap: 0;
  align-items: center;
  flex-wrap: wrap;
}

.eralux-news-category {
  appearance: none;
  border: 0;
  background: none;
  cursor: pointer;
  padding: 16px 0 12px;
  position: relative;
  color: var(--ink);
}

.eralux-news-category:after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 5px;
  width: 0;
  height: 1px;
  background: var(--ink);
  transition: width var(--ews-transition);
}

.eralux-news-category:hover:after,
.eralux-news-category.active:after {
  width: 100%;
}

.eralux-news-toolbar-tools {
  display: flex;
  align-items: center;
  gap: 22px;
} /* ---- Tile / list view toggle (desktop only) ------------------------- */

.eralux-news-search {
  width: min(310px, 32vw);
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(var(--ews-ink-rgb), 0.36);
  padding: 8px 0;
}

.eralux-news-search svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.eralux-news-search input {
  width: 100%;
  border: 0 !important;
  box-shadow: none !important;
  outline: 0;
  background: transparent !important;
  padding: 0 !important;
  color: var(--ink);
}

.eralux-news-search input::placeholder {
  color: var(--ews-muted-ink);
  opacity: 1;
}

.eralux-news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  justify-content: start;
  gap: 38px 18px;
}

.eralux-news-card {
  width: 100%;
  max-width: 600px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
}

.eralux-news-card.is-hidden {
  display: none;
}

.eralux-news-card-link {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.eralux-news-card-link:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 5px;
}

/* The box keeps the 16:9 so the rows of the grid stay level, but the
   picture is shown WHOLE inside it and the leftover is the page, not a
   grey block. Eralux article pictures are catalogue covers, logos and
   posters — cropping one to fill the box cuts the title off it, and a
   grey plate behind a white poster reads as a border nobody drew.

   This is what the phone has always done; the only difference now is
   that the desktop agrees. */
.eralux-news-image {
  width: 100%;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: transparent;
}

.eralux-news-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition:
    transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
    filter 0.45s;
}

/* A contained picture already touches the box on its long side, so the
   old 3.5% zoom would shave a sliver off each end of it. Dimming alone
   says the same thing and takes nothing away. */
.eralux-news-card:hover .eralux-news-image img {
  filter: brightness(0.95);
}

.eralux-news-meta {
  display: flex;
  width: 100%;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
  color: var(--ink-soft);
}

.eralux-news-meta span:last-child {
  text-align: right;
}

/* ---- Mosaic view (default) ------------------------------------------
   One article across the top, two on the next row, three on every row
   after that. The tile itself is the base card above, unchanged: the
   picture on top at a fixed ratio, then the date and the news type,
   then the title. No subheading — the template stopped printing one.

   FLEX, NOT GRID, and for two reasons that grid cannot give:

   - a row that does not fill up is CENTRED. Flex centres each wrapped
     line on its own; grid centres the whole track set, which leaves a
     lone last card hard against the left edge.
   - cards on the SAME ROW come out the same height. Each flex line
     stretches its own items, so a two-line title lengthens its row and
     nothing else. Grid would have to size every row alike.

   Which card is wide is not :nth-child() but data-rank, written by
   news-events.js from the cards the visitor can actually see — filter
   to one category and the first EVENT becomes the wide one, where
   :nth-child() would still be pointing at something hidden.
   ------------------------------------------------------------------ */
.eralux-news-grid.is-mosaic {
  --ene-gap-x: clamp(18px, 2vw, 32px);
  --ene-gap-y: clamp(34px, 3.4vw, 56px);

  display: flex;
  flex-wrap: wrap;
  /* Centres the last row when it is short; a full row fills the line
     exactly and is not moved. */
  justify-content: center;
  gap: var(--ene-gap-y) var(--ene-gap-x);
}

.eralux-news-grid.is-mosaic .eralux-news-card {
  /* The base card stops at 600px, which is right for a tile in a
     three-up row and wrong for the one across the top. */
  max-width: none;
  flex-grow: 0;
  flex-shrink: 0;
}

/* The three widths: two across the top, three on the next row, four on
   every row after. The hundredth of a pixel is taken off each so that a
   full row and its gaps cannot round up past 100% and drop the last card
   onto a line of its own — which on a centred flex row is very visible,
   and gets worse the more cards the row holds. */
.eralux-news-grid.is-mosaic .eralux-news-card[data-rank="1"] {
  flex-basis: calc((100% - var(--ene-gap-x)) / 2 - 0.01px);
}

.eralux-news-grid.is-mosaic .eralux-news-card[data-rank="2"] {
  flex-basis: calc((100% - 2 * var(--ene-gap-x)) / 3 - 0.01px);
}

.eralux-news-grid.is-mosaic .eralux-news-card[data-rank="3"] {
  flex-basis: calc((100% - 3 * var(--ene-gap-x)) / 4 - 0.01px);
}

/* Every tile is 16:9, the two at the top included — asked for explicitly,
   and it is the rule that makes the three sizes read as one grid rather
   than three unrelated shapes. There is no max-height anywhere: a cap is
   what made the top card the one tile on the page that was not 16:9. */

/* The headline follows the width it has. */
.eralux-news-grid.is-mosaic h3 {
  margin: 6px 0 0;
  /* a bit smaller than WordPress's base (David, 2026-11-26: 18-23 px read too big): 16 px on phones, 19 px on wide screens */
  font-size: clamp(16px, 1vw, 19px);
  line-height: 1.25;
}

/* One headline size for every card, whatever the size of its tile (David, 2026-11-26: "the texts under the
   tiles must be the same size for all of the tiles"). The per-row sizes carried over from WordPress (rank 1:
   22-30 px, rank 2: 19-24 px, rank 3: 16-19 px) are gone; every card uses the rule above. */

.eralux-news-grid.is-mosaic .eralux-news-meta {
  margin-top: 14px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* The date and the type read as one line with a rule between them, the
   way they did in the list this replaces. */
.eralux-news-grid.is-mosaic .eralux-news-meta {
  justify-content: flex-start;
  gap: 18px;
}

.eralux-news-grid.is-mosaic .eralux-news-meta span:last-child {
  text-align: left;
}

.eralux-news-grid.is-mosaic .eralux-news-meta span:nth-child(2):not(:empty) {
  position: relative;
  padding-left: 19px;
  color: var(--ews-accent-dark);
}

.eralux-news-grid.is-mosaic .eralux-news-meta span:nth-child(2):not(:empty)::before {
  content: "|";
  position: absolute;
  left: 0;
  color: var(--ews-line-strong);
}

/* Tablet: 2, 3, 3. Only the bottom rows change — four across a 1024px
   page is a 230px tile, narrower than the headline needs.
   The middle row is deliberately left at three even though three is now
   also the width below it. Dropping it to two would leave its THIRD card
   alone on a half-width line with a third-width card beside it, because
   there are three cards in that row and two columns to put them in: rows
   of mixed widths, which read as a mistake rather than a design. Keeping
   the count and the columns equal is what makes each row come out
   flush. */
@media (max-width: 1199px) {
  .eralux-news-grid.is-mosaic .eralux-news-card[data-rank="3"] {
    flex-basis: calc((100% - 2 * var(--ene-gap-x)) / 3 - 0.01px);
  }
}

.eralux-news-empty {
  display: none;
  text-align: center;
  padding: 90px 20px;
  color: var(--muted);
}

.eralux-news-empty.show,
.eralux-news-empty[data-initial-empty="true"] {
  display: block;
}

.eralux-news-load-wrap {
  display: flex;
  justify-content: center;
  margin-top: 54px;
}

.eralux-news-load-more {
  min-width: 320px;
  border: 1px solid var(--line);
  background: transparent;
  padding: 18px 28px;
  cursor: pointer;
  transition: var(--ews-transition);
}

.eralux-news-load-more:hover {
  background: var(--ink);
  color: var(--ews-contrast-ink);
  border-color: var(--ink);
}

.eralux-news-load-more[hidden] {
  display: none;
}

.eralux-news-modal[hidden] {
  display: none;
}

.eralux-news-modal {
  position: fixed;
  z-index: 999999;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 76px);
}

.eralux-news-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(var(--ews-ink-rgb), 0.72);
}

.eralux-news-modal-panel {
  position: relative;
  max-height: calc(100dvh - clamp(48px, 10vw, 152px));
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--ews-ink-rgb), 0.52) transparent;
  background: var(--paper);
}

.eralux-news-modal-panel::-webkit-scrollbar {
  width: 9px;
}

.eralux-news-modal-panel::-webkit-scrollbar-track {
  background: transparent;
}

.eralux-news-modal-panel::-webkit-scrollbar-thumb {
  background: rgba(var(--ews-ink-rgb), 0.48);
  border: 2px solid var(--paper);
  border-radius: var(--ews-radius-pill);
}

.eralux-news-modal-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--ews-ink-rgb), 0.72);
}

.eralux-news-modal-close {
  position: sticky;
  z-index: 4;
  top: 18px;
  float: right;
  margin: 18px 18px -62px 0;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(var(--ews-paper-rgb), 0.96);
  box-shadow: 0 4px 18px rgba(var(--ews-ink-rgb), 0.1);
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.eralux-news-modal-close:hover,
.eralux-news-modal-close:focus-visible {
  outline: 0;
  background: var(--ink);
  color: var(--paper);
}

.eralux-news-modal-body {
  padding: clamp(36px, 4vw, 64px);
}

.eralux-news-modal-heading {
  margin-bottom: 38px;
  padding-right: 120px;
}

.eralux-news-modal-eyebrow,
.eralux-news-modal-date {
  margin: 0;
}

.eralux-news-modal-date {
  color: var(--ews-muted-ink);
}

.eralux-news-modal-image {
  width: min(100%, 620px);
  margin: 0 0 clamp(32px, 4vw, 52px);
}

.eralux-news-modal-image img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  object-position: left center;
}

body.eralux-news-modal-open {
  overflow: hidden;
}

@media (max-width: 1050px) {
  .eralux-news-toolbar {
    align-items: flex-end;
  }

  .eralux-news-categories {
    column-gap: 22px;
    row-gap: 0;
  }

  .eralux-news-modal {
    padding: 24px;
  }

  .eralux-news-modal-body {
    padding: 42px 34px;
  }
}

.eralux-news-modal-images {
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(18px, 3vw, 34px);
  margin: 0 0 clamp(32px, 4vw, 52px);
}

.eralux-news-modal-images .eralux-news-modal-image {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.eralux-news-modal-images .eralux-news-modal-image img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: left center;
}

.eralux-news-modal-copy {
  /* Full width: no maximum text width inside the pop-up. */
  max-width: none;
  overflow-wrap: anywhere;
}

.eralux-news-modal-copy > *:first-child {
  margin-top: 0;
}

.eralux-news-modal-copy > *:last-child {
  margin-bottom: 0;
}

.eralux-news-modal-copy img,
.eralux-news-modal-copy iframe,
.eralux-news-modal-copy video {
  max-width: 100%;
  height: auto;
}

.eralux-news-modal-other-images {
  margin-top: clamp(32px, 4vw, 52px);
  margin-bottom: 0;
}

/* ---- The body, block by block ---------------------------------------
   The article is an ordered list of text, image and video blocks and is
   printed in that order, so these styles are about the RHYTHM between
   them rather than about three separate regions of a page. A picture
   between two paragraphs is the normal case now; it used to be
   impossible.

   The image class here is deliberately NOT .eralux-news-image. That one
   belongs to the listing tile and carries aspect-ratio: 16/9, which
   crops. A photograph inside an article has to be shown whole — the
   author chose the frame, and a 3:2 photo cropped to 16:9 loses a third
   of its height to a rule meant for a grid of thumbnails.
   ------------------------------------------------------------------ */
.eralux-news-blocks > .eralux-news-block {
  margin: clamp(26px, 3.2vw, 44px) 0;
}

.eralux-news-blocks > .eralux-news-block:first-child {
  margin-top: 0;
}

.eralux-news-blocks > .eralux-news-block:last-child {
  margin-bottom: 0;
}

/* Two paragraphs of running text are one passage, not two blocks: the
   gap between them should be a paragraph gap, not a block gap. */
.eralux-news-block-text + .eralux-news-block-text {
  margin-top: 0;
}

.eralux-news-block-text > p:first-child {
  margin-top: 0;
}

.eralux-news-block-text > p:last-child {
  margin-bottom: 0;
}

.eralux-news-block-image,
.eralux-news-block-video {
  /* figure carries a default indent in every browser. */
  margin-left: 0;
  margin-right: 0;
}

.eralux-news-block-image img {
  display: block;
  width: 100%;
  height: auto;          /* the picture's own shape, never a crop */
  background: transparent;
}

/* A picture in the body is as wide as the column — but a square one is
   then as TALL as the column is wide, and a portrait one is taller than
   the screen. Either way the reader scrolls past a wall of picture with
   no idea there is more article under it.

   So on a desktop the picture may be at most 70% of the window high.
   Past that it is scaled down by its height and centred, and what is
   left either side is the page, not a plate. `object-fit: contain` is
   what does the scaling: the box itself stays the full column width
   (that is what `width: 100%` asks for), and the picture is drawn whole
   inside it. Nothing is cropped at any size.

   A phone is left alone: the column there is about 360px, so a square
   picture is 360 high already — under any cap worth setting. */
@media (min-width: 901px) {
  .eralux-news-block-image img {
    max-height: 70vh;
    object-fit: contain;
  }
}

/* The caption belongs to the picture, not to the column, so it sits
   under its middle. A picture held back to 630 of 782 would otherwise
   leave its caption stranded out at the left margin. The video caption
   is centred with it: a video is always the full width, but one caption
   left and the next one centred in the same article reads as a slip. */
.eralux-news-block-image figcaption,
.eralux-news-block-video figcaption {
  text-align: center;
}

/* The pointer only promises what the lightbox delivers, and the
   lightbox is only wired up inside the article body. */
.eralux-news-blocks .eralux-news-block-image img {
  cursor: zoom-in;
}

.eralux-news-block-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--ews-ink, #111);
}

.eralux-news-block-video-frame iframe,
.eralux-news-block-video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* An address nothing could embed: a link, not a black rectangle. */
.eralux-news-block-video-frame:has(> .eralux-news-block-video-link) {
  aspect-ratio: auto;
  background: transparent;
}

.eralux-news-block-video-link {
  display: inline-block;
  padding: 14px 16px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.eralux-news-block-image figcaption,
.eralux-news-block-video figcaption {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ---- Modal top-right controls (expand/shrink + close) --------------- */

.eralux-news-modal-controls {
  position: sticky;
  z-index: 4;
  top: 18px;
  float: right;
  display: flex;
  gap: 10px;
  margin: 18px 18px -62px 0;
}

.eralux-news-modal-controls .eralux-news-modal-close {
  position: static;
  float: none;
  margin: 0;
}

.eralux-news-modal-expand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(var(--ews-paper-rgb), 0.96);
  box-shadow: 0 4px 18px rgba(var(--ews-ink-rgb), 0.1);
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.eralux-news-modal-expand svg {
  width: 18px;
  height: 18px;
}

.eralux-news-modal-expand:hover,
.eralux-news-modal-expand:focus-visible {
  outline: 0;
  background: var(--ink);
  color: var(--paper);
}

/* Expanded pop-up: almost the full viewport, centred with the SAME gap
   to every viewport edge (the modal container provides the gap). */
.eralux-news-modal.is-expanded {
  padding: 20px;
}

.eralux-news-modal.is-expanded .eralux-news-modal-panel {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: 100%;
}

/* ---- Masonry layout for the pop-up media ---------------------------- */
/* Column count adapts automatically to the pop-up width. */

.eralux-news-modal-images {
  display: block;
  columns: 300px;
  column-gap: 18px;
}

.eralux-news-modal-images .eralux-news-modal-image,
.eralux-news-modal-images > * {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  width: 100%;
  margin: 0 0 18px;
}

@media (prefers-reduced-motion: reduce) {
  .eralux-news * {
    transition: none !important;
  }
}

.eralux-news-modal-panel {
  width: min(86vw, 1280px);
}

@media (max-width: 1050px) {
  .eralux-news-modal-panel {
    max-height: calc(100dvh - 48px);
    width: min(92vw, 1040px);
  }
}

.eralux-news-modal-media {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.eralux-news-modal-media img,
.eralux-news-modal-media video {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
}

.eralux-news-modal-video video {
  background: var(--ews-ink);
}

.eralux-news-modal-embed {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--ews-ink);
}

.eralux-news-modal-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.eralux-news-modal-oembed iframe,
.eralux-news-modal-oembed video {
  display: block;
  width: 100%;
  max-width: 100%;
}

.eralux-news-modal-audio audio {
  display: block;
  width: 100%;
}

.eralux-news-modal-media-link {
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: rgba(var(--ews-contrast-ink-rgb), 0.34);
}

.eralux-news-modal-media-link a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.eralux-news-featured {
  margin-top: clamp(38px, 5vw, 68px);
  padding-top: clamp(24px, 3vw, 38px);
  border-top: 1px solid var(--line);
}

.eralux-news-featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

.eralux-news-featured-product {
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

/* Paper 2, matching the featured product tiles in the projects modal —
   this one was the odd one out at ink, which read as a black square behind
   a contained product shot. */
.eralux-news-featured-image {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  background: var(--ews-paper-2);
}

.eralux-news-featured-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* =====================================================================
   Mobile — single boundary at 900px (see --eralux-mobile-breakpoint)
   ===================================================================== */

@media (max-width: 900px) {
  .eralux-news-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 20px 0 28px;
    min-height: 0;
  }

  /* Filter options wrap onto the next line instead of being clipped
       when they exceed the viewport width. */
  .eralux-news-categories {
    flex-wrap: wrap;
    row-gap: 2px;
    padding-bottom: 2px;
  }

  .eralux-news-category {
    padding: 8px 0 12px;
    white-space: nowrap;
  }

  .eralux-news-search {
    width: 100%;
  }

  /* The list view is not available on mobile: hide the toggle and let
       the tile layout apply even if list mode was active on desktop. */

  .eralux-news-toolbar-tools {
    width: 100%;
  }

  .eralux-news-grid,
  .eralux-news-grid.is-mosaic {
    display: grid;
    grid-template-columns: 1fr;
    gap: 42px;
  }

  /* One per row, so every card is the wide one and none of the mosaic
     widths or ratios apply. */
  .eralux-news-grid.is-mosaic .eralux-news-card[data-rank] {
    flex-basis: auto;
  }

  .eralux-news-grid.is-mosaic .eralux-news-card[data-rank] .eralux-news-image {
    aspect-ratio: auto;
  }

  .eralux-news-card {
    max-width: none;
  }

  /* Mobile: never crop the main image — it fits the card WIDTH and
       keeps its original aspect ratio, with NO height limit. The
       !important flags make these win over every desktop/list rule
       regardless of specificity. */
  .eralux-news .eralux-news-image {
    aspect-ratio: auto !important;
    height: auto !important;
    max-height: none !important;
  }

  /* object-fit and the background are the same as the desktop now; what
     is still phone-only is dropping the fixed ratio so the picture sets
     the card's height itself. */
  .eralux-news .eralux-news-image img {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-position: left top !important;
    transform: none !important;
  }

  .eralux-news-load-wrap {
    margin-top: 42px;
  }

  .eralux-news-load-more {
    min-width: 0;
    width: 100%;
  }

  .eralux-news-modal {
    align-items: end;
    padding: 8px;
  }

  .eralux-news-modal-panel {
    width: 100%;
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 3px;
  }

  .eralux-news-modal-panel::-webkit-scrollbar {
    width: 6px;
  }

  .eralux-news-modal-close {
    top: 10px;
    margin: 10px 10px -52px 0;
    width: 40px;
    height: 40px;
  }

  .eralux-news-modal-body {
    padding: 28px 16px 36px;
  }

  .eralux-news-modal-heading {
    margin-bottom: 26px;
    padding-right: 44px;
  }

  .eralux-news-modal-image {
    width: 100%;
    margin-bottom: 30px;
  }

  /* See the projects note: a 260px cap with object-fit: contain
       letterboxes every landscape photo inside the panel width. */
  .eralux-news-modal-image img {
    width: 100%;
    height: auto;
    max-height: none;
    object-position: center;
  }

  /* The panel already fills the screen at this width, so expanding it
       does nothing. Hide the control rather than offer a no-op. */
  .eralux-news-modal-expand {
    display: none;
  }

  /* One image per row on a phone. The masonry above is columns: 300px,
       which still made two narrow columns inside an ~850px panel and left
       every photo floating at half width. */
  .eralux-news-modal-images {
    columns: 1;
    gap: 16px;
    margin-bottom: 28px;
  }

  .eralux-news-modal-images .eralux-news-modal-image {
    width: 100%;
    margin: 0;
  }

  .eralux-news-modal-images .eralux-news-modal-image img {
    width: 100%;
    object-position: center;
  }

  .eralux-news-modal-other-images {
    margin-top: 28px;
    margin-bottom: 0;
    gap: 20px;
  }

  .eralux-news-modal-media-link {
    padding: 14px 16px;
  }

  .eralux-news-featured {
    margin-top: 34px;
    padding-top: 24px;
  }

  .eralux-news-featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (max-width: 390px) {
  .eralux-news-featured-grid {
    grid-template-columns: 1fr;
  }

  .eralux-news-featured-image {
    aspect-ratio: 1.15/1;
  }
}

@media (max-width: 900px) {
  .eralux-news .eralux-news-card-link {
    min-height: 0 !important;
    max-height: none !important;
  }
}

/* ---- One article, on its own page --------------------------------- */
.eralux-news-article {
  /* Named because the sidebar's minimum height is "the rest of the
     screen", and the rest of the screen starts below this. */
  --ene-article-top: clamp(28px, 4vw, 64px);

  padding: var(--ene-article-top) 0 clamp(56px, 7vw, 120px);
}

/* The article and the Recent News column beside it.

   Two grid children and no more: the article's own wrapper, then the
   aside. The page used to be one 860px column down the middle; it is
   wider now because the sidebar is taking 320px of it, and the article
   itself comes out a little narrower than it was — which is the trade
   the sidebar is worth. */
.eralux-news-article-inner {
  --ene-aside: 320px;

  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 40px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--ene-aside);
  column-gap: clamp(32px, 4vw, 64px);
  /* The sidebar is STRETCHED to the article's height on purpose. How
     tall the page is, is the article's business; the list beside it
     fills whatever that comes to and scrolls inside itself if it has
     more cards than there is room for. */
  align-items: stretch;
}

/* minmax(0, 1fr) above and this together: a grid column's default
   minimum is its content, so one long unbroken word in the body would
   otherwise widen the column and push the sidebar off the page. */
.eralux-news-article-main {
  min-width: 0;
}

/* ---- Recent News ----------------------------------------------------
   The height of this column is the ARTICLE's height, and a scrollbar
   appears inside it only when five cards do not fit in that. The page
   is as long as the article; the sidebar never makes it longer and
   never makes it shorter.

   Which takes one trick. The obvious spelling — min-height: 0 with
   overflow: auto — does not work: `overflow` removes a grid item's
   automatic MINIMUM size, but the row is still sized by the item's
   max-content height, so a short article next to five cards gets a row
   as tall as the cards. The column has to contribute NO height at all,
   and the only way to do that is to take its contents out of flow.
   Hence the absolutely positioned box below: this element is an empty
   stretched cell, and the list lives inside it at inset: 0.

   The exception is the minimum: an article of one sentence would
   otherwise leave a sidebar a couple of hundred pixels tall, with the
   list crammed into it. Below that it stops following the article and
   reaches to the bottom of the screen instead. */
.eralux-news-recent {
  min-width: 0;
  position: relative;
  min-height: calc(100vh - var(--ews-header-overlay, 0px) - var(--ene-article-top, 40px));
  min-height: calc(100dvh - var(--ews-header-overlay, 0px) - var(--ene-article-top, 40px));
}

/* The three parts. The heading and the link to the index are fixed to
   the top and the bottom of the column; only the cards between them
   move. Scrolling a heading out of view hides the one word that says
   what the list is, and the link out of view hides the way on. */
.eralux-news-recent-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.eralux-news-recent-head {
  flex: none;
}

/* The window the cards move behind. It takes whatever height is left
   once the heading and the link have had theirs, and min-height: 0 is
   what allows it to be SMALLER than the cards inside it — a flex item's
   floor is its content otherwise, and the list would push the link off
   the bottom of the column. */
.eralux-news-recent-scroll {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.eralux-news-recent-track {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--ews-line-strong) transparent;
  /* Room for the scrollbar, so the cards do not shift sideways the
     moment one appears. */
  padding-right: 6px;
}

.eralux-news-recent-more {
  flex: none;
}

/* The fade at the bottom edge, over the content rather than behind it,
   so it reads as the list continuing past the cut.

   It is on the COLUMN, not on the scrolling box, so that it stays at
   the bottom edge instead of scrolling away with the cards. A small
   script switches it off when the list fits or has been scrolled to
   the end; with no script it simply stays on, which is a slightly
   redundant gradient rather than a broken page. */
.eralux-news-recent-scroll::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 56px;
  background: linear-gradient(to top, var(--paper, #fff) 12%, rgba(255, 255, 255, 0));
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.2s;
}

/* "none" = everything fits; "end" = scrolled to the last card. */
.eralux-news-recent[data-scroll="none"] .eralux-news-recent-scroll::after,
.eralux-news-recent[data-scroll="end"] .eralux-news-recent-scroll::after {
  opacity: 0;
}

.eralux-news-recent-head {
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ews-line-strong);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.eralux-news-recent-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* The whole card is the link, so the target is the picture, the date
   and the headline rather than the headline alone. */
.eralux-news-recent-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}

/* Same rule as the listing tile, for the same reason. */
.eralux-news-recent-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: transparent;
}

.eralux-news-recent-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: filter 0.45s;
}

.eralux-news-recent-card:hover .eralux-news-recent-thumb img {
  filter: brightness(0.95);
}

.eralux-news-recent-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.eralux-news-recent-type {
  color: var(--ews-accent-dark);
}

.eralux-news-recent-title {
  font-size: 15px;
  line-height: 1.35;
  font-weight: 500;
}

.eralux-news-recent-card:hover .eralux-news-recent-title,
.eralux-news-recent-card:focus-visible .eralux-news-recent-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.eralux-news-recent-card:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.eralux-news-recent-more {
  display: inline-block;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
}

.eralux-news-recent-more:hover {
  color: var(--ink);
}

/* Below this the two columns do not both fit: 320px out of a 1000px
   page leaves the article too narrow to read. The sidebar goes under
   the article instead — where the markup already put it — and becomes
   a row of cards rather than a tall thin column squeezed onto a phone. */
@media (max-width: 1100px) {
  .eralux-news-article-inner {
    display: block;
    width: min(100%, 860px);
  }

  .eralux-news-recent {
    position: static;
    min-height: 0;
    margin-top: clamp(44px, 6vw, 76px);
    padding-top: 28px;
    border-top: 1px solid var(--ews-line-strong);
  }

  /* Back into the flow: there is no column to fill and nothing to
     scroll inside — the cards are a row under the article. */
  .eralux-news-recent-inner,
  .eralux-news-recent-scroll,
  .eralux-news-recent-track {
    position: static;
    display: block;
    overflow: visible;
    padding-right: 0;
  }

  .eralux-news-recent-scroll::after {
    content: none;
  }

  .eralux-news-recent-more {
    margin-top: 28px;
  }

  .eralux-news-recent-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 30px 20px;
  }
}

.eralux-news-article-back {
  margin: 0 0 clamp(20px, 3vw, 38px);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.eralux-news-article-back a {
  color: var(--ink-soft);
  text-decoration: none;
}

.eralux-news-article-back a:hover {
  color: var(--ink);
}

/* The body is the pop-up's, so the pop-up's own spacing rules are the
   ones that apply to it; only the panel's scrolling box is not here. */
.eralux-news-article .eralux-news-modal-heading h2 {
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.1;
}
