/* Startseite „Nachrichten aktuell“ – Layout com_lmdb/shortnews/home */

/* Unterregeln hängen an .hwx-news-home, damit sie die globale Regel „main :is(p,span)“ aus app.css schlagen.
   ID-Selektor, weil app.css #hwx-lmdb-shortnews-list als Grid für das tiles-Layout definiert */
#hwx-lmdb-shortnews-list.hwx-news-home,
.hwx-news-home {
  --news-ink: #0C3247;
  --news-text: #303030;
  --news-muted: #6C757D;
  --news-soft: #586873;
  --news-line: #DBE3E8;
  --news-surface: #F5F8FA;
  --news-accent: #164F9E;
  --news-button: #013F58;
  --news-radius: .875rem;
  --news-radius-lead: 1.25rem;
  --news-shadow: 0 .45rem 1.2rem rgba(12, 50, 71, .08);
  --news-shadow-lead: 0 .75rem 2.25rem rgba(12, 50, 71, .11);
  --news-shadow-hover: 0 1rem 2.75rem rgba(12, 50, 71, .15);
  --news-font-display: var(--hwx-text_font-family, WorkSans-Regular), system-ui, sans-serif;

  grid-column: main-start / main-end;
  display: flex;
  grid-template: none;
  flex-direction: column;
  gap: var(--hwx-section-gap, 3rem);
  margin: 1.5rem 0 0; /* Abstand nach unten: sections.css (Modulposition „bottom“) */
  min-width: 0;
}

/* Kopf */
.hwx-news-home .hwx-news-home__top {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hwx-news-home .hwx-news-home__heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1.5rem;
}

.hwx-news-home .hwx-news-home__heading h1 {
  margin: 0;
  font-family: var(--news-font-display);
  font-weight: 500;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.2;
  color: var(--news-ink);
  text-wrap: balance;
}

.hwx-news-home .hwx-news-home__count {
  font-size: .9375rem;
  color: var(--news-muted);
}

.hwx-news-home .hwx-news-home__empty {
  margin: 0;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--news-line);
  border-radius: var(--news-radius);
  color: var(--news-text);
}

.hwx-news-home .hwx-news-home__empty--region {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .75rem;
  padding: 2.5rem 2rem;
}

.hwx-news-home .hwx-news-home__empty--region p {
  margin: 0;
  color: var(--news-ink);
  font-size: 1.125rem;
  font-weight: 600;
}

/* Aufmacher + Seitenleiste */
.hwx-news-home .hwx-news-home__stage {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: stretch;
}

.hwx-news-home .hwx-news-home__stage--no-lead {
  justify-content: flex-end;
}

.hwx-news-home .hwx-news-card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hwx-news-home .hwx-news-card-link:focus-visible {
  outline: 3px solid var(--news-accent);
  outline-offset: 3px;
  border-radius: inherit;
}

.hwx-news-home .hwx-news-lead {
  flex: 2 1 560px;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--news-radius-lead);
  overflow: hidden;
  box-shadow: var(--news-shadow-lead);
  transition: box-shadow .2s ease, transform .2s ease;
}

.hwx-news-home .hwx-news-lead:hover,
.hwx-news-home .hwx-news-tile:hover {
  box-shadow: var(--news-shadow-hover);
  transform: translateY(-2px);
}

.hwx-news-home .hwx-news-lead__media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--news-surface);
}

.hwx-news-home .hwx-news-lead__media,
.hwx-news-home .hwx-news-tile__media {
  overflow: hidden;
}

/* absolut, damit hohe Bilder das Seitenverhältnis des Rahmens nicht aufziehen */
.hwx-news-home .hwx-news-lead__media img,
/* Kachel ohne Bild: ruhige helle Fläche */
.hwx-news-home .hwx-news-tile__media--placeholder {
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, .55) 0 18%, transparent 19%),
    radial-gradient(circle at 10% 110%, rgba(22, 79, 158, .10) 0 35%, transparent 36%),
    linear-gradient(135deg, #E8F0FA 0%, #F3F7FB 100%);
}

.hwx-news-home .hwx-news-tile__media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.hwx-news-home .hwx-news-lead__badge {
  position: absolute;
  z-index: 1;
  left: 1rem;
  top: 1rem;
  padding: .375rem .625rem;
  background: #fff;
  border-radius: .2rem;
  color: var(--news-ink);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.hwx-news-home .hwx-news-lead__copyright {
  position: absolute;
  z-index: 1;
  right: .5rem;
  bottom: .375rem;
  padding: .125rem .375rem;
  background: rgba(0, 0, 0, .45);
  border-radius: .2rem;
  color: #fff;
  font-size: .6875rem;
}

.hwx-news-home .hwx-news-lead__body {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: clamp(1.25rem, 2.5vw, 2rem);
}

.hwx-news-home .hwx-news-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  font-size: .8125rem;
  color: var(--news-muted);
}

