﻿
/* =========================================================
   WALDHAUS – NEWS / AKTUELLES
   TYPO3 EXT:news
   3 Spalten mit Bildern
   ========================================================= */

.news {
  --news-green: #5c8f57;
  --news-green-dark: #3d6f2d;
  --news-green-soft: #eef5e8;
  --news-beige: #f3f0e9;
  --news-text: #666f68;
  --news-heading: #40594a;
  --news-border: #dfe8d9;

  width: 100%;
  font-family: var(--font-body, "Source Sans 3", sans-serif);
}

/* =========================================================
   NEWS GRID – 3 SPALTEN
   ========================================================= */

.news .news-list-view {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 2.5vw, 32px);
  width: 100%;
  margin: 0;
  padding: 0;
}

/* =========================================================
   NEWS KARTE
   ========================================================= */

.news .news-list-view .article {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;

  margin: 0 !important;
  padding: 0 !important;

  overflow: hidden;
  border: 1px solid var(--news-border);
  border-radius: 10px;

  background: linear-gradient(
    145deg,
    #ffffff 0%,
    #f7faf3 100%
  );

  box-shadow: 0 12px 32px rgba(47, 68, 46, 0.07);

  transition:
    transform .3s ease,
    box-shadow .3s ease,
    border-color .3s ease;
}

.news .news-list-view .article:hover,
.news .news-list-view .article:focus-within {
  transform: translateY(-5px);
  border-color: #bbd0b1;
  box-shadow: 0 20px 42px rgba(47, 68, 46, 0.13);
}

/* =========================================================
   NEWS BILDER WIEDER EINBLENDEN
   ========================================================= */

.news .news-list-view .news-img-wrap {
  display: block !important;
  position: relative;
  width: 100%;
  height: 220px;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 auto;

  overflow: hidden;
  background: var(--news-green-soft);
}

/* Unterschiedliche TYPO3 Bildstrukturen */

.news .news-list-view .news-img-wrap a,
.news .news-list-view .news-img-wrap picture,
.news .news-list-view .news-img-wrap figure {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0 !important;
}

.news .news-list-view .news-img-wrap img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;

  object-fit: cover;
  object-position: center;

  border-radius: 0 !important;
  transition: transform .6s ease;
}

.news .news-list-view .article:hover
.news-img-wrap img {
  transform: scale(1.045);
}

/* Dezente grüne Bildkante */

.news .news-list-view .news-img-wrap::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--news-green);
  content: "";
  pointer-events: none;
}

/* =========================================================
   ICON NUR WENN KEIN BILD VORHANDEN
   ========================================================= */

.news .news-list-view .article::before {
  display: none;
}

.news .news-list-view .article:not(:has(
  .news-img-wrap img
))::before {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 52px;

  width: 52px;
  height: 52px;
  margin: 30px 30px 0;

  border-radius: 50%;
  background: var(--news-green-soft);
  color: var(--news-green);

  font-family: "Font Awesome 6 Free";
  font-size: 1.15rem;
  font-weight: 900;
  content: "\f15c";
}

/* =========================================================
   ÜBERSCHRIFT
   ========================================================= */

.news .news-list-view .article > .header {
  margin: 0 !important;
  padding: 26px 28px 0 !important;
  background: transparent;
}

.news .news-list-view .article > .header h3 {
  margin: 0 !important;
  padding: 0 !important;

  color: var(--news-heading);
  font-family: var(--font-headline, "Albert Sans", sans-serif);
  font-size: clamp(1.18rem, 1.4vw, 1.45rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.015em;
  text-transform: none;
  text-align: left;
}

.news .news-list-view .article > .header h3::after {
  display: none !important;
}

.news .news-list-view .article > .header h3 a {
  color: var(--news-heading) !important;
  text-decoration: none !important;
}

.news .news-list-view .article > .header h3 a:hover {
  color: var(--news-green) !important;
}

/* =========================================================
   TEASERTEXT
   ========================================================= */

.news .news-list-view .teaser-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;

  padding: 17px 28px 27px;
}

.news .news-list-view .teaser-text
> div[itemprop="description"] {
  margin: 0 0 24px;
}

