/* =====================================================
   BISECT — SPLIT CONTENT IMAGE BOX SLIDER
   Scoped to .mas-bs-wrap.

   Every Style-tab control targets the Elementor wrapper PLUS .mas-bs-wrap —
   exactly one class more specific than the base rules below — so an Elementor
   value always wins regardless of stylesheet order. Never raise the specificity
   of the rules here, or the Style tab stops taking effect.
===================================================== */

.mas-bs-wrap *,
.mas-bs-wrap *::before,
.mas-bs-wrap *::after {
  box-sizing: border-box;
}

.mas-bs-wrap {
  /* Values the Style tab drives. Anything a control can set through a plain
     property lives on the rule itself instead — these are only the ones CSS
     needs to reuse in more than one place, or that feed a calc(). */
  --mas-bs-line: rgba(27, 26, 25, 0.14);
  --mas-bs-line-w: 1px;
  --mas-bs-rose: #a32546;
  --mas-bs-dur: 900ms;
  --mas-bs-plate-ratio: 1.05;
  --mas-bs-plate-zoom: 1.06;
  --mas-bs-plate-dur: 1400ms;
  --mas-bs-gauge-w: 2px;
  --mas-bs-icon-size: 14px;
  --mas-bs-icon-gap: 10px;
  --mas-bs-arrow-icon: 17px;
  --mas-bs-ease: cubic-bezier(0.76, 0, 0.24, 1);

  color: #1b1a19;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Flex, not grid: the split ratio is a control-driven custom property, and a
   bare number is only valid as a flex-grow — `minmax(0, var(--ratio))` has no
   `fr` unit, which invalidates the whole grid-template-columns declaration and
   silently collapses the spread to one column. */
.mas-bs-wrap .mas-bs-spread {
  position: relative;
  height: clamp(520px, 86vh, 900px);
  display: flex;
  align-items: stretch;
}

.mas-bs-wrap .mas-bs-prose-side {
  flex: 1 1 0;
  min-width: 0;
}

.mas-bs-wrap .mas-bs-plate-side {
  flex: var(--mas-bs-plate-ratio) 1 0;
  min-width: 0;
}

/* ---------- left: text, travels up ---------- */

.mas-bs-wrap .mas-bs-prose-side {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #f7f6f4;
  border-right: var(--mas-bs-line-w) solid var(--mas-bs-line);
}

.mas-bs-wrap .mas-bs-prose-window {
  position: relative;
  flex: 1;
  overflow: hidden;
}

/* A flex column of full-height items. The original positioned each item with
   an inline `top` written by JS; a flex basis of 100% produces the identical
   stack with no scripted layout, so nothing flashes before JS runs. */
.mas-bs-wrap .mas-bs-prose-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform var(--mas-bs-dur) var(--mas-bs-ease);
  will-change: transform;
}