.hwx-news-home .hwx-news-meta__district {
  padding: .125rem .375rem;
  border: 1px solid var(--news-line);
  border-radius: .2rem;
  color: #212529;
  font-weight: 700;
}

.hwx-news-home .hwx-news-lead__title {
  margin: 0;
  font-family: var(--news-font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  line-height: 1.15;
  color: var(--news-ink);
  text-wrap: balance;
}

.hwx-news-home .hwx-news-lead__subtitle {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--news-text);
}

.hwx-news-home .hwx-news-lead__teaser {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--news-soft);
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.hwx-news-home .hwx-news-home__aside {
  flex: 1 1 300px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hwx-news-home .hwx-news-home__aside > * {
  min-width: 0;
  margin: 0;
}

/* Anzeige (mod_bannerzone) als Karte über die volle Spaltenbreite, Werbemittel mittig in Originalgröße */
.hwx-news-home .hwx-news-home__aside .bannerzone {
  justify-content: center;
  margin: 0;
  padding: 0 1.25rem 1.25rem;
  background: #fff;
  border: 1px solid var(--news-line);
  border-radius: var(--news-radius);
}

.hwx-news-home .hwx-news-home__aside .bannerzone .sponsor {
  align-items: center;
  width: 100%;
  margin: 0 !important; /* überschreibt Bootstraps .mb-3 */
}

.hwx-news-home .hwx-news-home__aside .bannerzone .sponsor > span {
  align-self: flex-start;
  margin-bottom: .75rem;
  font-size: .6875rem;
  letter-spacing: .06em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--news-muted);
}

.hwx-news-home .hwx-news-home__aside .bannerzone ins img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: .25rem;
}

/* Kurznachrichten */
.hwx-news-home .hwx-news-home__tiles {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hwx-news-home .hwx-news-home__tiles-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.hwx-news-home .hwx-news-section-title {
  display: inline-block;
  margin: 0 0 0 .5rem;
  padding: .6rem 1.75rem;
  transform: skew(-15deg);
  background: var(--news-accent);
  color: #fff;
  font-family: var(--news-font-display);
  font-weight: 800;
  font-size: clamp(1.375rem, 2.35vw, 2rem);
  line-height: 1.2;
  text-transform: uppercase;
}

.hwx-news-home .hwx-news-filter {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.hwx-news-home .hwx-news-filter__pill {
  height: 36px;
  padding: 0 1rem;
  border: 1px solid var(--news-line);
  border-radius: 9999px;
  background: #fff;
  color: #212529;
  font: 500 .875rem system-ui, sans-serif;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}

.hwx-news-home .hwx-news-filter__pill:hover {
  border-color: var(--news-accent);
  color: var(--news-accent);
}

.hwx-news-home .hwx-news-filter__pill[aria-pressed="true"] {
  border-color: var(--news-accent);
  background: var(--news-accent);
  color: #fff;
  font-weight: 600;
}

.hwx-news-home .hwx-news-filter__pill:focus-visible {
  outline: 3px solid var(--news-accent);
  outline-offset: 2px;
}

.hwx-news-home .hwx-news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: 1.25rem;
}

.hwx-news-home .hwx-news-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--news-radius);
  overflow: hidden;
  box-shadow: var(--news-shadow);
  transition: box-shadow .2s ease, transform .2s ease;
}

.hwx-news-home .hwx-news-tile[hidden] {
  display: none;
}

.hwx-news-home .hwx-news-tile__media {
  position: relative;
  aspect-ratio: 3 / 2;
  background: var(--news-surface);
}

.hwx-news-home .hwx-news-tile__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: .5rem;
  padding: 1.125rem 1.25rem 1.25rem;
}

.hwx-news-home .hwx-news-tile__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  font-size: .75rem;
  color: var(--news-muted);
}

.hwx-news-home .hwx-news-tile__ressort {
  color: var(--news-accent);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.hwx-news-home .hwx-news-tile__district {
  color: #212529;
  font-weight: 700;
}

.hwx-news-home .hwx-news-tile__title {
  margin: 0;
  font-family: var(--news-font-display);
  font-weight: 500;
  font-size: 1.1875rem;
  line-height: 1.25;
  color: #000;
  text-wrap: pretty;
}

.hwx-news-home .hwx-news-tile__subtitle {
  margin: 0;
  font-size: .9375rem;
  line-height: 1.45;
  color: var(--news-text);
}

.hwx-news-home .hwx-news-tile__footer {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: auto;
  padding-top: .5rem;
  font-size: .8125rem;
  color: var(--news-muted);
}

.hwx-news-home .hwx-news-tile__footer i {
  margin-right: .25rem;
}

/* Per „Alle Kurznachrichten“ aufgeklappte Kacheln (home.js): nacheinander einblenden, kurz blau umrandet */
.hwx-news-home .hwx-news-tile.is-new {
  animation:
    hwx-news-new-in .5s cubic-bezier(.2, .7, .2, 1) var(--hwx-news-new-delay, 0ms) both,
    hwx-news-new-ring 2.4s ease-out var(--hwx-news-new-delay, 0ms);
}

@keyframes hwx-news-new-in {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }
}

