/* ==========================================================================
   Footer gramophone: "Duck Club Entertainment" sister-site links
   --------------------------------------------------------------------------
   Hover / focus / tap the gramophone and a sound beam pours out of the horn
   carrying the sister-site links, with music notes floating out.
   Markup:  resources/views/partials/footer.blade.php  (.phonograph)
   Loaded:  resources/views/partials/head.blade.php    (after additional_2022.css)
   Origin:  public_html/footer-test/megan-test-3.html

   Everything is sized relative to the GIF's width (cqw / %), so it scales
   with the footer's 33% / 25% / 40% breakpoints. The play-machine column is
   hidden below 768px (additional_2022.css), so this is desktop/tablet only.

   Plain CSS on purpose: the theme has no build toolchain checked in.
   NOTE: dist/ is wiped by a Sage build — if the theme is ever rebuilt,
   copy this file (and additional_2022.css) somewhere safe first.
   ========================================================================== */

.content-info__play-machine .phonograph {
  --beam: #e6e6e6;               /* light gray sound beam */
  --ink: #000;
  position: relative;
  container-type: inline-size;   /* 1cqw = 1% of the GIF's width */
  width: 33%;
  margin: -80px auto 10px;
  text-align: center;
}
@media (max-width: 1199.98px) { .content-info__play-machine .phonograph { width: 25%; } }
@media (max-width: 991.98px)  { .content-info__play-machine .phonograph { width: 40%; } }

/* Override the theme's `.content-info__play-machine img` sizing (33% width,
   -80px margin): that now lives on the wrapper above. */
.content-info__play-machine .phonograph img {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
  cursor: pointer;
}

/* ---- Sound beam: a soft cone pouring out of the horn mouth ---- */
.phonograph .beam {
  position: absolute;
  right: 80%;                    /* narrow end sits at the horn mouth */
  top: 30%;
  /* Beam unit: 1% of the GIF width, but never below 1.6px, so the beam
     keeps covering the text once the font hits its 11px floor (< 1200px). */
  --u: max(1cqw, 1.6px);
  width: calc(125 * var(--u));
  height: 0;
  transform-origin: 100% 0;
  transform: rotate(14deg);      /* tilt up-left, the way the horn points */
  pointer-events: none;
  /* No blend mode: the beam is opaque, so it covers the footer's top border.
     The GIF comes later in the markup and is positioned, so it sits on top. */
}
.phonograph .beam::before {
  content: "";
  position: absolute;
  right: 0;
  top: calc(-70 * var(--u));
  width: 100%;
  height: calc(140 * var(--u));
  background: radial-gradient(130% 75% at 100% 50%, var(--beam) 0 40%, color-mix(in srgb, var(--beam) 50%, #fff) 75%, #fff 100%);
  clip-path: polygon(100% 25%, 100% 75%, 0 100%, 0 0);
  opacity: 0;
  transform: scaleX(.05);
  transform-origin: 100% 50%;
  transition: opacity .25s ease, transform .45s cubic-bezier(.2, .9, .3, 1.2);
}

/* ---- Links riding in the beam ---- */
.phonograph .broadcast {
  position: absolute;
  right: calc(84% + 1.5em);
  top: 20%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .55em;
  font-family: "Poppins", sans-serif;
  font-size: clamp(11px, 6.4cqw, 15px);
  line-height: 1.1;
  text-align: center;
  pointer-events: none;          /* hidden links don't catch the mouse */
  z-index: 2;
}

.phonograph .broadcast__title,
.phonograph .broadcast a {
  display: inline-block;
  white-space: nowrap;
  opacity: 0;
  transform: translate(4em, 1em) scale(.2) rotate(-12deg);
  transform-origin: 100% 50%;
  transition:
    opacity .25s ease,
    transform .55s cubic-bezier(.2, .9, .3, 1.5);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.phonograph .broadcast__title {
  margin-bottom: .1em;
  padding: calc(.35em + 2px) .8em .3em;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: .78em;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.phonograph .broadcast a {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  text-decoration: none;
  padding: .1em .2em;
}
.phonograph .broadcast a:hover,
.phonograph .broadcast a:focus-visible {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.phonograph .broadcast a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

/* ---- Little music notes that float out of the horn ---- */
.phonograph .notes {
  position: absolute;
  left: calc(22% - 6px);
  top: 26%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 3;
}
.phonograph .notes span {
  position: absolute;
  left: 0;
  top: 0;
  font-size: clamp(12px, 9cqw, 22px);
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  opacity: 0;
}

/* ---- Revealed: hover, keyboard focus, or tapped ---- */
.phonograph:hover .broadcast,
.phonograph:focus-within .broadcast,
.phonograph.is-open .broadcast { pointer-events: auto; }

.phonograph:hover .beam::before,
.phonograph:focus-within .beam::before,
.phonograph.is-open .beam::before { opacity: 1; transform: none; }

.phonograph:hover :is(.broadcast__title, .broadcast a),
.phonograph:focus-within :is(.broadcast__title, .broadcast a),
.phonograph.is-open :is(.broadcast__title, .broadcast a) {
  opacity: 1;
  transform: none;
}

.phonograph:hover .notes span,
.phonograph:focus-within .notes span,
.phonograph.is-open .notes span {
  animation: dc-gramophone-note 2.4s ease-out infinite;
  animation-delay: calc(var(--n) * .6s);
}
@keyframes dc-gramophone-note {
  0%   { opacity: 0; transform: translate(0, 0) rotate(0) scale(.5); }
  15%  { opacity: 1; }
  40%  { transform: translate(-14cqw, -16cqw) rotate(-14deg) scale(1); }
  70%  { opacity: 1; transform: translate(-6cqw, -34cqw) rotate(12deg) scale(1); }
  100% { opacity: 0; transform: translate(-16cqw, -52cqw) rotate(-8deg) scale(.9); }
}

/* Idle hint: one shy note peeks out now and then so people know to hover */
.phonograph:not(:hover):not(:focus-within):not(.is-open) .notes span:first-child {
  animation: dc-gramophone-peek 6s ease-in-out 2s infinite;
}
@keyframes dc-gramophone-peek {
  0%, 70%, 100% { opacity: 0; transform: translate(0, 0) scale(.5); }
  80%           { opacity: 1; transform: translate(-6cqw, -8cqw) rotate(-10deg) scale(1); }
  92%           { opacity: 0; transform: translate(-10cqw, -18cqw) rotate(8deg) scale(.9); }
}

@media (prefers-reduced-motion: reduce) {
  .phonograph .broadcast__title,
  .phonograph .broadcast a,
  .phonograph .beam::before { transform: none !important; transition: opacity .2s; }
  .phonograph .notes { display: none; }
}
