/* MSW satellite layout: scoped to the observed Portal42 and OnePress themes. */
/* OnePress also shows its menu control at tablet widths above 767px. */
body.wp-theme-onepress #masthead #nav-toggle {
  min-width: 44px;
  min-height: 44px;
}
/* Embedded maps use a 600px HTML width; let them fit the article column. */
body.wp-theme-onepress .entry-content iframe {
  max-width: 100% !important;
}

/* A long native select must not set the minimum width of the whole form. */
body.wp-theme-msw-portal-42 .mswpc38-form,
body.wp-theme-msw-portal-42 .mswpc38-form label {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
}
body.wp-theme-msw-portal-42 .mswpc38-form :is(input:not([type="checkbox"]), select, textarea, .mswpc38-double) {
  min-width: 0;
}
body.wp-theme-msw-portal-42 .mswpc38-form .mswpc38-double {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 768px) {
  body.wp-theme-msw-portal-42 .mswpc38-form .mswpc38-double {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 767px) {
  /* OnePress: allow the title to wrap beside a stable 44px menu target. */
  body.wp-theme-onepress #masthead > .container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: center;
    column-gap: 12px;
    min-height: 76px;
    padding-top: 12px;
    padding-bottom: 12px;
    line-height: normal;
  }
  body.wp-theme-onepress #masthead > .container::before,
  body.wp-theme-onepress #masthead > .container::after {
    content: none;
  }
  body.wp-theme-onepress #masthead .site-branding {
    float: none;
    min-width: 0;
    max-width: 100%;
  }
  body.wp-theme-onepress #masthead .site-brand-inner.no-logo-img.has-desc {
    line-height: normal;
  }
  body.wp-theme-onepress #masthead .site-branding .site-title {
    display: block;
    position: static;
    max-width: 100%;
    margin: 0;
    line-height: 1.2;
  }
  body.wp-theme-onepress #masthead .site-title .site-text-logo {
    display: block;
    max-width: 100%;
    font-size: clamp(18px, 4.8vw, 23px);
    line-height: 1.2;
    letter-spacing: .02em;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  body.wp-theme-onepress #masthead .site-branding .site-description {
    position: static;
    top: auto;
    margin: 6px 0 0;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  body.wp-theme-onepress #masthead .header-right-wrapper {
    float: none;
    min-width: 0;
    line-height: 1;
  }
  body.wp-theme-onepress #masthead #nav-toggle {
    display: block;
    float: none;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    margin: 0;
    line-height: 44px;
  }
  body.wp-theme-onepress #masthead #nav-toggle span {
    right: 10px;
  }
  body.wp-theme-onepress #masthead #nav-toggle:focus-visible {
    outline: 3px solid #075f91;
    outline-offset: 2px;
  }
  body.wp-theme-onepress #masthead .onepress-menu.onepress-menu-mobile {
    top: 100%;
    max-height: 65vh;
    max-height: 65dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

