/* ============================================================================
   United Way of Rhode Island — newsroom band
   The blue "In the News / Press Releases" band, the tab pills, and the
   variant where the "United is the Way" card straddles the white/blue seam.
   Loaded after pages.css, on the newsroom, its article pages, and the board
   page. Everything works with JS off: both tab panels are ordinary sections
   and news.js only hides the inactive one.
   ========================================================================== */

.uwn-band {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #0B34B8 0%, #2050D8 46%, #4E86F0 100%);
  padding: clamp(46px, 5vw, 84px) 0 clamp(52px, 5.6vw, 96px);
}
.uwn-band::after {                       /* the same ring ghost the hero uses */
  content: "";
  position: absolute; z-index: 0; pointer-events: none;
  width: clamp(420px, 46vw, 760px); aspect-ratio: 1;
  right: clamp(-320px, -17vw, -200px); bottom: clamp(-200px, -14vw, -120px);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
    transparent 0 46%,
    rgba(255, 255, 255, .08) 46% 60%,
    transparent 60% 72%,
    rgba(255, 255, 255, .06) 72% 85%,
    transparent 85%);
}
.uwn-band > .uw-wrap { position: relative; z-index: 1; }
.uwn-band .uw-news__top { margin-bottom: clamp(22px, 2.6vw, 38px); }

