/* ============================================================
   JD Text Editor Widget — Frontend Styles
   File: widgets/jd-text-editor/css/jd-text-editor.css
   Version: 1.1.0
   ============================================================ */

/* ── Base widget wrapper ─────────────────────────────────── */

.jd-text-editor-widget {
  position: relative;
}

/* ── Drop Cap ────────────────────────────────────────────── */

.jd-te-content.jd-te-dropcap > p:first-child::first-letter {
  float: left;
  font-size: 3.2em;
  line-height: 0.8;
  margin: 0.06em 0.12em 0 0;
  font-weight: 700;
}

/* ── Content area ────────────────────────────────────────── */

.jd-te-content {
  position: relative;
}

.jd-te-content p:last-child {
  margin-bottom: 0;
}

/* ── Inner collapsed wrapper ─────────────────────────────── */

/*
 * SMOOTH ANIMATION SYSTEM:
 * We use max-height with a large enough expanded value so the animation
 * feels natural. A custom cubic-bezier curve gives a premium ease-in-out
 * deceleration — fast start, smooth finish. The collapse is slightly faster
 * than the expand for a snappier feel.
 */

.jd-te-inner {
  overflow: hidden;
  /* Collapsed default — height set inline by JS */
  transition: max-height 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: max-height;
}

.jd-te-inner.is-collapsed {
  /* max-height set inline by JS from data-jd-height */
}

.jd-te-inner.is-expanded {
  /* Large enough for all realistic content lengths */
  max-height: 4000px !important;
  transition: max-height 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Fade overlay ────────────────────────────────────────── */

.jd-te-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 96px;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  /* background set inline via JS from data-jd-bg attribute */
  will-change: opacity;
}

.jd-te-fade.is-hidden {
  opacity: 0;
}

/* ── Button wrapper ──────────────────────────────────────── */

.jd-te-btn-wrap {
  display: block;
  /* margin-top set by Elementor selector control */
}

/* ── Toggle button ───────────────────────────────────────── */

.jd-te-btn {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  /* Text / color set by Elementor selectors */
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-weight: 600;
  color: #3D4FD6;
  line-height: 1.4;
  text-decoration: none;
  /* Smooth all transitioning properties */
  transition:
    color 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  outline-offset: 3px;
}

.jd-te-btn--full {
  width: 100%;
}

.jd-te-btn:hover {
  color: #2B38A8;
  transform: translateY(-1px);
}

.jd-te-btn:active {
  transform: translateY(0);
}

/* Arrow icon ─────────────────────────────────────────────── */

.jd-te-btn .jd-te-arrow {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.jd-te-btn .jd-te-arrow svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

.jd-te-btn.is-expanded .jd-te-arrow {
  transform: rotate(180deg);
}

/* ── Device visibility helpers ───────────────────────────── */

@media (min-width: 1025px) {
  .jd-text-editor-widget[data-jd-device="mobile"] .jd-te-inner {
    max-height: none !important;
    overflow: visible !important;
  }
  .jd-text-editor-widget[data-jd-device="mobile"] .jd-te-fade,
  .jd-text-editor-widget[data-jd-device="mobile"] .jd-te-btn-wrap {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .jd-text-editor-widget[data-jd-device="desktop"] .jd-te-inner {
    max-height: none !important;
    overflow: visible !important;
  }
  .jd-text-editor-widget[data-jd-device="desktop"] .jd-te-fade,
  .jd-text-editor-widget[data-jd-device="desktop"] .jd-te-btn-wrap {
    display: none !important;
  }
}
