/*
 * Pop-up "join-46" (parts/popups/join-46.php). Everything scoped under .scm-pop--join-46.
 * One portrait card: a real Civics 4 Kids! photo (cropped to the table, the posters in the top
 * half stay out of frame) that fades into navy, white type over the
 * fade, one gold CTA. Same composition on phones, as a bottom sheet.
 */

.scm-pop--join-46 {
  --scm-pop-w: 500px;
  --scm-pop-bg: var(--navy-darker);
  --scm-pop-close-bg: rgba(8, 45, 107, .5);
  --scm-pop-close-bg-hover: rgba(8, 45, 107, .75);
  --scm-pop-close-fg: #fff;
}
.scm-pop--join-46 .scm-pop__close { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

.scm-pop--join-46 .j46 { position: relative; isolation: isolate; color: #fff; background: var(--navy-darker); }

/* Photo, fading into the navy below */
.scm-pop--join-46 .j46__photo {
  position: relative; z-index: -1; overflow: hidden;
  aspect-ratio: 4 / 3.3;
  background: var(--grad-panel);
}
.scm-pop--join-46 .j46__photo img {
  display: block; width: 100%; height: 100%; max-width: none;
  object-fit: cover; object-position: 50% 38%; transform-origin: 50% 38%;
}
.scm-pop--join-46 .j46__photo::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 45, 107, .55) 0%, rgba(8, 45, 107, 0) 26%),
    linear-gradient(180deg, rgba(8, 45, 107, 0) 42%, rgba(8, 45, 107, .6) 62%, rgba(8, 45, 107, .94) 80%, var(--navy-darker) 94%);
}

/* Copy, over the fade */
.scm-pop--join-46 .j46__body { position: relative; margin-top: -92px; padding: 0 36px 24px; }
.scm-pop--join-46 .j46__eyebrow {
  margin: 0;
  font-size: 12px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; color: var(--gold);
}
.scm-pop--join-46 .j46__title {
  margin: 10px 0 14px; color: #fff; font-family: inherit;
  font-weight: 800; font-size: clamp(2rem, 4.4vw, 2.3rem); line-height: 1.06; letter-spacing: -.03em;
  text-wrap: pretty;
}
.scm-pop--join-46 .j46__text { margin: 0 0 26px; color: var(--on-navy); font-size: 1.02rem; line-height: 1.6; }

/* CTA: gold, generous, lifts on hover and presses in */
.scm-pop--join-46 .j46__cta {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 58px; padding: 14px 24px;
  border-radius: var(--radius-btn);
  background: var(--grad-gold); color: var(--navy) !important;
  font-weight: 800; font-size: 1.02rem; letter-spacing: .4px; text-transform: uppercase; text-decoration: none;
  box-shadow: var(--shadow-gold);
  transition: transform var(--ease), box-shadow var(--ease);
}
.scm-pop--join-46 .j46__cta i { transition: transform var(--ease); }
.scm-pop--join-46 .j46__cta:hover { transform: translateY(-2px); box-shadow: var(--shadow-gold-hover); }
.scm-pop--join-46 .j46__cta:hover i { transform: translateX(4px); }
.scm-pop--join-46 .j46__cta:active { transform: translateY(1px) scale(.985); box-shadow: 0 6px 16px -8px rgba(244, 180, 0, .6); }
.scm-pop--join-46 .j46__cta:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.scm-pop--join-46 button.j46__later {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; min-height: 48px; margin: 6px 0 0; padding: 0;
  border: 0; border-radius: var(--radius-btn); background: transparent;
  color: rgba(255, 255, 255, .72); font: inherit; font-size: .95rem; font-weight: 600;
  text-transform: none; letter-spacing: 0; cursor: pointer;
  transition: color var(--ease);
}
.scm-pop--join-46 button.j46__later:hover,
.scm-pop--join-46 button.j46__later:focus {
  background: transparent; color: #fff; text-decoration: underline; text-underline-offset: 3px;
}
.scm-pop--join-46 button.j46__later:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }

.scm-pop--join-46 .j46__foot {
  margin: 2px 0 0; text-align: center;
  font-size: .8rem; color: rgba(255, 255, 255, .7);
}

/* Entrance: the photo settles slowly, the copy rises in order */
.scm-pop--join-46.is-open .j46__photo img { animation: j46-settle 8s ease-out both; }
.scm-pop--join-46.is-open .j46__body > * { animation: j46-rise .2s ease both; }
.scm-pop--join-46.is-open .j46__body > :nth-child(1) { animation-delay: .1s; }
.scm-pop--join-46.is-open .j46__body > :nth-child(2) { animation-delay: .16s; }
.scm-pop--join-46.is-open .j46__body > :nth-child(3) { animation-delay: .22s; }
.scm-pop--join-46.is-open .j46__body > :nth-child(4) { animation-delay: .28s; }
.scm-pop--join-46.is-open .j46__body > :nth-child(n+5) { animation-delay: .34s; }

@keyframes j46-settle { from { transform: scale(1.08); } to { transform: none; } }
@keyframes j46-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Phones: the same card as a bottom sheet */
@media (max-width: 620px) {
  .scm-pop--join-46 .j46__photo { aspect-ratio: 16 / 12.5; }
  .scm-pop--join-46 .j46__body { margin-top: -78px; padding: 0 22px 10px; }
  .scm-pop--join-46 .j46__eyebrow { font-size: 11px; letter-spacing: 2px; }
  .scm-pop--join-46 .j46__title { font-size: 1.95rem; margin: 8px 0 12px; }
  .scm-pop--join-46 .j46__text { font-size: .98rem; margin-bottom: 22px; }
}
@media (max-width: 360px) {
  .scm-pop--join-46 .j46__body { padding: 0 18px 8px; }
  .scm-pop--join-46 .j46__title { font-size: 1.7rem; }
  .scm-pop--join-46 .j46__cta { font-size: .95rem; padding: 14px 16px; letter-spacing: .2px; }
}

@media (prefers-reduced-motion: reduce) {
  .scm-pop--join-46.is-open .j46__photo img,
  .scm-pop--join-46.is-open .j46__body > * { animation: none; }
  .scm-pop--join-46 .j46__cta,
  .scm-pop--join-46 .j46__cta i,
  .scm-pop--join-46 button.j46__later { transition: none; }
}
