/* DM Pillar Hub – Frontend Styles
 * Prefix .dmh-, isoliert vom Avada-Theme.
 * Farbpalette an gg.at angelehnt (sanftes Grün als Akzent).
 */

.dmh-hub, .dmh-hub *, .dmh-hub *::before, .dmh-hub *::after { box-sizing: border-box; }
.dmh-hub[x-cloak] { display: none; }

/* TEXT-WRAPPING: lange deutsche Wörter brauchen Hyphenation, sonst überlaufen sie. */
.dmh-hub h1, .dmh-hub h2, .dmh-hub h3, .dmh-hub h4,
.dmh-hub p, .dmh-hub span, .dmh-hub a, .dmh-hub button {
    overflow-wrap: break-word;
    word-wrap: break-word;
}
.dmh-pillar__title, .dmh-pillar__desc,
.dmh-card__title, .dmh-card__cat, .dmh-card--more {
    hyphens: auto;
    -webkit-hyphens: auto;
}

.dmh-hub {
    /* Brand-Farben aus Avada/GG-Theme uebernommen, damit Hub nicht als Fremdkoerper wirkt.
       --dmh-accent      = Avada Brand-Gruen (Buttons, Links)
       --dmh-accent-dark = Avada Petrol (Page-Headlines H1/H2)
       --dmh-fg          = Avada Body-Color */
    --dmh-fg: #143d3f;
    --dmh-fg-muted: #5c6d65;
    --dmh-bg: #f9f9fb;
    --dmh-card-bg: #ffffff;
    --dmh-accent: #619501;
    --dmh-accent-dark: #037677;
    --dmh-border: rgba(20, 61, 63, 0.08);
    --dmh-shadow: 0 1px 3px rgba(20, 61, 63, 0.06), 0 4px 16px rgba(20, 61, 63, 0.04);
    --dmh-radius: 14px;
    --dmh-radius-sm: 10px;
    --dmh-radius-pill: 999px;
    /* Innere Inhalts-Breite folgt der Avada-Site-Width (var greift wenn Avada sie setzt). */
    --dmh-inner-width: var(--awb-site-width, 1200px);

    /* Body-Font matched Avada: Open Sans. Heading-Font (Merriweather) wird auf .dmh-hub__title und .dmh-pillar__title explizit gesetzt. */
    font-family: "Open Sans", Arial, Helvetica, sans-serif;
    color: var(--dmh-fg);
    background: linear-gradient(180deg, #f4f7f2 0%, #f9faf7 60%, #ffffff 100%);
    padding: 48px 16px 24px;
    margin: 0 calc(50% - 50vw);
    width: 100vw;
    max-width: 100vw;
}

/* HERO */
.dmh-hub__hero { max-width: 860px; margin: 0 auto 32px; text-align: center; }
.dmh-hub__chip {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(97, 149, 1, 0.08); color: var(--dmh-accent-dark);
    padding: 6px 14px; border-radius: var(--dmh-radius-pill);
    font-size: 13px; font-weight: 600; margin-bottom: 16px;
}
.dmh-hub__chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dmh-accent); }
.dmh-hub__title {
    font-family: 'Merriweather', Georgia, 'Times New Roman', serif;
    font-size: clamp(28px, 4.5vw, 44px); line-height: 1.25; font-weight: 400;
    color: var(--dmh-accent-dark); margin: 0 0 16px;
}
.dmh-hub__lead { font-size: 16px; line-height: 1.55; color: var(--dmh-fg-muted); margin: 0 0 32px; }
.dmh-hub__stats {
    display: flex; justify-content: center; gap: 48px; margin: 0;
    padding: 0;
}
.dmh-hub__stat dt { font-size: 28px; font-weight: 700; color: var(--dmh-accent-dark); line-height: 1; margin-bottom: 4px; }
.dmh-hub__stat dd { font-size: 13px; color: var(--dmh-fg-muted); margin: 0; }

