/**
 * Homepage notice (B+C: date square + rotator)
 * Mounted below the nav on index.html.
 */

#site-notice {
  overflow: hidden;
  max-height: 0;
  background: #0b1220;
}

#site-notice.is-in {
  animation: site-notice-drop 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.35s both;
}

@keyframes site-notice-drop {
  from { max-height: 0; }
  to { max-height: 8rem; }
}

@media (prefers-reduced-motion: reduce) {
  #site-notice.is-in {
    animation: none;
    max-height: 8rem;
  }
}

.site-notice {
  --accent: #10b981;
  --accent-soft: rgba(16, 185, 129, 0.18);
  position: relative;
  background: #0b1220;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.site-notice[data-kind="webinar"] { --accent: #10b981; }
.site-notice[data-kind="event"] { --accent: #2ec4c6; }
.site-notice[data-kind="usergroup"] { --accent: #8b5cf6; }
.site-notice[data-kind="news"] { --accent: #f8ad29; }

.site-notice__slide[data-kind="webinar"] { --accent: #10b981; }
.site-notice__slide[data-kind="event"] { --accent: #2ec4c6; }
.site-notice__slide[data-kind="usergroup"] { --accent: #8b5cf6; }
.site-notice__slide[data-kind="news"] { --accent: #f8ad29; }

.site-notice__inner {
  position: relative;
  max-width: 1536px;
  margin: 0 auto;
  padding: 0.65rem 4.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.35rem;
}

@media (min-width: 640px) {
  .site-notice__inner { padding-left: 4.5rem; padding-right: 4.5rem; }
}
@media (min-width: 1024px) {
  .site-notice__inner { padding-left: 5rem; padding-right: 5rem; }
}

.site-notice__track {
  flex: 0 0 auto;
  min-width: 0;
  max-width: none;
  position: relative;
  overflow: hidden;
  height: 3.4rem;
}

.site-notice__slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.site-notice__slide.is-on {
  position: relative;
  inset: auto;
  height: 100%;
  width: max-content;
  max-width: 100%;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.site-notice__copy {
  flex: 0 0 auto;
  min-width: auto;
  max-width: none;
}

.site-notice__date {
  width: 3.25rem;
  flex-shrink: 0;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-color: color-mix(in srgb, var(--accent) 40%, rgba(255, 255, 255, 0.08));
  border-radius: 0.7rem;
  padding: 0.35rem 0.15rem 0.4rem;
}

.site-notice__mon {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
}

.site-notice__day {
  display: block;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
}

.site-notice__kicker {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.site-notice__title {
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: visible;
}

.site-notice__meta {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: visible;
}

.site-notice__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-shrink: 0;
  font-weight: 600;
  font-size: 0.75rem;
  line-height: 1;
  padding: 0.5rem 0.85rem;
  border-radius: 0.75rem;
  white-space: nowrap;
  background: var(--accent, #10b981);
  color: #0f172a;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.site-notice__cta:hover { filter: brightness(1.08); }
.site-notice__cta:active { transform: translateY(1px); }

.site-notice__cta-inline { display: none; }

.site-notice__dots {
  display: flex;
  gap: 0.3rem;
  flex-shrink: 0;
}

.site-notice__dot {
  width: 0.4rem;
  height: 0.4rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
}

.site-notice__dot.is-on { background: var(--accent, #10b981); }

.site-notice__step {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 0.45rem;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}

.site-notice__step[data-dir="-1"] {
  left: max(0.75rem, calc(50% - 22rem));
}
.site-notice__step[data-dir="1"] {
  right: max(2.75rem, calc(50% - 22rem));
}

.site-notice__step:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.site-notice__close {
  position: absolute;
  top: 50%;
  right: 0.55rem;
  transform: translateY(-50%);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.site-notice__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .site-notice__slide {
    transition: none;
    transform: none;
  }
}

@media (max-width: 767px) {
  .site-notice__inner {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "track"
      "dots";
    gap: 0.15rem;
    align-items: stretch;
    max-width: none;
    margin: 0;
    padding: 0.55rem 0.7rem 0.3rem;
    width: 100%;
    box-sizing: border-box;
  }

  .site-notice__step,
  .site-notice__cta { display: none; }

  .site-notice__track {
    grid-area: track;
    height: 3.55rem;
    padding-right: 1.75rem;
  }

  .site-notice__slide { gap: 0.7rem; justify-content: center; }
  .site-notice__slide.is-on { width: auto; }
  .site-notice__meta { display: none; }
  .site-notice__copy { text-align: left; max-width: calc(100% - 0.5rem); min-width: 0; }

  .site-notice__title {
    font-size: 0.8125rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .site-notice__cta-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.12rem;
    padding: 0;
    background: none;
    color: var(--accent, #10b981);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 0;
  }

  .site-notice__cta-inline:hover { filter: brightness(1.12); }

  .site-notice__dots {
    grid-area: dots;
    justify-content: center;
    width: auto;
    justify-self: center;
    gap: 0.1rem;
    padding: 0;
  }

  .site-notice__dot {
    width: 1.15rem;
    height: 0.9rem;
    border-radius: 0;
    background: transparent;
    position: relative;
  }

  .site-notice__dot::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0.35rem;
    height: 0.35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
    transform: translate(-50%, -50%);
  }

  .site-notice__dot.is-on { background: transparent; }
  .site-notice__dot.is-on::after { background: var(--accent, #10b981); }

  .site-notice__close {
    top: 0.2rem;
    right: 0.2rem;
    transform: none;
    width: 1.85rem;
    height: 1.85rem;
  }
}
