/* ===== Base Tokens ===== */
.rpe-pro-widget-container,
.rpe-pro-related-section-isolated,
.rpe-pro-lead-magnet {
  --rpe-main-bg: #fff;
  --rpe-main-color: #2d3748;
  --rpe-accent: #f7a984;
  --rpe-muted: #718096;
  --rpe-border: #e2e8f0;
  --rpe-radius: 12px;
  --rpe-gap: 20px;
  --rpe-padding: 24px;
  --rpe-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  --rpe-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.12);
  --rpe-transition: 0.3s;
  --rpe-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

/* ===== Shared Media ===== */
.rpe-pro-thumb-container {
  position: relative;
  height: 100%;
  overflow: hidden;
}

.rpe-pro-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.rpe-lazy-img {
  opacity: 0;
  background: linear-gradient(90deg, #f0f0f0 25%, #e5e7eb 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: rpe-loading 1.4s linear infinite;
}

.rpe-loaded {
  opacity: 1;
  animation: none;
  background: none;
}

@keyframes rpe-loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.rpe-pro-thumb-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top right, rgba(247, 169, 132, 0.26), transparent 45%),
    linear-gradient(135deg, #f8fafc, #eef2f7);
}

.rpe-pro-thumb-fallback-icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 18px rgba(45, 55, 72, 0.08);
}

.rpe-pro-thumb-fallback-icon svg {
  width: 26px;
  height: 26px;
  fill: rgba(45, 55, 72, 0.58);
}

.rpe-pro-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
  .rpe-pro-widget-card:hover .rpe-pro-thumb-overlay,
  .rpe-pro-related-card:hover .rpe-pro-thumb-overlay {
    opacity: 1;
  }

  .rpe-pro-widget-card:hover .rpe-pro-thumb-img,
  .rpe-pro-related-card:hover .rpe-pro-thumb-img {
    transform: scale(1.01);
  }
}

/* ===== Widget ===== */
.rpe-pro-widget-container {
  display: grid;
  gap: var(--rpe-gap);
  margin: 0 0 var(--rpe-gap);
  isolation: isolate;
  background: var(--rpe-main-bg);
  font-family: var(--rpe-font-family);
}

.widget-title + .rpe-pro-widget-container {
  margin-top: 0 !important;
}

.rpe-pro-widget-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--rpe-radius);
  background: var(--rpe-main-bg);
  box-shadow: var(--rpe-shadow);
  transition: transform var(--rpe-transition) ease, box-shadow var(--rpe-transition) ease;
}

@media (hover: hover) and (pointer: fine) {
  .rpe-pro-widget-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--rpe-shadow-hover);
  }
}

.rpe-pro-widget-thumb {
  display: block;
  height: 180px;
  overflow: hidden;
}

.rpe-pro-widget-thumb .rpe-pro-thumb-container,
.rpe-pro-widget-thumb .rpe-pro-thumb-img {
  border-radius: var(--rpe-radius) var(--rpe-radius) 0 0;
}

.rpe-pro-widget-content {
  padding: var(--rpe-padding);
}

.rpe-pro-widget-title {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
}

.rpe-pro-widget-title a {
  color: var(--rpe-main-color);
  text-decoration: none;
  transition: color var(--rpe-transition);
}

.rpe-pro-widget-title a:hover,
.rpe-pro-widget-title a:focus-visible {
  color: var(--rpe-accent);
}

.rpe-pro-widget-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--rpe-muted);
}

.rpe-pro-meta-separator {
  font-size: 16px;
  line-height: 1;
}

.rpe-pro-widget-excerpt {
  font-size: 15px;
  line-height: 1.55;
  color: var(--rpe-muted);
}

.rpe-pro-widget-empty {
  padding: var(--rpe-padding);
  text-align: center;
  color: #94a3b8;
  font-style: italic;
}

.rpe-pro-widget-footer {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--rpe-border);
  text-align: center;
}

.rpe-pro-widget-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border: 1px solid var(--rpe-border);
  border-radius: 999px;
  background: #f8f9fa;
  color: var(--rpe-main-color);
  text-decoration: none;
  font-weight: 500;
  transition: background-color var(--rpe-transition), color var(--rpe-transition), border-color var(--rpe-transition), transform var(--rpe-transition);
}

.rpe-pro-widget-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: transform var(--rpe-transition);
}

.rpe-pro-widget-button:hover,
.rpe-pro-widget-button:focus-visible {
  background: var(--rpe-accent);
  border-color: var(--rpe-accent);
  color: #fff;
}

.rpe-pro-widget-button:hover svg,
.rpe-pro-widget-button:focus-visible svg {
  transform: translateX(3px);
}

/* ===== Related Block ===== */
.rpe-pro-related-section-isolated {
  display: block !important;
  margin: 0;
  padding: 0;
  isolation: isolate;
  font-family: var(--rpe-font-family);
}

