.wp-block-ionso-authenticity-steps {
  --auth-surface: #ffffff;
  --auth-border: rgba(14, 14, 14, 0.12);
  --auth-accent: var(--nostalg-black, #0e0e0e);
  --auth-muted: rgba(14, 14, 14, 0.65);
  --auth-highlight: var(--nostalg-primary, #d4af37);
  padding: clamp(3rem, 6vw, 4.25rem) clamp(1.5rem, 6vw, 4rem);
  background: var(--auth-surface);
  border: none;
  box-shadow: 0 24px 48px rgba(12, 22, 32, 0.08);
  position: relative;
}

.wp-block-ionso-authenticity-steps.wp-block-group.is-layout-constrained.alignwide {
  --auth-viewport-unit: 100vh;
  --auth-viewport-max: min(var(--auth-viewport-unit), 56rem);
  --auth-viewport-frame: clamp(9rem, 22vh, 12rem);
  --auth-viewport-body-min: clamp(18rem, 38vh, 26rem);
  --auth-viewport-body-max: max(
    var(--auth-viewport-body-min),
    calc(var(--auth-viewport-max) - var(--auth-viewport-frame))
  );
  max-height: var(--auth-viewport-max);
  overflow: hidden;
}

@supports (height: 100svh) {
  .wp-block-ionso-authenticity-steps.wp-block-group.is-layout-constrained.alignwide {
    --auth-viewport-unit: 100svh;
  }
}

.wp-block-ionso-authenticity-steps.wp-block-group.is-layout-constrained.alignwide
  .wp-block-group__inner-container {
  display: grid;
  grid-template-rows: auto minmax(var(--auth-viewport-body-min), 1fr) auto;
  height: 100%;
  gap: clamp(1.5rem, 3vh, 2.25rem);
}

.wp-block-ionso-authenticity-steps.wp-block-group.is-layout-constrained.alignwide
  .ionso-auth-body {
  min-height: var(--auth-viewport-body-min);
  height: min(var(--auth-viewport-body-max), clamp(360px, 70vw, 520px));
  max-height: var(--auth-viewport-body-max);
}

.wp-block-ionso-authenticity-steps.wp-block-group.is-layout-constrained.alignwide
  .ionso-auth-body
  .swiper-wrapper {
  height: 100%;
}

.wp-block-ionso-authenticity-steps.wp-block-group.is-layout-constrained.alignwide
  .swiper-slide.ionso-auth-item {
  height: 100%;
  min-height: 0;
}

.wp-block-ionso-authenticity-steps.wp-block-group.is-layout-constrained.alignwide
  .ionso-auth-content {
  max-height: 100%;
  overflow-y: auto;
  scrollbar-gutter: stable both-edges;
}

.wp-block-ionso-authenticity-steps .wp-block-group__inner-container {
  max-width: min(1140px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 5vw, 2.75rem);
}

.wp-block-ionso-authenticity-steps .ionso-auth-header {
  text-align: center;
  display: grid;
  gap: 0.75rem;
}

.wp-block-ionso-authenticity-steps .ionso-auth-title {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.75rem);
}

.wp-block-ionso-authenticity-steps .ionso-auth-lead {
  margin: 0 auto;
  max-width: min(90%, 620px);
  color: var(--auth-muted);
}

.wp-block-ionso-authenticity-steps .ionso-auth-body {
  position: relative;
  min-height: clamp(360px, 70vw, 520px);
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

.wp-block-ionso-authenticity-steps .ionso-auth-body .swiper-wrapper {
  align-items: stretch;
}

.wp-block-ionso-authenticity-steps .swiper-slide.ionso-auth-item {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(1.5rem, 5vw, 2.75rem);
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  box-shadow: 0 18px 32px rgba(12, 22, 32, 0.14);
  padding: clamp(1.75rem, 5vw, 2.75rem);
  align-items: stretch;
  height: auto;
  opacity: 0;
  pointer-events: none;
  transform: translateY(24px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.wp-block-ionso-authenticity-steps .swiper-slide.ionso-auth-item.is-active,
.wp-block-ionso-authenticity-steps .swiper-slide.ionso-auth-item.swiper-slide-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.wp-block-ionso-authenticity-steps .ionso-auth-media {
  border: 1px solid rgba(14, 14, 14, 0.08);
  overflow: hidden;
}

.wp-block-ionso-authenticity-steps .ionso-auth-media figure {
  margin: 0;
  height: 100%;
}

.wp-block-ionso-authenticity-steps .ionso-auth-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wp-block-ionso-authenticity-steps .ionso-auth-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(0.75rem, 3vw, 1.25rem);
  max-width: 520px;
}

.wp-block-ionso-authenticity-steps .ionso-auth-number {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--auth-highlight);
}

.wp-block-ionso-authenticity-steps .ionso-auth-headline {
  margin: 0;
  font-size: clamp(1.85rem, 4vw, 2.4rem);
  line-height: 1.1;
}

.wp-block-ionso-authenticity-steps .ionso-auth-copy {
  margin: 0;
  color: var(--auth-muted);
}

.wp-block-ionso-authenticity-steps .ionso-auth-navigation {
  margin-top: clamp(2rem, 5vw, 2.6rem);
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
  justify-content: space-between;
}

.wp-block-ionso-authenticity-steps .ionso-auth-stepper {
  display: flex;
  gap: clamp(0.6rem, 2vw, 1rem);
  flex: 1 1 auto;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scrollbar-width: thin;
}

.wp-block-ionso-authenticity-steps .ionso-auth-stepper::-webkit-scrollbar {
  height: 4px;
}

.wp-block-ionso-authenticity-steps .ionso-auth-stepper::-webkit-scrollbar-thumb {
  background: rgba(14, 14, 14, 0.2);
}

.wp-block-ionso-authenticity-steps .ionso-auth-stepper-button {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--auth-border) !important;
  background: transparent !important;
  color: var(--auth-accent) !important;
  padding: 0.65rem 1.4rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.wp-block-ionso-authenticity-steps .ionso-auth-stepper-number {
  font-size: 0.75rem;
  letter-spacing: 0.32em;
  color: inherit;
}

.wp-block-ionso-authenticity-steps .ionso-auth-stepper-button.is-active {
  background: var(--auth-accent) !important;
  border-color: var(--auth-accent) !important;
  color: #fff !important;
}

.wp-block-ionso-authenticity-steps .ionso-auth-stepper-button:focus-visible {
  outline: 3px solid var(--auth-highlight);
  outline-offset: 2px;
}

.wp-block-ionso-authenticity-steps .ionso-auth-controls {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.wp-block-ionso-authenticity-steps .ionso-auth-control {
  width: 48px;
  height: 48px;
  border: 1px solid var(--auth-accent) !important;
  background: var(--auth-accent) !important;
  color: #fff !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.wp-block-ionso-authenticity-steps .ionso-auth-control.swiper-button-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.wp-block-ionso-authenticity-steps .ionso-auth-control:hover,
.wp-block-ionso-authenticity-steps .ionso-auth-control:focus-visible {
  background: var(--auth-highlight) !important;
  border-color: var(--auth-highlight) !important;
  outline: none;
}

.wp-block-ionso-authenticity-steps .ionso-auth-control-icon {
  position: relative;
  width: 16px;
  height: 16px;
  display: inline-block;
}

.wp-block-ionso-authenticity-steps .ionso-auth-control-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0.75rem;
  height: 0.75rem;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

.wp-block-ionso-authenticity-steps .ionso-auth-control-prev .ionso-auth-control-icon::before {
  transform: rotate(225deg);
}

@media (max-width: 1024px) {
  .wp-block-ionso-authenticity-steps {
    padding: clamp(2.4rem, 8vw, 3.2rem) clamp(1.25rem, 6vw, 2.5rem);
  }

  .wp-block-ionso-authenticity-steps .ionso-auth-item {
    grid-template-columns: 1fr;
  }

  .wp-block-ionso-authenticity-steps .ionso-auth-media {
    max-height: 420px;
  }

  .wp-block-ionso-authenticity-steps .ionso-auth-navigation {
    flex-direction: column;
    align-items: stretch;
  }

  .wp-block-ionso-authenticity-steps .ionso-auth-controls {
    justify-content: flex-end;
  }
}

@media (max-width: 640px) {
  .wp-block-ionso-authenticity-steps {
    padding: clamp(2rem, 9vw, 2.5rem) clamp(1rem, 7vw, 1.75rem);
  }

  .wp-block-ionso-authenticity-steps .swiper-slide.ionso-auth-item {
    display: flex;
    flex-direction: column;
    gap: clamp(1.1rem, 6vw, 1.5rem);
    padding: clamp(1.5rem, 8vw, 1.9rem);
  }

  .wp-block-ionso-authenticity-steps .ionso-auth-stepper-button {
    padding: 0.6rem 1rem;
    gap: 0.5rem;
  }

  .wp-block-ionso-authenticity-steps .ionso-auth-media {
    order: 2;
    max-height: 320px;
    border-radius: 12px;
  }

  .wp-block-ionso-authenticity-steps .ionso-auth-stepper {
    overflow-x: visible;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  .wp-block-ionso-authenticity-steps .ionso-auth-stepper-button {
    flex: 1 1 calc(50% - 0.5rem);
    justify-content: center;
    text-align: center;
  }

  .wp-block-ionso-authenticity-steps .ionso-auth-controls {
    justify-content: center;
  }

  .wp-block-ionso-authenticity-steps .ionso-auth-content {
    order: 1;
    max-width: 100%;
    text-align: left;
  }

  .wp-block-ionso-authenticity-steps .ionso-auth-headline {
    font-size: clamp(1.6rem, 6vw, 1.9rem);
  }

  .wp-block-ionso-authenticity-steps .ionso-auth-copy {
    line-height: 1.65;
  }
}

@media (max-height: 860px) {
  .wp-block-ionso-authenticity-steps.wp-block-group.is-layout-constrained.alignwide {
    --auth-viewport-frame: clamp(7.5rem, 18vh, 10rem);
    --auth-viewport-body-min: clamp(17rem, 36vh, 24rem);
    padding: clamp(2.4rem, 5vh, 3.25rem) clamp(1.25rem, 5vw, 3rem);
  }

  .wp-block-ionso-authenticity-steps.wp-block-group.is-layout-constrained.alignwide
    .wp-block-group__inner-container {
    gap: clamp(1.25rem, 2.5vh, 2rem);
  }

  .wp-block-ionso-authenticity-steps.wp-block-group.is-layout-constrained.alignwide
    .ionso-auth-title {
    font-size: clamp(1.65rem, 4vw, 2.2rem);
  }

  .wp-block-ionso-authenticity-steps.wp-block-group.is-layout-constrained.alignwide
    .ionso-auth-navigation {
    margin-top: clamp(1.15rem, 2.5vh, 1.75rem);
  }
}

@media (max-height: 720px) {
  .wp-block-ionso-authenticity-steps.wp-block-group.is-layout-constrained.alignwide {
    --auth-viewport-frame: clamp(6.5rem, 16vh, 8.5rem);
    --auth-viewport-body-min: clamp(16rem, 34vh, 22rem);
    padding: clamp(2rem, 5vh, 2.75rem) clamp(1rem, 4vw, 2.5rem);
  }

  .wp-block-ionso-authenticity-steps.wp-block-group.is-layout-constrained.alignwide
    .ionso-auth-navigation {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .wp-block-ionso-authenticity-steps.wp-block-group.is-layout-constrained.alignwide
    .ionso-auth-controls {
    justify-content: flex-end;
  }
}

/* Block editor preview ---------------------------------------------------- */
.ionso-auth-steps-editor {
  display: grid;
  gap: 1.5rem;
}

.ionso-auth-steps-editor__item {
  border: 1px solid rgba(14, 14, 14, 0.12);
  border-radius: 4px;
  padding: 1rem;
  background: #fff;
  display: grid;
  gap: 1rem;
}

.ionso-auth-steps-editor__toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.ionso-auth-steps-editor__actions {
  display: inline-flex;
  gap: 0.25rem;
}

.ionso-auth-steps-editor__media {
  display: block;
  width: 100%;
  padding: 0.75rem;
  border: 1px dashed rgba(14, 14, 14, 0.3);
  border-radius: 4px;
  background: #f9f9f9;
  text-align: center;
  cursor: pointer;
}

.ionso-auth-steps-editor__media img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