/* ── tabs ───────────────────────────────────────────────────────────────── */
.uwn-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.uwn-tab {
  padding: 10px 22px;
  font-family: var(--uw-display); font-weight: 600; text-transform: uppercase;
  font-size: clamp(12px, 1vw, 15px); letter-spacing: .03em;
  color: #fff;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, .55);
  border-radius: 40px;
  cursor: pointer;
  transition: background-color .24s ease, color .24s ease, border-color .24s ease, transform .24s cubic-bezier(.22,1,.36,1);
}
.uwn-tab:hover { transform: translateY(-1px); border-color: #fff; }
.uwn-tab.is-on {
  background: var(--uw-navy);
  border-color: var(--uw-navy);
  color: #fff;
  box-shadow: 0 10px 22px rgba(9, 18, 60, .3);
}
.uwn-all { color: #fff !important; }
.uwn-all .uw-arrow { background: rgba(255, 255, 255, .16); border: 2px solid rgba(255, 255, 255, .5); }
.uwn-all:hover .uw-arrow { background: #fff; color: var(--uw-navy); }

/* ── cards ──────────────────────────────────────────────────────────────── */
.uwn-grid[hidden] { display: none !important; }
.uwn-grid { align-items: stretch; }
/* Three fixed rows, and a headline clamped to a fixed number of lines, so the
   date and the body start at the same height on every card in a row. */
.uwn-card {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  box-shadow: 0 18px 34px rgba(9, 18, 60, .2);
  transition: transform .42s cubic-bezier(.22, 1, .36, 1), box-shadow .42s ease, opacity .42s ease;
}
/* The headline sits in a fixed-height window so every card's date and body
   line up. A long headline is not chopped with an ellipsis — hovering the card
   scrolls it, and a soft fade at the foot of the window says there is more. */
.uwn-card h3 {
  margin: 0;
  position: relative;
  height: calc(4 * 1.38em);
  line-height: 1.38;
  font-size: clamp(17px, 1.2vw, 21px);
  overflow: hidden;
}
.uwn-card__hin {
  display: block;
  transform: translateY(0);
  transition: transform .35s ease;
}
.uwn-card h3.is-over {
  -webkit-mask-image: linear-gradient(180deg, #000 74%, rgba(0, 0, 0, .15) 100%);
          mask-image: linear-gradient(180deg, #000 74%, rgba(0, 0, 0, .15) 100%);
}
.uwn-card:hover h3.is-over,
.uwn-card:focus-within h3.is-over {
  -webkit-mask-image: none; mask-image: none;
}
.uwn-card:not(.is-centre):hover h3.is-over .uwn-card__hin,
.uwn-card:not(.is-centre):focus-within h3.is-over .uwn-card__hin {
  transform: translateY(calc(-1 * var(--over, 0px)));
  transition: transform var(--over-dur, .6s) linear .28s;
}
.uwn-card time { align-self: start; }
.uwn-card p {
  margin: 0;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5;
  overflow: hidden;
}
@media (max-width: 860px) {
  .uwn-card h3 { height: calc(3 * 1.38em); }
}
.uwn-card:hover { transform: translateY(-6px); box-shadow: 0 30px 52px rgba(9, 18, 60, .3); }
.uwn-card h3 a::after { content: ""; position: absolute; inset: 0; }
.uwn-card h3 a:hover { text-decoration: none; }
.uwn-card:hover h3 a { text-decoration: underline; }
.uwn-card p { font-weight: 400; color: rgba(35, 31, 32, .78); }

/* the panels fade as they swap, but only when JS is driving them */
.uwn-js .uwn-grid { animation: uwn-in .38s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes uwn-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .uwn-js .uwn-grid { animation: none; }
  .uwn-card__hin { transition: none; }
  .uwn-card:hover h3.is-over .uwn-card__hin { transform: none; }
  .uwn-card, .uwn-tab { transition: none; }
  .uwn-card:hover { transform: none; }
}

/* ── the "United is the Way" card straddling the seam ───────────────────── */
.uwn-outro { background: #fff; --uwn-lap: clamp(96px, 9.5vw, 148px); }
.uwn-outro__head {
  text-align: center;
  padding-top: clamp(46px, 5.2vw, 92px);
  padding-bottom: clamp(22px, 2.6vw, 40px);
}
.uwn-outro__head h2 {
  font-family: var(--uw-display); font-weight: 700; text-transform: uppercase;
  color: var(--uw-navy); font-size: var(--uw-h2); line-height: .96; margin: 0;
}
.uwn-outro__cardwrap {
  position: relative;
  z-index: 6;                 /* the straddling card always paints over the band */
  margin-bottom: calc(-1 * var(--uwn-lap));
}
.uwn-outro__cardwrap .uw-join__card {
  background: var(--uw-navy);
  box-shadow: 0 30px 64px rgba(9, 18, 60, .34);
}
.uwn-outro__cardwrap .uw-joincol { border-left-color: rgba(255, 255, 255, .24); }
.uwn-outro__cardwrap .uw-joincol h3 { color: #fff; }
.uwn-outro__cardwrap .uw-joincol--gold h3 { color: var(--uw-gold); }
.uwn-outro__cardwrap .uw-joincol p { color: rgba(255, 255, 255, .82); }
.uwn-outro__cardwrap .uw-btn--outline { color: #fff; border-color: rgba(255, 255, 255, .8); }
.uwn-outro__cardwrap .uw-btn--outline:hover { background: #fff; color: var(--uw-navy); }
.uwn-band--lap { padding-top: calc(var(--uwn-lap) + clamp(38px, 4.2vw, 70px)); }

@media (max-width: 860px) {
  .uwn-outro { --uwn-lap: 84px; }
}

/* ── the newsroom's own rails ───────────────────────────────────────────── */
.uwn-railwrap[hidden] { display: none !important; }
.uwn-railwrap .uwb-rail { padding: 10px 0 34px; }
.uwn-railwrap .uwb-rail > .uwn-card { flex: 0 0 clamp(258px, 26vw, 340px); }
.uwn-railwrap .uwb-rail__nav { margin-top: 0; }
.uwn-railwrap .uwb-rail__hint {
  margin: 10px 0 0;
  font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, .55);
}

/* ── the band that ends a page has to clear the footer wave ─────────────── */
.uwn-band--last { padding-bottom: clamp(210px, 18vw, 300px); }

/* ── hero that bleeds into the band below ───────────────────────────────────
   The sub-hero normally clips its ring motif at its own edge, which leaves a
   hard line where the newsroom band starts. Here the hero stops clipping and
   is lifted above the band so the rings carry across the seam, and the band
   opens with a gradient in the hero's closing navy so the two grounds meet
   without a step. ─────────────────────────────────────────────────────────── */
.uw-hero--bleed { overflow: visible; z-index: 4; }
.uw-hero--bleed::after {
  z-index: 2;
  width: clamp(500px, 56vw, 940px);
  right: clamp(-300px, -14vw, -150px);
  top: auto; bottom: clamp(-260px, -20vw, -150px);
  transform: none;
}
.uw-hero--bleed .uw-wrap { position: relative; z-index: 3; }

.uwn-band--bridge::before {
  content: "";
  position: absolute; z-index: 0;
  inset: 0 0 auto 0;
  height: clamp(140px, 16vw, 280px);
  background: linear-gradient(180deg, #1B2360 0%, rgba(27, 35, 96, .55) 45%, rgba(27, 35, 96, 0) 100%);
  pointer-events: none;
}
/* the ring that spills out of the hero has to sit above that bridge */
.uwn-band--bridge {
  z-index: 1;
  padding-bottom: clamp(118px, 10vw, 170px);
}
.uwn-band--bridge + .uw-endcta {
  margin-top: clamp(-96px, -7vw, -48px);
}

/* ── the card at the centre of a rail is the highlighted one ────────────────
   It gets a gold edge, and its headline scrolls itself on a slow loop so the
   full title can be read without hovering. Hovering takes over from the loop
   and plays the scroll once, on demand. */
.uwn-card.is-centre {
  box-shadow: 0 0 0 2px var(--uw-gold), 0 32px 58px rgba(9, 18, 60, .34);
}
@keyframes uwn-titleroll {
  0%, 14%   { transform: translateY(0); }
  50%, 66%  { transform: translateY(calc(-1 * var(--over, 0px))); }
  97%, 100% { transform: translateY(0); }
}
.uwn-card.is-centre h3.is-over {
  -webkit-mask-image: none; mask-image: none;
}
.uwn-card.is-centre h3.is-over .uwn-card__hin {
  animation: uwn-titleroll calc(var(--over-dur, .6s) * 3 + 3s) ease-in-out infinite;
}
/* The centre card is already scrolling on its own loop, so hovering it changes
   nothing. Killing the animation to hand over to a transition would snap the
   headline to whatever the transition asks for, which reads as a jump to the
   end of the title. */
@media (prefers-reduced-motion: reduce) {
  .uwn-card.is-centre h3.is-over .uwn-card__hin { animation: none; }
}

/* a searched rail becomes a plain grid so every hit is on screen at once */
.uwn-railwrap .uwb-rail.is-flat {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 1.9vw, 30px);
  overflow: visible; cursor: default; padding-top: 8px;
}
.uwn-railwrap .uwb-rail.is-flat > .uwn-card { flex: initial; width: auto; }
@media (max-width: 900px) { .uwn-railwrap .uwb-rail.is-flat { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .uwn-railwrap .uwb-rail.is-flat { grid-template-columns: 1fr; } }

.uwn-card.is-hidden { display: none !important; }
.uwn-empty {
  margin: clamp(16px, 2vw, 26px) 0 0;
  font-size: 15px; color: rgba(255, 255, 255, .78);
}
.uwn-hl { background: var(--uw-gold); color: var(--uw-navy); border-radius: 3px; padding: 0 2px; }

/* ── All News archive grid ────────────────────────────────────────────────
   The flat view the capped carousels link out to. Cards are the newsroom's
   own .uwn-card, but on a light ground rather than inside a navy band, so the
   type colours are restated here. */
.uwa-band {
  background: var(--uw-blue-mist);
  padding: clamp(34px, 4vw, 60px) 0 clamp(48px, 5.4vw, 84px);
}
.uwa-grid {
  display: grid; gap: clamp(16px, 1.9vw, 28px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  /* stretch, not start: headlines and summaries vary a lot in length, and
     letting each card take its natural height left the grid looking ragged */
  align-items: stretch;
}
@media (max-width: 980px) { .uwa-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .uwa-grid { grid-template-columns: 1fr; } }

.uwa-grid > .uwn-card {
  flex: initial; width: auto;
  background: #fff; border-radius: var(--uw-r-lg);
  padding: clamp(20px, 2.2vw, 28px);
  box-shadow: 0 12px 30px rgba(12, 19, 52, .09);
  transform: none; opacity: 1;
  transition: transform .25s ease, box-shadow .25s ease;
}
.uwa-grid > .uwn-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(12, 19, 52, .15);
}
/* One shape for every card: the headline takes up to three lines, the summary
   up to four, and the date sits on a common baseline between them. Anything
   longer is clamped rather than allowed to push its neighbours out of line. */
.uwa-grid > .uwn-card {
  display: flex; flex-direction: column; gap: 10px;
}
.uwa-grid .uwn-card h3 {
  height: auto; overflow: hidden; margin: 0;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
}
.uwa-grid .uwn-card h3 .uwn-card__hin { animation: none; transform: none; }
.uwa-grid .uwn-card time { margin: 0; }
.uwa-grid .uwn-card p {
  margin: 0; overflow: hidden;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4;
}
.uwa-grid .uwn-card h3 a { color: var(--uw-navy); }
.uwa-grid .uwn-card h3 a:hover { color: var(--uw-blue); }
.uwa-grid .uwn-card time { color: var(--uw-blue); }
.uwa-grid .uwn-card p { color: rgba(35, 31, 32, .78); }
.uwa-grid .uwn-card.is-hidden { display: none !important; }

.uwa-empty, .uwa-back {
  margin: clamp(22px, 2.6vw, 34px) 0 0;
  font-size: 15px; color: rgba(35, 31, 32, .75);
}
.uwa-back a { font-weight: 700; color: var(--uw-blue); }
.uwn-all { margin: clamp(8px, 1vw, 14px) 0 0; font-size: 14px; }
.uwn-all a { font-weight: 700; color: #fff; border-bottom: 2px solid var(--uw-gold); padding-bottom: 2px; }
.uwn-all a:hover { color: var(--uw-gold); }
