/* ==========================================================================
   News (sections/news.php, assets/js/news.js): one screen, built like Moonrise's marriage screen. The headline and
   its button sit low on the inline-start side with the item's picture above them (shown whole: the company's
   pictures are banners with their own text), a blurred copy of it colours the screen, the items run under a line
   of progress bars, the cluster of boxes stands on the inline-end side. Animated mode: it rises over the hero's last screen (ch_sec2, a diagonal edge
   that lights up like the hero's scan wall); news.js sets the edge (--cl, --cr, --ea) and the arrival (--k).
   ========================================================================== */
.nws {
  --dur: 8s;                                   /* one item */
  --grid-w: clamp(330px, 27vw, 430px);
  --cell: rgb(11 17 24 / .62); --line: rgb(255 255 255 / .2);
  --k: 1;
  position: relative; z-index: 6; color: var(--white); background: var(--night-2);
}
.nws__stage { position: relative; height: 100vh; height: 100svh; min-height: 620px; overflow: hidden; overflow: clip; background: var(--night-2); }
/* over the hero's last screen: the section itself is clear, only its (clipped) stage paints */
html.js:not(.gr-static) .nws { margin-top: -100vh; margin-top: -100svh; background: transparent; }
html.js:not(.gr-static) .nws__stage { clip-path: polygon(0 var(--cl, 0px), 100% var(--cr, 0px), 100% 100%, 0 100%); }
/* the hold: the screen stays one more screen while the projects map opens over it (ch_sec4, projects.css),
   stepping back and dimming as it goes (--rp: 0 → 1, set by projects.js) */
html.js:not(.gr-static) .nws { height: 200vh; height: 200svh; }
html.js:not(.gr-static) .nws__stage { position: sticky; top: 0; }   /* projects.js scales it back */
/* while it steps back, its glass is plain: a backdrop blur inside a scaling screen is redrawn every frame */
.nws__stage.is-leaving .nws-cell { -webkit-backdrop-filter: none; backdrop-filter: none; }
html.js:not(.gr-static) .nws__stage { will-change: transform; }
.nws__dim { position: absolute; z-index: 9; inset: 0; background: #000; opacity: 0; pointer-events: none; }   /* projects.js sets its opacity */
.nws__edge {
  position: absolute; z-index: 7; top: 0; left: 0; width: var(--ew, 100%); height: 2px; pointer-events: none;
  transform-origin: var(--eo, right) top; transform: rotate(var(--ea, 0deg)); opacity: var(--eop, 0);
  background: linear-gradient(to var(--eg, left), #E8FFF8, var(--wire) 30%, rgb(91 230 198 / .4));
  box-shadow: 0 0 22px 4px rgb(91 230 198 / .55), 0 0 60px 10px rgb(91 230 198 / .22);
}
[dir="rtl"] .nws__edge { left: auto; right: 0; }
[dir="ltr"] .nws__edge { --eo: left; --eg: right; }

/* ---------- backgrounds ---------- */
.nws-bg { position: absolute; z-index: 0; inset: 0; margin: 0; padding: 0; list-style: none; }
/* the next picture comes in over the last one, which stays whole underneath until it is covered, then resets */
.nws-bg__item { position: absolute; inset: 0; overflow: hidden; opacity: 0; visibility: hidden; transition: opacity 0s 1.6s, visibility 0s 1.6s; }
.nws-bg__item.is-on { z-index: 1; opacity: 1; visibility: visible; transition: opacity 1.2s var(--ease-io), visibility 0s; }
/* the blurred copy (480 px, baked): only a field of the picture's colours, darkened */
.nws-bg__item img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.15); filter: brightness(.85) saturate(1.3); }
.nws-bg__item.is-on img { animation: nws-drift calc(var(--dur) + 2s) linear forwards; }
.nws.is-paused .nws-bg__item.is-on img, .nws.is-paused .nws-pic.is-on .nws-pic__frame { animation-play-state: paused; }
@keyframes nws-drift { from { transform: scale(1.15) translateY(-1.5%); } to { transform: scale(1.06) translateY(0); } }
.nws__shade {
  position: absolute; z-index: 1; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgb(91 230 198 / .04) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(90deg, rgb(91 230 198 / .04) 0 1px, transparent 1px 56px),
    linear-gradient(to top, rgb(8 12 17 / .92), rgb(8 12 17 / .55) 36%, rgb(8 12 17 / .3) 62%, rgb(8 12 17 / .6)),
    linear-gradient(to var(--to-end, left), rgb(8 12 17 / .4), rgb(8 12 17 / 0) 55%);
}
[dir="ltr"] .nws__shade { --to-end: right; }

