/* ==========================================================================
   SAJ Dental Clinic — "Book Your Appointment" CTA section
   Scope: every selector is prefixed saj-cta. Visual values are CSS custom
   properties so they can map to future Elementor widget controls.
   ========================================================================== */

/* Standalone preview page only (cta.html) */
.saj-cta-preview {
  margin: 0;
  background: #FFFFFF;
}

.saj-cta {
  /* ---- Colours ---- */
  --saj-cta-navy: #102D5A;
  --saj-cta-blue: #1269A8;
  --saj-cta-orange: #F4511E;
  --saj-cta-orange-strong: #D6400F;
  --saj-cta-text: #56647C;
  --saj-cta-cool: #E1EFFB;
  --saj-cta-warm: #FDEBDC;
  --saj-cta-line: rgba(16, 45, 90, 0.16);

  /* ---- Typography ---- */
  --saj-cta-font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --saj-cta-font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --saj-cta-heading-size: clamp(42px, 5.2vw, 84px);

  /* ---- Layout ---- */
  --saj-cta-max-width: 1500px;
  --saj-cta-gutter: clamp(20px, 5vw, 96px);
  --saj-cta-spacing: clamp(64px, 6vw, 96px);
  --saj-cta-icon-size: clamp(60px, 4.6vw, 78px);
  --saj-cta-portrait-position: 50% 30%;

  /* ---- Background (set to none for gradients only) ---- */
  --saj-cta-bg-image: url("../images/cta-bg.webp");
  --saj-cta-bg-position: center;

  --saj-cta-ease: cubic-bezier(0.22, 1, 0.36, 1);

  box-sizing: border-box;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  overflow: clip;
  background-color: #F2F8FE;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.2) 45%, rgba(255, 255, 255, 0) 60%),
    var(--saj-cta-bg-image),
    linear-gradient(160deg, #F7FBFF 0%, #EAF3FC 100%);
  background-position: center, var(--saj-cta-bg-position), center;
  background-size: auto, cover, auto;
  background-repeat: no-repeat;
  font-family: var(--saj-cta-font-body);
  color: var(--saj-cta-text);
  -webkit-font-smoothing: antialiased;
}

.saj-cta *,
.saj-cta *::before,
.saj-cta *::after {
  box-sizing: border-box;
}

.saj-cta__defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ==========================================================================
   Decorative layers (soft curves that drift / respond to the mouse)
   ========================================================================== */
.saj-cta__decor {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.saj-cta__blob {
  position: absolute;
  border-radius: 50%;
}

.saj-cta__blob--a {                           /* big pale dome, lower centre */
  left: 30%;
  bottom: -38%;
  width: 46%;
  height: 70%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0));
}

.saj-cta__blob--b {                           /* soft blue behind the portrait */
  right: 6%;
  top: 8%;
  width: 36%;
  height: 90%;
  background: radial-gradient(closest-side, rgba(196, 222, 248, 0.6), rgba(196, 222, 248, 0));
}

.saj-cta__blob--c {                           /* faint wash upper left */
  left: -12%;
  top: -30%;
  width: 40%;
  height: 80%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0));
}

/* ==========================================================================
   Layout
   ========================================================================== */
.saj-cta__container {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  align-items: center;
  gap: clamp(24px, 3vw, 56px);
  max-width: var(--saj-cta-max-width);
  margin: 0 auto;
  padding: 0 var(--saj-cta-gutter);
}

.saj-cta__content {
  padding: var(--saj-cta-spacing) 0;
}

.saj-cta__line {
  display: block;
  width: clamp(80px, 8vw, 140px);
  height: 2px;
  margin-bottom: clamp(8px, 2vw, 0px);
  background: var(--saj-cta-orange);
  transform-origin: 0 50%;
}

.saj-cta__heading {
  margin: 0 0 clamp(18px, 1.8vw, 26px);
  font-family: var(--saj-cta-font-display);
  font-size: var(--saj-cta-heading-size);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--saj-cta-navy);
}