.rpe-pro-related-section {
  max-width: 1200px !important;
  margin: 60px auto 0 !important;
  padding: 40px 20px 0 !important;
  border-top: 1px solid var(--rpe-border) !important;
  background: var(--rpe-main-bg) !important;
}

.rpe-pro-related-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.rpe-pro-related-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--rpe-main-color);
}

.rpe-pro-view-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--rpe-accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.rpe-pro-view-all:hover,
.rpe-pro-view-all:focus-visible {
  text-decoration: underline;
}

.rpe-pro-related-slider-container {
  position: relative;
  overflow: hidden;
  padding: 0 40px;
}

.rpe-pro-slider-arrows {
  position: absolute;
  inset: 50% 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 10;
}

.rpe-pro-slider-arrow {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  height: 48px;
  padding: 0;
  display: inline-flex;
  flex: 0 0 48px;
  align-items: center;
  justify-content: center;
  margin: 0 10px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
  color: var(--rpe-main-color);
  cursor: pointer;
  pointer-events: auto;
  opacity: 0.72;
  font-size: 0;
  line-height: 0;
  -webkit-appearance: none;
  appearance: none;
  transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

.rpe-pro-slider-arrow svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  aspect-ratio: 1 / 1;
  display: block;
  fill: currentColor;
  overflow: visible;
  pointer-events: none;
}

.rpe-pro-related-slider-container:hover .rpe-pro-slider-arrow,
.rpe-pro-related-slider-container:focus-within .rpe-pro-slider-arrow {
  opacity: 1;
}

.rpe-pro-slider-arrow:hover:not(.disabled),
.rpe-pro-slider-arrow:focus-visible:not(.disabled) {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  color: var(--rpe-accent);
}

.rpe-pro-slider-arrow:focus-visible {
  outline: 3px solid rgba(247, 169, 132, 0.45);
  outline-offset: 2px;
}

.rpe-pro-slider-arrow.disabled {
  opacity: 0.42 !important;
  cursor: not-allowed;
}

.rpe-pro-related-slider {
  display: flex;
  gap: 25px;
  padding: 10px 0;
  margin: 0 -20px;
  min-width: min-content;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
  touch-action: pan-y;
}

.rpe-pro-related-slider::-webkit-scrollbar {
  display: none;
}

.rpe-pro-related-card {
  position: relative;
  flex: 0 0 calc(25% - 19px);
  min-width: 280px;
  overflow: hidden;
  border-radius: var(--rpe-radius);
  background: var(--rpe-main-bg);
  box-shadow: var(--rpe-shadow);
  transition: transform var(--rpe-transition) ease, box-shadow var(--rpe-transition) ease;
}

@media (hover: hover) and (pointer: fine) {
  .rpe-pro-related-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--rpe-shadow-hover);
  }
}

.rpe-pro-related-thumb {
  display: block;
  height: 160px;
  overflow: hidden;
}

.rpe-pro-related-thumb .rpe-pro-thumb-container,
.rpe-pro-related-thumb .rpe-pro-thumb-img {
  border-radius: var(--rpe-radius) var(--rpe-radius) 0 0;
}

.rpe-pro-related-content {
  padding: var(--rpe-padding);
}

.rpe-pro-related-heading {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
}

.rpe-pro-related-heading a {
  color: var(--rpe-main-color);
  text-decoration: none;
  transition: color var(--rpe-transition);
}

.rpe-pro-related-heading a:hover,
.rpe-pro-related-heading a:focus-visible {
  color: var(--rpe-accent);
}

.rpe-pro-related-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--rpe-muted);
}

.rpe-pro-reading-time {
  white-space: nowrap;
}

.rpe-pro-related-excerpt {
  font-size: 15px;
  line-height: 1.55;
  color: var(--rpe-muted);
}

.rpe-pro-slider-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.rpe-pro-slider-dot {
  display: block;
  width: 10px;
  height: 10px;
  min-width: 10px;
  max-width: 10px;
  min-height: 10px;
  max-height: 10px;
  flex: 0 0 10px;
  margin: 0;
  border: 0;
  padding: 0;
  border-radius: 999px;
  appearance: none;
  -webkit-appearance: none;
  background: #d1d5db;
  box-shadow: none;
  font-size: 0;
  line-height: 0;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.rpe-pro-slider-dot.active,
.rpe-pro-slider-dot:hover,
.rpe-pro-slider-dot:focus-visible {
  background: var(--rpe-accent);
  transform: scale(1.12);
}

.rpe-pro-slider-dot:focus-visible {
  outline: 3px solid rgba(247, 169, 132, 0.35);
  outline-offset: 2px;
}

/* ===== Lead Magnet ===== */
.rpe-pro-lead-magnet {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: min(100%, 600px);
  margin: 24px auto;
  padding: 24px 20px;
  border: 1px solid #f0f0f0;
  border-radius: var(--rpe-radius);
  background: var(--rpe-main-bg);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  text-align: center;
  box-sizing: border-box;
}

.rpe-pro-lead-magnet::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #ff9b7c, #f7a984);
  z-index: 1;
}

