/**
 * Neravo Joomla integration
 * Keeps Joomla/Payo Builder wrapper output neutral while the original Neravo
 * component classes remain the visual source of truth.
 */

html,
body {
  min-height: 100%;
}

body > .alert,
body > .joomla-alert,
.stage > .alert,
.workspace-scroll > .alert {
  position: relative;
  z-index: 20;
}

.stage > .payo-builder-page,
.workspace-scroll > .payo-builder-page {
  display: contents;
}

.neravo-stage-fallback .hero-copy {
  pointer-events: none;
}

.neravo-component-view {
  margin: 0;
  background: var(--bg, #080908);
  color: var(--text, #f2f3ec);
}

.neravo-error {
  overflow: auto;
}

.neravo-error-page {
  width: min(920px, calc(100% - 40px));
  min-height: 100svh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 18px;
}

.neravo-error-page > span {
  color: var(--accent);
  font: 500 12px/1 var(--font-mono);
  letter-spacing: .14em;
}

.neravo-error-page h1 {
  margin: 0;
  max-width: 800px;
  font: 700 clamp(54px, 9vw, 120px)/.9 var(--font-display);
  letter-spacing: -.06em;
}

.neravo-error-page p {
  max-width: 620px;
  margin: 0 0 10px;
  color: var(--muted);
}

/* Joomla menu links use anchors; the original HTML submenu used buttons. */
.nav-dropdown-menu > a {
  width: 100%;
  text-decoration: none;
}

/* The Builder is allowed to add focus/editor attributes without changing geometry. */
.payo-builder-page [data-payo-node-id] {
  min-width: 0;
}

@media (max-width: 900px) {
  .neravo-error-page {
    width: min(100% - 32px, 760px);
  }
}

/* Neravo 1.1.19 — accessible workspace title when Joomla Show Title is disabled. */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Neravo 1.1.19 — native Joomla responsive safety. */
.neravo-component-view,
.neravo-component-view main,
.neravo-component-view .com-content-article,
.neravo-component-view .blog,
.neravo-component-view .blog-items,
.neravo-component-view .category-list {
  min-width: 0;
  max-width: 100%;
}

.neravo-component-view :is(img,video,svg,canvas,iframe,embed,object) {
  max-width: 100%;
}

.neravo-component-view :is(h1,h2,h3,h4,h5,h6,p,li,a,dd,dt,code) {
  max-width: 100%;
  overflow-wrap: break-word;
}

.neravo-component-view :is(a,code) {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.neravo-component-view :is(input,select,textarea,button) {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 480px) {
  .neravo-error-page {
    width: calc(100% - 32px);
  }
  .neravo-error-page h1 {
    font-size: clamp(46px,17vw,72px);
    overflow-wrap: break-word;
  }
}

/* Neravo 1.1.20 — native Joomla narrow-content contract. */
@media (max-width: 900px) {
  .neravo-component-view :is(main,.com-content-article,.blog,.blog-items,.category-list) {
    min-width: 0;
    max-width: 100%;
  }

  .neravo-component-view :is(h1,h2,h3,h4,h5,h6) {
    width: 100%;
    max-width: 100%;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .neravo-component-view :is(table,pre) {
    max-width: 100%;
  }

  .neravo-component-view table {
    width: 100%;
    table-layout: fixed;
  }

  .neravo-component-view :is(th,td,pre) {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}
