/*** UST system ***/

:root{
  --ust-text-width: 600px;
  --ust-space-factor: 1;
  --ust-gutter: clamp(16px, 4vw, 48px);
  --ust-text-width-fluid: min(var(--ust-text-width), calc(100vw - (2 * var(--ust-gutter))));
  --ust-wide-width: clamp(
    var(--ust-text-width-fluid),
    calc((100vw + var(--ust-text-width)) / 2),
    calc(100vw - (2 * var(--ust-gutter)))
  );
  --ust-space-1: calc(8px * var(--ust-space-factor));
  --ust-space-2: calc(16px * var(--ust-space-factor));
  --ust-space-3: calc(24px * var(--ust-space-factor));
  --ust-space-4: calc(36px * var(--ust-space-factor));
}

*,
*::before,
*::after{ box-sizing: border-box; }

html, body{ height: 100%; }

body{
  margin: 0;
  background: #fff;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

img{ max-width: 100%; height: auto; display: block; }

a{
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: from-font;
  text-underline-offset: 0.15em;
}

a:hover,
a:focus{ opacity: 0.85; }

/*** Width helpers ***/
.ust-width-wide{
  width: 100%;
  max-width: calc(100vw - (2 * var(--ust-gutter)));
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--ust-gutter);
  padding-right: var(--ust-gutter);
}

.ust-width-content{
  width: 100%;
  max-width: var(--ust-text-width-fluid);
  margin-left: auto;
  margin-right: auto;
}

.ust-width-full{
  width: 100%;
  max-width: 100vw;
  margin-left: 0;
  margin-right: 0;
  padding-left: var(--ust-gutter);
  padding-right: var(--ust-gutter);
}

/*** Header ***/

:root{
  --menu-top-offset: 0.4rem;
}

.site-header .ust-nav{
  align-self: start;
  padding-top: var(--ust-space-2);
}


.ust-header{ padding: var(--ust-space-2) 0; }


/*** Default header geometry ***/
.ust-header-inner{
  display: flex;
  /*align-items: center;*/
  justify-content: space-between;
  gap: var(--ust-space-2);
}

body.ust-has-tophero.ust-hsticky-sticky .site-header, body.ust-has-tophero.ust-hsticky-sticky .ust-header {	height:4rem; }
.ust-header-branding .site-title{
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
}

.ust-nav{
  margin-left: 0;
  display: flex;
  /*align-items: center;*/
  gap: var(--ust-space-1);
}

.ust-nav ul{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--ust-space-2);
  align-items: center;
}

.ust-nav a{ text-decoration: none; }
.ust-nav a:hover,
.ust-nav a:focus{ text-decoration: none; }

.ust-nav-toggle{
  display: none;
  border: 1px solid currentColor;
  background: transparent;
  padding: 6px 10px;
  line-height: 1;
  cursor: pointer;
}

/*** Mobile navigation ***/
@media (max-width: 1360px){
  .ust-nav-toggle{ display: inline-block; }
  .ust-nav{
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .ust-nav ul{
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--ust-space-1);
    padding-top: var(--ust-space-2);
  }
}

/*** Hero ***/
.ust-hero{
  width: 100vw;
  margin-left: calc(50% - 50vw);
  position: relative;
}

.ust-hero-media img{
  width: 100%;
  height: auto;
}

.ust-hero-content{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  pointer-events: none;
  padding: var(--ust-space-4) 0;
}

.ust-hero-title{
  margin: 0;
  font-size: clamp(1.4rem, 3.2vw, 2.6rem);
  line-height: 1.15;
}

/*** Site content ***/
.site-content{
  padding-top: var(--ust-space-3);
  padding-bottom: var(--ust-space-4);
}

/*** Gutenberg widths ***/
.entry-content{
  padding-left: var(--ust-gutter);
  padding-right: var(--ust-gutter);
}

.entry-content > :where(*){
  margin-left: auto;
  margin-right: auto;
}

