/* "Your Zodiac Sign Is the Same. Your Story Is Unique.": the membership box at the end of the
   monthly and daily sign pages (template-parts/story-cta.php, inc/story-cta.php) */

.scta {
  --sc-night: #1a0f2e;
  --sc-night-2: #2a1845;
  --sc-indigo: #17143f;
  --sc-gold: #D4A574;
  --sc-gold-light: #E8C9A1;
  --sc-gold-deep: #C8935C;

  container-type: inline-size;
  position: relative;
  isolation: isolate;
  margin: 40px 0;
  padding: 34px 36px 32px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.78);
  background:
    radial-gradient(110% 85% at 100% 0%, rgba(118, 74, 190, 0.42), transparent 62%),
    radial-gradient(70% 60% at 0% 100%, rgba(212, 165, 116, 0.14), transparent 65%),
    linear-gradient(158deg, var(--sc-night-2) 0%, var(--sc-night) 52%, var(--sc-indigo) 100%);
  border-radius: 22px;
  box-shadow: 0 18px 42px rgba(26, 15, 46, 0.22);
}

/* A gold hairline frame just inside the edge */
.scta::before {
  content: "";
  position: absolute;
  inset: 9px;
  z-index: -1;
  border: 1px solid rgba(212, 165, 116, 0.22);
  border-radius: 15px;
  pointer-events: none;
}

/* The zodiac ring and three stars, behind the text */
.scta__ring {
  position: absolute;
  top: 50%;
  right: -120px;
  z-index: -1;
  width: 380px;
  height: 380px;
  transform: translateY(-50%);
  fill: none;
  stroke: rgba(212, 165, 116, 0.16);
  stroke-width: 1;
  pointer-events: none;
}

.scta__ring * { vector-effect: non-scaling-stroke; }

.scta__star {
  position: absolute;
  z-index: -1;
  width: 3px;
  height: 3px;
  background: var(--sc-gold-light);
  border-radius: 50%;
  box-shadow: 0 0 6px 1px rgba(232, 201, 161, 0.55);
  opacity: 0.75;
  pointer-events: none;
}

.scta__star--1 { top: 22px; right: 34%; }
.scta__star--2 { top: 58%; right: 7%; width: 2px; height: 2px; opacity: 0.55; }
.scta__star--3 { bottom: 16px; left: 62%; width: 2px; height: 2px; opacity: 0.5; }

@media (prefers-reduced-motion: no-preference) {
  .scta__star { animation: scta-twinkle 5.5s ease-in-out infinite; }
  .scta__star--2 { animation-delay: -2s; }
  .scta__star--3 { animation-delay: -3.7s; }
}

@keyframes scta-twinkle {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 0.25; }
}

/* ───────── Layout: medallion above the text, beside it when the box is wide ───────── */

.scta__inner {
  display: grid;
  gap: 18px;
}

@container (min-width: 600px) {
  .scta__inner {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 26px;
    align-items: start;
  }
}

.scta__medallion {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  color: var(--sc-gold-light);
  background: radial-gradient(circle at 35% 30%, rgba(232, 201, 161, 0.2), rgba(212, 165, 116, 0.06) 70%);
  border: 1px solid rgba(212, 165, 116, 0.55);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(212, 165, 116, 0.07), 0 0 26px rgba(212, 165, 116, 0.22);
}

@container (min-width: 600px) {
  .scta__medallion { width: 76px; height: 76px; margin-top: 4px; }
}

.scta__glyph {
  font-family: 'Noto Sans Symbols', 'Segoe UI Symbol', 'Apple Symbols', 'DejaVu Sans', sans-serif;
  font-size: 1.7rem;
  font-variant-emoji: text;
  line-height: 1;
}

@container (min-width: 600px) {
  .scta__glyph { font-size: 2.2rem; }
}

/* ───────── Text ───────── */

.scta .scta__eyebrow {
  margin: 0 0 10px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sc-gold);
}

.scta .scta__title {
  margin: 0 0 16px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.85rem;
  font-size: clamp(1.7rem, 5.4cqi, 2.4rem);
  font-weight: 600;
  line-height: 1.1;
  color: #fff;
  text-wrap: balance;
}

.scta__title > span { display: block; }

.scta .scta__title-em {
  margin-top: 2px;
  font-style: italic;
  font-weight: 400;
  color: var(--sc-gold-light);
}

.scta .scta__lead {
  margin: 0 0 10px;
  max-width: 56ch;
  font-size: 1.05rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
  text-wrap: pretty;
}

.scta__lead strong {
  font-weight: 700;
  color: var(--sc-gold-light);
}

.scta .scta__text {
  margin: 0;
  max-width: 58ch;
  font-size: 0.95rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.72);
  text-wrap: pretty;
}

/* ───────── Button and fine print ───────── */

.scta__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
  margin-top: 24px;
}

.scta .scta__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 26px;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--sc-night);
  text-align: center;
  text-decoration: none;
  background: linear-gradient(180deg, #E2BA8C 0%, var(--sc-gold) 55%, var(--sc-gold-deep) 100%);
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(212, 165, 116, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.38);
  transition: transform 160ms ease-out, box-shadow 160ms ease-out, filter 160ms ease-out;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.scta__arrow {
  display: inline-block;
  transition: transform 160ms ease-out;
}

@media (hover: hover) and (pointer: fine) {
  .scta .scta__btn:hover {
    color: var(--sc-night);
    text-decoration: none;
    filter: brightness(1.07);
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(212, 165, 116, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  }

  .scta .scta__btn:hover .scta__arrow { transform: translateX(3px); }
}

.scta .scta__btn:active {
  filter: brightness(0.96);
  transform: scale(0.98);
  box-shadow: 0 5px 14px rgba(212, 165, 116, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.scta .scta__btn:focus { outline: none; }

.scta .scta__btn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.scta .scta__fine {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.6);
}

.scta .scta__fine a {
  font-weight: 700;
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgba(212, 165, 116, 0.7);
  text-underline-offset: 3px;
}

.scta .scta__fine a:hover { color: var(--sc-gold-light); }

.scta .scta__fine a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ───────── Narrow boxes (phones) ───────── */

@container (max-width: 459px) {
  .scta__actions { flex-direction: column; align-items: stretch; gap: 14px; }
  .scta .scta__btn { width: 100%; padding: 12px 20px; }
  .scta .scta__fine { flex-direction: column; align-items: center; text-align: center; gap: 2px; }
}

@media (max-width: 640px) {
  .scta { margin: 32px 0; padding: 28px 22px 26px; border-radius: 20px; }
  .scta::before { inset: 7px; border-radius: 14px; }
  .scta__ring { top: -70px; right: -110px; width: 260px; height: 260px; transform: none; }
  .scta__star--3 { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .scta .scta__btn,
  .scta__arrow { transition: none; }
  .scta .scta__btn:hover,
  .scta .scta__btn:active,
  .scta .scta__btn:hover .scta__arrow { transform: none; }
}

@media print {
  .scta { display: none; }
}