.mas-bs-wrap .mas-bs-prose-item {
  flex: 0 0 100%;
  height: 100%;
  padding: clamp(28px, 5vw, 64px) clamp(24px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.mas-bs-wrap .mas-bs-issue {
  display: block;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mas-bs-rose);
}

.mas-bs-wrap .mas-bs-title {
  display: block;
  font-family: Newsreader, Georgia, "Times New Roman", serif;
  margin: 0;
  font-size: clamp(1.9rem, 4.2vw, 3.05rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.06;
  /* The measure. Content Width overrides both this and the copy's below by
     setting --mas-bs-measure; empty keeps the design's own character counts. */
  max-width: var(--mas-bs-measure, 20ch);
  text-wrap: balance;
  color: #1b1a19;
}

.mas-bs-wrap .mas-bs-title-accent {
  font-style: italic;
  line-height: 1.14;
  padding-bottom: 0.06em;
  display: inline-block;
}

.mas-bs-wrap .mas-bs-copy {
  display: block;
  margin: 0;
  color: #5c5a57;
  max-width: var(--mas-bs-measure, 52ch);
  font-size: 1rem;
  line-height: 1.7;
}

.mas-bs-wrap .mas-bs-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  color: #5c5a57;
  margin-top: 4px;
}

.mas-bs-wrap .mas-bs-byline-name {
  color: #1b1a19;
  font-weight: 600;
}

.mas-bs-wrap .mas-bs-byline-rule {
  display: block;
  width: 22px;
  height: 1px;
  flex: none;
  background: var(--mas-bs-line);
  font-style: normal;
}

.mas-bs-wrap .mas-bs-read {
  align-self: flex-start;
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: var(--mas-bs-icon-gap);
  font-size: 0.84rem;
  font-weight: 600;
  color: #f7f6f4;
  background: #1b1a19;
  border: 0 solid transparent;
  text-decoration: none;
  padding: 13px 24px;
  border-radius: 999px;
  transition:
    background 220ms var(--mas-bs-ease),
    color 220ms var(--mas-bs-ease),
    border-color 220ms var(--mas-bs-ease),
    transform 140ms var(--mas-bs-ease);
}

/* Literal, not the accent variable: Button Background Hover is a control with
   a real default, so its emitted rule would win here anyway and the variable
   would read as dead. The accent governs only what no control overrides —
   the issue label, the progress rail and the focus rings. */
.mas-bs-wrap .mas-bs-read:hover {
  background: #a32546;
}

.mas-bs-wrap .mas-bs-read:active {
  transform: translateY(1px);
}

.mas-bs-wrap .mas-bs-read:focus-visible {
  outline: 2px solid var(--mas-bs-rose);
  outline-offset: 3px;
}

.mas-bs-wrap .mas-bs-read-icon {
  display: inline-flex;
  align-items: center;
  flex: none;
  transition: transform 220ms var(--mas-bs-ease);
}

.mas-bs-wrap .mas-bs-read-icon i,
.mas-bs-wrap .mas-bs-read-icon img,
.mas-bs-wrap .mas-bs-read-icon svg {
  width: var(--mas-bs-icon-size);
  height: var(--mas-bs-icon-size);
  font-size: var(--mas-bs-icon-size);
  line-height: 1;
  display: block;
}

/* ---------- right: image, travels down ---------- */

.mas-bs-wrap .mas-bs-plate-side {
  position: relative;
  overflow: hidden;
  background: #ecebe7;
}

/* column-reverse anchored to the bottom lays the items out upward, which is
   the mirror of the prose column — so translating this track DOWN by the same
   amount moves the two halves against each other. */
.mas-bs-wrap .mas-bs-plate-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  display: flex;
  flex-direction: column-reverse;
  transition: transform var(--mas-bs-dur) var(--mas-bs-ease);
  will-change: transform;
}

.mas-bs-wrap .mas-bs-plate-item {
  flex: 0 0 100%;
  height: 100%;
  overflow: hidden;
}

.mas-bs-wrap .mas-bs-plate-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(var(--mas-bs-plate-zoom));
  transition: transform var(--mas-bs-plate-dur) var(--mas-bs-ease);
}

.mas-bs-wrap .mas-bs-plate-item[data-active="true"] .mas-bs-plate-img {
  transform: scale(1);
}

/* ---------- controls, straddling the seam ---------- */

.mas-bs-wrap .mas-bs-seam {
  position: absolute;
  z-index: 6;
  left: clamp(24px, 4vw, 56px);
  bottom: clamp(24px, 4vw, 44px);
  display: flex;
  align-items: center;
  gap: 10px;
}

.mas-bs-wrap .mas-bs-nav {
  width: 52px;
  height: 52px;
  padding: 0;
  display: grid;
  place-items: center;
  background: #f7f6f4;
  color: #1b1a19;
  border: 1px solid var(--mas-bs-line);
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 220ms var(--mas-bs-ease),
    color 220ms var(--mas-bs-ease),
    border-color 220ms var(--mas-bs-ease),
    transform 140ms var(--mas-bs-ease);
}

.mas-bs-wrap .mas-bs-nav:hover {
  background: #1b1a19;
  color: #f7f6f4;
}

.mas-bs-wrap .mas-bs-nav:active {
  transform: scale(0.94);
}

.mas-bs-wrap .mas-bs-nav:focus-visible {
  outline: 2px solid var(--mas-bs-rose);
  outline-offset: 3px;
}

.mas-bs-wrap .mas-bs-nav[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

.mas-bs-wrap .mas-bs-nav[disabled]:hover {
  background: #f7f6f4;
  color: #1b1a19;
}

.mas-bs-wrap .mas-bs-nav i,
.mas-bs-wrap .mas-bs-nav img,
.mas-bs-wrap .mas-bs-nav svg {
  width: var(--mas-bs-arrow-icon);
  height: var(--mas-bs-arrow-icon);
  font-size: var(--mas-bs-arrow-icon);
  line-height: 1;
  display: block;
}

.mas-bs-wrap .mas-bs-pager {
  margin-left: 8px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: #5c5a57;
}

.mas-bs-wrap .mas-bs-cur {
  color: #1b1a19;
  font-weight: 500;
}

/* Vertical progress on the seam itself, centred on the divider. */
.mas-bs-wrap .mas-bs-gauge {
  position: absolute;
  z-index: 6;
  top: 0;
  bottom: 0;
  left: calc(100% - (var(--mas-bs-gauge-w) / 2));
  width: var(--mas-bs-gauge-w);
  background: transparent;
}

.mas-bs-wrap .mas-bs-gauge-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--mas-bs-rose);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--mas-bs-dur) var(--mas-bs-ease);
}