.entry-content > :where(*:not(.alignwide):not(.alignfull)){
  max-width: var(--ust-text-width-fluid);
}

.entry-content > :where(.alignwide){
  max-width: var(--ust-wide-width);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.entry-content > :where(.alignfull){
  max-width: none;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/*** Surface padding ***/
.wp-block-group.has-background{ padding: var(--ust-space-3); }

/*** Footer ***/
.ust-footer{ padding: var(--ust-space-3) calc(var(--ust-gutter) * 1); }
.ust-footer .ust-footer-inner{ max-width: 100%; }

.ust-footer-inner{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--ust-space-2);
  align-items: start;
}

/*** Footer widgets ***/
.ust-footer-widgets{
  grid-column: 1 / -1;
  width: 100%;
}

.ust-footer-menu{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--ust-space-2);
}

.ust-footer-menu a{ text-decoration: none; }

.ust-footer-menu a:hover,
.ust-footer-menu a:focus{ text-decoration: underline; }

.ust-footer-meta{ justify-self: end; }

/*** Color tokens ***/
:root{
  --ust-primary: var(--wp--preset--color--primary);
  --ust-primary-75: var(--wp--preset--color--primary-75);
  --ust-primary-50: var(--wp--preset--color--primary-50);
  --ust-primary-30: var(--wp--preset--color--primary-30);

  --ust-secondary: var(--wp--preset--color--secondary);
  --ust-secondary-75: var(--wp--preset--color--secondary-75);
  --ust-secondary-50: var(--wp--preset--color--secondary-50);
  --ust-secondary-30: var(--wp--preset--color--secondary-30);
}

body {
  background: var(--ust-content-bg);
  color: var(--ust-content-text);
}

