/* News-Sektion (templates/news-index.php, templates/news-single.php).
   Eigenstaendig, ohne Elementor; Selektoren mit Elternklasse gegen globale Stile. */

.nm-news-page {
  --nm-primary: #007f6b;
  --nm-primary-dark: #00604f;
  --nm-accent: #9fc518;
  --nm-text: #23231a;
  --nm-muted: #6b6b63;
  --nm-line: #e3e3dd;
  --nm-soft: #f5f5f0;
  --nm-radius: 16px;

  color: var(--nm-text);
  font-family: "Ubuntu", Arial, sans-serif;
}

.nm-news-page *,
.nm-news-page *::before,
.nm-news-page *::after {
  box-sizing: border-box;
}

.nm-news-wrap {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Kopf + Filter ---------- */

.nm-news-head {
  padding: clamp(28px, 5vw, 56px) 0 8px;
}

.nm-news-page .nm-news-crumb {
  margin: 0 0 10px;
  color: var(--nm-muted);
  font-size: 14px;
}

.nm-news-page .nm-news-crumb a {
  color: var(--nm-primary);
  text-decoration: none;
}

.nm-news-page .nm-news-crumb a:hover {
  text-decoration: underline;
}

.nm-news-page .nm-news-head__title {
  margin: 0 0 10px;
  color: var(--nm-text);
  font-size: clamp(32px, 4.5vw, 52px);
  font-weight: 600;
  line-height: 1.1;
}

.nm-news-page .nm-news-head__intro {
  max-width: 680px;
  margin: 0 0 24px;
  color: var(--nm-muted);
  font-size: 17px;
  line-height: 1.55;
}

.nm-news-filter {
  display: grid;
  gap: 10px;
  margin: 0 -20px;
}

.nm-news-filter__list {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 2px 20px 4px;
  overflow-x: auto;
  list-style: none;
  scrollbar-width: none;
}

.nm-news-filter__list::-webkit-scrollbar {
  display: none;
}

.nm-news-filter__list li {
  flex: none;
}

.nm-news-page .nm-chip {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  border: 1px solid var(--nm-line);
  border-radius: 10em;
  background: #fff;
  color: var(--nm-text);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color .2s, background-color .2s, color .2s;
}

.nm-news-page .nm-chip:hover,
.nm-news-page .nm-chip:focus-visible {
  border-color: var(--nm-primary);
  color: var(--nm-primary);
}

.nm-news-page .nm-chip.is-active {
  border-color: var(--nm-primary);
  background: var(--nm-primary);
  color: #fff;
}

.nm-news-page .nm-chip--tag {
  padding: 7px 12px;
  border-color: transparent;
  background: var(--nm-soft);
  color: var(--nm-muted);
  font-size: 14px;
  font-weight: 400;
}

/* ---------- Liste ---------- */

.nm-news-list {
  padding: 24px 0 clamp(48px, 7vw, 80px);
}

.nm-news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 2.4vw, 28px);
}

.nm-ncard {
  min-width: 0;
}

.nm-news-page .nm-ncard__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--nm-line);
  border-radius: var(--nm-radius);
  background: #fff;
  color: var(--nm-text);
  text-decoration: none;
  transition: box-shadow .2s, transform .2s;
}

.nm-news-page .nm-ncard__link:hover,
.nm-news-page .nm-ncard__link:focus-visible {
  box-shadow: 0 12px 32px rgba(0, 0, 0, .08);
  transform: translateY(-2px);
  color: var(--nm-text);
}

.nm-ncard__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--nm-soft);
}

.nm-ncard__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nm-ncard__video {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 10em;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

.nm-ncard__video svg {
  width: 11px;
  height: 11px;
}

.nm-ncard__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px 20px;
}

.nm-ncard__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  color: var(--nm-muted);
  font-size: 13px;
}

.nm-ncard__cat {
  color: var(--nm-primary);
  font-weight: 500;
}

