/* 7.58: mobile refinement. Desktop layout remains in final-layout.css.
   Important declarations also cover saved WordPress block styles. */
@media (max-width:900px) {
  body.esv-mobile-journey .esv-header .wp-block-navigation__responsive-container-close {
    width:48px !important; height:48px !important; min-width:48px; min-height:48px;
    display:grid; place-items:center;
  }
  body.esv-mobile-journey .esv-header .wp-block-navigation__responsive-container.is-menu-open {
    padding-top:max(12px,env(safe-area-inset-top)) !important;
    padding-bottom:max(24px,env(safe-area-inset-bottom)) !important;
    overscroll-behavior-y:contain;
  }
  body.esv-mobile-journey .esv-header .is-menu-open .wp-block-navigation__responsive-container-content {
    padding-top:60px !important;
  }
  body.esv-mobile-journey .esv-header .is-menu-open a.wp-block-navigation-item__content {
    white-space:normal !important; overflow-wrap:anywhere;
  }
  body.esv-mobile-journey .esv-mobile-menu-actions a { white-space:normal; text-align:center; }
  body.esv-mobile-journey nav.esv-mobile-subnav-compact {
    display:grid !important; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px !important;
  }
  body.esv-mobile-journey nav.esv-mobile-subnav-compact a {
    min-width:0 !important; padding:7px 4px !important; justify-content:center;
    text-align:center; white-space:normal !important; overflow-wrap:anywhere; line-height:1.35;
  }
  body.esv-mobile-journey .esv-mobile-updates-shortcuts {
    display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); margin-bottom:20px !important;
  }
  body.esv-mobile-journey .esv-mobile-updates-shortcuts a { min-width:0; min-height:48px; font-size:.94rem; }
  body.esv-mobile-journey .esv-mobile-jump-target { scroll-margin-top:90px; }
  body.esv-mobile-journey .esv-mobile-jump-target:focus-visible { outline:3px solid var(--esv-color-focus,#00873b); outline-offset:4px; }
  body.esv-mobile-journey .esv-updates-overview-grid { grid-template-columns:minmax(0,1fr) !important; }
  body.esv-mobile-journey :is(.esv-updates-overview-news,.esv-updates-overview-events) { min-width:0; }
  body.esv-mobile-journey .esv-updates-overview-section-head { flex-wrap:wrap !important; gap:4px 12px !important; }
  body.esv-mobile-journey .esv-overview-all-link,
  body.esv-mobile-journey .wp-block-post-excerpt__more-link {
    display:inline-flex; align-items:center; min-height:44px; line-height:1.4;
  }
  body.esv-mobile-journey :is(.esv-event-compact-body,.esv-event-overview-body) { min-width:0; overflow-wrap:anywhere; }
  body.esv-mobile-journey .esv-updates-overview-events .esv-event-compact-image-link { width:calc(100% + 40px); max-width:none; }
  body.esv-mobile-journey .esv-webform :is(input[type="date"],select) { min-width:0 !important; }
  body.esv-mobile-journey .esv-webform .esv-form-submit { width:100%; }
  body.esv-mobile-journey :is(.esv-form-notice,.esv-field-error) { scroll-margin-top:90px; overflow-wrap:anywhere; }
  body.esv-mobile-journey .esv-contact-meta a { max-width:100%; }
}
@media (max-width:620px) {
  body.esv-mobile-journey :is(.esv-updates-overview-news,.esv-updates-overview-events) {
    padding:12px !important; border-radius:14px;
  }
  body.esv-mobile-journey :is(.esv-overview-news-card,.esv-news-card) > :is(.esv-overview-news-body,.esv-news-card-body),
  body.esv-mobile-journey .esv-updates-overview-events .esv-event-overview-body { padding:16px !important; }
  body.esv-mobile-journey .esv-updates-overview-events .esv-event-compact-image-link { width:calc(100% + 32px); }
  body.esv-mobile-journey .esv-webform-wrap { padding:18px 12px !important; }
  /* Keep the full picture width; place gallery buttons on a separate row. */
  .esv-lightbox { padding:12px; padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)); box-sizing:border-box; }
  .esv-lightbox-dialog {
    width:100%; height:calc(100vh - 24px);
    height:calc(100dvh - max(12px,env(safe-area-inset-top)) - max(12px,env(safe-area-inset-bottom)));
    grid-template-columns:48px minmax(0,1fr) 48px;
    grid-template-rows:48px minmax(0,1fr) 48px; gap:10px;
  }
  .esv-lightbox-close { position:static; grid-column:3; grid-row:1; width:48px; height:48px; }
  .esv-lightbox-figure { grid-column:1 / -1; grid-row:2; height:100%; overflow:hidden; }
  .esv-lightbox-image { min-height:0; max-height:100%; flex:0 1 auto; object-fit:contain; }
  .esv-lightbox-caption { flex:0 0 auto; max-height:25%; overflow-y:auto; margin-top:8px; font-size:.9rem; overflow-wrap:anywhere; }
  .esv-lightbox-prev { grid-column:1; grid-row:3; }
  .esv-lightbox-next { grid-column:3; grid-row:3; }
  .esv-lightbox-nav { width:48px; height:48px; }
  .esv-lightbox-counter { grid-column:2; grid-row:3; align-self:center; }
}
@media (max-width:360px) {
  body.esv-mobile-journey .esv-mobile-menu-actions { grid-template-columns:minmax(0,1fr) !important; }
  body.esv-mobile-journey .esv-contact-card { grid-template-columns:44px minmax(0,1fr) !important; gap:10px !important; padding:14px !important; }
  body.esv-mobile-journey .esv-contact-card :is(.esv-contact-photo-wrap,.esv-contact-photo) { width:44px !important; height:44px !important; }
}