a {
  color: var(--ust-link);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

a:hover,
a:focus-visible {
  color: var(--ust-link);
}

:root { --ust-space-unit: 1.25rem; }

/*** Link hover modes ***/
html:root a:hover,
html:root a:focus-visible {
  opacity: 1;
}

/*** Switch link hover mode ***/
body.ust-linkhover-opacity a:hover,
body.ust-linkhover-opacity a:focus-visible {
  opacity: 0.75;
}

body.ust-linkhover-color a:hover,
body.ust-linkhover-color a:focus-visible {
  color: var(--ust-link-hover);
  opacity: 1;
}

/*** Buttons ***/
.wp-block-button__link,
button,
input[type="submit"],
input[type="button"],
.wp-element-button {
  background: var(--ust-button-bg);
  color: var(--ust-button-text);
  border: 0;
  border-radius: 2px;
  padding: 0.65em 1.0em;
  line-height: 1.2;
}

.wp-block-button__link:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.wp-element-button:hover,
.wp-block-button__link:focus-visible,
button:focus-visible,
input[type="submit"]:focus-visible,
input[type="button"]:focus-visible,
.wp-element-button:focus-visible {
  background: var(--ust-button-bg);
  color: var(--ust-button-text);
}

/*** Button hover background mode ***/
body.ust-btnhoverbg-opacity .wp-block-button__link:hover,
body.ust-btnhoverbg-opacity button:hover,
body.ust-btnhoverbg-opacity input[type="submit"]:hover,
body.ust-btnhoverbg-opacity input[type="button"]:hover,
body.ust-btnhoverbg-opacity .wp-element-button:hover,
body.ust-btnhoverbg-opacity .wp-block-button__link:focus-visible,
body.ust-btnhoverbg-opacity button:focus-visible,
body.ust-btnhoverbg-opacity input[type="submit"]:focus-visible,
body.ust-btnhoverbg-opacity input[type="button"]:focus-visible,
body.ust-btnhoverbg-opacity .wp-element-button:focus-visible {
  opacity: 0.85;
}

body.ust-btnhoverbg-color .wp-block-button__link:hover,
body.ust-btnhoverbg-color button:hover,
body.ust-btnhoverbg-color input[type="submit"]:hover,
body.ust-btnhoverbg-color input[type="button"]:hover,
body.ust-btnhoverbg-color .wp-element-button:hover,
body.ust-btnhoverbg-color .wp-block-button__link:focus-visible,
body.ust-btnhoverbg-color button:focus-visible,
body.ust-btnhoverbg-color input[type="submit"]:focus-visible,
body.ust-btnhoverbg-color input[type="button"]:focus-visible,
body.ust-btnhoverbg-color .wp-element-button:focus-visible {
  background: var(--ust-button-hover-bg);
  opacity: 1;
}

/*** Button hover text mode ***/
body.ust-btnhovertext-opacity .wp-block-button__link:hover,
body.ust-btnhovertext-opacity button:hover,
body.ust-btnhovertext-opacity input[type="submit"]:hover,
body.ust-btnhovertext-opacity input[type="button"]:hover,
body.ust-btnhovertext-opacity .wp-element-button:hover {
  opacity: 0.85;
}

body.ust-btnhovertext-color .wp-block-button__link:hover,
body.ust-btnhovertext-color button:hover,
body.ust-btnhovertext-color input[type="submit"]:hover,
body.ust-btnhovertext-color input[type="button"]:hover,
body.ust-btnhovertext-color .wp-element-button:hover {
  color: var(--ust-button-hover-text);
  opacity: 1;
}

/*** Header colors + sticky behavior ***/

.ust-header {
  background: var(--ust-header-bg);
  color: var(--ust-header-text);
}

/*** Header menu links ***/
.ust-nav a{
  color: var(--ust-header-link, currentColor);
  text-decoration: none;
  opacity: 1;
  transition: opacity 160ms ease, color 160ms ease;
}

/*** Header link hover mode (not sticky) ***/
body.ust-headerlinkhover-opacity .ust-nav a:hover,
body.ust-headerlinkhover-opacity .ust-nav a:focus-visible{
  opacity: 0.65;
  text-decoration: underline;
}

body.ust-headerlinkhover-color .ust-nav a:hover,
body.ust-headerlinkhover-color .ust-nav a:focus-visible{
  color: var(--ust-header-link-hover);
  opacity: 1;
  text-decoration: underline;
}

body.ust-hsticky-sticky .ust-header {
  position: sticky;
  top: 0;
  z-index: 50;
}

/*** Sticky: initial colors ***/
body.ust-hsticky-sticky .ust-header {
  color: var(--ust-header-sticky-text-initial);
  background: transparent;
}

/*** Sticky link colors ***/
body.ust-hsticky-sticky .ust-nav a{
  color: var(--ust-header-sticky-link-initial, var(--ust-header-sticky-text-initial));
}
body.ust-hsticky-sticky .ust-header.ust-scrolled .ust-nav a{
  color: var(--ust-header-sticky-link-scrolled, var(--ust-header-sticky-text-scrolled));
}

/*** Header link hover mode (sticky) ***/
body.ust-hsticky-sticky.ust-headerstickylinkhover-opacity .ust-nav a:hover,
body.ust-hsticky-sticky.ust-headerstickylinkhover-opacity .ust-nav a:focus-visible{
  opacity: 0.65;
  text-decoration: underline;
}

body.ust-hsticky-sticky.ust-headerstickylinkhover-color .ust-nav a:hover,
body.ust-hsticky-sticky.ust-headerstickylinkhover-color .ust-nav a:focus-visible{
  color: var(--ust-header-sticky-link-hover);
  opacity: 1;
  text-decoration: underline;
}

/*** Sticky background modes ***/
body.ust-hsticky-sticky .ust-header {
  color: var(--ust-header-sticky-text-initial);
  background: transparent;
}

body.ust-hsticky-sticky .ust-header.ust-scrolled {
  color: var(--ust-header-sticky-text-scrolled);
}

/*** Mode: scroll_bg ***/
body.ust-hsticky-sticky.ust-stickybg-scroll_bg .ust-header {
  background: transparent;
}

body.ust-hsticky-sticky.ust-stickybg-scroll_bg .ust-header.ust-scrolled {
  background: var(--ust-header-sticky-bg);
}

/*** Mode: always_bg ***/
body.ust-hsticky-sticky.ust-stickybg-always_bg .ust-header {
  background: var(--ust-header-sticky-bg);
}

/*** Mode: transparent ***/
body.ust-hsticky-sticky.ust-stickybg-transparent .ust-header,
body.ust-hsticky-sticky.ust-stickybg-transparent .ust-header.ust-scrolled {
  background: transparent;
}

/*** Widget areas ***/

.ust-after-content-widgets,
.ust-footer-widgets {
  padding: calc(var(--ust-space-4) * var(--ust-space-factor)) calc(var(--ust-space-3) * var(--ust-space-factor));
}

.ust-widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: calc(var(--ust-space-3) * var(--ust-space-factor));
  align-items: start;
}

