/* POL.FAN | M5 EVENTS mobile polish V3 2026-11-28.
 * Appends AFTER existing V5 artwork CSS. Preserves native links, forms and AJAX.
 * Only home view; no intervention in event create/detail/admin.
 */
@media (max-width: 760px) {
  /* The PNG contains its own '+ Dodaj wydarzenie'. Do not reserve space
     for a SECOND, HTML-based button underneath the PNG. */
  html body .m5e-home.m5hero-neon header.m5e-head.m5e-showcase:not(.m5hero-artwork-failed-v3) {
    display: block !important;
    box-sizing: border-box !important;
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    margin: 0 0 14px !important;
    padding: 0 !important;
    gap: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    border-radius: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    flex-wrap: nowrap !important;
    isolation: auto !important;
  }
  html body .m5e-home.m5hero-neon header.m5e-head.m5e-showcase:not(.m5hero-artwork-failed-v3)::before,
  html body .m5e-home.m5hero-neon header.m5e-head.m5e-showcase:not(.m5hero-artwork-failed-v3)::after {
    content: none !important;
    display: none !important;
  }
  html body .m5e-home.m5hero-neon header.m5e-head.m5e-showcase:not(.m5hero-artwork-failed-v3) > img.m5hero-artwork-img-v3 {
    display: block !important;
    box-sizing: border-box !important;
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    object-fit: contain !important;
    transform: none !important;
    border: 0 !important;
    outline: 0 !important;
    border-radius: 14px !important;
    pointer-events: none !important;
    z-index: 3 !important;
    vertical-align: middle !important;
    box-shadow: 0 4px 14px rgba(39,14,76,.12) !important;
  }
  html body .m5e-home.m5hero-neon header.m5e-head.m5e-showcase:not(.m5hero-artwork-failed-v3) > img.m5hero-artwork-img-v3[hidden] {
    display: none !important;
  }
  /* All legacy headline/artwork labels are still present for the fallback
     state; when PNG has loaded, they must not paint over the graphic. */
  html body .m5e-home.m5hero-neon header.m5e-head.m5e-showcase:not(.m5hero-artwork-failed-v3) > div {
    position: absolute !important;
    inset: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
  }
  /* One real accessible link, invisibly overlaying the button in the PNG. */
  html body .m5e-home.m5hero-neon header.m5e-head.m5e-showcase:not(.m5hero-artwork-failed-v3) > a.m5e-primary {
    display: block !important;
    position: absolute !important;
    z-index: 10 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: 25% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    opacity: 1 !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-decoration: none !important;
    text-shadow: none !important;
    pointer-events: auto !important;
  }
  html body .m5e-home.m5hero-neon header.m5e-head.m5e-showcase:not(.m5hero-artwork-failed-v3) > a.m5e-primary:focus-visible {
    outline: 3px solid #fff !important;
    outline-offset: -3px !important;
    box-shadow: inset 0 0 0 5px #8e36de !important;
  }
  /* Place the two location filters side by side; submit below them.
     Covers the existing events-home form while excluding create/edit forms. */
  html body .m5e-home.m5hero-neon form:has(select):not(:has(textarea)) {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    align-items: end !important;
    column-gap: 9px !important;
    row-gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 14px !important;
    margin-bottom: 14px !important;
  }
  html body .m5e-home.m5hero-neon form:has(select):not(:has(textarea)) > :has(select) {
    box-sizing: border-box !important;
    grid-column: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
  }
  html body .m5e-home.m5hero-neon form:has(select):not(:has(textarea)) label {
    box-sizing: border-box !important;
    min-width: 0 !important;
    font-size: 12px !important;
    font-weight: 750 !important;
    color: #2f214d !important;
  }
  html body .m5e-home.m5hero-neon form:has(select):not(:has(textarea)) > :is(button, input[type="submit"]) {
    grid-column: 1 / -1 !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
  /* Proper touch targets and consistent purple controls in event listing. */
  html body .m5e-home.m5hero-neon form:has(select) :is(button[type="submit"], button:not([type]), input[type="submit"]) {
    box-sizing: border-box !important;
    width: 100% !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 10px 14px !important;
    border: 0 !important;
    border-radius: 12px !important;
    color: #fff !important;
    background: linear-gradient(110deg,#c02aeb,#7133db) !important;
    box-shadow: 0 5px 13px rgba(95,42,171,.13) !important;
    font-weight: 850 !important;
    font-size: 14px !important;
    text-align: center !important;
  }
  html body .m5e-home.m5hero-neon form:has(select) select {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    font-size: 13px !important;
    border-radius: 11px !important;
    border-color: #d3c4ea !important;
    color: #302251 !important;
  }
  html body .m5e-home.m5hero-neon .m5e-event-status-tabs {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: 8px !important;
    margin: 12px 0 16px !important;
    padding: 0 !important;
  }
  html body .m5e-home.m5hero-neon .m5e-event-status-tabs a {
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    min-height: 44px !important;
    min-width: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 10px 8px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    font-weight: 850 !important;
  }
}
