/* ==========================================================================
   Marchhart Projekte – Übersicht (Loop) + Single
   Tokens aus docs/design-system.md (Fallbacks, falls :root-Variablen fehlen).
   ========================================================================== */

.mh-p-hero, .mh-p-section, .mh-p-cta, .mh-p-gallery, .mh-p-filter, .mh-p-card,
.mh-j-card, .mh-j-initiativ, .mh-j-heading,
.mh-p-filter__empty {
  --p-primary: var(--mh-primary, #51778f);
  --p-text: var(--mh-text, #3c3e40);
  --p-bg-alt: #efefef;
  --p-surface: var(--mh-surface, #dbdfe3);
  --p-focus: 0 0 0 2px #fff, 0 0 0 4px var(--p-primary);
  font-family: 'urw-din', 'Barlow', system-ui, sans-serif;
  color: var(--p-text);
}

.mh-p-container {
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: 24px;
}
@media (min-width: 960px) {
  .mh-p-container { padding-inline: 64px; }
}

.mh-p-sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Hero ------------------------------------------------------------------ */
.mh-p-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(240px, 26vw, 380px);
  padding-block: 48px;
  background-color: var(--p-primary);
  background-image: linear-gradient(90deg, rgba(60, 62, 64, .8) 0%, rgba(81, 119, 143, .72) 60%, rgba(81, 119, 143, .55) 100%), var(--mh-hero-img, none);
  background-size: cover;
  background-position: center;
  color: #fff;
}
.mh-p-hero > .mh-p-container { width: 100%; }
.mh-p-hero .mh-p-hero__title {
  margin: 0;
  color: #fff;
  font-size: clamp(2.25rem, 4vw + 1rem, 3.5rem);
  font-weight: 400;
  line-height: 1.1;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .25);
}
.mh-p-hero__lead {
  margin: 16px 0 0;
  max-width: 60ch;
  color: #fff;
  font-size: 1.125rem;
  line-height: 1.5;
}
.mh-p-hero__back {
  display: inline-block;
  margin-bottom: 16px;
  color: #fff;
  font-size: 1rem;
  text-decoration: underline;
  text-underline-offset: .2em;
}
.mh-p-hero__back::before { content: "\2190\00a0"; }
.mh-p-hero__back:hover, .mh-p-hero__back:focus-visible { color: #fff; text-decoration-thickness: 2px; }

/* Filter ---------------------------------------------------------------- */
.mh-p-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 48px;
  margin: 0 0 48px;
}
.mh-p-filter__btn {
  appearance: none;
  margin: 0;
  padding: 4px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--p-text);
  font: inherit;
  font-size: clamp(1.125rem, 1vw + .75rem, 1.75rem);
  line-height: 1.3;
  text-transform: none;
  cursor: pointer;
  box-shadow: inset 0 -2px 0 transparent;
  transition: background-color .15s, color .15s, box-shadow .15s;
}
.mh-p-filter__btn:hover { box-shadow: inset 0 -2px 0 var(--p-primary); background: transparent; color: var(--p-text); }
.mh-p-filter__btn[aria-pressed="true"] { background: var(--p-primary); color: #fff; box-shadow: none; }
.mh-p-filter__btn:focus-visible { outline: none; box-shadow: var(--p-focus); }
.mh-j-card, .mh-j-initiativ, .mh-j-heading,
.mh-p-filter__empty { margin: 0 0 48px; font-size: 1rem; }

/* Karte (Loop-Item) ----------------------------------------------------- */
.mh-p-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--p-bg-alt);
  color: var(--p-text);
  text-decoration: none;
}
.mh-p-card__media {
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--p-surface);
}
.mh-p-card img.mh-p-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.mh-p-card__body { display: block; padding: 24px 32px 24px; }
.mh-p-card .mh-p-card__title {
  margin: 0;
  color: var(--p-text);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.3;
}
.mh-p-card__sub { display: block; margin-top: 4px; font-size: .875rem; line-height: 1.4; }
.mh-p-card:hover .mh-p-card__title,
.mh-p-card:focus-visible .mh-p-card__title { text-decoration: underline; text-underline-offset: .15em; }
.mh-p-card:hover .mh-p-card__img { transform: scale(1.03); }
.mh-p-card:focus-visible { outline: none; box-shadow: var(--p-focus); }