/*** After-content widgets ***/
.ust-after-content-widgets .ust-widget-grid {
  --ust-ac-col-min: 18rem;
  --ust-ac-gap: calc(var(--ust-space-3) * var(--ust-space-factor));
  max-width: min(100%, calc((4 * var(--ust-ac-col-min)) + (3 * var(--ust-ac-gap))));
  margin-left: auto;
  margin-right: auto;
}

/*** Footer widgets ***/
.ust-footer-widgets .ust-widget-grid {
  --ust-footer-col-min: 18rem;
  --ust-footer-gap: calc(var(--ust-space-3) * var(--ust-space-factor));
  max-width: min(100%, calc((4 * var(--ust-footer-col-min)) + (3 * var(--ust-footer-gap))));
  margin-left: auto;
  margin-right: auto;
}

/*** Link wrapping rules ***/
.ust-footer-widgets .ust-widget-grid,
.ust-footer-widgets .ust-widget-grid a,
.ust-footer-widgets .ust-widget-grid li {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: auto;
}

.ust-after-content-widgets .ust-widget-grid,
.ust-after-content-widgets .ust-widget-grid a,
.ust-after-content-widgets .ust-widget-grid li {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: auto;
}

@media (max-width: 1024px) {
  .ust-widget-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .ust-widget-grid {
    grid-template-columns: 1fr;
  }
}

.ust-widget-grid .widget-title {
  margin-top: 0;
  margin-bottom: 0.6em;
  font-size: 1rem;
  line-height: 1.25;
}





/* =========================================================
   Header Optionslogik (deterministische Zonen, DOM-Reihenfolge egal)
   ========================================================= */

/* INLINE: 3 Zonen (left / center / right) + Areas (menu/logo) je Kombination */
body.ust-hmode-inline .ust-header-inner{
  display:grid;
  /* Equal zones regardless of logo/menu intrinsic width */
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr);
  /*align-items:center;*/
  column-gap:calc(var(--ust-space-2) * var(--ust-space-factor));
  grid-template-areas: ". logo menu"; /* Default: Logo center, Menu right */
}

body.ust-hmode-inline .ust-header-branding{ grid-area: logo; min-width:0; }
body.ust-hmode-inline .ust-nav{ grid-area: menu; min-width:0; width:auto; }

/* Area maps (allowed combos) */
body.ust-hmode-inline.ust-logo-left.ust-menu-center  .ust-header-inner{ grid-template-areas: "logo menu ."; }
body.ust-hmode-inline.ust-logo-left.ust-menu-right   .ust-header-inner{ grid-template-areas: "logo . menu"; }

body.ust-hmode-inline.ust-logo-center.ust-menu-left  .ust-header-inner{ grid-template-areas: "menu logo ."; }
body.ust-hmode-inline.ust-logo-center.ust-menu-right .ust-header-inner{ grid-template-areas: ". logo menu"; }

