/* News overlay (components/news.js, site/snippets/news-*.php).

   Styled after the printed newspaper of Wat niet mag wijken: white pages,
   black Roboto Mono for text and (large, in normal capitalisation)
   headings, photos in their own shape placed off-centre, small captions,
   and the red Mammane running head along the right edge. Red is the
   accent, as in the rest of the site. The overview slides up over the map;
   a news item slides up over the overview as a second page. */

.news-panel {
  --news-ink: #000;
  --news-paper: #fff;
  --news-accent: var(--color-text-primary);
  --news-gutter: 1.25rem;
  --news-gutter-right: var(--news-gutter);

  position: fixed;
  inset: 0;
  /* Above the places (2000) and the map/list buttons (3000), below the
     mini player (3500) and the menu (4000). */
  z-index: 3200;
  color: var(--news-ink);
  transform: translateY(100%);
  transition: transform var(--duration-panel) var(--ease-panel);
}

.app.is-news-open .news-panel {
  transform: none;
}

@media (min-width: 768px) {
  .news-panel {
    --news-gutter: 3rem;
    /* Room on the right for the running head. */
    --news-gutter-right: 5rem;
  }
}

/* "WAT NIET MAG WIJKEN" up the right edge, reading bottom to top. */
.news-panel__runner {
  display: none;
}

@media (min-width: 768px) {
  .news-panel__runner {
    display: block;
    position: absolute;
    z-index: 30;
    top: 5.5rem;
    right: 1.1rem;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--news-accent);
    pointer-events: none;
  }
}

/* While loading (fetched from /nieuws), a quiet pulse instead of nothing. */
.news-overview__slot[aria-busy='true'],
.news-sheet__slot[aria-busy='true'] {
  min-height: 60vh;
  animation: news-loading 1s ease-in-out infinite alternate;
}

@keyframes news-loading {
  from { opacity: 0.3; }
  to { opacity: 0.8; }
}

/* ---------- Buttons: close (overview) and back (item) ---------- */

.news-close,
.news-back {
  position: sticky;
  top: 1rem;
  z-index: 20;
  display: flex;
  align-items: center;
  color: var(--news-accent);
  background: var(--news-paper);
  transition: color 0.2s ease;
}

.news-close {
  float: right;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: 1rem 1rem 0 0;
  border-radius: 9999px;
}

.news-back {
  gap: 0.25rem;
  width: fit-content;
  margin: 1rem 0 0 1rem;
  padding: 0.35rem 0.9rem 0.35rem 0.25rem;
  border-radius: 9999px;
  font-weight: 700;
}

/* Phones and tablets: a red border and a shadow, so the buttons stand out
   on top of the photos scrolling underneath. */
