.alphauzi-post-preview {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  /* Premium neutral palette (overridable from Elementor via CSS vars) */
  --pp-card-bg: #f4f2ee;
  --pp-btn-bg: #ffffff;
  --pp-btn-color: #6f665b;
  --pp-btn-bg-hover: #5e564d;
  --pp-btn-color-hover: #ffffff;
  --pp-btn-border: #d6d1c9;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  padding: 0;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
}

/* Button corners — same presets as category-featured-post (.post-button) */
.alphauzi-post-preview.alphauzi-pp-btn-shape--square {
  --alphauzi-pp-btn-radius: 0;
}

.alphauzi-post-preview.alphauzi-pp-btn-shape--rounded {
  --alphauzi-pp-btn-radius: 8px;
}

.alphauzi-post-preview.alphauzi-pp-btn-shape--pill {
  --alphauzi-pp-btn-radius: 9999px;
}

.preview-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  min-width: 0;
}

/*
 * Tablet & mobile (≤1024px): perbaikan ruang bawah di Elementor — tidak memengaruhi desktop.
 */
@media (max-width: 1024px) {
  .elementor-element[data-widget_type^="alphauzi_post_preview"] {
    flex-grow: 0 !important;
    flex-shrink: 0;
    align-self: flex-start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .elementor-element[data-widget_type^="alphauzi_post_preview"]
    > .elementor-widget-container {
    display: block;
    height: fit-content;
    min-height: 0 !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .elementor-widget-alphauzi_post_preview .elementor-widget-container {
    height: fit-content;
    min-height: 0 !important;
  }

  .e-con:has(.alphauzi-post-preview),
  .e-con-inner:has(.alphauzi-post-preview),
  .e-child:has(.alphauzi-post-preview) {
    min-height: 0;
    justify-content: flex-start;
  }

  .elementor-column:has(.alphauzi-post-preview),
  .elementor-column-wrap:has(.alphauzi-post-preview) {
    justify-content: flex-start;
  }

  .elementor-widget-container:has(> .alphauzi-post-preview) {
    height: fit-content;
    min-height: 0 !important;
  }

  .alphauzi-post-preview {
    display: flow-root;
    height: fit-content;
    min-height: 0;
    margin: 0;
  }
}

/* Text Block Styles */
.preview-text-block {
  flex: 1 1 55%;
  min-width: 0;
  background: var(--pp-card-bg);
  background-color: var(--pp-card-bg);
  padding: 50px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 2;
}

/* Content Position Left (default) */
.content-position-left .preview-text-block {
  margin-right: -15%;
}

/* Content Position Right */
.content-position-right .preview-text-block {
  margin-left: -15%;
  order: 2;
}

.content-position-right .preview-background {
  order: 1;
}

.post-category {
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 500;
  margin-bottom: 15px;
  text-transform: uppercase;
  color: #000000;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.post-title {
  margin: 0 0 20px 0;
  font-size: 36px;
  line-height: 1.3;
  font-weight: 400;
  font-family: Georgia, "Times New Roman", serif;
  color: #000000;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.post-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.post-title a:hover {
  color: #5b5b5b;
}

.post-excerpt {
  font-size: 15px;
  line-height: 1.7;
  color: #2f2f2f;
  margin-bottom: 25px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.alphauzi-post-preview .post-button {
  display: inline-block;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  align-self: flex-start;
  overflow-wrap: break-word;
  text-align: center;
  padding: 12px 30px;
  background: var(--pp-btn-bg);
  background-color: var(--pp-btn-bg);
  color: var(--pp-btn-color);
  text-decoration: none;
  border-radius: var(--alphauzi-pp-btn-radius, 0);
  font-size: 12px;
  letter-spacing: 1px;
  font-weight: 500;
  text-transform: uppercase;
  transition: all 0.3s ease;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  border: 1px solid var(--pp-btn-border);
  opacity: 1;
  cursor: pointer;
}

.alphauzi-post-preview .post-button:hover,
.alphauzi-post-preview .post-button:focus-visible {
  background: var(--pp-btn-bg-hover);
  background-color: var(--pp-btn-bg-hover);
  color: var(--pp-btn-color-hover);
  border-color: transparent;
  outline: none;
}

/* Background Image Styles */
.preview-background {
  flex: 1 1 50%;
  min-width: 0;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  z-index: 1;
  padding-bottom: 60%;
  height: 0;
}

.preview-background::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.08);
  z-index: 1;
}

.preview-background img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  filter: blur(5px);
  transform: scale(1.1);
  transition: transform 0.3s ease;
}