body.ust-hmode-inline.ust-logo-right.ust-menu-left   .ust-header-inner{ grid-template-areas: "menu . logo"; }
body.ust-hmode-inline.ust-logo-right.ust-menu-center .ust-header-inner{ grid-template-areas: ". menu logo"; }

/* Alignment inside zones */
body.ust-hmode-inline.ust-logo-left   .ust-header-branding{ justify-self:start; }
body.ust-hmode-inline.ust-logo-center .ust-header-branding{ justify-self:center; }
body.ust-hmode-inline.ust-logo-right  .ust-header-branding{ justify-self:end; }

body.ust-hmode-inline.ust-menu-left   .ust-nav{ justify-self:start; }
body.ust-hmode-inline.ust-menu-center .ust-nav{ justify-self:center; }
body.ust-hmode-inline.ust-menu-right  .ust-nav{ justify-self:end; }

/* Ensure UL aligns as expected inside nav */
body.ust-hmode-inline .ust-nav ul{
  display:flex;
  gap:1rem;
  flex-wrap:wrap;
  list-style:none;
  padding:0;
  margin:0;
}
body.ust-hmode-inline.ust-menu-left   .ust-nav ul{ justify-content:flex-start; }
body.ust-hmode-inline.ust-menu-center .ust-nav ul{ justify-content:center; }
body.ust-hmode-inline.ust-menu-right  .ust-nav ul{ justify-content:flex-end; }

/* Stacked mode */
body.ust-hmode-stacked .ust-header-inner {
  display: flex;
  flex-direction: column;
  row-gap: calc(var(--ust-space-2) * var(--ust-space-factor));
}

/* Stacked logo alignment */
body.ust-hmode-stacked.ust-logo-left .ust-header-branding { align-self: flex-start; text-align: left; }
body.ust-hmode-stacked.ust-logo-center .ust-header-branding { align-self: center; text-align: center; }
body.ust-hmode-stacked.ust-logo-right .ust-header-branding { align-self: flex-end; text-align: right; }

/* Stacked menu alignment (ul alignment) */
body.ust-hmode-stacked .ust-nav { width: 100%; }
body.ust-hmode-stacked .ust-nav ul { display: flex; gap: 1rem; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; 
  width: 100%;
}
body.ust-hmode-stacked.ust-menu-left .ust-nav ul { justify-content: flex-start; }
body.ust-hmode-stacked.ust-menu-center .ust-nav ul { justify-content: center; }
body.ust-hmode-stacked.ust-menu-right .ust-nav ul { justify-content: flex-end; }

/* (removed duplicate inline nav-ul alignment rules; handled above) */




/* Inline mode should remain inline (no forced stacking by viewport width).
   Mobile handling is delegated to menu toggle styles, not to collapsing header layout. */



/* =========================================================
   Logo height (initial / sticky) via CSS variables
   ========================================================= */
.ust-header .custom-logo-link img,
.ust-header .site-logo img {
  max-width: 200%;
  height: auto;
  width: auto;
  max-height: var(--ust-logo-height-initial, 80px);
  transition: max-height 180ms ease;
}

/* Sticky state (scrolled) */
body.ust-hsticky-sticky .ust-header.ust-scrolled .custom-logo-link img,
body.ust-hsticky-sticky .ust-header.ust-scrolled .site-logo img {
  max-height: var(--ust-logo-height-sticky, 56px);
}

.ust-header .ust-header-branding {
  display: flex;
  align-items: center;
  /*min-height: var(--ust-logo-height-initial, 80px);*/
}


/* Smooth sticky header state change */
body.ust-hsticky-sticky .ust-header {
  transition: background-color 160ms linear, color 160ms linear;
  will-change: background-color, color;
}

/* =========================================================
   Content width: ensure headings follow text width as well
   - Applies to all direct children in .entry-content that are not alignwide/full
   ========================================================= */