/* FILTER BAR */
.dmh-hub__filter-bar {
    max-width: var(--dmh-inner-width); margin: 0 auto 16px;
    background: var(--dmh-card-bg); border-radius: var(--dmh-radius);
    padding: 12px; display: grid; gap: 8px;
    grid-template-columns: 1fr auto;
    box-shadow: var(--dmh-shadow);
}
.dmh-hub__btn--ghost { background: transparent; color: var(--dmh-fg-muted); border: 1px solid var(--dmh-border); }
.dmh-hub__btn--ghost:hover { background: rgba(97, 149, 1, 0.05); color: var(--dmh-accent-dark); }
.dmh-hub__empty { background: var(--dmh-card-bg); border-radius: var(--dmh-radius); padding: 32px; text-align: center; color: var(--dmh-fg-muted); }
.dmh-pillar__icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.dmh-pillar__icon svg { width: 24px; height: 24px; }
.dmh-card__media--placeholder { display: flex; align-items: center; justify-content: center; aspect-ratio: 16/9; }
.dmh-card__media--placeholder svg { width: 32px; height: 32px; }
.dmh-pillar__no-cards { font-size: 14px; color: var(--dmh-fg-muted); margin: 0; padding: 8px 4px; }
.dmh-card__media--placeholder { background: rgba(97, 149, 1, 0.08); aspect-ratio: 16/9; }
.dmh-hub__search {
    display: flex; align-items: center; gap: 8px;
    background: #f5f8f4; border-radius: var(--dmh-radius-sm); padding: 0 14px;
    color: var(--dmh-fg-muted);
}
.dmh-hub__search input { border: 0; background: transparent; padding: 12px 0; flex: 1; font-size: 14px; color: var(--dmh-fg); outline: none; }
.dmh-hub__select {
    background: #f5f8f4; border: 0; border-radius: var(--dmh-radius-sm);
    padding: 0 14px; font-size: 14px; color: var(--dmh-fg);
    cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235c6d65' stroke-width='2.5' stroke-linecap='round'><path d='m6 9 6 6 6-6'/></svg>");
    background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
.dmh-hub__btn { border: 0; border-radius: var(--dmh-radius-sm); padding: 12px 22px; font-size: 14px; font-weight: 600; cursor: pointer; }
.dmh-hub__btn--primary { background: var(--dmh-accent); color: #fff; }
.dmh-hub__btn--primary:hover { background: var(--dmh-accent-dark); }

/* CHIPS */
.dmh-hub__chips {
    max-width: var(--dmh-inner-width); margin: 0 auto 32px;
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    background: var(--dmh-card-bg); padding: 10px 14px; border-radius: var(--dmh-radius);
    box-shadow: var(--dmh-shadow);
}
.dmh-hub__chips-label { font-size: 13px; color: var(--dmh-fg-muted); margin-right: 4px; }
.dmh-hub__chip-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: transparent; border: 1px solid var(--dmh-border);
    border-radius: var(--dmh-radius-pill); padding: 7px 14px;
    font-size: 13px; font-weight: 500; color: var(--dmh-fg); cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.dmh-hub__chip-btn:hover { background: rgba(97, 149, 1, 0.05); }
.dmh-hub__chip-btn.is-active { background: var(--dmh-accent); border-color: var(--dmh-accent); color: #fff; }
.dmh-hub__chip-btn.is-active .dmh-hub__chip-icon { color: #fff !important; }
.dmh-hub__chip-icon { width: 14px; height: 14px; display: inline-flex; align-items: center; }
.dmh-hub__chip-icon svg { width: 14px; height: 14px; }

/* SECTION HEADER */
.dmh-hub__section { max-width: var(--dmh-inner-width); margin: 0 auto 16px; display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px; flex-wrap: wrap; gap: 4px 12px; }
.dmh-hub__section-title { font-size: 22px; font-weight: 700; color: var(--dmh-accent-dark); margin: 0; }
.dmh-hub__section-meta { font-size: 13px; color: var(--dmh-fg-muted); }

/* THEMENWELT */
.dmh-hub__pillars { max-width: var(--dmh-inner-width); margin: 0 auto; display: grid; gap: 12px; }
.dmh-pillar {
    background: var(--dmh-card-bg); border-radius: var(--dmh-radius);
    box-shadow: var(--dmh-shadow); overflow: hidden;
}
.dmh-pillar__header {
    display: flex; align-items: center; gap: 16px;
    padding: 18px 22px; cursor: pointer; user-select: none;
}
.dmh-pillar__icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.dmh-pillar__icon svg { width: 22px; height: 22px; }
.dmh-pillar__head { flex: 1; min-width: 0; }
.dmh-pillar__title-row { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 4px; }
/* Element-Wechsel auf span + !important: Avada-Typografie greift sonst durch */
.dmh-pillar__title { font-family: 'Merriweather', Georgia, 'Times New Roman', serif !important; font-size: 20px !important; font-weight: 400 !important; color: var(--dmh-accent-dark) !important; margin: 0 !important; min-width: 0; line-height: 1.3 !important; letter-spacing: 0; display: block; }
.dmh-pillar__count {
    background: rgba(97, 149, 1, 0.10); color: var(--dmh-accent-dark);
    font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: var(--dmh-radius-pill);
    white-space: nowrap; flex-shrink: 0;
}
.dmh-pillar__desc { font-size: 14px; color: var(--dmh-fg-muted); margin: 0; line-height: 1.45; }
.dmh-pillar__chevron { color: var(--dmh-fg-muted); flex-shrink: 0; transition: transform 0.2s ease; }
.dmh-pillar.is-open .dmh-pillar__chevron { transform: rotate(180deg); }

.dmh-pillar__cards {
    display: grid; gap: 12px; padding: 4px 22px 22px;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.dmh-card {
    position: relative;
    display: flex; flex-direction: column;
    background: #fafdf8; border-radius: var(--dmh-radius-sm);
    text-decoration: none; color: var(--dmh-fg);
    border: 1px solid var(--dmh-border);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    min-width: 0;
    /* Avada haengt der .fusion-text a Regel ein asymmetrisches padding-left: 27px an
       (Theme-Default fuer Inline-Text-Links). Auf den Cards schiebt das Bild + Body
       nach rechts und verschwendet links Platz. Auf NULL zwingen, scoped innerhalb des
       Hubs (kein globaler Avada-Eingriff). */
    padding: 0 !important;
}
.dmh-card:hover { transform: translateY(-2px); box-shadow: var(--dmh-shadow); }
/* Avada haengt automatisch ein FontAwesome external-link-Icon (\f35d) per ::after
   an jeden <a>. Standard-Position oben-links ueberdeckt das Card-Bild und nimmt links
   wertvollen Platz weg. Wir verschieben das Icon nach unten-rechts auf die GLEICHE
   Baseline wie die Lesezeit (.dmh-card__meta): beide nutzen bottom=16px (matched das
   card-body padding-bottom) + line-height=1, so dass ihre vertikalen Zentren exakt
   uebereinander liegen. */
.dmh-card::after {
    top: auto !important;
    left: auto !important;
    right: 14px !important;
    bottom: 16px !important;
    font-size: 14px !important;
    line-height: 1 !important;
}
/* Bei .dmh-card--more haben wir schon einen eigenen "->"-Pfeil im Markup —
   das Avada-Icon waere doppelt. */
.dmh-card--more::after { content: none !important; }
.dmh-card__media { display: flex; align-items: center; justify-content: center; aspect-ratio: 16/9; overflow: hidden; border-top-left-radius: var(--dmh-radius-sm); border-top-right-radius: var(--dmh-radius-sm); }
.dmh-card__media img { width: 100%; height: 100%; object-fit: cover; }
.dmh-card__media--icon svg { width: 36px; height: 36px; }
.dmh-card__body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.dmh-card__cat { font-size: 11px; font-weight: 700; letter-spacing: 0.6px; color: var(--dmh-accent); text-transform: uppercase; }
/* Element-Wechsel auf span + !important: Avada-Typografie greift sonst durch */
.dmh-card__title { font-size: 14px !important; font-weight: 600 !important; line-height: 1.35 !important; color: var(--dmh-accent-dark) !important; margin: 0 !important; letter-spacing: 0; display: block; }
.dmh-card__meta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 1; color: var(--dmh-fg-muted); margin-top: auto; white-space: nowrap; }
.dmh-card__meta svg { width: 14px; height: 14px; flex-shrink: 0; }

.dmh-card--more {
    align-items: center; justify-content: center; flex-direction: row; gap: 8px;
    background: transparent; border: 1px dashed var(--dmh-accent);
    padding: 18px 14px; color: var(--dmh-accent-dark); font-weight: 600; font-size: 14px;
    text-align: center;
}
.dmh-card--more:hover { background: rgba(97, 149, 1, 0.06); }

/* NEWSLETTER */
.dmh-newsletter { max-width: var(--dmh-inner-width); margin: 32px auto 0; }
.dmh-newsletter__inner {
    background: linear-gradient(135deg, #037677 0%, #619501 100%);
    color: #fff; border-radius: var(--dmh-radius);
    padding: 28px 32px;
    display: grid; gap: 20px;
    grid-template-columns: 1fr 1fr; align-items: center;
}
.dmh-newsletter__headline { font-size: 22px; font-weight: 700; margin: 0 0 8px; }
.dmh-newsletter__subtext { font-size: 14px; line-height: 1.5; color: rgba(255,255,255,0.85); margin: 0; }
.dmh-newsletter__form { display: flex; flex-direction: column; gap: 8px; }
.dmh-newsletter__row { display: flex; gap: 8px; background: #fff; border-radius: var(--dmh-radius-pill); padding: 4px 4px 4px 18px; }
.dmh-newsletter__row input[type=email] { flex: 1; border: 0; background: transparent; padding: 12px 0; font-size: 14px; outline: none; color: var(--dmh-fg); }
.dmh-newsletter__row button { background: var(--dmh-accent); color: #fff; border: 0; border-radius: var(--dmh-radius-pill); padding: 10px 22px; font-weight: 600; cursor: pointer; }
.dmh-newsletter__row button:hover { background: var(--dmh-accent-dark); }
.dmh-newsletter__consent { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: rgba(255,255,255,0.8); line-height: 1.4; }
.dmh-newsletter__consent input { margin-top: 2px; flex-shrink: 0; }
.dmh-newsletter__consent a { color: #fff; text-decoration: underline; }
.dmh-newsletter__honeypot { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; opacity: 0; }
.dmh-newsletter__notice { background: rgba(255,255,255,0.15); border-radius: var(--dmh-radius-sm); padding: 16px; font-size: 14px; }
.dmh-newsletter__error { font-size: 13px; color: #ffd2d2; margin: 4px 0 0; }

/* RESPONSIVE */
@media (max-width: 860px) {
    .dmh-hub__filter-bar { grid-template-columns: 1fr; }
    .dmh-hub__select, .dmh-hub__search { padding: 10px 14px; }
    .dmh-newsletter__inner { grid-template-columns: 1fr; padding: 24px; }
    .dmh-hub__stats { gap: 32px; }
    .dmh-pillar__cards { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
@media (max-width: 600px) {
    .dmh-hub { padding: 32px 12px 24px; }
    .dmh-hub__hero { margin-bottom: 24px; }
    .dmh-pillar__header { padding: 14px 16px; gap: 12px; }
    .dmh-pillar__cards { padding: 4px 14px 16px; grid-template-columns: 1fr 1fr; gap: 10px; }
    .dmh-hub__title { font-size: 26px; }
    .dmh-hub__stats { gap: 24px; }
    .dmh-hub__stat dt { font-size: 22px; }
    .dmh-hub__chips { padding: 8px 12px; }
    .dmh-hub__section-meta { width: 100%; }
}
@media (max-width: 440px) {
    .dmh-pillar__cards { grid-template-columns: 1fr; gap: 10px; }
    .dmh-pillar__header { padding: 14px; gap: 12px; }
    .dmh-pillar__icon { width: 40px; height: 40px; }
    .dmh-pillar__icon svg { width: 20px; height: 20px; }
    .dmh-pillar__title { font-size: 17px !important; }
    .dmh-card__title { font-size: 14px !important; }
    .dmh-card__media { aspect-ratio: 21/9; }
    .dmh-newsletter { margin-top: 24px; }
    .dmh-newsletter__inner { padding: 20px; gap: 16px; }
    .dmh-newsletter__row {
        flex-direction: column;
        background: transparent;
        padding: 0;
        gap: 8px;
    }
    .dmh-newsletter__row input[type=email] {
        background: #fff; border-radius: var(--dmh-radius-pill);
        padding: 12px 18px; width: 100%;
    }
    .dmh-newsletter__row button {
        width: 100%; padding: 12px 22px;
    }
}