.mas-bs-wrap .mas-bs-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- modifier classes ----------
   Enum and toggle controls arrive as wrapper classes, never raw CSS values, so
   an unrecognised value matches nothing and the base design stands. None of
   these set a property a Style control owns — that would tie on specificity
   and beat the control. */

.mas-bs-wrap.mas-bs-valign-top .mas-bs-prose-item {
  justify-content: flex-start;
}

.mas-bs-wrap.mas-bs-valign-center .mas-bs-prose-item {
  justify-content: center;
}

.mas-bs-wrap.mas-bs-icon-left .mas-bs-read {
  flex-direction: row-reverse;
}

.mas-bs-wrap:not(.mas-bs-gauge-yes) .mas-bs-gauge {
  display: none;
}

.mas-bs-wrap:not(.mas-bs-arrows-yes) .mas-bs-nav {
  display: none;
}

.mas-bs-wrap:not(.mas-bs-pager-yes) .mas-bs-pager {
  display: none;
}

.mas-bs-wrap:not(.mas-bs-byline-yes) .mas-bs-byline {
  display: none;
}

/* Hiding every child of the seam should take the seam with it. */
.mas-bs-wrap:not(.mas-bs-arrows-yes):not(.mas-bs-pager-yes) .mas-bs-seam {
  display: none;
}

/* ---------- button icon hover effects ---------- */

.mas-bs-wrap.mas-bs-fx-slide .mas-bs-read:hover .mas-bs-read-icon {
  transform: translateX(4px);
}

.mas-bs-wrap.mas-bs-fx-slide.mas-bs-icon-left .mas-bs-read:hover .mas-bs-read-icon {
  transform: translateX(-4px);
}

.mas-bs-wrap.mas-bs-fx-rotate .mas-bs-read:hover .mas-bs-read-icon {
  transform: rotate(45deg);
}

.mas-bs-wrap.mas-bs-fx-scale .mas-bs-read:hover .mas-bs-read-icon {
  transform: scale(1.2);
}

.mas-bs-wrap.mas-bs-fx-bounce .mas-bs-read:hover .mas-bs-read-icon {
  animation: mas-bs-bounce 620ms var(--mas-bs-ease);
}

@keyframes mas-bs-bounce {
  0%,
  100% {
    transform: translateX(0);
  }
  40% {
    transform: translateX(5px);
  }
  70% {
    transform: translateX(-2px);
  }
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .mas-bs-wrap .mas-bs-spread {
    flex-direction: column;
  }

  .mas-bs-wrap .mas-bs-prose-side {
    order: 2;
    flex: 1 1 auto;
    border-right: 0;
    border-top: var(--mas-bs-line-w) solid var(--mas-bs-line);
  }

  .mas-bs-wrap .mas-bs-plate-side {
    order: 1;
    flex: 0 0 46%;
  }

  .mas-bs-wrap .mas-bs-prose-item {
    padding: 24px;
    justify-content: flex-start;
    gap: 12px;
  }

  .mas-bs-wrap .mas-bs-title {
    font-size: clamp(1.55rem, 7vw, 2.1rem);
  }

  .mas-bs-wrap .mas-bs-copy {
    font-size: 0.92rem;
  }

  .mas-bs-wrap .mas-bs-seam {
    bottom: 16px;
    left: 24px;
  }

  .mas-bs-wrap .mas-bs-nav {
    width: 46px;
    height: 46px;
  }

  .mas-bs-wrap .mas-bs-gauge {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mas-bs-wrap .mas-bs-prose-track,
  .mas-bs-wrap .mas-bs-plate-track,
  .mas-bs-wrap .mas-bs-plate-img,
  .mas-bs-wrap .mas-bs-gauge-fill,
  .mas-bs-wrap .mas-bs-read-icon {
    transition-duration: 1ms !important;
    animation: none !important;
  }
}

/* Digife: su telefono il testo è più alto del pannello e il pulsante finiva sotto le frecce. */
@media (max-width: 900px) {
  .mas-bs-wrap .mas-bs-spread{height:clamp(720px,100svh,900px)}
  .mas-bs-wrap .mas-bs-plate-side{flex:0 0 38%}
  .mas-bs-wrap .mas-bs-prose-item{padding-bottom:88px}
}
