/**
 * Custom CTA Inserter — front.
 * Tokens z motywu LovEV, z fallbackiem gdy arkusz ładuje się sam.
 */

.custom-cta-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 1rem 1.15rem;
  border: 1px solid var(--lv-color-semantic-border, #d6dee8);
  border-radius: var(--lv-radius-lg, 12px);
  background: var(--lv-color-semantic-surface, #fff);
  box-shadow: none;
  color: var(--lv-color-semantic-text, #101820);
  font-family: var(--lv-font-sans, system-ui, sans-serif);
}

.custom-cta-content {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  color: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.45;
}

.custom-cta-content p,
.custom-cta-content li,
.custom-cta-content span,
.custom-cta-content strong,
.custom-cta-content em {
  color: inherit;
}

.custom-cta-content a:not(.custom-cta-button) {
  color: var(--lv-color-semantic-primary-text, #2f7a16);
}

.custom-cta-action {
  flex: 0 0 auto;
  padding: 0;
  text-align: right;
}

.custom-cta-code {
  display: inline-block;
  margin: 0.5rem 0 0;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--lv-color-semantic-border, #d6dee8);
  border-radius: var(--lv-radius-pill, 999px);
  background: var(--lv-color-neutral-50, #f7f9fc);
  color: inherit;
  font-weight: 600;
  font-style: normal;
  font-size: 0.8125rem;
}

.custom-cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.5rem 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--lv-radius-md, 12px);
  background: var(--lv-color-primary-500, #5bcb2b);
  color: #101820;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.custom-cta-button:hover,
.custom-cta-button:focus {
  background: var(--lv-color-primary-600, #46a822);
  color: #101820;
  text-decoration: none;
}

.custom-cta-button:focus-visible {
  outline: 2px solid var(--lv-color-primary-500, #5bcb2b);
  outline-offset: 2px;
}

.custom-cta-image {
  max-width: 100%;
  height: auto;
  border-radius: var(--lv-radius-md, 8px);
}

.custom-cta-clickable {
  display: block;
  color: inherit;
  text-decoration: none;
}

.custom-cta-clickable:hover {
  text-decoration: none;
}

@media (max-width: 768px) {
  .custom-cta-container {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }

  .custom-cta-content {
    padding: 0;
  }

  .custom-cta-action {
    text-align: left;
  }

  .custom-cta-button {
    width: 100%;
  }
}

html[data-theme="dark"] .custom-cta-container,
[data-theme="dark"] .custom-cta-container {
  background: var(--lv-color-semantic-surface, #20242c);
  border-color: var(--lv-color-semantic-border, #3a4250);
  color: var(--lv-color-semantic-text, #f3f6fb);
}

html[data-theme="dark"] .custom-cta-content a:not(.custom-cta-button),
[data-theme="dark"] .custom-cta-content a:not(.custom-cta-button) {
  color: var(--lv-color-primary-300, #8cde55);
}

html[data-theme="dark"] .custom-cta-code,
[data-theme="dark"] .custom-cta-code {
  background: var(--lv-color-neutral-100, #2a3038);
  border-color: var(--lv-color-semantic-border, #3a4250);
  color: inherit;
}

html[data-theme="dark"] .custom-cta-button,
[data-theme="dark"] .custom-cta-button {
  background: var(--lv-color-primary-500, #5bcb2b);
  color: #101820;
}

html[data-theme="dark"] .custom-cta-button:hover,
html[data-theme="dark"] .custom-cta-button:focus,
[data-theme="dark"] .custom-cta-button:hover,
[data-theme="dark"] .custom-cta-button:focus {
  background: var(--lv-color-primary-400, #6fd438);
  color: #101820;
}