.news .news-list-view .teaser-text p {
  margin: 0 !important;
  padding: 0 !important;

  color: var(--news-text);
  font-family: var(--font-body, "Source Sans 3", sans-serif);
  font-size: .98rem;
  font-weight: 400;
  line-height: 1.65;
}

/* =========================================================
   WEITERLESEN LINK
   ========================================================= */

.news .news-list-view .article .more {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;

  width: fit-content;
  min-height: 36px;
  margin-top: auto;
  padding: 10px 22px 0 0 !important;

  border: 0 !important;
  border-radius: 0 !important;

  background: transparent !important;
  box-shadow: none !important;

  color: var(--news-green-dark) !important;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .09em;
  line-height: 1.3;
  text-decoration: none !important;
  text-transform: uppercase;

  transition: color .25s ease;
}

/* Kleiner grüner Trennstrich */

.news .news-list-view .article .more::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 2px;

  border-radius: 2px;
  background: var(--news-green);
  content: "";
}

/* Pfeil */

.news .news-list-view .article .more::after {
  display: inline-block;
  color: var(--news-green);
  font-family: "Font Awesome 6 Free";
  font-size: .8rem;
  font-weight: 900;
  content: "\f061";
  transition: transform .25s ease;
}

.news .news-list-view .article .more:hover {
  color: var(--news-green) !important;
}

.news .news-list-view .article .more:hover::after {
  transform: translateX(5px);
}

/* =========================================================
   DATUM / FOOTER VERSTECKEN
   ========================================================= */

.news .news-list-view .news-list-date,
.news .news-list-view .footer,
.news .news-list-view .no-media-element {
  display: none !important;
}

/* =========================================================
   FOKUS
   ========================================================= */

.news a:focus-visible {
  outline: 3px solid var(--news-green);
  outline-offset: 4px;
}

/* =========================================================
   TABLET – 2 SPALTEN
   ========================================================= */

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

  .news .news-list-view .news-img-wrap {
    height: 210px;
  }
}

/* =========================================================
   SMARTPHONE – 1 SPALTE
   ========================================================= */