@media (max-width: 1023px) {
  .news-close,
  .news-back {
    border: 2px solid var(--news-accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
}

@media (hover: hover) {
  .news-close:hover,
  .news-back:hover {
    color: var(--color-text-darkpurple);
  }
}

/* ---------- The overview page ---------- */

.news-overview {
  position: absolute;
  inset: 0;
  /* Own stacking context, so its sticky close button stays under the
     item page. */
  z-index: 0;
  overflow-y: auto;
  background: var(--news-paper);
}

.news-overview__inner {
  max-width: 90rem;
  margin: 0 auto;
  padding-top: 2.5rem;
  padding-bottom: 7rem;
  padding-left: var(--news-gutter);
  padding-right: var(--news-gutter-right);
}

.news-overview__title {
  font-size: 3.5rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .news-overview__inner {
    padding-top: 4rem;
  }
  .news-overview__title {
    font-size: 7rem;
  }
}

/* ---------- Category filter: plain words, the active one red ---------- */

.news-filter {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin-bottom: 3rem;
  font-size: 0.875rem;
}

.news-filter__btn {
  padding: 0.25rem 0 0.4rem;
  color: var(--news-ink);
  transition: color 0.3s ease;
}

@media (hover: hover) {
  .news-filter__btn:hover {
    color: var(--news-accent);
  }
}

.news-filter__btn[aria-pressed='true'] {
  color: var(--news-accent);
}

/* The line under the active category. components/news.js sets its
   position and width; it glides to the next category (also across a
   line break on phones). */
.news-filter__line {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--news-accent);
  pointer-events: none;
  transition:
    transform 0.6s var(--ease-panel),
    width 0.6s var(--ease-panel);
}

.news-filter__line.is-instant {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .news-filter__line {
    transition: none;
  }
}

/* ---------- Items: staggered left and right, like a photo spread ---------- */

.news-grid {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3.5rem;
}

/* Phones: every other item steps in a little. */
.news-grid__item.is-right {
  padding-left: 2.5rem;
}

@media (min-width: 768px) {
  .news-grid {
    grid-template-columns: repeat(12, 1fr);
    column-gap: 1.5rem;
    row-gap: 5rem;
    align-items: start;
  }
  .news-grid__item {
    grid-column: 1 / span 6;
  }
  .news-grid__item.is-right {
    grid-column: 8 / span 5;
    padding-left: 0;
    margin-top: 9rem;
  }
  .news-grid__item.is-featured {
    grid-column: 1 / -1;
  }
}

.news-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.news-card__image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 85vh;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.news-card__meta,
.news-article__meta {
  font-size: 0.75rem;
  line-height: 1.5;
}

/* Categories after the date: "25 oktober 2026 / Expositie". */
.news-tag::before {
  content: ' / ';
}

.news-card__title {
  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

@media (min-width: 768px) {
  .news-card__title {
    font-size: 1.75rem;
  }
}

@media (hover: hover) {
  .news-card:hover .news-card__title {
    color: var(--news-accent);
  }
  .news-card:hover .news-card__image img {
    opacity: 0.9;
  }
}

.news-card:focus-visible .news-card__title {
  color: var(--news-accent);
}

/* While a title types itself out after switching category
   (components/news.js): the letters still to come hold their place,
   invisibly. */
.news-card__untyped {
  visibility: hidden;
}

/* The newest item: a big photo with the title beside it, like the
   opening of a place in the newspaper. */
@media (min-width: 768px) {
  .news-grid__item.is-featured .news-card {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: 1.5rem;
    align-items: end;
  }
  .news-grid__item.is-featured .news-card__image {
    grid-column: 1 / span 7;
  }
  .news-grid__item.is-featured .news-card__body {
    grid-column: 8 / span 5;
    padding-right: 1.5rem;
  }
  .news-grid__item.is-featured .news-card__title {
    font-size: 3rem;
    line-height: 1.05;
    margin-top: 1rem;
  }
}

@media (min-width: 1280px) {
  .news-grid__item.is-featured .news-card__title {
    font-size: 4rem;
  }
}

.news-overview__empty {
  padding: 2rem 0;
}

/* ---------- Newsletter sign-up, under the overview ---------- */

/* Like the opening of a chapter in the newspaper: a thin rule, a large
   title, and the text with the button beside it. */
.news-newsletter {
  margin-top: 6rem;
  padding-top: 2rem;
  border-top: 1px solid var(--news-ink);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.news-newsletter__title {
  font-size: 2.25rem;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.news-newsletter__body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 36rem;
  font-size: 0.95rem;
  line-height: 1.65;
}

@media (min-width: 768px) {
  .news-newsletter {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: 1.5rem;
    margin-top: 9rem;
  }
  .news-newsletter__title {
    grid-column: 1 / span 6;
    /* Grows with the screen, so a long word ("nieuwsbrief!") always fits
       its half of the block (it stuck out on tablets at a fixed 4rem). */
    font-size: clamp(2.25rem, 4.5vw, 4rem);
    overflow-wrap: break-word;
  }
  .news-newsletter__body {
    grid-column: 8 / span 5;
    padding-top: 0.75rem;
  }
}


/* ---------- The item page ---------- */

.news-sheet {
  position: absolute;
  inset: 0;
  z-index: 10;
  overflow-y: auto;
  background: var(--news-paper);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.18);
  transform: translateY(100%);
  transition: transform var(--duration-panel) var(--ease-panel);
}

.news-panel.is-article-open .news-sheet {
  transform: none;
}

.news-article {
  max-width: 90rem;
  margin: 0 auto;
  padding-top: 1.5rem;
  padding-bottom: 7rem;
  padding-left: var(--news-gutter);
  padding-right: var(--news-gutter-right);
}

.news-article__top {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 3rem;
}

.news-article__title {
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-top: 0.75rem;
  overflow-wrap: break-word;
}

.news-article__hero img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 90vh;
  object-fit: contain;
  object-position: left top;
}

/* Desktop: photo on the left, title on the right at the bottom. */
@media (min-width: 1024px) {
  .news-article {
    padding-top: 0;
  }
  .news-article__top {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: 1.5rem;
    align-items: end;
    margin-bottom: 4rem;
  }
  .news-article__hero {
    grid-column: 1 / span 7;
    grid-row: 1;
  }
  .news-article__header {
    grid-column: 8 / span 5;
    grid-row: 1;
    padding-right: 1.5rem;
  }
  .news-article__top--no-image .news-article__header {
    grid-column: 1 / span 10;
    padding-top: 4rem;
  }
  .news-article__title {
    font-size: 4rem;
  }
}

@media (min-width: 1280px) {
  .news-article__title {
    font-size: 5rem;
  }
}

/* Captions: small, as under the photos in the newspaper. */
.news-article figcaption {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.5;
}

/* ---------- Blocks ---------- */

.news-article__body {
  max-width: 44rem;
  font-size: 0.95rem;
  line-height: 1.65;
}

/* Desktop: the text column starts under the title, like on the
   newspaper's right-hand pages. */
@media (min-width: 1024px) {
  .news-article__body {
    margin-left: calc((100% + 1.5rem) / 12 * 4);
  }
}

.news-article__body > * + * {
  margin-top: 1.25rem;
}

/* The opening paragraph a size up, like the introductions in the paper. */
.news-article__body > p:first-child {
  font-size: 1.15rem;
  line-height: 1.55;
}

.news-article__body h2,
.news-article__body h3 {
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-top: 3rem;
}

.news-article__body h2 {
  font-size: 2.25rem;
}

.news-article__body h3 {
  font-size: 1.5rem;
}

.news-article__body strong {
  font-weight: 700;
}

/* Text links; buttons (the button block) keep their own style. */
.news-article__body a:not(.news-button) {
  color: var(--news-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.news-article__body a:not(.news-button):hover {
  color: var(--color-text-darkpurple);
}

.news-article__body ul,
.news-article__body ol {
  padding-left: 1.5rem;
}

.news-article__body li + li {
  margin-top: 0.25rem;
}

/* Quotes like the pull quotes in the paper: larger, no decoration. */
.news-article__body blockquote {
  font-size: 1.5rem;
  line-height: 1.3;
  margin-block: 2.5rem;
}

.news-article__body blockquote footer {
  margin-top: 0.75rem;
  font-size: 0.75rem;
}

/* Images, sliders and videos reach out to the left of the text column. */
.news-article__body .block-image,
.news-article__body .block-slider,
.news-article__body .block-video {
  margin-block: 3rem;
}

@media (min-width: 1024px) {
  .news-article__body .block-image,
  .news-article__body .block-slider,
  .news-article__body .block-video {
    margin-left: calc(-1 * (100% / 3));
  }
}

.news-article__body .block-image img {
  display: block;
  width: 100%;
  height: auto;
}

/* Slider */
.block-slider__swiper {
  overflow: hidden;
}

.block-slider__slide img {
  display: block;
  width: 100%;
  height: auto; /* not the height attribute: the 3:2 ratio decides */
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: #f2f2f2;
}

.block-slider__slide-caption {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.5;
}

.block-slider__controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.block-slider__btn {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--news-accent);
  transition: color 0.2s ease, opacity 0.2s ease;
}

.block-slider__btn:disabled {
  opacity: 0.25;
  cursor: default;
}

@media (hover: hover) {
  .block-slider__btn:not(:disabled):hover {
    color: var(--color-text-darkpurple);
  }
}

.block-slider__count {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

/* Buttons: like the site's other buttons (the PDF button in the popup).
   Used by the button block and the newsletter sign-up. */
.news-article__body .block-button {
  margin-block: 2rem;
}

/* Several buttons in a row stay together. */
.news-article__body .block-button + .block-button {
  margin-top: -1rem;
}

/* Buttons are also used outside the news overlay (the newsletter form in
   the menu), hence the fallbacks for the news colours. */
.news-button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.1rem;
  border: 2px solid var(--news-accent, var(--color-text-primary));
  color: var(--news-accent, var(--color-text-primary));
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.news-button:hover {
  background: var(--news-accent, var(--color-text-primary));
  color: var(--news-paper, #fff);
}

/* The filled version, for the newsletter: red until hovered. */
.news-button--filled {
  background: var(--news-accent, var(--color-text-primary));
  color: var(--news-paper, #fff);
}

.news-button--filled:hover {
  background: var(--news-paper, #fff);
  color: var(--news-accent, var(--color-text-primary));
}

.news-button svg {
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (hover: hover) {
  .news-button:hover svg {
    transform: translateX(3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .news-button svg {
    transform: none !important;
  }
}

/* Video: 16:9, uploaded files keep their own shape. */
.block-video__frame {
  background: #000;
}

.block-video__frame iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

.block-video__frame video {
  display: block;
  width: 100%;
  height: auto;
}