/* Responsive Styles - Large Desktop */
@media (max-width: 1440px) {
  .preview-text-block {
    padding: 45px;
    flex: 1 1 52%;
    min-width: 0;
  }

  .content-position-left .preview-text-block {
    margin-right: -12%;
  }

  .content-position-right .preview-text-block {
    margin-left: -12%;
  }

  .preview-background {
    flex: 1 1 48%;
    min-width: 0;
    padding-bottom: 65%;
  }

  .post-title {
    font-size: 32px;
  }

  .post-excerpt {
    font-size: 14px;
  }
}

/* Responsive Styles - Desktop */
@media (max-width: 1200px) {
  .preview-text-block {
    flex: 1 1 50%;
    min-width: 0;
    padding: 40px;
  }

  .content-position-left .preview-text-block {
    margin-right: -10%;
  }

  .content-position-right .preview-text-block {
    margin-left: -10%;
  }

  .preview-background {
    flex: 1 1 50%;
    min-width: 0;
    padding-bottom: 70%;
  }

  .post-title {
    font-size: 30px;
    margin-bottom: 18px;
  }

  .post-excerpt {
    font-size: 14px;
    margin-bottom: 22px;
  }
}

/* Responsive Styles - Tablet Portrait: dua kolom sama lebar, tanpa overlap margin negatif */
@media (max-width: 1024px) and (min-width: 601px) {
  /* Cegah tinggi “kosong” dari parent flex/Elementor */
  .alphauzi-post-preview {
    height: auto;
    min-height: 0;
    width: 100%;
  }

  .preview-container {
    align-items: stretch;
    align-content: flex-start;
    min-height: 0;
  }

  .preview-text-block {
    flex: 1 1 50%;
    max-width: 50%;
    min-width: 0;
    padding: 35px;
    /* Default desktop memakai justify-content: center; saat kolom di-stretch tinggi kolom
       ikut sisi gambar → konten terlihat “mengambang” dengan ruang besar di bawah */
    justify-content: flex-start;
  }

  .content-position-left .preview-text-block {
    margin-right: 0;
  }

  .content-position-right .preview-text-block {
    margin-left: 0;
  }

  .preview-background {
    flex: 1 1 50%;
    max-width: 50%;
    min-width: 0;
    align-self: stretch;
    padding-bottom: 0;
    height: auto;
    min-height: 220px;
    position: relative;
  }

  .preview-background img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .post-title {
    font-size: 28px;
    margin-bottom: 18px;
  }

  .post-excerpt {
    font-size: 14px;
    margin-bottom: 22px;
  }
}

/* Tablet portrait / lebar ~iPad: padding bawah teks sedikit lebih rapat */
@media (max-width: 1024px) and (min-width: 601px) and (orientation: portrait),
  (max-width: 834px) and (min-width: 601px) {
  .preview-text-block {
    padding-bottom: 28px;
  }
}

/* Responsive Styles - Mobile (ubah ke column: image di atas, content di bawah) */
@media (max-width: 600px) {
  .preview-container {
    flex-direction: column;
    min-height: auto;
    overflow: hidden;
  }

  /* Image di atas */
  .preview-background {
    flex: 1 1 auto;
    max-width: 100%;
    width: 100%;
    padding-bottom: 60%;
    height: 0;
    order: 1 !important;
  }

  .preview-background img {
    position: absolute;
  }

  /* Content di bawah */
  .preview-text-block {
    flex: 1 1 auto;
    max-width: 100%;
    width: 100%;
    padding: 35px 30px;
    margin-right: 0 !important;
    margin-left: 0 !important;
    order: 2 !important;
  }

  .post-title {
    font-size: 28px;
    margin-bottom: 18px;
  }

  .post-excerpt {
    font-size: 14px;
    margin-bottom: 22px;
  }

  .alphauzi-post-preview .post-button {
    padding: 10px 25px;
    font-size: 11px;
  }
}

/* Responsive Styles - Small Mobile */
@media (max-width: 480px) {
  .preview-text-block {
    padding: 30px 20px;
  }

  .post-category {
    font-size: 10px;
    margin-bottom: 12px;
  }

  .post-title {
    font-size: 24px;
    margin-bottom: 15px;
  }

  .post-excerpt {
    font-size: 13px;
    margin-bottom: 20px;
    line-height: 1.6;
  }

  .alphauzi-post-preview .post-button {
    padding: 10px 20px;
    font-size: 10px;
  }

  .preview-background {
    padding-bottom: 55%;
    height: 0;
  }

  .preview-background img {
    position: absolute;
  }
}
