/**
 * Smort Media Text Block Styles
 */
.smort-media-text {
  &.media-left .smort-media-text-inner {
    flex-direction: row;
  }

  &.media-right .smort-media-text-inner {
    flex-direction: row-reverse;
  }
}
.smort-media-text-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  position: relative;

  & > * {
    flex: 1;
    min-width: 0;
  }

  /* Vertikal divider mellan kolumnerna */
  &::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: rgba(0, 0, 0, 0.05);
    transform: translateX(-50%);
    z-index: 1;
  }

  /* Horisontell divider top */
  &::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background-color: rgba(0, 0, 0, 0.05);
    z-index: 1;
  }
}

.smort-media-text {
  padding-top: 0;
  padding-bottom: 0;
}

.smort-media-text + .smort-media-text {
  padding-top: 0;
}
.smort-media-text.media-left .smort-media-text-inner {
  .smort-media-text-media {
    order: -1;
  }
}

.smort-media-text.media-right .smort-media-text-inner {
  .smort-media-text-media {
    order: 1;
  }
}

.smort-media-text-media {
  overflow: hidden;
  position: relative;
  padding: var(--space-12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.smort-media-text-image,
.smort-media-text-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.smort-media-text-inner {
  flex: 1;
  min-width: 0;
}
.smort-media-text.media-left {
  .smort-media-text-content {
    &.text-white a {
      color: var(--secondary-color);
    }
  }
}

.smort-media-text-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  padding: var(--space-12);
  height: 100%;
  gap: 0;

  &.text-black {
    p,
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
      color: var(--black);
    }
    a:not(.button) {
      color: var(--accent-color) !important;
    }
  }
  &.text-white {
    p,
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
      color: var(--white);
    }
    a:not(.button) {
      color: var(--secondary-color) !important;
    }
  }
}

.smort-media-text-subtitle {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
  margin: 0;
  padding-top: var(--space-4);
}

.smort-media-text-content-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: var(--space-4);
}

.smort-media-text-content h2,
.smort-media-text-content h3 {
  font-family: var(--font-heading);
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 1.1;
}

.smort-media-text-content p {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.6;
  max-width: 80%;
}

/* Responsive styles */
@media (width <= 768px) {
  .smort-media-text-inner {
    display: grid;

    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    flex-direction: column !important;
    padding-block: var(--space-6);
    .smort-media-text-media {
      max-height: 50vh;
    }
    .smort-media-text-content {
      padding: var(--space-8) var(--space-4);
      margin: 0;
    }
  }
  .smort-media-text.media-left .smort-media-text-content,
  .smort-media-text.media-right .smort-media-text-content {
    padding: var(--space-6) 0;
  }

  .smort-media-text.media-right .smort-media-text-inner {
    .smort-media-text-media {
      order: 0;
    }
  }
}

.smort-media-text-cta-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: var(--space-4);

  .button {
    min-width: 170px;
  }
}

/* Responsive styles */
@media (width <= 768px) {
  .smort-media-text-inner {
    grid-template-columns: 1fr;

    /* Ta bort vertikal divider i mobil */
    &::before {
      display: none;
    }
  }

  .smort-media-text-content {
    padding: var(--space-8);
    min-height: 35vh;
    gap: var(--space-6);
  }

  .smort-media-text-subtitle {
    padding-top: var(--space-2);
  }

  .smort-media-text-content-inner {
    gap: var(--space-6);
  }

  .smort-media-text-cta-wrapper {
    padding-bottom: var(--space-2);
  }

  .smort-media-text-media {
    padding: var(--space-8);
  }
}