.entry-content > :where(:not(.alignfull):not(.alignwide)) {
  max-width: var(--ust-text-width-fluid);
  margin-left: auto;
  margin-right: auto;
}

.entry-content > :where(.alignwide) {
  max-width: var(--ust-wide-width);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.entry-content > :where(.alignfull) {
  max-width: none;
}



/* Post title width (entry-title) */
.entry-header,
.entry-title,
.wp-block-post-title,
.wp-block-query-title {
  max-width: var(--ust-text-width, 600px);
  margin-left: auto;
  margin-right: auto;
}



/* Footer colors */
.ust-footer {
  background: var(--ust-footer-bg, #111111);
  color: var(--ust-footer-text, #ffffff);
}

.ust-footer a {
  color: var(--ust-footer-link, #ffffff);
}

body.ust-footerlinkhover-opacity .ust-footer a:hover,
body.ust-footerlinkhover-opacity .ust-footer a:focus {
  opacity: 0.72;
}

body.ust-footerlinkhover-color .ust-footer a:hover,
body.ust-footerlinkhover-color .ust-footer a:focus {
  color: var(--ust-footer-link-hover, var(--ust-footer-link, #ffffff));
  opacity: 1;
}


/* === UST background spacing system === */
.wp-block-group.has-background,
.wp-block-columns.has-background {
  padding-block: calc(var(--ust-space-unit) * var(--ust-space-factor));
  padding-inline: calc(var(--ust-space-unit) * var(--ust-space-factor) * 1.2);
}

/* =========================================================
   UST background surfaces padding (systemic)
   Applies when blocks form a surface (background color/image).
   ========================================================= */
.wp-block-group.has-background,
.wp-block-columns.has-background {
  padding: var(--ust-space-3);
}



/* Block gap aligns Gutenberg spacing with UST space scale */
.entry-content{
  --wp--style--block-gap: var(--ust-space-3);
}

/* =========================================================
   UST block vertical rhythm (frontend)
   Gutenberg uses gap variables; ensure visible spacing between blocks.
   ========================================================= */
.entry-content{
  --wp--style--block-gap: var(--ust-space-3);
}

.entry-content.is-layout-flow > * + *,
.entry-content > .wp-block-group.is-layout-flow > * + *{
  margin-block-start: var(--wp--style--block-gap);
}

/* =========================================================
   UST line-height (frontend)
   ========================================================= */
html, body{
  line-height: var(--ust-line-height-base);
}


@media (min-width: 1361px){
  .site-header .ust-nav ul,
  .site-header .ust-nav ul#ust-primary-menu{
    display: flex;
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  .site-header .ust-nav li{
    white-space: nowrap;
  }
}

@media (min-width: 1361px){
  .site-header .ust-header-inner{
    gap: 2rem; /* optional: kontrollierter Abstand statt space-between-Überraschungen */
  }

  .site-header .ust-header-branding{
    flex: 0 0 auto;
  }

  .site-header .ust-nav{
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: flex-end;
  }
}

/* ===== NAV: früher in Mobile-Mode schalten ===== */
@media (max-width: 1360px){
  /* Toggle (Burger) zeigen */
  .ust-nav-toggle{
    display: inline-flex !important;
    align-items: center;
  }

  /* Desktop-Menüliste ausblenden */
  #ust-primary-menu{
    display: none !important;
  }
}

@media (min-width: 1361px){
  /* Toggle verstecken */
  .ust-nav-toggle{
    display: none !important;
  }

  /* Desktop-Menü wieder normal */
  #ust-primary-menu{
    display: flex !important;
    flex-wrap: nowrap;
    white-space: nowrap;
    gap: 1.8rem;
  }
}
@media (max-width: 1360px){
  .ust-nav-toggle{
    border: 0;
    background: transparent;
    padding: 10px 12px;
  }
}

/* ===== NAV: früher in Mobile-Mode schalten (ohne JS zu blockieren) ===== */
@media (max-width: 1360px){

  /* Toggle sichtbar */
  .ust-nav-toggle{
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* Menü-Grundzustand: zu, aber nicht display:none */
  #ust-primary-menu{
    display: block !important;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 200ms ease, opacity 200ms ease;
  }

  /* Auf: wenn Button expanded ist */
  .ust-nav-toggle[aria-expanded="true"] + #ust-primary-menu{
    max-height: 80vh;
    opacity: 1;
    pointer-events: auto;
  }
}

@media (min-width: 1361px){
  .ust-nav-toggle{ display:none !important; }
  #ust-primary-menu{
    display:flex !important;
    max-height:none;
    opacity:1;
    overflow:visible;
    pointer-events:auto;
  }
}
@media (min-width: 1361px){
  #ust-primary-menu > li > ul.sub-menu{
    padding: .65rem 0;
    background: #fff;
  }

  #ust-primary-menu > li > ul.sub-menu > li > a{
    display: block;              /* wichtig */
    padding: .65rem .95rem;      /* Höhe kommt hier her */
    line-height: 1.2;
  }
}

