/* =====================================================================
   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;
}

.eralux-news-image {
  width: 100%;
  overflow: hidden;
  aspect-ratio: 1.34/1;
  background: var(--ews-line-strong);
}

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

.eralux-news-card:hover .eralux-news-image img {
  transform: scale(1.035);
  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;
}

/* ---- List view (default) -------------------------------------------- */
/* Rows top to bottom: a wide image on the left; on the right the date and
   news type (line 1), the title (line 2), then the subheading (line 3). */

.eralux-news-grid.is-list {
  display: flex;
  flex-direction: column;
  /* Very thin gap between news rows; the hairline stays. */
  gap: 14px;
}

.eralux-news-grid.is-list .eralux-news-card {
  max-width: none;
  border-bottom: 1px solid var(--ews-line-strong);
  padding-bottom: 14px;
}

.eralux-news-grid.is-list .eralux-news-card:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.eralux-news-grid.is-list .eralux-news-card-link {
  display: grid;
  grid-template-columns: minmax(320px, 44%) 1fr;
  grid-template-rows: auto auto 1fr;
  column-gap: clamp(28px, 4vw, 64px);
  row-gap: 10px;
  align-items: start;
  /* Every news row has a minimum and a maximum height. */
  min-height: 170px;
  max-height: 360px;
}

.eralux-news-grid.is-list .eralux-news-image {
  grid-column: 1;
  grid-row: 1 / span 3;
  /* Contain fitting: the image keeps its aspect ratio and takes as much
       space as the boundary allows, without any cropping. */
  aspect-ratio: auto;
  align-self: start;
  max-height: 360px;
  background: transparent;
}

.eralux-news-grid.is-list .eralux-news-image img {
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: contain;
  object-position: left top;
}

.eralux-news-grid.is-list .eralux-news-meta {
  grid-column: 2;
  grid-row: 1;
  justify-content: flex-start;
  align-items: baseline;
  gap: 18px;
  margin-top: 4px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

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

.eralux-news-grid.is-list h3 {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  font-size: clamp(24px, 2.4vw, 36px);
}

.eralux-news-grid.is-list .eralux-news-card-link p {
  grid-column: 2;
  grid-row: 3;
  margin: 0;
}

.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;
}

/* ---- 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-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .eralux-news-grid.is-list .eralux-news-card-link {
    display: flex;
    flex-direction: column;
  }

  .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;
    background: transparent !important;
  }

  .eralux-news .eralux-news-image img {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !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;
  }
}
