﻿/*
Theme Name: Heliport Classic
Theme URI: https://www.heliport-services.de/hps/
Author: Heliport Services
Version: 1.0.2
Description: Classic theme matching legacy Heliport layout.
*/

html, body {
  margin: 0;
  padding: 0;
  background: #004A85;
}

body {
  width: 100%;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  color: #575757;
  line-height: 150%;
  text-align: center;
}

#master {
  width: 800px;
  background-color: #FFFFFF;
  margin: 0 auto;
  padding: 10px;
  text-align: left;
}

#headImage img {
  display: block; /* removes inline image baseline gap above menu */
}

/* =========================
   Modern pages (…-neu)
   ========================= */

body.hps-modern {
  text-align: left;
  background: #004A85;
}

.hps-modern-topbar {
  background: #004A85;
  margin-top: 0;
  border-radius: 0 0 4px 4px;
  padding: 6px;
  border: 0;
  position: sticky;
  top: 0;
  z-index: 30;
}
.hps-modern-topbar-inner{
  display:flex;
  align-items:center;
  gap:10px;
  justify-content: space-between;
}
.hps-modern-topbar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 0 1 auto; /* don't consume all space; allow logo to sit at far right */
}
.hps-modern-topbar-list li{
  display:flex;
  align-items:stretch;
}
.hps-modern-topbar-list li + li{
  position: relative;
}
.hps-modern-topbar-list li + li:before{
  content:"";
  position:absolute;
  left:-3px;
  top: 8px;
  bottom: 8px;
  width:1px;
  background: rgba(255,255,255,.75);
  pointer-events:none;
}
.hps-modern-topbar-list a {
  display: block;
  padding: 8px 10px;
  border-radius: 3px;
  text-decoration: none;
  color: #ffffff;
  font-weight: 600;
}
/* Topmenü Hover: wird per Customizer (wp_head) gesetzt */
.hps-modern-topbar-list a.is-active {
  background: rgba(212,0,0,.85);
  color: #ffffff;
}

.hps-modern-topbar-logo{
  display:none;
  flex: 0 0 auto;
  /* Make logo much larger without increasing bar height */
  width: 260px;
  height: 44px;
  border-radius: 2px;
  overflow:hidden;
  opacity: 1;
}
.hps-modern-topbar-logo img{
  width:100%;
  height:100%;
  object-fit: contain;
  object-position: right center; /* make the mark visually right-aligned */
  display:block;
  background: transparent;
}

.hps-modern-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.hps-modern-aside {
  background: #f8fafc;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 4px;
  padding: 12px;
}
.hps-modern-aside.is-empty{
  background: transparent;
  border-color: transparent;
  padding: 0;
}
/* Einstieg der Rubrik: wie Untermenü-Link klickbar (Ziel = Hauptmenü-Seite) */
a.hps-modern-aside-title {
  display: block;
  margin: 0 0 10px;
  padding: 8px 10px 8px 22px;
  border-radius: 3px;
  font-weight: 800;
  color: #004A85;
  text-decoration: none;
}
a.hps-modern-aside-title:hover {
  /* bg: Customizer */
  color: var(--hps-brand);
}
/* Nur wenn die Hauptmenü-Seite selbst aktiv ist */
a.hps-modern-aside-title.is-active {
  background: rgba(212, 0, 0, 0.1);
  color: #b00000;
  position: relative;
}
a.hps-modern-aside-title.is-active:hover {
  background: rgba(212, 0, 0, 0.14);
  color: #b00000;
}
a.hps-modern-aside-title.is-active:before {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid #d40000;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}
.hps-modern-aside-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.hps-modern-aside-list li a {
  display: block;
  padding: 8px 10px 8px 22px;
  border-radius: 3px;
  text-decoration: none;
  color: #334155;
}
/* Seitenmenü Hover: wird per Customizer (wp_head) gesetzt */
.hps-modern-aside-list li.is-l2 a { padding-left: 34px; }
.hps-modern-aside-list li.is-active a {
  background: rgba(212,0,0,.10);
  color: #b00000;
  font-weight: 800;
  position: relative;
}
.hps-modern-aside-list li.is-active a:before {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid #d40000;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.hps-modern-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 40;
}
html.hps-nav-open .hps-modern-overlay {
  opacity: 1;
  pointer-events: auto;
}

.hps-modern-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px;
}

.hps-modern-paper{
  background:#ffffff;
  border-radius: 4px;
  box-shadow: var(--hps-shadow-sm);
  /* allow sticky topbar to work; header clips itself */
  overflow: visible;
  /* show a visible "paper" frame */
  padding: 10px;
}