/* ---------- the content ---------- */
.nws-hero {
  position: absolute; z-index: 2; inset: 0; display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) var(--grid-w); grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "title pic grid" "tabs tabs tabs"; align-items: end; column-gap: 40px;
  padding: calc(var(--header-h) + 24px) var(--gutter) 92px;   /* the tabs stay clear of the next-section pill */
  opacity: clamp(0, (var(--k) - .45) * 2.4, 1); transform: translateY(calc((1 - var(--k)) * 90px));
}
.nws-head { grid-area: title; }

/* the item's picture: whole, between the headline and the cluster, as large as its room allows (container units) */
.nws-pics { grid-area: pic; align-self: stretch; position: relative; min-height: 0; margin: 0; padding: 0; list-style: none; container-type: size; }
.nws-pic {
  --gap: 0px;
  position: absolute; inset: 0 0 var(--gap); display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(18px) scale(.97); transform-origin: 50% 100%;
  transition: opacity .5s var(--ease-io), transform .8s var(--ease-out), visibility 0s .5s;
}
.nws-pic.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity .8s var(--ease-io) .15s, transform 1.1s var(--ease-out) .15s, visibility 0s; }
.nws-pic__frame {
  position: relative; display: block; overflow: hidden; border-radius: 14px; aspect-ratio: var(--ar);
  width: min(100cqw, calc((100cqh - var(--gap)) * (var(--ar))), 760px);
  box-shadow: 0 0 0 1px rgb(255 255 255 / .16), 0 40px 80px -30px rgb(0 0 0 / .9), 0 0 110px -30px rgb(91 230 198 / .3);
}
.nws-pic__frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nws-pic__frame::after {   /* a glass glint across it */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(118deg, transparent 40%, rgb(255 255 255 / .1) 48%, rgb(255 255 255 / .02) 54%, transparent 62%);
}
.nws-pic.is-on .nws-pic__frame { animation: nws-float calc(var(--dur) + 2s) var(--ease-io) forwards; }
@keyframes nws-float { from { transform: translateY(6px); } to { transform: translateY(-6px); } }
/* not enough room (short screens, where it stands above the headline): no picture */
@container (max-height: 130px) { .nws-pic { display: none; } }
.nws-eyebrow {
  display: inline-flex; align-items: center; gap: .6em; height: 32px; padding: 0 14px; border-radius: 999px; margin-bottom: 18px;
  background: rgb(14 156 89 / .18); box-shadow: inset 0 0 0 1px rgb(23 184 108 / .4); color: #79E9B5; font-size: 14px; font-weight: 700;
}
.nws-eyebrow__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgb(23 184 108 / .2); }
.nws-titles { display: grid; margin: 0; padding: 0; list-style: none; }
.nws-title {
  --x: 10px;
  grid-area: 1 / 1; align-self: end; opacity: 0; visibility: hidden; transform: translateX(var(--x));
  transition: opacity .5s var(--ease-io), transform .8s var(--ease-out), visibility 0s .5s;
}
[dir="rtl"] .nws-title { --x: -10px; }
.nws-title.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity .7s var(--ease-io) .25s, transform 1s var(--ease-out) .25s, visibility 0s; }
.nws-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 13.5px; color: rgb(255 255 255 / .72); }
.nws-title__h { max-width: 13em; font-size: clamp(30px, 3.3vw, 60px); font-weight: 300; line-height: 1.3; text-wrap: balance; }
.nws-btn { display: inline-flex; gap: 3px; margin-top: 22px; text-decoration: none; }
.nws-btn__label { display: flex; align-items: center; height: 52px; padding: 0 24px; border-radius: 999px; background: var(--white); color: var(--ink); font-size: 14.5px; font-weight: 700; transition: background-color .3s; }
.nws-btn__go { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: var(--white); transition: background-color .3s, translate .4s var(--ease-out); }
.nws-btn:hover .nws-btn__label { background: #E6F7EF; }
.nws-btn:hover .nws-btn__go { background: var(--green-hi); translate: var(--nudge, -4px) 0; }
[dir="ltr"] .nws-btn { --nudge: 4px; }
.nws-btn:focus-visible { outline: 2px solid var(--wire); outline-offset: 4px; border-radius: 999px; }

/* ---------- the cluster ---------- */
.nws-grid {
  grid-area: grid; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px;
  grid-template-areas: "ad ad" "call cta" "box box";
}
.nws-cell {
  position: relative; overflow: hidden; border-radius: 14px; background: var(--cell); color: var(--white); text-decoration: none;
  font-size: 13.5px; line-height: 1.6; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .1);
  -webkit-backdrop-filter: blur(12px) saturate(120%); backdrop-filter: blur(12px) saturate(120%);
}
a.nws-cell:focus-visible, .nws-swap a:focus-visible { outline: 2px solid var(--wire); outline-offset: 2px; }
.nws-cell .arrow { width: 22px; height: 22px; flex: none; transition: translate .4s var(--ease-out); }
[dir="ltr"] .nws-cell { --nudge: 4px; }
.nws-cell__tag { position: absolute; z-index: 2; inset-inline-start: 12px; top: 12px; padding: 3px 10px; border-radius: 999px; background: rgb(11 17 24 / .8); font-size: 11px; font-weight: 700; color: var(--wire); box-shadow: 0 4px 14px -4px rgb(0 0 0 / .6); }
/* the fixed ad: the admin's picture, whole */
.nws-cell--ad { grid-area: ad; display: block; aspect-ratio: var(--ar, 16 / 9); padding: 6px; }
.nws-cell--ad img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 9px; transition: transform .8s var(--ease-out); }
.nws-cell--ad:hover img { transform: scale(1.03); }
.nws-cell--call { grid-area: call; display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.nws-call__icon { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--green); box-shadow: 0 8px 20px -8px rgb(14 156 89 / .9); }
.nws-call__icon .ico { width: 19px; height: 19px; }
.nws-call__text { display: grid; gap: 0; line-height: 1.5; }
.nws-call__text b { font-weight: 750; }
.nws-call__text span { font-size: 12px; color: rgb(255 255 255 / .7); }
.nws-cell--call:hover .nws-call__icon { background: var(--green-hi); }
.nws-cell--cta { grid-area: cta; display: flex; align-items: center; gap: 14px; padding-inline: 18px 14px; font-weight: 650; }
.nws-cell--cta:hover .arrow { translate: var(--nudge, -4px) 0; }
.nws-cell--box { grid-area: box; min-height: calc(var(--grid-w) * .28); }