.nm-news-page .nm-ncard__title {
  margin: 0;
  color: var(--nm-text);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.nm-news-page .nm-ncard__link:hover .nm-ncard__title {
  color: var(--nm-primary);
}

.nm-ncard__excerpt {
  display: -webkit-box;
  overflow: hidden;
  color: var(--nm-muted);
  font-size: 15px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* Aufmacher: volle Breite, Bild links, Text rechts */
.nm-ncard--lead {
  grid-column: 1 / -1;
}

.nm-news-page .nm-ncard--lead .nm-ncard__link {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}

.nm-ncard--lead .nm-ncard__media {
  aspect-ratio: auto;
  min-height: 320px;
}

.nm-ncard--lead .nm-ncard__body {
  justify-content: center;
  padding: clamp(22px, 3vw, 40px);
}

.nm-news-page .nm-ncard--lead .nm-ncard__title {
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.2;
}

.nm-ncard--lead .nm-ncard__excerpt {
  font-size: 17px;
  -webkit-line-clamp: 5;
}

/* Seitenzahlen */
.nm-news-pager {
  margin-top: 40px;
}

.nm-news-pager ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nm-news-pager a,
.nm-news-pager span {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--nm-line);
  border-radius: 10em;
  color: var(--nm-text);
  font-weight: 500;
  text-decoration: none;
}

.nm-news-pager a:hover {
  border-color: var(--nm-primary);
  color: var(--nm-primary);
}

.nm-news-pager .current {
  border-color: var(--nm-primary);
  background: var(--nm-primary);
  color: #fff;
}

.nm-news-pager .dots {
  border-color: transparent;
}

.nm-news-empty {
  color: var(--nm-muted);
}

/* ---------- Artikel ---------- */

.nm-article__wrap {
  max-width: 860px;
  padding-top: clamp(24px, 4vw, 48px);
}

.nm-news-page .nm-article__title {
  margin: 0 0 16px;
  color: var(--nm-text);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 600;
  line-height: 1.15;
}

.nm-news-page .nm-article__lead {
  margin: 0 0 16px;
  color: var(--nm-text);
  font-size: clamp(18px, 2vw, 21px);
  font-weight: 500;
  line-height: 1.5;
}

.nm-news-page .nm-article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 0 0 24px;
  color: var(--nm-muted);
  font-size: 14px;
}

.nm-article__image {
  margin: 0 0 28px;
}

.nm-article__image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--nm-radius);
}

.nm-article__image figcaption {
  margin-top: 8px;
  color: var(--nm-muted);
  font-size: 13px;
}

.nm-article__content {
  font-size: 18px;
  line-height: 1.7;
}

.nm-news-page .nm-article__content h2 {
  margin: 1.6em 0 .5em;
  color: var(--nm-text);
  font-size: clamp(21px, 2.4vw, 26px);
  font-weight: 600;
  line-height: 1.3;
}

.nm-news-page .nm-article__content p,
.nm-news-page .nm-article__content ul,
.nm-news-page .nm-article__content ol {
  margin: 0 0 1.1em;
}

.nm-news-page .nm-article__content li {
  margin-bottom: .35em;
}

.nm-news-page .nm-article__content a {
  color: var(--nm-primary);
}

.nm-news-page .nm-article__content blockquote {
  margin: 1.4em 0;
  padding: 4px 0 4px 20px;
  border-left: 4px solid var(--nm-accent);
  color: var(--nm-text);
  font-style: italic;
}

.nm-news-page .nm-article__subhead {
  margin: 0 0 14px;
  color: var(--nm-text);
  font-size: 20px;
  font-weight: 600;
}

.nm-article__video,
.nm-article__sources {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--nm-line);
}

.nm-article__sources ul {
  margin: 0;
  padding-left: 1.2em;
  color: var(--nm-muted);
  font-size: 15px;
  line-height: 1.6;
}

.nm-article__sources a {
  color: var(--nm-primary);
}

.nm-article__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.nm-article__related {
  margin-top: clamp(40px, 6vw, 64px);
  padding-top: clamp(36px, 5vw, 56px);
  background: var(--nm-soft);
}

.nm-news-grid--3 .nm-ncard__link {
  border-color: transparent;
}

.nm-news-page .nm-news-section-title {
  margin: 0 0 20px;
  color: var(--nm-text);
  font-size: clamp(24px, 2.8vw, 32px);
  font-weight: 600;
}

.nm-article__all {
  margin: 24px 0 0;
}

.nm-news-page .nm-news-more {
  color: var(--nm-primary);
  font-weight: 500;
  text-decoration: none;
}

/* ---------- Video (Klick zum Laden, Start an der Themenstelle) ---------- */

.nm-news-page .nm-video__poster,
.nm-news-page .nm-video__frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--nm-radius);
  background: #000;
  cursor: pointer;
}

.nm-news-page .nm-video__poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .2s;
}

.nm-news-page .nm-video__poster:hover img {
  opacity: .88;
}

.nm-news-page .nm-video__play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 76px;
  transform: translate(-50%, -50%);
}

.nm-news-page .nm-video__play svg {
  display: block;
  width: 100%;
  height: auto;
  fill: #ff0033;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .4));
}

.nm-news-page .nm-video__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.nm-news-page .nm-video__note {
  margin: 10px 0 0;
  color: var(--nm-muted);
  font-size: 13px;
}

.nm-news-page .nm-video__note a {
  color: var(--nm-primary);
}

.nm-consent-youtube .nm-news-page .nm-video__note {
  display: none;
}

/* ---------- Responsive ---------- */

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

  .nm-news-page .nm-ncard--lead .nm-ncard__link {
    grid-template-columns: minmax(0, 1fr);
  }

  .nm-ncard--lead .nm-ncard__media {
    aspect-ratio: 16 / 9;
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .nm-news-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .nm-article__content {
    font-size: 17px;
  }
}

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