.hps-modern-header {
  /* "Outpainting" ohne KI: erst Strip (repeat-x), dann harter Sky/Sea-Gradient */
  background-image:
    url("kopf-strip.png"),
    linear-gradient(
      180deg,
      #B9C0D2 0%,
      #B9C0D2 40%,
      #728CAD 47%,
      #11507C 55%,
      #11507C 100%
    );
  background-repeat: repeat-x, no-repeat;
  background-size: auto 100%, 100% 100%;
  background-position: center center, center center;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
  line-height: 0; /* avoid extra inline gaps */
  display: block;
  padding: 0;
}

.hps-modern-header-bar {
  position: relative;
  display: block;
}
/* Mobil: Mini-Logo mittig, Burger rechts über dem Kopfbild */
.hps-modern-header-mini {
  display: none;
}
@media (max-width: 991px) {
  .hps-modern-header-mini {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: min(168px, calc(100% - 110px));
    height: 40px;
    text-decoration: none;
    border-radius: 3px;
  }
  .hps-modern-header-mini:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
  }
  .hps-modern-header-mini img {
    max-height: 34px;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center center;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
    display: block;
  }
  .hps-modern-header-bar .hps-modern-burger {
    position: absolute;
    right: max(8px, env(safe-area-inset-right, 0px));
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  }
}

.hps-modern-brand {
  display: flex;
  justify-content: center;
  width: 100%;
}
.hps-modern-brand-img {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  vertical-align: top;
}

/* Desktop: keep the legacy header image centered with side fill */
@media (min-width: 992px) {
  .hps-modern-brand-img {
    max-width: 800px;
    margin: 0 auto;
  }
}

.hps-modern-burger {
  border: 1px solid rgba(0,0,0,.15);
  background: #fff;
  border-radius: 3px;
  width: 44px;
  height: 44px;
  padding: 0;
  cursor: pointer;
}
.hps-modern-burger-lines {
  display: block;
  width: 20px;
  height: 2px;
  background: #004A85;
  margin: 0 auto;
  position: relative;
}
.hps-modern-burger-lines:before,
.hps-modern-burger-lines:after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: #004A85;
}
.hps-modern-burger-lines:before { top: -6px; }
.hps-modern-burger-lines:after { top: 6px; }
.hps-modern-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.hps-modern-nav {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: min(360px, calc(100vw - 24px));
  background: #ffffff;
  border-radius: 4px;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  transform: translateX(110%);
  transition: transform 220ms ease;
  z-index: 50;
}
html.hps-nav-open .hps-modern-nav { transform: translateX(0); }

.hps-modern-nav-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 12px;
}

.hps-modern-nav-title {
  font-weight: 700;
  color: #004A85;
  margin-bottom: 6px;
}
.hps-modern-nav-list,
.hps-modern-nav-sublist {
  list-style: none;
  margin: 0;
  padding: 0;
}
.hps-modern-nav-inline-sublist{
  list-style: none;
  margin: 6px 0 0;
  padding: 0 0 0 10px;
  border-left: 2px solid rgba(0,74,133,.16);
}
.hps-modern-nav-inline-sublist li a{
  display: block;
  padding: 8px 10px;
  text-decoration: none;
  color: #575757;
  border-radius: 2px;
}
.hps-modern-nav-inline-sublist li.is-l2 a{ padding-left: 20px; }
.hps-modern-nav-inline-sublist li a.is-active{
  background: rgba(0,74,133,.08);
  color: #004A85;
  font-weight: 700;
}
.hps-modern-nav-list a,
.hps-modern-nav-sublist a {
  display: block;
  padding: 10px 10px;
  text-decoration: none;
  color: #575757;
  border-radius: 2px;
}
.hps-modern-nav-list a.is-active,
.hps-modern-nav-sublist a.is-active {
  background: rgba(0,74,133,.08);
  color: #004A85;
  font-weight: 700;
}

.hps-modern-content {
  background: #F8FCFF;
  margin-top: 0;
  border-radius: 0;
  padding: 18px 16px;
}

.hps-modern-main {
  max-width: none;
  margin: 0 auto;
}