@media (max-width: 900px) {
  /* Premium portal: its flex brand label was allowed to push Menu off screen. */
  body.wp-theme-msw-portal-42 .mswp-header-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
  }
  body.wp-theme-msw-portal-42 .mswp-header .mswp-brand {
    min-width: 0;
    max-width: 100%;
    gap: 9px;
  }
  body.wp-theme-msw-portal-42 .mswp-header .mswp-monogram {
    flex: 0 0 48px;
    width: 48px;
  }
  body.wp-theme-msw-portal-42 .mswp-header .mswp-brand-label {
    min-width: 0;
  }
  body.wp-theme-msw-portal-42 .mswp-header .mswp-brand-label strong,
  body.wp-theme-msw-portal-42 .mswp-header .mswp-brand-label small {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  body.wp-theme-msw-portal-42 .mswp-header .mswp-menu-toggle {
    min-width: 44px;
    min-height: 44px;
    white-space: nowrap;
    margin: 0;
  }
  body.wp-theme-msw-portal-42 .mswp-header .mswp-nav {
    grid-column: 1 / -1;
    min-width: 0;
    max-height: 65vh;
    max-height: 65dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  body.wp-theme-msw-portal-42 .mswp-hero .mswp-hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  body.wp-theme-msw-portal-42 .mswp-hero .mswp-hero-grid > div {
    min-width: 0;
  }
  body.wp-theme-msw-portal-42 .mswp-hero :is(h1, .mswp-intro, .mswp-eyebrow) {
    overflow-wrap: anywhere;
  }
}


/* Keep long portal navigation inside the available desktop column. */
body.wp-theme-msw-portal-42 .mswp-header .mswp-brand-label {
  min-width: 0;
  overflow-wrap: anywhere;
}
body.wp-theme-msw-portal-42 .mswp-header .mswp-monogram { flex-shrink: 0; }
body.wp-theme-msw-portal-42 .mswp-header .mswp-nav { min-width: 0; }
body.wp-theme-msw-portal-42 .mswp-header .mswp-navlinks { flex-wrap: wrap; }
body.wp-theme-msw-portal-42 .mswp-header .mswp-navlinks li { min-width: 0; max-width: 100%; }
body.wp-theme-msw-portal-42 .mswp-header .mswp-nav a {
  display: flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  white-space: normal;
  overflow-wrap: anywhere;
}
body.wp-theme-msw-portal-42 .mswp-hero-grid > * { min-width: 0; }
body.wp-theme-msw-portal-42 .mswp-hero :is(h1, .mswp-intro, .mswp-eyebrow) { overflow-wrap: anywhere; }
body.wp-theme-msw-portal-42 :is(.mswp-btn, .mswp-searchline button, .mswpc38-submit) { min-height: 44px; }
body.wp-theme-msw-portal-42 .mswpc38-form label.mswpc38-privacy {
  display: block;
  line-height: 1.5;
}
body.wp-theme-msw-portal-42 .mswpc38-form label.mswpc38-privacy > input[type="checkbox"] {
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}
@media (min-width: 901px) {
  body.wp-theme-msw-portal-42 .mswp-header-layout {
    display: grid;
    grid-template-columns: minmax(190px, 300px) minmax(0, 1fr) auto;
    gap: 16px;
    padding-block: 12px;
  }
  body.wp-theme-msw-portal-42 .mswp-header .mswp-brand { min-width: 0; max-width: 100%; }
  body.wp-theme-msw-portal-42 .mswp-header .mswp-nav {
    max-height: 280px;
    max-height: min(280px, 40dvh);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  body.wp-theme-msw-portal-42 .mswp-header .mswp-navlinks { gap: 4px 12px; }
  body.wp-theme-msw-portal-42 .mswp-header .sub-menu {
    list-style: none;
    margin: 0;
    padding-left: 14px;
  }
}
@media (max-width: 900px) {
  body.wp-theme-msw-portal-42 .mswp-header .mswp-nav {
    max-height: min(65vh, calc(100vh - 120px - var(--msw-layout-reserve, 0px)));
    max-height: min(65dvh, calc(var(--msw-layout-vh, 100dvh) - 120px - var(--msw-layout-reserve, 0px)));
    scroll-padding-block: 8px;
  }
  body.wp-theme-msw-portal-42 .mswpc38-form :is(input:not([type="checkbox"]), select, textarea) { font-size: 16px; min-height: 44px; }
}
@media (max-width: 767px) {
  body.wp-theme-onepress #masthead .onepress-menu.onepress-menu-mobile {
    max-height: min(65vh, calc(100vh - 120px - var(--msw-layout-reserve, 0px)));
    max-height: min(65dvh, calc(var(--msw-layout-vh, 100dvh) - 120px - var(--msw-layout-reserve, 0px)));
    scroll-padding-block: 8px;
  }
  body.wp-theme-onepress #masthead .onepress-menu.onepress-menu-mobile a { min-height: 44px; }
}

/* Confirmed on elektryk-warszawa24.pl: the tablet Menu remains 35px wide. */
body.wp-theme-onepress #masthead #nav-toggle {
  min-width: 44px;
  min-height: 44px;
}

/* The existing fallback contact card exposes two 17px-high action links. */
body.wp-theme-onepress .msw-contact-fallback > p > a[href^="tel:"],
body.wp-theme-onepress .msw-contact-fallback > p > a[href*="wa.me/"] {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* Public calculators: the observed fields are 43px high with 15px text. */
body.wp-theme-onepress .mswp-calc input:not([type="checkbox"]):not([type="radio"]) {
  min-height: 44px;
  font-size: 16px;
  max-width: 100%;
}

/* Keep long labels inside the observed open OnePress mobile menu. */
body.wp-theme-onepress #masthead .onepress-menu.onepress-menu-mobile a {
  white-space: normal;
  overflow-wrap: anywhere;
}
