/* 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; }
}

/* 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%;
}

/* Assigned OnePress sites: enlarge the observed brand link without overlapping its description. */
body.wp-theme-onepress #masthead .site-brand-inner.no-logo-img.has-desc {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 75px;
  line-height: normal;
}
body.wp-theme-onepress #masthead .site-branding .site-title {
  display: block;
  position: static;
  margin: 0;
}
body.wp-theme-onepress #masthead .site-branding .site-title .site-text-logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  line-height: 1.2;
}
body.wp-theme-onepress #masthead .site-branding .site-description {
  position: static;
  top: auto;
  margin: 0;
  line-height: 1.35;
}
body.wp-theme-onepress #commentform #submit {
  min-height: 44px;
  box-sizing: border-box;
}
@media (max-width: 767px) {
  body.wp-theme-onepress #masthead .site-brand-inner.no-logo-img.has-desc {
    min-height: 0;
  }
  body.wp-theme-onepress #masthead .site-branding .site-description {
    margin-top: 4px;
  }
}

/* Only mobilny-mechanik-warszawa24h.pl: keep both home contact actions above the call bar. */
@media (max-width: 750px) {
  body.home.page-id-8 .msw58-portal .msw58-hero {
    margin-top: 12px;
    padding: 20px 24px;
    gap: 16px;
  }
  body.home.page-id-8 .msw58-portal .msw58-hero-orb {
    width: 88px;
    font-size: 34px;
  }
  body.home.page-id-8 .msw58-portal .msw58-hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 20px;
  }
  body.home.page-id-8 .msw58-portal .msw58-cta {
    min-width: 0;
    padding: 8px;
    font-size: 13px;
    line-height: 1.3;
  }
}

/* MSW round 2: confirmed 19px contact targets after editorial cleanup.
 * This addition belongs only to mobilny-mechanik-warszawa24h.pl.
 */
body.wp-theme-onepress.page-id-16 #post-16 .entry-content > ul:first-of-type a:is([href^="tel:"], [href^="sms:"], [href^="mailto:"], [href^="https://wa.me/"]),
body.wp-theme-onepress.page-id-43 #post-43 .entry-content a[href^="tel:"] {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 44px;
  max-width: 100%;
  overflow-wrap: anywhere;
  vertical-align: middle;
}
body.wp-theme-onepress.page-id-16 #post-16 .entry-content > ul:first-of-type a:is([href^="tel:"], [href^="sms:"], [href^="mailto:"], [href^="https://wa.me/"]):focus-visible,
body.wp-theme-onepress.page-id-43 #post-43 .entry-content a[href^="tel:"]:focus-visible {
  outline: 3px solid #075f91;
  outline-offset: 3px;
}
/* Preserve heading text and semantics while allowing the new service title to fit. */
body.wp-theme-onepress:is(.page-id-16, .page-id-43) .page-header .entry-title {
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* Low landscape viewports: align the two contact links and the closed AI
 * launcher in one row. Existing panel/keyboard suppression stays in control. */
@media (min-width: 768px) and (max-width: 1140px) and (max-height: 500px) {
  html[data-msw-layout-ready]:not([data-msw-layout-panel-open]) body.wp-theme-onepress .mswpc38-dock {
    top: auto !important;
    height: auto !important;
    flex-direction: row !important;
    align-items: stretch;
    gap: 8px;
    left: max(8px, env(safe-area-inset-left, 0px)) !important;
    right: calc(max(8px, env(safe-area-inset-right, 0px)) + 212px) !important;
    bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
    width: auto !important;
    max-width: none !important;
    transform: none !important;
  }
  html[data-msw-layout-ready]:not([data-msw-layout-panel-open]) body.wp-theme-onepress #mswpc62-chat {
    left: auto !important;
    right: max(8px, env(safe-area-inset-right, 0px)) !important;
    bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
    width: auto !important;
    max-width: 204px;
  }
}

/* The theme rotates this 50px control by 45deg: reserve room for its corners. */
@media (max-width: 1140px) {
  body.wp-theme-onepress a.back-to-top {
    right: max(16px, env(safe-area-inset-right, 0px)) !important;
    left: auto !important;
  }
}

/* Remove only the theme's generic missing-thumbnail tile, preserving real photos. */
body.wp-theme-onepress .list-article:has(> .list-article-thumb img[src$="/assets/images/placholder2.png"]) > .list-article-thumb {
  display: none;
}
body.wp-theme-onepress .list-article:has(> .list-article-thumb img[src$="/assets/images/placholder2.png"]) > .list-article-content {
  float: none;
  width: 100%;
  margin-left: 0;
  padding-left: 0;
}
/* Keep the open AI form and its actions visible on a short landscape screen. */
@media (min-width: 768px) and (max-width: 1140px) and (max-height: 500px) {
  html[data-msw-layout-panel-open] body.wp-theme-onepress #mswpc62-chat #mswpc62-panel:not([hidden]) {
    display: flex !important;
    flex-direction: column;
    overflow: hidden !important;
  }
  html[data-msw-layout-panel-open] body.wp-theme-onepress #mswpc62-panel > header {
    flex: 0 0 auto;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  html[data-msw-layout-panel-open] body.wp-theme-onepress #mswpc62-panel .mswpc62-log {
    flex: 1 1 auto;
    min-height: 0 !important;
    max-height: none !important;
    overflow: auto;
  }
  body.wp-theme-onepress #mswpc62-panel .mswpc62-log:empty,
  body.wp-theme-onepress #mswpc62-panel .mswpc62-status:empty {
    display: none;
  }
  html[data-msw-layout-panel-open] body.wp-theme-onepress #mswpc62-panel > :is(form, .mswpc62-status, .mswpc62-footer) {
    flex: 0 0 auto;
  }
  body.wp-theme-onepress #mswpc62-panel .mswpc62-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0 16px;
  }
  body.wp-theme-onepress #mswpc62-panel .mswpc62-options > label {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin: 0;
  }
}

/* Give the panel's phone action the same comfortable touch height. */
body.wp-theme-onepress #mswpc62-panel .mswpc62-footer a[href^="tel:"] {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  max-width: 100%;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

/* Article titles are large navigation targets, including short one-line titles. */
body.wp-theme-onepress .list-article .entry-title > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
body.wp-theme-onepress .list-article .entry-title > a:focus-visible {
  outline: 3px solid #075f91;
  outline-offset: 3px;
}

/* Consistent touch areas for contact links throughout articles and service pages. */
body.wp-theme-onepress main .entry-content a:is([href^="tel:"], [href^="sms:"], [href^="mailto:"], [href^="https://wa.me/"]),
body.wp-theme-onepress #secondary a[href^="tel:"] {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 44px;
  min-width: 44px;
  max-width: 100%;
  overflow-wrap: anywhere;
  vertical-align: middle;
}
body.wp-theme-onepress main .entry-content a:is([href^="tel:"], [href^="sms:"], [href^="mailto:"], [href^="https://wa.me/"]):focus-visible,
body.wp-theme-onepress #secondary a[href^="tel:"]:focus-visible {
  outline: 3px solid #075f91;
  outline-offset: 3px;
}

/* The theme omits the block editor's fixed-table rule. Restore it on phones. */
@media (max-width: 767px) {
  body.wp-theme-onepress main .entry-content .wp-block-table {
    max-width: 100%;
  }
  body.wp-theme-onepress main .entry-content table.has-fixed-layout {
    table-layout: fixed;
    width: 100%;
    max-width: 100%;
  }
  body.wp-theme-onepress main .entry-content table.has-fixed-layout :is(th, td) {
    overflow-wrap: anywhere;
    word-break: normal;
  }
}