.rpe-pro-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background: radial-gradient(circle, var(--rpe-accent) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.rpe-pro-telegram-icon,
.rpe-pro-lead-title,
.rpe-pro-lead-magnet p,
.rpe-pro-lead-button,
.rpe-pro-lead-note,
.rpe-pro-lead-magnet form {
  position: relative;
  z-index: 2;
}

.rpe-pro-lead-title {
  margin: 0 0 12px;
  color: var(--rpe-main-color);
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 700;
}

.rpe-pro-lead-magnet p {
  margin: 0 0 20px;
  color: var(--rpe-muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.rpe-pro-telegram-icon {
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0088cc, #24a2e0);
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.22);
}

.rpe-pro-telegram-icon svg {
  width: 32px;
  height: 32px;
  fill: #fff;
}

.rpe-pro-lead-magnet form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.rpe-pro-lead-magnet input[type="email"] {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--rpe-border);
  border-radius: 8px;
  font-size: 16px;
  box-sizing: border-box;
  transition: border-color var(--rpe-transition), box-shadow var(--rpe-transition);
}

.rpe-pro-lead-magnet input[type="email"]:focus-visible {
  border-color: var(--rpe-accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(247, 169, 132, 0.2);
}

.rpe-pro-lead-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 20px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff9b7c, #f7a984);
  box-shadow: 0 3px 10px rgba(247, 169, 132, 0.25);
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--rpe-transition), box-shadow var(--rpe-transition), background-color var(--rpe-transition);
}

.rpe-pro-lead-button svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

.rpe-pro-lead-button:hover,
.rpe-pro-lead-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 5px 16px rgba(247, 169, 132, 0.32);
}

.rpe-pro-lead-button:focus-visible {
  outline: 3px solid rgba(247, 169, 132, 0.35);
  outline-offset: 2px;
}

.rpe-pro-lead-button.is-disabled {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.rpe-pro-telegram-button {
  background: linear-gradient(135deg, #0088cc, #24a2e0);
  box-shadow: 0 3px 10px rgba(0, 136, 204, 0.25);
}

.rpe-pro-telegram-button:hover,
.rpe-pro-telegram-button:focus-visible {
  background: linear-gradient(135deg, #0077b3, #1d8bc7);
  box-shadow: 0 5px 16px rgba(0, 136, 204, 0.3);
}

.rpe-pro-lead-note {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--rpe-muted);
  opacity: 0.85;
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
  .rpe-pro-related-card {
    flex: 0 0 calc(33.333% - 17px);
  }
}

@media (max-width: 992px) {
  .rpe-pro-related-slider-container {
    padding: 0 30px;
  }

  .rpe-pro-related-card {
    flex: 0 0 calc(50% - 13px);
  }

  .rpe-pro-slider-arrow {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .rpe-pro-slider-arrow svg {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
  }
}

@media (max-width: 768px) {
  .rpe-pro-related-section {
    margin-top: 40px !important;
    padding: 30px 16px 0 !important;
  }

  .rpe-pro-related-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .rpe-pro-related-slider-container {
    padding: 0 12px;
  }

  .rpe-pro-related-slider {
    gap: 15px;
    margin: 0 -8px;
  }

  .rpe-pro-related-card {
    flex: 0 0 calc(100vw - 56px);
    min-width: calc(100vw - 56px);
    max-width: calc(100vw - 56px);
  }

  .rpe-pro-related-thumb {
    height: 144px;
  }

  .rpe-pro-slider-arrows {
    display: none;
  }

  .rpe-pro-lead-magnet {
    padding: 22px 16px;
    margin: 20px auto;
  }

  .rpe-pro-telegram-icon {
    width: 60px;
    height: 60px;
  }

  .rpe-pro-telegram-icon svg {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 480px) {
  .rpe-pro-widget-content,
  .rpe-pro-related-content {
    padding: 16px;
  }

  .rpe-pro-widget-button {
    padding: 8px 16px;
    font-size: 14px;
  }

  .rpe-pro-related-slider-container {
    padding: 0 8px;
  }

  .rpe-pro-related-card {
    flex-basis: calc(100vw - 40px);
    min-width: calc(100vw - 40px);
    max-width: calc(100vw - 40px);
  }

  .rpe-pro-thumb-fallback-icon {
    width: 48px;
    height: 48px;
  }

  .rpe-pro-thumb-fallback-icon svg {
    width: 22px;
    height: 22px;
  }

  .rpe-pro-lead-title {
    font-size: 1.3rem;
  }

  .rpe-pro-lead-magnet p {
    font-size: 0.94rem;
  }
}