/* Sections (Single) ----------------------------------------------------- */
.mh-p-section { padding-block: 64px; background: #fff; }
.mh-p-section--band { background: var(--p-primary); color: #fff; }
.mh-p-section--band .mh-p-h2, .mh-p-section--band .mh-p-copy { color: #fff; }
.mh-p-section--alt { background: #f4f5f6; }
@media (min-width: 960px) {
  .mh-p-section { padding-block: 88px; }
}
.mh-p-section .mh-p-h2, .mh-p-h2.mh-p-h2 {
  margin: 0 0 16px;
  color: inherit;
  font-size: clamp(1.75rem, 1.5vw + 1rem, 2.25rem);
  font-weight: 400;
  line-height: 1.2;
}
.mh-p-h2.mh-p-h2--small { font-size: 1.5rem; }
.mh-p-copy { max-width: 72ch; font-size: 1.125rem; line-height: 1.6; }
.mh-p-copy p { margin: 0 0 16px; }
.mh-p-copy p:last-child { margin-bottom: 0; }

.mh-p-link { color: var(--p-primary); text-decoration: underline; text-underline-offset: .15em; }
.mh-p-link:hover { color: var(--p-text); }
.mh-p-link:focus-visible, .mh-p-hero__back:focus-visible, .mh-p-btn:focus-visible,
.mh-p-gallery__item a:focus-visible { outline: none; box-shadow: var(--p-focus); }

/* Galerie-Mosaik -------------------------------------------------------- */
.mh-p-gallery__grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  grid-auto-rows: clamp(140px, 16vw, 240px);
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mh-p-gallery__item { grid-row: span 2; margin: 0; overflow: hidden; background: var(--p-surface); }
.mh-p-gallery__item:nth-child(3n) { grid-column: 1 / -1; grid-row: span 1; }
.mh-p-gallery__item:nth-child(3n+1):last-child { grid-column: 1 / -1; }
.mh-p-gallery__item a { display: block; height: 100%; }
.mh-p-gallery__item a img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.mh-p-gallery__item a:hover img { transform: scale(1.02); }
@media (max-width: 599px) {
  .mh-p-gallery__grid { grid-template-columns: 1fr; grid-auto-rows: 120px; }
  .mh-p-gallery__item:nth-child(n) { grid-column: 1; grid-row: span 2; }
}

/* Projektdaten ---------------------------------------------------------- */
.mh-p-facts { display: grid; gap: 32px; align-items: center; }
@media (min-width: 960px) {
  .mh-p-facts { grid-template-columns: 2fr 1fr; }
}
.mh-p-facts__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px 32px;
  margin: 24px 0 0;
}
.mh-p-facts__list dt { margin: 0 0 4px; font-size: .875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.mh-p-facts__list dd { margin: 0; font-size: 1.125rem; }
.mh-p-facts__logo img { display: block; max-width: 240px; max-height: 120px; width: auto; height: auto; }

/* Verknüpfte Inhalte ---------------------------------------------------- */
.mh-p-related { display: grid; gap: 48px; }
@media (min-width: 960px) {
  .mh-p-related { grid-template-columns: 1fr 1fr; }
}
.mh-p-list { margin: 0; padding: 0; list-style: none; }
.mh-p-list li { padding: 12px 0; border-bottom: 1px solid var(--p-surface); font-size: 1.125rem; }

/* CTA-Band -------------------------------------------------------------- */
.mh-p-cta { padding-block: 56px; background: var(--p-bg-alt); }
.mh-p-cta .mh-p-cta__title {
  margin: 0 0 24px;
  color: var(--p-text);
  font-size: clamp(1.5rem, 1.5vw + 1rem, 2.25rem);
  font-weight: 400;
  line-height: 1.25;
}
.mh-p-btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 0;
  background: var(--p-primary);
  color: #fff;
  font-size: 1.125rem;
  line-height: 1.3;
  text-decoration: none;
}
.mh-p-btn:hover { background: var(--p-text); color: #fff; }

/* Loop-Grid-Section im Übersichts-Template */
.mh-p-overview { padding-block: 64px 88px; }

@media (prefers-reduced-motion: reduce) {
  .mh-p-card__img, .mh-p-gallery__item img, .mh-p-filter__btn { transition: none; }
  .mh-p-card:hover .mh-p-card__img, .mh-p-gallery__item a:hover img { transform: none; }
}

/* Elementor-Widget-Wrapper der Shortcodes volle Breite */
.elementor-widget-shortcode:has(.mh-p-hero, .mh-p-cta, .mh-p-section, .mh-p-gallery, .mh-p-filter) { width: 100%; }
.elementor-widget-shortcode .mh-p-hero, .elementor-widget-shortcode .mh-p-cta { width: 100%; }
@media (max-width: 599px) {
  .mh-p-filter { gap: 8px 16px; margin-bottom: 32px; }
}

/* ==========================================================================
   Jobs (mu-plugin mh-jobs.php) – Mockup Hauptseite_Karriere
   ========================================================================== */
.mh-j-heading.mh-j-heading { margin-bottom: 32px; color: var(--p-text); }

.mh-j-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  height: 100%;
  min-height: 200px;
  padding: 32px 24px;
  background: #fff;
  color: var(--p-text);
  text-align: center;
  text-decoration: none;
  transition: box-shadow .15s;
}
.mh-j-card .mh-j-card__title {
  margin: 0;
  color: var(--p-primary);
  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.3;
  hyphens: auto;
}
.mh-j-card__meta { font-size: .875rem; line-height: 1.4; }
.mh-j-card:hover { box-shadow: inset 0 -3px 0 var(--p-primary); }
.mh-j-card:hover .mh-j-card__title { text-decoration: underline; text-underline-offset: .15em; }
.mh-j-card:focus-visible { outline: none; box-shadow: var(--p-focus); }

.mh-j-initiativ { margin-top: 48px; }
.mh-j-initiativ p { margin: 0 0 24px; max-width: 72ch; font-size: 1.125rem; line-height: 1.6; }

.mh-j-list ul { margin: 0; padding-left: 1.25em; }
.mh-j-list li { margin: 0 0 8px; }
.mh-p-section--band .mh-j-list li::marker { color: #fff; }
.mh-j-file { font-size: .875rem; }
.mh-j-intro .mh-p-copy { font-size: 1.25rem; }

@media (prefers-reduced-motion: reduce) {
  .mh-j-card { transition: none; }
}
.mh-j-textblock .elementor-widget-text-editor { max-width: 75ch; }
