/*
 * News Page Styles (Grid wie Referenz)
 * Variante: Kategorien horizontal wischbar (iOS), Scrollbar versteckt + Overscroll kontrolliert
 */

.news-page{
  background-color: var(--color-primary);
  color: var(--color-text-invert);
  overflow-x: clip; /* Safety: verhindert horizontales "Mitziehen" durch andere Elemente */
}

/* Hero */
.news-hero{
  padding-top: calc(var(--header-height) + 64px);
  padding-bottom: 40px;
}

.news-hero__inner{
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad-x);
  box-sizing: border-box;
}

.news-title{
  font-size: clamp(2.25rem, 1.5rem + 2.5vw, 3.5rem);
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
  margin: 0 0 0.4em 0;
}

.news-lead{
  max-width: 60ch;
  margin: 0 0 2rem 0;
}

/* ----------------------------------------------------------
   Kategorien: horizontal wischbar, aber Scrollbar versteckt
   + iOS Overscroll/Bounce kontrolliert
---------------------------------------------------------- */

.news-categories{
  margin-top: 1.5rem;
  overflow: hidden; /* verhindert, dass die Seite horizontal "zieht" */
}

.news-categories__list{
  display: flex;
  flex-wrap: nowrap;
  gap: clamp(.8rem, 3vw, 1.5rem);
  margin: 0;
  list-style: none;

  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;

  overscroll-behavior-x: contain;

  scrollbar-width: none;
  -ms-overflow-style: none;

  scroll-snap-type: x proximity;

  padding: 0 2px .5rem 2px;
}

.news-categories__list::-webkit-scrollbar{
  width: 0;
  height: 0;
  display: none;
}

.news-categories__item{
  scroll-snap-align: start;
}

/* Standard: Rahmen IMMER sichtbar (color-text) */
.news-categories__link{
  display: inline-flex;
  align-items: center;
  padding: .5rem 1rem;
  font-weight: var(--fw-medium);
  border: 2px solid var(--color-text);
  border-radius: 999px;
  white-space: nowrap;
  transition: color .2s ease, border-color .2s ease;
  color: var(--color-text-invert);
}

/* Hover */
.news-categories__link:is(:hover,:focus-visible){
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* Active */
.news-categories__link.is-active{
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* Grid */
.news-grid-section{
  padding-block: 40px 60px;
}

.news-grid{
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad-x);
  box-sizing: border-box;

  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 600px){
  .news-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px){
  .news-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Cards: kein Schatten */
.news-card{
  position: relative; /* für .news-card__hit */
  border-radius: 10px;
  overflow: hidden;
  background: transparent;
  color: inherit;
  box-shadow: none;
}

/* Ganze Kachel klickbar */
.news-card__hit{
  position: absolute;
  inset: 0;
  z-index: 6;
  border-radius: inherit;
}

.news-card__hit:focus-visible{
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

/* Bildkarte: Bild oben, Text unten */
.news-card--image .news-card__image{
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 10px;
}

.news-card--image .news-card__image img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.news-card--image .news-card__content{
  padding-top: 14px;
}

/* Typo */
.news-card__label{
  display: block;
  margin-bottom: 6px;
  font-size: .75rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  font-weight: var(--fw-bold);
  color: var(--color-accent);
}

.news-card__title{
  margin: 0 0 10px 0;
  font-size: clamp(1.1rem, 1rem + .8vw, 1.5rem);
  line-height: 1.25;
  font-weight: var(--fw-bold);
}

.news-card__title a{
  color: inherit;
  text-decoration: none;
  position: relative;
  z-index: 7; /* über hit-layer */
}

.news-card__title a:hover{
  text-decoration: underline;
}

.news-card__excerpt{
  margin: 0;
  line-height: 1.4;
  opacity: .9;
}

/* Akzentkarte: orange Block mit Beitragsbild im Hintergrund + Overlay Hover wie grid.css */
.news-card--accent{
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: 10px;

  background: var(--color-accent);
  color: var(--color-text-invert);

  padding: 24px;
  min-height: 320px;
  display: flex;
}

/* Hintergrundbild */
.news-card--accent .news-card__bg{
  position: absolute;
  inset: 0;
  z-index: 0;
}

.news-card--accent .news-card__bg img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Overlay (wie grid.css Hover-Layer) */
.news-card--accent::before{
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;

  background-color: var(--color-accent);
  opacity: .78;
  mix-blend-mode: color;

  pointer-events: none;
  transition: opacity .25s ease;
}

.news-card--accent:is(:hover, :focus-within)::before{
  opacity: .93;
}

/* Content über Overlay + Layout verbessern */
.news-card--accent .news-card__content{
  position: relative;
  z-index: 2;
  padding: 0;

  display: flex;
  flex-direction: column;
  justify-content: flex-start;

  min-height: 100%;
}

/* Akzent-Kachel: größere Überschrift (Token aus base.css) */
.news-card--accent .news-card__title{
  font-size: var(--fs-h2);
  line-height: 1.1;
  margin-bottom: 12px;
}

/* Label im Orange-Block: Akzentfarbe mit 85% Deckkraft (global über Token) */
.news-card--accent .news-card__label{
  color: color-mix(in srgb, var(--color-accent) 85%, transparent);
}

/* Fallback für Browser ohne color-mix() */
@supports not (color: color-mix(in srgb, #000 50%, transparent)) {
  .news-card--accent .news-card__label{
    color: rgba(236, 100, 19, 0.85);
  }
}

/* Excerpt nach unten */
.news-card--accent .news-card__excerpt{
  margin-top: auto;
  opacity: .95;
}