.saj-cta__heading-line {
  display: block;
  overflow: hidden;
  padding: 0.02em 0.12em 0.14em 0;
  margin-bottom: -0.14em;
}

.saj-cta__heading-inner {
  display: inline-block;
}

.saj-cta__heading-highlight {
  font-style: italic;
  font-weight: 500;
  color: var(--saj-cta-orange);
}

.saj-cta__description {
  max-width: 36rem;
  margin: 0;
  font-size: clamp(16px, 1.3vw, 20px);
  line-height: 1.6;
  color: var(--saj-cta-text);
}

/* ---- Features ---- */
.saj-cta__features {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 0;
  margin: 20px 0;
  padding: 0;
  list-style: none;
}

.saj-cta__feature {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 clamp(12px, 1.4vw, 26px);
}

.saj-cta__feature:first-child {
  padding-left: 0;
}

/* thin vertical divider, drawn so it can scale in (--saj-cta-divider) */
.saj-cta__feature + .saj-cta__feature::before {
  content: "";
  position: absolute;
  top: 12%;
  bottom: 12%;
  left: 0;
  width: 1px;
  background: var(--saj-cta-line);
  transform: scaleY(var(--saj-cta-divider, 1));
}

.saj-cta__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: var(--saj-cta-icon-size);
  height: var(--saj-cta-icon-size);
  border-radius: 50%;
  color: var(--saj-cta-navy);
}

.saj-cta__icon--cool { background: var(--saj-cta-cool); }

/* Each title is two lines (one span per line), as in the design. */
.saj-cta__feature-title > span {
  display: block;
  white-space: nowrap;
}
.saj-cta__icon--warm { background: var(--saj-cta-warm); }

.saj-cta__icon svg {
  width: 46%;
  height: 46%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.saj-cta__icon-accent {
  stroke: var(--saj-cta-blue);
}

.saj-cta__icon--warm .saj-cta__icon-accent {
  stroke: var(--saj-cta-orange);
}

.saj-cta__feature-title {
  max-width: 7.4em;
  font-family: var(--saj-cta-font-display);
  font-size: clamp(16px, 1.3vw, 20px);
  font-weight: 500;
  line-height: 1.3;
  color: var(--saj-cta-navy);
}

/* ---- Button ---- */
.saj-cta__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  width: min(360px, 100%);
  min-height: clamp(64px, 3.6vw, 88px);
  padding: 0 36px;
  border-radius: 999px;
  background: var(--saj-cta-orange);
  color: #FFFFFF;
  font-family: var(--saj-cta-font-display);
  font-size: clamp(19px, 1.6vw, 24px);
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 22px 40px -20px rgba(244, 81, 30, 0.85);
  transition: background-color 0.35s ease, box-shadow 0.35s ease;
}