/* the box that changes with the item: the entries lie on one another and cross-fade */
.nws-swap { display: grid; height: 100%; margin: 0; padding: 0; list-style: none; }
.nws-swap > li { grid-area: 1 / 1; min-height: 0; opacity: 0; visibility: hidden; transform: scale(.95); transition: opacity .5s var(--ease-io), transform .8s var(--ease-out), visibility 0s .5s; }
.nws-swap > li.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity .7s var(--ease-io) .3s, transform 1s var(--ease-out) .3s, visibility 0s; }
.nws-swap a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; height: 100%; padding: 14px 16px; color: inherit; text-decoration: none; }
.nws-box__icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: var(--wire); background: radial-gradient(circle at 35% 30%, #20323A, #0E161D 70%); box-shadow: inset 0 0 0 1px rgb(91 230 198 / .3); }
.nws-box__icon .ico { width: 25px; height: 25px; }
.nws-box__text { display: grid; gap: 3px; }
.nws-box__text b, .nws-box__text span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nws-box__text b { font-weight: 750; line-height: 1.55; }
.nws-box__text span { font-size: 12.5px; color: rgb(255 255 255 / .72); line-height: 1.6; }
.nws-swap a:hover .arrow { translate: var(--nudge, -4px) 0; }

/* ---------- the items as steps (more than fit: the row scrolls, the one that is on is kept in view) ---------- */
.nws-tabs { grid-area: tabs; display: flex; align-items: flex-start; min-width: 0; margin-top: 16px; }
.nws-tabs__list {
  display: flex; gap: 12px; min-width: 0; margin: 0; padding: 6px 0; padding-inline-end: 56px; list-style: none;
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
  -webkit-mask-image: linear-gradient(to var(--fade, left), #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to var(--fade, left), #000 calc(100% - 56px), transparent);
}
[dir="ltr"] .nws-tabs__list { --fade: right; }
.nws-tabs__list::-webkit-scrollbar { display: none; }
.nws-tabs__rest { flex: 1; min-width: 0; height: 1px; margin-top: 6px; background: var(--line); }
.nws-tab { flex: none; }
.nws-tab button {
  position: relative; display: grid; grid-template-columns: 102px minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 12px;
  width: clamp(220px, 17vw, 270px); padding: 18px 0 0; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer;
}
.nws-tab button:focus-visible { outline: 2px solid var(--wire); outline-offset: 3px; border-radius: 4px; }
.nws-tab__bar { position: absolute; inset-inline: 0; top: 0; height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.nws-tab__bar i { position: absolute; inset: 0; background: var(--wire); transform: scaleX(0); transform-origin: left; }
[dir="rtl"] .nws-tab__bar i { transform-origin: right; }
.nws-tab.is-done .nws-tab__bar i { transform: none; }
.nws-tab.is-on .nws-tab__bar i { animation: nws-fill var(--dur) linear forwards; }
.nws.is-paused .nws-tab.is-on .nws-tab__bar i { animation-play-state: paused; }
@keyframes nws-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.nws-tab__pic { grid-row: 1 / 3; width: 102px; height: 62px; object-fit: cover; border-radius: 6px; opacity: .7; transition: opacity .4s; }
.nws-tab.is-on .nws-tab__pic, .nws-tab button:hover .nws-tab__pic { opacity: 1; }
.nws-tab__no { font-size: 12px; font-weight: 700; color: var(--wire); }
.nws-tab__title {
  align-self: end; font-size: 12.5px; font-weight: 650; line-height: 1.55; color: rgb(255 255 255 / .78);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.nws-tab.is-on .nws-tab__title { color: var(--white); }

/* ---------- tablets: the cluster gets smaller ---------- */
@media (max-width: 1100px) {
  .nws { --grid-w: 300px; }
  /* the picture goes above the headline */
  .nws-hero { grid-template-columns: minmax(0, 1fr) var(--grid-w); grid-template-rows: minmax(0, 1fr) auto auto; grid-template-areas: "pic grid" "title grid" "tabs tabs"; }
  .nws-pic { --gap: 22px; justify-content: flex-start; }
  .nws-hero { column-gap: 24px; }
  .nws-tabs__rest { display: none; }
}
/* ---------- phones: picture, headline, the items in a row to swipe, no cluster (as Moonrise) ---------- */
@media (max-width: 860px) {
  .nws-hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "pic" "title" "tabs"; padding-bottom: 84px; }
  .nws-pic { --gap: 18px; }
  .nws-pic__frame { border-radius: 12px; }
  .nws-grid { display: none; }
  .nws-title__h { font-size: clamp(26px, 7.6vw, 40px); }
  .nws-btn { margin-top: 18px; }
  .nws-btn__label, .nws-btn__go { height: 50px; }
  .nws-btn__go { width: 50px; }
  .nws-tabs { margin-inline: calc(var(--gutter) * -1); }
  .nws-tabs__list { scroll-snap-type: x mandatory; padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); gap: 14px; -webkit-mask-image: none; mask-image: none; }
  .nws-tab { scroll-snap-align: start; }
  .nws-tab button { width: min(220px, 58vw); grid-template-columns: 44% minmax(0, 1fr); }
  .nws-tab__pic { width: 100%; height: auto; aspect-ratio: 1.6; }
}

/* ---------- reduced motion: nothing moves by itself (news.js does not advance), changes are instant ---------- */
@media (prefers-reduced-motion: reduce) {
  .nws-bg__item, .nws-bg__item.is-on, .nws-title, .nws-title.is-on, .nws-swap > li, .nws-swap > li.is-on, .nws-pic, .nws-pic.is-on { transition: none; transform: none; }
  .nws-pic.is-on .nws-pic__frame { animation: none; }
  .nws-bg__item.is-on img { animation: none; transform: none; }
  .nws-tab.is-on .nws-tab__bar i { animation: none; transform: none; }
}