/* Modern typography + block defaults */
body.hps-modern {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: #1f2a37;
}
body.hps-modern .hps-modern-main p { margin: 0 0 1em; color: #334155; }
body.hps-modern .hps-modern-main a { color: #004A85; text-decoration-thickness: 2px; text-underline-offset: 3px; }
body.hps-modern .hps-modern-main a:hover { text-decoration: none; }

body.hps-modern .hps-modern-main h1,
body.hps-modern .hps-modern-main h2,
body.hps-modern .hps-modern-main h3 {
  color: #004A85;
  line-height: 1.2;
  margin: 1.1em 0 .45em;
}
body.hps-modern .hps-modern-main h1 { font-size: 1.75rem; }
/* Sub-headings: slightly above body size for visible hierarchy */
body.hps-modern .hps-modern-main h2,
body.hps-modern .hps-modern-main h3 {
  font-size: 1.1rem;
  color: #334155;
  font-weight: 800;
  margin: calc(1.55em + 5px) 0 .7em;
}
/* Kurzer roter Unterstrich unter h2 – editorial accent */
body.hps-modern .hps-modern-main h2::after {
  content: '';
  display: block;
  width: 2em;
  height: 2px;
  background: var(--hps-accent, #C4161C);
  margin-top: 0.35em;
  border-radius: 1px;
}
body.hps-modern .hps-modern-main h2 {
}

/* Align sidebar top with first page heading (without pulling content up) */
body.hps-modern .hps-modern-aside {
  margin-top: 36px;
  margin-left: calc(-1 * var(--hps-content-pad));
}

body.hps-modern .hps-modern-main ul,
body.hps-modern .hps-modern-main ol { padding-left: 1.15em; margin: 0 0 1em; }
body.hps-modern .hps-modern-main li { margin: .25em 0; }

body.hps-modern .hps-modern-main img,
body.hps-modern .hps-modern-main video {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}
body.hps-modern .hps-modern-main video { background: #000; }

/* Large company logo inside content */
body.hps-modern .hps-modern-main img.hps-content-logo {
  display: block;
  max-width: 520px;
  width: 100%;
  margin: 0 0 var(--hps-gap-4);
  border-radius: 0;
}

/* Gutenberg button block */
body.hps-modern .wp-block-button__link {
  background: #004A85;
  color: #fff;
  border-radius: 999px;
  padding: .75em 1.1em;
  font-weight: 700;
  text-decoration: none;
}
body.hps-modern .wp-block-button__link:hover { filter: brightness(1.05); }

/* Tables in legacy content (if any) */
body.hps-modern .hps-modern-main table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25em;
  font-size: .95em;
}
body.hps-modern .hps-modern-main th,
body.hps-modern .hps-modern-main td {
  border-bottom: 1px solid rgba(15,23,42,.12);
  padding: .65em .6em;
  vertical-align: top;
}

/* Footer: Kontaktzeile (weiß) + rotes Quadrat */
.hps-modern-footer {
  margin-top: 10px;
}
.hps-modern-footer-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 8px 0 8px 14px;
  background: #004A85;
  border-radius: 4px;
  border: 0;
  overflow: hidden;
}
.hps-modern-footer-text-wrap {
  flex: 1;
  min-width: 0;
  text-align: left;
  align-self: center;
  padding-right: 10px;
}
.hps-modern-footer-line {
  margin: 0;
  color: #ffffff;
  font-size: 12px;
  line-height: 1.45;
}
.hps-modern-footer-line a {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.hps-modern-footer-line a:hover {
  text-decoration-thickness: 2px;
}
.hps-modern-footer-line--compact {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.hps-modern-footer-name {
  flex: 1 1 140px;
  min-width: 0;
  font-weight: 700;
}
.hps-modern-footer-icons {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
}
.hps-modern-footer-iconlink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  color: #ffffff;
  border-radius: 3px;
  text-decoration: none;
}
.hps-modern-footer-iconlink:hover {
  background: rgba(255, 255, 255, 0.12);
}
.hps-modern-footer-iconlink:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}
@media (max-width: 719px) {
  .hps-modern-footer-line--full {
    display: none !important;
  }
  .hps-modern-footer-line--compact {
    display: flex !important;
  }
}
@media (min-width: 720px) {
  .hps-modern-footer-line--full {
    display: block;
  }
  .hps-modern-footer-line--compact {
    display: none !important;
  }
}
.hps-modern-footer-quad {
  width: 20px;
  flex: 0 0 20px;
  align-self: stretch;
  min-height: 100%;
  background: #C4161C;
  border-radius: 0;
}

/* Desktop: Fußzeile flacher, Text mittig (Quad rechts fixiert) */
@media (min-width: 992px) {
  .hps-modern-footer-inner {
    justify-content: center;
    align-items: stretch;
    min-height: 22px;
    padding: 3px 0 3px 10px;
    position: relative;
  }
  .hps-modern-footer-text-wrap {
    flex: 0 1 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    align-self: center;
    text-align: center;
    max-width: calc(100% - 28px);
    padding-right: 10px;
  }
  .hps-modern-footer-line--full {
    text-align: center;
  }
  .hps-modern-footer-quad {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    height: auto;
    transform: none;
    align-self: auto;
  }
}

/* Mobil: nach Inhalt auf Hauptmenü-Seiten — Untermenü-Liste (Sidebar ist ausgeblendet) */
.hps-modern-mobile-subnav {
  display: none;
}
@media (max-width: 991px) {
  .hps-modern-mobile-subnav {
    display: block;
    margin-top: 1.5rem;
    padding: 14px 14px 12px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 4px;
  }
  .hps-modern-mobile-subnav-title {
    font-weight: 800;
    color: #004a85;
    font-size: 0.95rem;
    margin: 0 0 10px;
  }
  .hps-modern-mobile-subnav-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .hps-modern-mobile-subnav-list li a {
    display: block;
    padding: 10px 12px;
    border-radius: 3px;
    text-decoration: none;
    color: #334155;
    font-weight: 600;
  }
  /* Mobile Untermenü Hover: wird per Customizer (wp_head) gesetzt */
  .hps-modern-mobile-subnav-list li a:hover { }
  .hps-modern-mobile-subnav-list li.is-l2 a {
    padding-left: 22px;
    font-weight: 500;
    font-size: 0.95em;
  }
}

/* „Weiter zu …“ (Reihenfolge wie Sidebar; entfällt auf letzter Untermenü-Seite) */
body.hps-modern .hps-modern-next {
  margin-top: 1.75rem;
}
body.hps-modern .hps-modern-main a.hps-modern-next-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  position: relative;
  padding: 0.65em 2.35rem 0.65em 1.2em;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  color: #ffffff;
  background: #004a85;
  border: 1px solid rgba(0, 42, 77, 0.35);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
/* rotes Dreieck rechts wie bei aktivem Untermenü-Link */
body.hps-modern .hps-modern-main a.hps-modern-next-link::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid #d40000;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  pointer-events: none;
}
body.hps-modern .hps-modern-main a.hps-modern-next-link:hover {
  filter: brightness(1.06);
  text-decoration: none;
  color: #ffffff;
}
body.hps-modern .hps-modern-main a.hps-modern-next-link:focus-visible {
  outline: 3px solid rgba(0, 74, 133, 0.35);
  outline-offset: 2px;
  color: #ffffff;
}

/* Desktop: nav always visible, burger hidden */
@media (min-width: 992px) {
  .hps-modern-burger { display: none; }
  .hps-modern-overlay { display: none; }
  /* Desktop: main navigation is the topbar; hide the off-canvas panel */
  .hps-modern-nav { display: none; }
  /* show company logo always on desktop */
  .hps-modern-topbar-logo{ display:block; }

  .hps-modern-layout {
    grid-template-columns: 260px 1fr;
    gap: 29px; /* +15px vs mobile gap */
    align-items: start;
  }
  /* First main headline aligns with aside section title (aside margin-top + padding) */
  body.hps-modern .hps-modern-layout > .hps-modern-main {
    padding-top: 48px;
  }
  body.hps-modern .hps-modern-layout > .hps-modern-aside.is-empty ~ .hps-modern-main {
    padding-top: 0;
  }
}

/* Mobile: hide desktop navigation/sidebar, use burger/off-canvas only */
@media (max-width: 991px) {
  .hps-modern-topbar { display: none !important; }
  .hps-modern-aside { display: none !important; }
}

/* Desktop: keep menu in one row even with big logo */
@media (min-width: 992px) {
  .hps-modern-topbar-inner{
    /* Deterministic right-alignment for logo */
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 16px;
    width: 100%;
  }
  .hps-modern-topbar-list{
    flex-wrap: nowrap;
    min-width: 0;
    justify-self: start;
  }
  .hps-modern-topbar-logo{
    justify-self: end;
  }
}

/* Desktop: make left/right whitespace feel equal (submenu gap wider, right edge tighter) */
@media (min-width: 992px) {
  body.hps-modern .hps-modern-content {
    padding-right: calc(var(--hps-content-pad) - 15px);
  }
}

/* Legacy main title (explicitly inserted) */
.hps-title {
  font-size: 16px;
  color: #004A85;
  font-weight: bold;
  margin: 0;
  padding: 0;
}

/* =========================
   Modern enhancements (scoped)
   ========================= */

body.hps-modern {
  /* Brand + neutrals */
  --hps-brand: #004A85;
  --hps-text: #1f2937;
  --hps-muted: #4b5563;
  --hps-border: rgba(15, 23, 42, 0.14);
  --hps-surface: #ffffff;
  --hps-surface-2: #f6f8fb;

  /* Shadows + radius */
  --hps-radius: 4px;
  --hps-radius-sm: 3px;
  --hps-shadow-sm: 0 1px 1px rgba(15, 23, 42, 0.08), 0 1px 8px rgba(15, 23, 42, 0.06);
  --hps-shadow-md: 0 12px 32px rgba(15, 23, 42, 0.14);

  /* Typography */
  --hps-font: 'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --hps-font-heading: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --hps-leading: 1.65;
  --hps-fs-0: clamp(0.98rem, 0.92rem + 0.3vw, 1.05rem); /* base */
  --hps-fs-1: clamp(1.15rem, 1.05rem + 0.6vw, 1.35rem); /* h3 */
  --hps-fs-2: clamp(1.35rem, 1.18rem + 0.9vw, 1.75rem); /* h2 */
  --hps-fs-3: clamp(1.6rem, 1.28rem + 1.4vw, 2.25rem); /* h1 */

  /* Spacing */
  --hps-gap-1: 8px;
  --hps-gap-2: 12px;
  --hps-gap-3: 16px;
  --hps-gap-4: 22px;
  --hps-gap-5: 30px;

  /* Modern content padding (desktop overrides tweak right side) */
  --hps-content-pad: clamp(14px, 2.2vw, 22px);
}

body.hps-modern {
  font-family: var(--hps-font);
  font-size: var(--hps-fs-0);
  line-height: var(--hps-leading);
  color: var(--hps-text);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-optical-sizing: auto;
}

/* Barlow for all headings in modern content */
body.hps-modern .hps-modern-main h1,
body.hps-modern .hps-modern-main h2,
body.hps-modern .hps-modern-main h3,
body.hps-modern .hps-modern-main h4 {
  font-family: var(--hps-font-heading);
  font-weight: 700;
}
body.hps-modern .hps-modern-main h1.hps-title {
  font-family: var(--hps-font-heading);
  font-weight: 700;
  font-size: 1.5rem;
}

/* Barlow for all navigation elements (topbar, sidebar, mobile off-canvas) */
body.hps-modern .hps-modern-topbar-list a,
body.hps-modern .hps-modern-aside-title,
body.hps-modern .hps-modern-aside-list li a,
body.hps-modern .hps-modern-nav-title,
body.hps-modern .hps-modern-nav-list a,
body.hps-modern .hps-modern-nav-sublist a,
body.hps-modern .hps-modern-nav-inline-sublist li a,
body.hps-modern .hps-modern-mobile-subnav-title,
body.hps-modern .hps-modern-mobile-subnav-list li a,
body.hps-modern .hps-modern-main a.hps-modern-next-link {
  font-family: var(--hps-font-heading);
}

body.hps-modern .hps-modern-shell {
  /* keep outer spacing, but don't interfere with header image */
  padding: clamp(10px, 2vw, 18px);
}

body.hps-modern .hps-modern-header,
body.hps-modern .hps-modern-nav,
body.hps-modern .hps-modern-content {
  border-radius: var(--hps-radius);
  box-shadow: var(--hps-shadow-sm);
}

body.hps-modern .hps-modern-header {
  /* header is an image banner + topbar; no inner padding */
  padding: 0;
  gap: 0;
  /* keep top corners round, bottom corners square */
  border-radius: 4px 4px 0 0;
}

body.hps-modern .hps-modern-brand-img {
  max-width: none;
}

/* Focus styles (accessibility) */
body.hps-modern :where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid rgba(0, 74, 133, 0.35);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Modern content container */
body.hps-modern .hps-modern-content {
  /* legacy-like very light blue/grey without being a separate "card" */
  background: #F8FCFF;
  padding: var(--hps-content-pad);
}

/* Reduce "grey border" feel around main content */
body.hps-modern .hps-modern-content {
  box-shadow: none;
  border: 0;
  border-radius: 0;
}

body.hps-modern .hps-modern-main {
  max-width: none;
  margin: 0 auto;
  display: flow-root; /* contain floated images so footer appears below content */
}

/* Default text + headings inside modern main */
/* CLS-Prävention: Bilder mit width-Attribut behalten ihr Seitenverhältnis */
body.hps-modern img {
  height: auto;
  max-width: 100%;
}
/* Logo-Bild im Topbar braucht height: 100% für object-fit: contain */
.hps-modern-topbar-logo img {
  height: 100% !important;
}

body.hps-modern .hps-modern-main :where(p, li) {
  color: var(--hps-text);
}

body.hps-modern .hps-modern-main :where(h1, h2, h3, h4) {
  color: var(--hps-brand);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: var(--hps-gap-5) 0 var(--hps-gap-2);
}
body.hps-modern .hps-modern-main :where(h3, h4) {
  letter-spacing: -0.01em;
  line-height: 1.3;
}

body.hps-modern .hps-modern-main :where(h1) { font-size: var(--hps-fs-3); }
/* Static page headline: larger than body copy, brand blue, bold (not document-scale h1) */
body.hps-modern .hps-modern-main h1.hps-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--hps-brand);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 var(--hps-gap-3);
}
/* h2/h3 font-size is set above with higher specificity (1.1rem) */