/* =========================================================
   UST: Gutenberg image vertical rhythm
   ========================================================= */

/* Image blocks: let the global block-gap drive vertical spacing */
.entry-content :where(figure.wp-block-image, figure.wp-block-gallery){
  margin: 0 auto;                /* prevents double spacing */
}

/* Make sure the actual image has no margins */
.entry-content :where(figure.wp-block-image img, figure.wp-block-gallery img){
  margin: 0;
  display: block;
  max-width: 100%;
  height: auto;
}

/* Caption spacing is NOT a full block-gap; keep it tight */
.entry-content :where(figure.wp-block-image figcaption,
                      figure.wp-block-gallery figcaption){
  margin: var(--ust-space-1) 0 0 0;
  font-size: 0.9em;
  line-height: 1.4;
  opacity: 0.85;
}

/* If an image is directly followed by a paragraph, don't stack big gaps */
.entry-content :where(figure.wp-block-image + p,
                      figure.wp-block-gallery + p){
  margin-block-start: calc(var(--wp--style--block-gap) * 0.75);
}

/* If a paragraph is directly followed by an image, keep normal block gap */
.entry-content :where(p + figure.wp-block-image,
                      p + figure.wp-block-gallery){
  /* nothing needed; global rule handles it */
}

/* Optional: reduce gap between consecutive media blocks slightly */
.entry-content :where(figure.wp-block-image + figure.wp-block-image,
                      figure.wp-block-image + figure.wp-block-gallery,
                      figure.wp-block-gallery + figure.wp-block-image,
                      figure.wp-block-gallery + figure.wp-block-gallery){
  margin-block-start: calc(var(--wp--style--block-gap) * 0.8);
}

:root{
  /* Fallback: überschreibbar per Customizer/Inline oder per JS wenn du willst */
  --ust-anchor-offset: calc(var(--ust-logo-height-sticky, 56px) + var(--ust-space-2));
}

/* Damit auch Browser-UI (z.B. per Tastatur/Find) korrekt offsettet */
html{
  scroll-padding-top: var(--ust-anchor-offset);
  scroll-behavior: smooth; /* optional */
}

/* Jeder Anker-Zielpunkt bekommt den Offset */
.entry-content :where([id]){
  scroll-margin-top: var(--ust-anchor-offset);
}

/*** Gutenberg Styles ***/

.wp-block-image.alignleft {
  float: left;
  margin-right: 1.5rem;
  margin-left: 0;
}

.wp-block-image.alignright {
  float: right;
  margin-left: 1.5rem;
  margin-right: 0;
}

.wp-block-image.aligncenter {
  clear: both;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.wp-block-image.aligncenter img {
  margin-left: auto;
  margin-right: auto;
}