@keyframes hwx-news-new-ring {
  0%,
  40% {
    box-shadow: 0 0 0 3px var(--news-accent), var(--news-shadow-hover);
  }
}

/* Button wartet auf das Nachladen */
.hwx-news-home .hwx-news-all-button[aria-busy="true"] .hwx-news-all-button__icon i {
  animation: hwx-news-busy 1s linear infinite;
}

.hwx-news-home .hwx-news-all-button[aria-busy="true"] .hwx-news-all-button__icon i::before {
  content: "\f110";
}

@keyframes hwx-news-busy {
  to {
    transform: rotate(1turn);
  }
}

/* Abschluss der Kurznachrichten: Linien links und rechts, Button in der Mitte */
.hwx-news-home .hwx-news-home__all {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-top: 1rem;
}

.hwx-news-home .hwx-news-home__all::before,
.hwx-news-home .hwx-news-home__all::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--news-line);
}

/* Gefüllt im Akzentblau des Abschnittsbands, Pfeil im weißen Kreis */
.hwx-news-home .hwx-news-all-button {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 1rem;
  height: 56px;
  padding: 0 .4375rem 0 1.75rem;
  border: 0;
  border-radius: 9999px;
  background: var(--news-accent);
  box-shadow: 0 .5rem 1.25rem rgba(22, 79, 158, .28);
  color: #fff;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: .01em;
  text-decoration: none;
  transition: background-color .25s ease, box-shadow .25s ease, transform .25s ease;
}

/* Beschriftung erbt die Buttonfarbe; app.css färbt jedes span in main („main :is(p,span)“) */
.hwx-news-home .hwx-news-all-button [data-hwx-news-all-label] {
  background: none;
  color: inherit;
  line-height: inherit;
}

.hwx-news-home .hwx-news-all-button__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  color: var(--news-accent);
  font-size: .9375rem;
  transition: transform .25s ease;
}

.hwx-news-home .hwx-news-all-button:hover {
  background: #0F3D7E;
  box-shadow: 0 .75rem 1.75rem rgba(22, 79, 158, .36);
  color: #fff;
  transform: translateY(-2px);
}

.hwx-news-home .hwx-news-all-button:hover .hwx-news-all-button__icon {
  transform: translateX(3px);
}

.hwx-news-home .hwx-news-all-button:focus-visible {
  outline: 3px solid var(--news-accent);
  outline-offset: 3px;
}

/* Kleine Variante (Region zurücksetzen): zurückhaltend als Umriss */
.hwx-news-home .hwx-news-all-button--small {
  height: 44px;
  padding: 0 1.25rem;
  font-size: 1rem;
  border: 2px solid var(--news-button);
  background: transparent;
  box-shadow: none;
  color: var(--news-button);
  font-weight: 500;
}

.hwx-news-home .hwx-news-all-button--small:hover {
  background: var(--news-button);
  box-shadow: none;
  transform: none;
}

/* Handy: „Neueste Meldungen“ ausblenden, dieselben Schlagzeilen folgen direkt darunter als Kacheln */
@media (max-width: 767.98px) {
  .hwx-news-home .hwx-news-home__aside > :has(.hwx-news-latest) {
    display: none;
  }
}

@media (max-width: 575.98px) {
  .hwx-news-home .hwx-news-home__all::before,
  .hwx-news-home .hwx-news-home__all::after {
    display: none;
  }

  .hwx-news-home .hwx-news-home__all {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hwx-news-home .hwx-news-lead,
  .hwx-news-home .hwx-news-tile,
  .hwx-news-home .hwx-news-all-button,
  .hwx-news-home .hwx-news-all-button__icon {
    transition: none;
  }

  .hwx-news-home .hwx-news-tile.is-new,
  .hwx-news-home .hwx-news-all-button[aria-busy="true"] .hwx-news-all-button__icon i {
    animation: none;
  }

  .hwx-news-home .hwx-news-all-button:hover,
  .hwx-news-home .hwx-news-all-button:hover .hwx-news-all-button__icon {
    transform: none;
  }

  .hwx-news-home .hwx-news-lead:hover,
  .hwx-news-home .hwx-news-tile:hover {
    transform: none;
  }
}