/* Spacing rhythm:
   - paragraphs match the heading→text gap
   - other blocks keep a larger default gap */
body.hps-modern .hps-modern-main :where(p) {
  margin: 0 0 var(--hps-gap-2);
}
body.hps-modern .hps-modern-main :where(ul, ol, dl, blockquote, table, pre, .wp-block-image, .wp-block-gallery, .wp-block-columns, .wp-block-group, .wp-block-cover, .wp-block-media-text, .wp-block-embed) {
  margin: 0 0 var(--hps-gap-4);
}

body.hps-modern .hps-modern-main :where(p:last-child) {
  margin-bottom: 0;
}

/* Links */
body.hps-modern .hps-modern-main a {
  color: var(--hps-brand);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
body.hps-modern .hps-modern-main a:hover {
  text-decoration-thickness: 3px;
}

/* “Download” links (generic: PDFs / common files) */
body.hps-modern .hps-modern-main a[href$=".pdf" i],
body.hps-modern .hps-modern-main a[href$=".doc" i],
body.hps-modern .hps-modern-main a[href$=".docx" i],
body.hps-modern .hps-modern-main a[href$=".xls" i],
body.hps-modern .hps-modern-main a[href$=".xlsx" i],
body.hps-modern .hps-modern-main a[href$=".zip" i] {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--hps-border);
  border-radius: 4px;
  background: var(--hps-surface-2);
  text-decoration: none;
}
body.hps-modern .hps-modern-main a[href$=".pdf" i]::before,
body.hps-modern .hps-modern-main a[href$=".doc" i]::before,
body.hps-modern .hps-modern-main a[href$=".docx" i]::before,
body.hps-modern .hps-modern-main a[href$=".xls" i]::before,
body.hps-modern .hps-modern-main a[href$=".xlsx" i]::before,
body.hps-modern .hps-modern-main a[href$=".zip" i]::before {
  content: "";
  flex: 0 0 auto;
  align-self: center;
  width: 0;
  height: 0;
  border-left: 7px solid #d40000;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

/* kID 53 + 117: interne Seiten-Textlinks wie PDF-Kacheln (body.hps-page-kid-* aus functions.php) */
body.hps-page-kid-53.hps-modern .hps-modern-main a[href*="/hps/kid-"]:not(.hps-modern-next-link),
body.hps-page-kid-117.hps-modern .hps-modern-main a[href*="/hps/kid-"]:not(.hps-modern-next-link) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--hps-border);
  border-radius: 4px;
  background: var(--hps-surface-2);
  text-decoration: none;
  color: var(--hps-brand);
}
body.hps-page-kid-53.hps-modern .hps-modern-main a[href*="/hps/kid-"]:not(.hps-modern-next-link)::before,
body.hps-page-kid-117.hps-modern .hps-modern-main a[href*="/hps/kid-"]:not(.hps-modern-next-link)::before {
  content: "";
  flex: 0 0 auto;
  align-self: center;
  width: 0;
  height: 0;
  border-left: 7px solid #d40000;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

/* Kein Aufzählungspunkt vor Download-Zeilen (PDF & Co. in Listen, auch mit Span/Blöcken drumherum) */
body.hps-modern .hps-modern-main li:has(a[href$=".pdf" i]),
body.hps-modern .hps-modern-main li:has(a[href$=".doc" i]),
body.hps-modern .hps-modern-main li:has(a[href$=".docx" i]),
body.hps-modern .hps-modern-main li:has(a[href$=".xls" i]),
body.hps-modern .hps-modern-main li:has(a[href$=".xlsx" i]),
body.hps-modern .hps-modern-main li:has(a[href$=".zip" i]) {
  list-style: none;
}
body.hps-page-kid-53.hps-modern .hps-modern-main li:has(a[href*="/hps/kid-"]:not(.hps-modern-next-link)),
body.hps-page-kid-117.hps-modern .hps-modern-main li:has(a[href*="/hps/kid-"]:not(.hps-modern-next-link)) {
  list-style: none;
}

/* Lists */
body.hps-modern .hps-modern-main :where(ul, ol) {
  padding-left: 1.15em;
}
body.hps-modern .hps-modern-main :where(li) {
  margin: 0.35em 0;
}
body.hps-modern .hps-modern-main :where(ul) {
  list-style: disc;
}
body.hps-modern .hps-modern-main :where(ol) {
  list-style: decimal;
}

/* Images / galleries */
body.hps-modern .hps-modern-main :where(img, video) {
  max-width: 100%;
  height: auto;
}
body.hps-modern .hps-modern-main :where(.wp-block-image img, img) {
  border-radius: 4px;
}
body.hps-modern .hps-modern-main :where(.wp-block-image figure, figure) {
  margin: 0 0 var(--hps-gap-4);
}
body.hps-modern .hps-modern-main :where(figcaption) {
  margin-top: 8px;
  color: var(--hps-muted);
  font-size: 0.92em;
}

/* Remove "container borders" caused by legacy table layouts */
body.hps-modern .hps-modern-main :where(table, tbody, thead, tfoot, tr, th, td) {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* WordPress legacy alignment classes */
body.hps-modern .hps-modern-main :where(.alignleft) { float: left; margin: 0 18px 12px 0; }
body.hps-modern .hps-modern-main :where(.alignright) { float: right; margin: 0 0 12px 18px; }
body.hps-modern .hps-modern-main :where(.aligncenter) { display: block; margin-left: auto; margin-right: auto; }
@media (max-width: 700px) {
  body.hps-modern .hps-modern-main :where(.alignleft, .alignright) {
    float: none;
    margin: 0 0 var(--hps-gap-4);
    width: 100% !important;
    max-width: 100% !important;
  }
  body.hps-modern .hps-modern-main :where(.alignleft img, .alignright img) {
    width: 100% !important;
    height: auto;
  }
}

/* Make small right-aligned legacy images appear ~30% larger (175px → ~228px) */
body.hps-modern .hps-modern-main figure.wp-block-image.alignright {
  width: min(228px, 42%);
  margin: 0 0 var(--hps-gap-2) 18px;
  clear: right; /* prevent stacking when multiple right-floated images follow each other */
}
body.hps-modern .hps-modern-main figure.wp-block-image.alignright img {
  width: 100%;
  height: auto;
}

/* Tables */
body.hps-modern .hps-modern-main :where(table) {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}
body.hps-modern .hps-modern-main :where(th, td) {
  text-align: left;
  padding: 12px 0;
  border-bottom: 0;
  vertical-align: top;
}
body.hps-modern .hps-modern-main :where(tr:last-child td) {
  border-bottom: 0;
}
body.hps-modern .hps-modern-main :where(th) {
  color: var(--hps-brand);
  background: rgba(0, 74, 133, 0.06);
  font-weight: 700;
}

/* Better table handling on small screens */
@media (max-width: 700px) {
  body.hps-modern .hps-modern-main :where(table) {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Legacy CMS layout tables: use available width better */
body.hps-modern .hps-modern-main > table[width="555"] {
  width: 100% !important;
}

body.hps-modern .hps-modern-main > table[width="555"] > tbody > tr {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.95fr);
  gap: 32px;
  align-items: start;
}

/* Single-column blocks should span full width */
body.hps-modern .hps-modern-main > table[width="555"] > tbody > tr > td[width="555"] {
  grid-column: 1 / -1;
  width: auto !important;
}

/* 3-column rows keep equal columns */
body.hps-modern .hps-modern-main > table[width="555"] > tbody > tr > td[width="175"]:nth-child(3) {
  width: auto !important;
}
body.hps-modern .hps-modern-main > table[width="555"] > tbody > tr:has(> td[width="175"]:nth-child(3)) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Let legacy fixed widths breathe */
body.hps-modern .hps-modern-main > table[width="555"] > tbody > tr > td[width="365"],
body.hps-modern .hps-modern-main > table[width="555"] > tbody > tr > td[width="175"] {
  width: auto !important;
  min-width: 0;
}

/* If the right column is empty, hide it so text can use the space */
body.hps-modern .hps-modern-main > table[width="555"] > tbody > tr > td:empty {
  display: none;
}

/* Legacy image wrappers should fill the new column width */
body.hps-modern .hps-modern-main :where(.imageContent, .imageContent img) {
  max-width: 100%;
  width: 100%;
}

/* Preserve stacked mobile behavior */
@media (max-width: 900px) {
  body.hps-modern .hps-modern-main > table[width="555"] > tbody > tr,
  body.hps-modern .hps-modern-main > table[width="555"] > tbody > tr:has(> td[width="175"]:nth-child(3)) {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* Robust text wrap around right image (JS adds .hps-float-img-right) */
body.hps-modern .hps-modern-main tr.hps-float-img-right {
  display: block;
}

body.hps-modern .hps-modern-main tr.hps-float-img-right > td[width="175"] {
  float: right;
  width: min(34%, 280px) !important;
  margin: 0 0 14px 24px;
  padding-top: 0;
}

body.hps-modern .hps-modern-main tr.hps-float-img-right > td[width="365"] {
  display: block;
  width: auto !important;
  min-width: 0;
}

body.hps-modern .hps-modern-main tr.hps-float-img-right::after {
  content: "";
  display: block;
  clear: both;
}

@media (max-width: 900px) {
  body.hps-modern .hps-modern-main tr.hps-float-img-right > td[width="175"] {
    float: none;
    width: auto !important;
    margin: 0 0 10px 0;
  }
}

/* Buttons (classic + block editor) */
body.hps-modern .hps-modern-main :where(.wp-block-button__link, .button, button, input[type="submit"], input[type="button"], input[type="reset"]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 4px;
  border: 1px solid rgba(0, 74, 133, 0.25);
  background: linear-gradient(180deg, rgba(0, 74, 133, 0.95), rgba(0, 74, 133, 0.85));
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.08);
}
body.hps-modern .hps-modern-main :where(.wp-block-button__link:hover, .button:hover, button:hover, input[type="submit"]:hover, input[type="button"]:hover, input[type="reset"]:hover) {
  filter: brightness(1.03);
}
body.hps-modern .hps-modern-main :where(.is-style-outline .wp-block-button__link, .wp-block-button.is-style-outline .wp-block-button__link) {
  background: transparent;
  color: var(--hps-brand);
  border-color: rgba(0, 74, 133, 0.35);
  box-shadow: none;
}

/* Blockquotes + separators */
body.hps-modern .hps-modern-main :where(blockquote) {
  padding: 14px 16px;
  border-left: 4px solid rgba(0, 74, 133, 0.4);
  background: var(--hps-surface-2);
  border-radius: 4px;
  color: var(--hps-text);
}
body.hps-modern .hps-modern-main :where(hr, .wp-block-separator) {
  border: 0;
  height: 1px;
  background: var(--hps-border);
  margin: var(--hps-gap-5) 0;
}

/* Code / pre */
body.hps-modern .hps-modern-main :where(code) {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
  background: rgba(15, 23, 42, 0.06);
  padding: 0.15em 0.35em;
  border-radius: 2px;
}
body.hps-modern .hps-modern-main :where(pre) {
  overflow: auto;
  padding: 14px 16px;
  border-radius: 4px;
  border: 1px solid var(--hps-border);
  background: rgba(15, 23, 42, 0.04);
}
body.hps-modern .hps-modern-main :where(pre code) {
  background: transparent;
  padding: 0;
}

/* Responsive embeds + videos */
body.hps-modern .hps-modern-main :where(.wp-block-embed, .wp-block-video, .wp-block-media-text__media) {
  max-width: 100%;
}
body.hps-modern .hps-modern-main :where(iframe) {
  max-width: 100%;
}
body.hps-modern .hps-modern-main :where(.wp-block-embed__wrapper) {
  position: relative;
  padding-top: 56.25%;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.06);
}
body.hps-modern .hps-modern-main :where(.wp-block-embed__wrapper > iframe, .wp-block-embed__wrapper > embed, .wp-block-embed__wrapper > object) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
body.hps-modern .hps-modern-main :where(video) {
  width: 100%;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.06);
}

/* Columns/groups: keep whitespace consistent */
body.hps-modern .hps-modern-main :where(.wp-block-columns) {
  gap: var(--hps-gap-3);
}
@media (max-width: 782px) {
  body.hps-modern .hps-modern-main :where(.wp-block-columns) {
    gap: var(--hps-gap-2);
  }
}

/* Navigation: optional offcanvas feel on mobile (uses existing html.hps-nav-open toggle) */
@media (max-width: 991px) {
  body.hps-modern .hps-modern-nav {
    display: block; /* keep in DOM for transitions; visibility controlled via transform */
    position: fixed;
    z-index: 1000;
    top: 12px;
    right: 12px;
    bottom: 12px;
    width: min(360px, calc(100vw - 24px));
    margin-top: 0;
    transform: translateX(calc(100% + 18px));
    transition: transform 180ms ease;
    box-shadow: var(--hps-shadow-md);
    border: 1px solid var(--hps-border);
  }
  html.hps-nav-open body.hps-modern .hps-modern-nav {
    transform: translateX(0);
  }
  html.hps-nav-open body.hps-modern {
    overflow: hidden;
    touch-action: none;
  }
}

body.hps-modern .hps-modern-nav-inner {
  padding: 14px;
}

body.hps-modern .hps-modern-nav-title {
  font-size: 0.95em;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--hps-brand);
}

body.hps-modern .hps-modern-nav-list a,
body.hps-modern .hps-modern-nav-sublist a {
  border: 1px solid transparent;
  transition: background-color 120ms ease, border-color 120ms ease;
}
/* Untermenü Hover: wird per Customizer (wp_head) gesetzt */
body.hps-modern .hps-modern-nav-list a:hover,
body.hps-modern .hps-modern-nav-sublist a:hover {
}

/* Classic pages: Tabellen und Bilder nie breiter als ihr Container */
#innerContent table {
  max-width: 100% !important;
  width: auto !important;
  table-layout: fixed;
}
#innerContent td,
#innerContent th {
  word-break: break-word;
}
#innerContent img {
  max-width: 100% !important;
  height: auto !important;
  width: auto !important;
}

/* Classic pages: #content muss seinen gefloateten Inhalt umschließen,
   damit der Footer erst nach dem gesamten Inhalt erscheint */
#content::after {
  content: "";
  display: table;
  clear: both;
}

/* Scroll-in Einblend-Animationen (nur moderne Seiten) */
.hps-anim {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease-out, transform 0.55s ease-out;
}
.hps-anim.hps-anim-in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .hps-anim { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* Desktop: Fließtext eine Stufe kleiner (14 px statt ~16 px).
   Überschriften bleiben unverändert (rem-Einheiten, root-relativ).
   Menüs (.hps-modern-topbar, .hps-modern-aside) liegen außerhalb
   von .hps-modern-main und sind ebenfalls nicht betroffen. */
@media (min-width: 992px) {
  body.hps-modern .hps-modern-main {
    font-size: 0.875rem;
  }
}