@media (max-width: 680px) {
  .news .news-list-view {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .news .news-list-view .news-img-wrap {
    height: 220px;
  }

  .news .news-list-view .article > .header {
    padding: 22px 23px 0 !important;
  }

  .news .news-list-view .article > .header h3 {
    font-size: 1.3rem;
  }

  .news .news-list-view .teaser-text {
    padding: 15px 23px 24px;
  }

  .news .news-list-view .article:not(:has(
    .news-img-wrap img
  ))::before {
    margin: 24px 23px 0;
  }
}

/* =========================================================
   REDUZIERTE BEWEGUNG
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .news .article,
  .news .news-img-wrap img,
  .news .article .more,
  .news .article .more::after {
    transition: none !important;
    transform: none !important;
  }
}


/* ==========================================
   NEWS – GLEICHE HEADLINE-HÖHEN
   ========================================== */

.news .news-list-view .article > .header {
  min-height: 105px;
  display: flex;
  align-items: flex-start;
  padding: 25px 28px 0 !important;
}

.news .news-list-view .article > .header h3 {
  margin: 0 !important;
  font-size: 1.35rem;
  line-height: 1.35;
}

/* ==========================================
   NEWS – GRÜNER WEITERLESEN-BUTTON
   ========================================== */

.news .news-list-view .article .more {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 12px;

  width: fit-content;
  min-height: 46px;
  margin-top: auto;
  padding: 12px 20px !important;

  border: 2px solid transparent !important;
  border-radius: 8px !important;

  background: #5c8f57 !important;
  color: #ffffff !important;

  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.3;
  text-transform: uppercase;
  text-decoration: none !important;

  box-shadow: 0 4px 12px rgba(35, 66, 25, .12) !important;

  transition:
    background .25s ease,
    transform .25s ease,
    box-shadow .25s ease;
}

/* Alten Trennstrich entfernen */

.news .news-list-view .article .more::before {
  display: none !important;
}

/* Pfeil wie bei den Homepage-Buttons */

.news .news-list-view .article .more::after {
  display: inline-block;
  content: "›";
  font-family: inherit;
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1;
  color: #ffffff !important;
  transition: transform .25s ease;
}

/* Hover */

.news .news-list-view .article .more:hover {
  background: #2b5120 !important;
  color: #ffffff !important;
  transform: translateY(-3px);

  box-shadow: 0 10px 22px
    rgba(35, 66, 25, .24) !important;
}

.news .news-list-view .article .more:hover::after {
  transform: translateX(4px);
}

/* ==========================================
   MOBILE
   ========================================== */

@media (max-width: 680px) {
  .news .news-list-view .article > .header {
    min-height: 0;
    padding: 22px 23px 0 !important;
  }

  .news .news-list-view .article .more {
    min-height: 44px;
    padding: 10px 18px !important;
  }
}

/* =========================================================
   WALDHAUS – NEWS DETAILANSICHT
   Exakt auf die vorhandene HTML-Struktur abgestimmt
   ========================================================= */

/* Gesamten Artikel vertikal anordnen */

.news.news-single > .article {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 0 !important;

  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

/* Dokument-Icon aus der Listenansicht entfernen */

.news.news-single > .article::before,
.news.news-single > .article::after {
  display: none !important;
}

/* =========================================================
   REIHENFOLGE
   ========================================================= */

.news.news-single > .article > .header {
  order: 1;
}

.news.news-single > .article > .footer {
  order: 2;
}

.news.news-single > .article > .teaser-text {
  order: 3;
}

.news.news-single > .article > .news-text-wrap {
  order: 4;
}

.news.news-single > .article > .news-img-wrap {
  order: 5;
}

.news.news-single > .article > .news-related-wrap {
  order: 6;
}

/* =========================================================
   ÜBERSCHRIFT
   ========================================================= */

.news.news-single > .article > .header {
  width: 100%;
  margin: 0 0 18px !important;
  padding: 0 !important;
}

.news.news-single .header h1 {
  margin: 0 !important;
  padding: 0 0 16px !important;

  color: #5c8f57;
  font-family: var(--font-headline);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
}

/* =========================================================
   DATUM UND KATEGORIE
   ========================================================= */

.news.news-single > .article > .footer {
  display: block !important;
  width: 100%;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
  background: transparent;
}

.news.news-single > .article > .footer p {
  margin: 0;
  color: #788078;
  font-size: .95rem;
  line-height: 1.5;
}

/* =========================================================
   TEASER
   ========================================================= */

.news.news-single > .article > .teaser-text {
  display: block !important;
  flex: none !important;
  width: 100% !important;
  max-width: 100% !important;

  margin: 0 0 22px !important;
  padding: 0 !important;
  clear: both !important;
}

.news.news-single .teaser-text p {
  margin: 0 !important;
  color: #666f68;
  font-size: 1.15rem;
  line-height: 1.7;
}

/* =========================================================
   HAUPTTEXT – 100 PROZENT BREITE
   ========================================================= */

.news.news-single > .article > .news-text-wrap {
  display: block !important;
  float: none !important;
  clear: both !important;

  flex: none !important;
  width: 100% !important;
  max-width: 100% !important;

  margin: 0 !important;
  padding: 0 !important;

  columns: auto !important;
}

.news.news-single .news-text-wrap p {
  margin: 0 0 18px !important;
  color: #303b33;
  font-size: 1.1rem;
  line-height: 1.75;
}

/* =========================================================
   BILDERGALERIE – UNTER DEM TEXT
   ========================================================= */

.news.news-single > .article > .news-img-wrap {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;

  float: none !important;
  clear: both !important;

  flex: none !important;
  width: 100% !important;
  max-width: 100% !important;

  margin: 30px 0 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

/* Alle direkten Bildelemente */

.news.news-single .news-img-wrap > .outer {
  float: none !important;
  clear: none !important;

  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;

  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* =========================================================
   ANZAHL DER BILDER
   ========================================================= */

/* 1 Bild = 50 % */

.news.news-single .news-img-wrap:has(
  > .outer:only-child
) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* 2 Bilder = jeweils 50 % */

.news.news-single .news-img-wrap:has(
  > .outer:first-child:nth-last-child(2)
) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* 3 Bilder = jeweils 33,33 % */

.news.news-single .news-img-wrap:has(
  > .outer:first-child:nth-last-child(3)
) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* 4 oder mehr Bilder = 4 Spalten
   Ab dem 5. Bild erfolgt ein Umbruch */

/* =========================================================
   BILDDARSTELLUNG
   ========================================================= */

.news.news-single .news-img-wrap .mediaelement,
.news.news-single .news-img-wrap a {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 !important;
}

.news.news-single .news-img-wrap img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;

  height: auto !important;
  aspect-ratio: auto !important;

  object-fit: contain;
  border-radius: 10px;

  box-shadow: 0 8px 24px rgba(47, 68, 46, .1);

  transition:
    transform .3s ease,
    box-shadow .3s ease;
}

.news.news-single .news-img-wrap a:hover img {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(47, 68, 46, .16);
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 991.98px) {
  .news.news-single > .article > .news-img-wrap,
  .news.news-single .news-img-wrap:has(
    > .outer:first-child:nth-last-child(3)
  ) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .news.news-single .news-img-wrap {
    gap: 16px;
  }
}

/* =========================================================
   SMARTPHONE
   ========================================================= */

@media (max-width: 600px) {
  .news.news-single > .article > .news-img-wrap,
  .news.news-single .news-img-wrap:has(
    > .outer:only-child
  ),
  .news.news-single .news-img-wrap:has(
    > .outer:first-child:nth-last-child(2)
  ),
  .news.news-single .news-img-wrap:has(
    > .outer:first-child:nth-last-child(3)
  ) {
    grid-template-columns: 1fr;
  }

  .news.news-single .news-text-wrap p {
    font-size: 1rem;
  }

  .news.news-single .teaser-text p {
    font-size: 1.05rem;
  }
}

/* ==========================================
   NEWS – ZURÜCK ZUR ÜBERSICHT
   ========================================== */

/* Backlink ganz ans Ende verschieben */
.news.news-single > .article > .news-backlink-wrap {
  order: 99 !important;

  display: flex !important;
  justify-content: center;
  align-items: center;

  width: 100%;
  clear: both;

  margin: 55px 0 15px !important;
  padding: 25px 0 0 !important;

  border-top: 1px solid #d9e6cf;
}

/* Button */
.news.news-single .news-backlink-wrap a {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 12px;

  width: auto;
  min-height: 48px;
  padding: 12px 26px !important;

  border: 1px solid #3d6f2d !important;
  border-radius: 999px !important;

  background: #ffffff !important;
  color: #3d6f2d !important;

  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .03em;
  text-decoration: none !important;

  box-shadow: none !important;

  transition:
    background .25s ease,
    color .25s ease,
    transform .25s ease,
    box-shadow .25s ease;
}

/* Alten Text optisch ersetzen */
.news.news-single .news-backlink-wrap a {
  font-size: 0 !important;
}

/* Pfeil links */
.news.news-single .news-backlink-wrap a::before {
  content: "\f060";
  font-family: "Font Awesome 6 Free";
  font-size: 14px;
  font-weight: 900;
}

/* Neuer Text */
.news.news-single .news-backlink-wrap a::after {
  content: "Zurück zur Übersicht";
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .03em;
}

/* Hover */
.news.news-single .news-backlink-wrap a:hover {
  background: #5c8f57 !important;
  color: #ffffff !important;
  transform: translateY(-2px);

  box-shadow: 0 8px 20px rgba(35, 66, 25, .18) !important;
}

/* Fokus */
.news.news-single .news-backlink-wrap a:focus-visible {
  outline: 3px solid #5c8f57;
  outline-offset: 4px;
}

/* Der zusätzliche Zurück-Button
   unterhalb des News-Plugins entfällt */
body:has(.news.news-single) .container.zurueck {
  display: none !important;
}

/* Mobile */
@media (max-width: 600px) {
  .news.news-single > .article > .news-backlink-wrap {
    margin-top: 35px !important;
    padding-top: 20px !important;
  }
}

