/*
 * Heidenheim.info – Unterseiten-CI 0.1.188
 * Finaler Breiten-Lock nach dem Portal-Refactoring.
 *
 * Wichtig: Nur der Hero darf full-bleed sein. Alle Inhalte darunter liegen
 * auf einer festen, zentrierten 1320px-Achse. Die experimentellen 84vw-Regeln
 * aus 0.1.179/0.1.181 werden nicht mehr geladen.
 */
:root{
  --hi188-axis:1320px;
  --hi188-gutter:28px;
  --hi188-gap:18px;
}

/* Gutenberg darf das Portal weder auf Lesebreite einsperren noch auf 84vw aufblasen. */
body:not(.home) main.hi-page-shell,
body:not(.home) main.hi-page-shell--wide,
body:not(.home) main.hi-page-shell--universal{
  width:100%!important;
  max-width:none!important;
  margin-left:0!important;
  margin-right:0!important;
  padding-top:0!important;
  box-sizing:border-box!important;
}
body:not(.home) main.hi-page-shell>.wp-block-post-content,
body:not(.home) main.hi-page-shell--wide>.wp-block-post-content,
body:not(.home) main.hi-page-shell--universal>.wp-block-post-content,
body:not(.home) main.hi-page-shell .wp-block-post-content>.wp-block-shortcode,
body:not(.home) main.hi-page-shell--wide .wp-block-post-content>.wp-block-shortcode{
  width:100%!important;
  max-width:none!important;
  margin-left:0!important;
  margin-right:0!important;
  padding-left:0!important;
  padding-right:0!important;
  box-sizing:border-box!important;
}

/* Verbindliche Portalachse. Diese Selektoren sind absichtlich spezifisch,
 * damit keine ältere Wide-Template-Regel sie erneut überschreiben kann. */
body:not(.home) main.hi-page-shell .wp-block-post-content>.wp-block-shortcode>
:is(.hi-place-portal,.hi-gastro-portal,.hi-service-portal,.hi-topic-landing,.hi-daily-menu-portal,.hi-municipality-portal,.hi-clubs-bars,.hi-public-infrastructure),
body:not(.home) main.hi-page-shell--wide .wp-block-post-content>.wp-block-shortcode>
:is(.hi-place-portal,.hi-gastro-portal,.hi-service-portal,.hi-topic-landing,.hi-daily-menu-portal,.hi-municipality-portal,.hi-clubs-bars,.hi-public-infrastructure),
body:not(.home) main :is(.hi-place-portal,.hi-gastro-portal,.hi-service-portal,.hi-topic-landing,.hi-daily-menu-portal,.hi-municipality-portal,.hi-clubs-bars,.hi-public-infrastructure){
  position:relative!important;
  left:auto!important;
  right:auto!important;
  transform:none!important;
  width:min(var(--hi188-axis),calc(100vw - 2 * var(--hi188-gutter)))!important;
  max-width:var(--hi188-axis)!important;
  min-width:0!important;
  margin-left:auto!important;
  margin-right:auto!important;
  box-sizing:border-box!important;
}

/* Nur der Hero darf über die Browserbreite laufen. */
body:not(.home) main :is(
  .hi-place-portal>.hi-place-portal__hero,
  .hi-gastro-portal>.hi-gastro-portal__hero,
  .hi-service-portal>.hi-service-portal__hero,
  .hi-topic-landing>.hi-topic-landing__hero,
  .hi-daily-menu-portal>.hi-daily-menu-portal__hero,
  .hi-municipality-portal>.hi-municipality-portal__hero,
  .hi-clubs-bars>.hi-place-portal__hero,
  .hi-public-infrastructure>.hi-place-portal__hero
){
  width:100vw!important;
  max-width:none!important;
  margin-left:calc(50% - 50vw)!important;
  margin-right:0!important;
  box-sizing:border-box!important;
}

/* Alles unter dem Hero bleibt innerhalb der 1320px-Achse. */
body:not(.home) main :is(.hi-place-portal,.hi-gastro-portal,.hi-service-portal,.hi-topic-landing,.hi-daily-menu-portal,.hi-municipality-portal,.hi-clubs-bars,.hi-public-infrastructure)>
:not(.hi-place-portal__hero,.hi-gastro-portal__hero,.hi-service-portal__hero,.hi-topic-landing__hero,.hi-daily-menu-portal__hero,.hi-municipality-portal__hero){
  width:100%!important;
  max-width:100%!important;
  margin-left:0!important;
  margin-right:0!important;
  box-sizing:border-box!important;
}

/* Ergebnislisten: 3 ruhige Spalten statt viewport-breiter 4/5/6-Spalten. */
body:not(.home) main.hi-page-shell :is(.hi-place-directory,.hi-gastro-directory,.hi-service-directory,.hi-daily-menu-list),
body:not(.home) main.hi-page-shell--wide :is(.hi-place-directory,.hi-gastro-directory,.hi-service-directory,.hi-daily-menu-list),
body:not(.home) main :is(.hi-place-directory,.hi-gastro-directory,.hi-service-directory,.hi-daily-menu-list){
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:var(--hi188-gap)!important;
  width:100%!important;
  max-width:100%!important;
  margin-left:0!important;
  margin-right:0!important;
  justify-content:stretch!important;
  box-sizing:border-box!important;
}

/* Abschnitt, Trefferzahl und Karte folgen derselben Achse. */
body:not(.home) main :is(
  .hi-place-directory-section,.hi-gastro-directory-section,.hi-service-directory-section,
  .hi-gastro-map-section,.hi-service-map-section,.hi-topic-landing__section,
  .hi-daily-menu-days,.hi-daily-menu-toolbar,.hi-daily-menu-hint,.hi-daily-menu-day-group,
  .hi-daily-menu-map,.hi-feedback-cta
){
  width:100%!important;
  max-width:100%!important;
  margin-left:0!important;
  margin-right:0!important;
  box-sizing:border-box!important;
}
body:not(.home) main :is(.hi-gastro-map-section,.hi-service-map-section,.hi-topic-landing__section--map,.hi-daily-menu-map) :is(.hi-map-overview,.hi-portal-map,.leaflet-container){
  width:100%!important;
  max-width:100%!important;
}

/* Überschriften unter dem Hero bleiben mittig. */
body:not(.home) main :is(.hi-place-directory-section,.hi-gastro-directory-section,.hi-service-directory-section,.hi-topic-landing__section,.hi-daily-menu-day-group) :is(h2,.hi-gastro-directory-section__head){
  text-align:center!important;
}

@media(max-width:1050px){
  :root{--hi188-gutter:22px}
  body:not(.home) main :is(.hi-place-directory,.hi-gastro-directory,.hi-service-directory,.hi-daily-menu-list){grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:700px){
  :root{--hi188-gutter:14px}
  body:not(.home) main :is(.hi-place-directory,.hi-gastro-directory,.hi-service-directory,.hi-daily-menu-list){grid-template-columns:1fr!important}
}
