/* =========================================================================
   TOOL-SEITE ALS VOLLBILD
   Nur auf Seiten mit dem Tool geladen (includes/tool-page.php, Body-Klasse
   .sciarc-app). Das Tool füllt das Fenster unter Header und Topbar, die Seite
   selbst scrollt nicht — es bleibt die eine Scrollleiste im Chat.
   ========================================================================= */

/* ---------- Header: kein „Sign in“ auf der Seite, zu der er führt ---------- */
.sciarc-app [data-section="kadence_customizer_header_button"],
.sciarc-app .sciarc-menu-signin { display: none; }

/* ---------- Footer: nur die Zeile mit den Rechtslinks ---------- */
/* Erkannt am Datenschutz-Link, den WordPress im Menü kennzeichnet — so
   bleibt es richtig, auch wenn das Menü live umbenannt wird. */
.sciarc-app #colophon .site-bottom-footer-wrap,
.sciarc-app #colophon .site-middle-footer-wrap .site-footer-section:not(:has(.menu-item-privacy-policy)) { display: none; }

.sciarc-app #colophon .site-middle-footer-inner-wrap {
  display: flex;
  justify-content: center;
  padding-block: 10px;
}
.sciarc-app #colophon .site-middle-footer-wrap .widget { margin: 0; }
.sciarc-app #colophon .site-middle-footer-wrap .widget-title { display: none; }
.sciarc-app #colophon .site-middle-footer-wrap .menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 22px;
  margin: 0;
  padding: 0;
}
.sciarc-app #colophon .site-middle-footer-wrap .menu li { margin: 0; padding: 0; }
.sciarc-app #colophon .site-middle-footer-wrap .menu a { padding: 0; font-size: 12.5px; }

/* ---------- Hinweis unter dem Tool: schmal ---------- */
.sciarc-app .sciarc-notice--box,
.sciarc-app .sciarc-notice--bar { padding: 8px var(--az-gutter); }
.sciarc-app .sciarc-notice--box .sciarc-notice__inner,
.sciarc-app .sciarc-notice--bar .sciarc-notice__inner {
  padding: 7px 14px;
  font-size: 12.5px;
  line-height: 1.4;
}

/* ---------- Das Tool füllt den Rest des Fensters ---------- */
/* Die Höhe aus dem style-Attribut im HTML-Block (1023px) gilt hier nicht. */
.sciarc-app .tool-frame,
.sciarc-app #aiToolFrame,
.sciarc-app .sciarc-geo-placeholder {
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 0 !important;
}

/* Nur wenn das Fenster hoch genug ist: auf Handys quer bleibt sonst kaum
   Platz für den Chat — dort scrollt die Seite wie bisher, das Tool ist dann
   so hoch wie das Fenster. */
@media (min-height: 520px) {
  .sciarc-app #wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }
  .sciarc-app.admin-bar #wrapper { height: calc(100vh - 32px); height: calc(100dvh - 32px); }

  .sciarc-app #wrapper > * { flex: none; }

  /* Jede Ebene von main bis zum iframe gibt die Höhe weiter. */
  .sciarc-app #wrapper > #inner-wrap,
  .sciarc-app #inner-wrap #primary,
  .sciarc-app #inner-wrap .content-container,
  .sciarc-app #inner-wrap #main,
  .sciarc-app #inner-wrap .content-wrap,
  .sciarc-app #inner-wrap article,
  .sciarc-app #inner-wrap .entry-content-wrap,
  .sciarc-app #inner-wrap .entry-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    /* Kadence zentriert den Container mit margin:auto — ohne width würde er
       in der Flex-Spalte auf die 300px des iframes schrumpfen. */
    width: 100%;
    min-height: 0;
    margin-block: 0;
    padding-block: 0;
  }

  .sciarc-app #inner-wrap .entry-content > * {
    flex: none;
    margin-block: 0;
  }
  .sciarc-app #inner-wrap .entry-content > .tool-frame,
  .sciarc-app #inner-wrap .entry-content > #aiToolFrame,
  .sciarc-app #inner-wrap .entry-content > .sciarc-geo-placeholder {
    flex: 1 1 auto;
    height: auto !important;
  }
}

@media (min-height: 520px) and (max-width: 782px) {
  .sciarc-app.admin-bar #wrapper { height: calc(100vh - 46px); height: calc(100dvh - 46px); }
}