.saj-cta__button-arrow {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.saj-cta__button:hover,
.saj-cta__button:focus-visible {
  background: var(--saj-cta-orange-strong);
  box-shadow: 0 26px 44px -20px rgba(214, 64, 15, 0.9);
}

.saj-cta__button:focus-visible {
  outline: 3px solid var(--saj-cta-navy);
  outline-offset: 4px;
}

/* No-GSAP fallback for the hover motion (JS takes over when available) */
.saj-cta:not(.saj-cta--js) .saj-cta__button,
.saj-cta:not(.saj-cta--js) .saj-cta__button-arrow {
  transition: transform 0.4s var(--saj-cta-ease), background-color 0.35s ease, box-shadow 0.35s ease;
}

.saj-cta:not(.saj-cta--js) .saj-cta__button:hover { transform: translateY(-3px); }
.saj-cta:not(.saj-cta--js) .saj-cta__button:hover .saj-cta__button-arrow { transform: translateX(5px); }

/* ==========================================================================
   Portrait
   ========================================================================== */
.saj-cta__visual {
  position: relative;
  align-self: end;
  height: 100%;
  min-height: clamp(460px, 42vw, 680px);
}

/* Organic silhouette (SVG clipPath) applied to the wrapper, never the image. */
.saj-cta__portrait {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(100%, 620px);
  aspect-ratio: 0.9;
  max-height: 104%;
  overflow: hidden;
  -webkit-clip-path: url(#saj-cta-portrait-mask);
  clip-path: url(#saj-cta-portrait-mask);
  background: var(--saj-cta-cool);
}

.saj-cta__portrait-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--saj-cta-portrait-position);
}

/* Soft light glow inside the silhouette so the photo's own background
   melts into the section instead of forming a hard dark edge. */
.saj-cta__portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(62% 58% at 50% 48%, rgba(242, 248, 254, 0) 62%, rgba(242, 248, 254, 0.55) 86%, rgba(242, 248, 254, 0.85) 100%);
  pointer-events: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Desktop: the three features always share one row, equal thirds */
@media (min-width: 1280px) {
  .saj-cta__features {
    display: grid;
    grid-template-columns: repeat(3, auto);
    justify-content: start;
  }

  .saj-cta__feature {
    padding: 0 clamp(14px, 1.1vw, 24px);
  }

  .saj-cta__feature-title {
    font-size: clamp(16px, 1.25vw, 20px);
  }
}

/* Laptop / small desktop: feature row wraps onto two lines if needed */
@media (max-width: 1279.98px) {
  .saj-cta__features {
    row-gap: 22px;
  }

  .saj-cta__feature:nth-child(3) {
    padding-left: 0;
  }

  .saj-cta__feature:nth-child(3)::before {
    display: none;
  }
}

/* Tablet: narrower portrait column */
@media (max-width: 1023.98px) {
  .saj-cta {
    --saj-cta-heading-size: clamp(40px, 6.4vw, 60px);
  }

  .saj-cta__container {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  }

  .saj-cta__visual {
    min-height: 420px;
  }
}

/* Mobile: stacked — text, features, button, then the portrait */
@media (max-width: 767.98px) {
  .saj-cta {
    --saj-cta-gutter: 20px;
    --saj-cta-spacing: 56px;
    --saj-cta-heading-size: clamp(38px, 11vw, 50px);
    --saj-cta-icon-size: 56px;
  }

  .saj-cta__container {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  /* Centred composition */
  .saj-cta__content {
    padding-bottom: 36px;
    text-align: center;
  }

  .saj-cta__line {
    margin-left: auto;
    margin-right: auto;
    transform-origin: 50% 50%;
  }

  .saj-cta__description {
    margin-left: auto;
    margin-right: auto;
  }

  /* Three features in one row: icon above its two-line title */
  .saj-cta__features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
  }

  .saj-cta__feature,
  .saj-cta__feature:first-child,
  .saj-cta__feature:nth-child(3) {
    flex-direction: column;
    gap: 10px;
    padding: 0 4px;
    text-align: center;
  }

  .saj-cta__feature + .saj-cta__feature::before,
  .saj-cta__feature:nth-child(3)::before {
    display: block;
    top: 8%;
    bottom: 8%;
  }

  .saj-cta__feature-title {
    max-width: none;
    font-size: clamp(13px, 3.8vw, 15px);
  }

  .saj-cta__button {
    width: 100%;
  }

  .saj-cta__visual {
    min-height: 0;
    height: auto;
    padding-bottom: 40px;
  }

  .saj-cta__portrait {
    position: relative;
    width: min(100%, 420px);
    margin: 0 auto;
    max-height: none;
  }
}

/* Very small phones: keep the button label on one line */
@media (max-width: 359.98px) {
  .saj-cta__button {
    gap: 14px;
    padding: 0 20px;
    font-size: 18px;
    white-space: nowrap;
  }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .saj-cta *,
  .saj-cta *::before {
    transition-duration: 0.01ms !important;
  }
}
