/* ==========================================================================
   Announcements — the bar above the header and the pop-up on arrival
   --------------------------------------------------------------------------
   Drawn by assets/js/ui/announcements.js; edited in Admin → Website →
   Announcements, whose preview uses this same file.

   Every colour is a site token, so both pieces follow light and dark on
   their own. The one exception is the bar's "custom" style, which takes the
   two colours the admin picked as --ann-bar-bg / --ann-bar-ink.

   The pop-up's panel is the same material as the dealer invite and the
   contact form (the approved reference): a thick frosted surface with a
   bright top edge, solid content on it — never glass on glass.

   z-index 126: above the dealer invite (124/125) and the quick view (110),
   below the toast stack (140).
   ========================================================================== */

/* ── the bar ─────────────────────────────────────────────────────────────── */

.ann-bar {
  --ann-bar-bg: var(--brand, #38D7FF);
  --ann-bar-ink: var(--brand-ink, #FFFFFF);
  position: relative;
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 var(--pad-x, 20px);
  background: var(--ann-bar-bg);
  color: var(--ann-bar-ink);
  font-size: 13.5px;
  line-height: 1.4;
  letter-spacing: -0.005em;
}
.ann-bar--ink  { --ann-bar-bg: var(--text, #1d1d1f); --ann-bar-ink: var(--bg, #fff); }
.ann-bar--soft { --ann-bar-bg: var(--accent-soft, #EAF6FF); --ann-bar-ink: var(--text, #1d1d1f); }
.ann-bar--soft .ann-bar__cta { color: var(--accent, #0872C6); }

.ann-bar__inner {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 14px;
  max-width: var(--max, 1328px);
  margin: 0 auto;
  padding: 9px 0;
  text-align: center;
}
/* Room for the close button, on both sides so the message stays centred. */
.ann-bar--dismissible .ann-bar__inner { padding-inline: 40px; }

.ann-bar__text { margin: 0; font-weight: 500; }

.ann-bar__cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: inherit;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.ann-bar__cta svg { width: 14px; height: 14px; transition: transform 180ms ease; }
.ann-bar__cta:hover svg { transform: translateX(2px); }
.ann-bar__cta:focus-visible,
.ann-bar__close:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 6px; }

.ann-bar__close {
  position: absolute;
  top: 50%;
  right: max(4px, calc(var(--pad-x, 20px) - 14px));
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--pill, 999px);
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 160ms ease, background-color 160ms ease;
}
.ann-bar__close:hover { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }
.ann-bar__close svg { width: 16px; height: 16px; }

@media (max-width: 600px) {
  .ann-bar { font-size: 13px; }
  .ann-bar--dismissible .ann-bar__inner { padding-inline: 4px 36px; }
}

/* ── the pop-up ──────────────────────────────────────────────────────────── */

.ann-pop {
  --ann-radius: 26px;
  --ann-pad: clamp(1.4rem, 4vw, 2rem);
  position: fixed;
  inset: 0;
  z-index: 126;
  display: grid;
  place-items: center;
  padding: 20px;
}

.ann-pop__scrim {
  position: absolute;
  inset: 0;
  background: rgba(8, 9, 13, 0.46);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  opacity: 0;
  transition: opacity 220ms ease;
}

.ann-pop__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(480px, 100%);
  max-height: min(88dvh, 820px);
  overflow: hidden;
  border-radius: var(--ann-radius);
  background: color-mix(in srgb, var(--surface, #fff) 82%, transparent);
  backdrop-filter: blur(40px) saturate(1.7);
  -webkit-backdrop-filter: blur(40px) saturate(1.7);
  border: 1px solid var(--line-soft, rgba(29,29,31,.07));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 30px 80px rgba(0, 0, 0, 0.28),
    0 6px 18px rgba(0, 0, 0, 0.10);
  color: var(--text, #1d1d1f);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 220ms ease, transform 260ms cubic-bezier(.2, .7, .2, 1);
  outline: none;
}
[data-theme="dark"] .ann-pop__panel { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 30px 80px rgba(0, 0, 0, 0.5); }

.ann-pop[data-open] .ann-pop__scrim { opacity: 1; }
.ann-pop[data-open] .ann-pop__panel { opacity: 1; transform: none; }

.ann-pop__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--pill, 999px);
  /* Solid, so it reads over any photograph. */
  background: var(--surface, #fff);
  color: var(--text, #1d1d1f);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
  cursor: pointer;
  transition: background-color 160ms ease;
}
.ann-pop__close:hover { background: var(--surface-sunk, #f5f5f7); }
.ann-pop__close svg { width: 16px; height: 16px; }
.ann-pop__close:focus-visible { outline: 3px solid var(--accent, #0872C6); outline-offset: 2px; }

.ann-pop__media {
  flex: none;
  margin: 0;
  aspect-ratio: 16 / 10;
  background: var(--surface-sunk, #f5f5f7);
  overflow: hidden;
}
.ann-pop__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ann-pop__media--contain img { object-fit: contain; }

.ann-pop__content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: var(--ann-pad);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.ann-pop--text .ann-pop__content { padding-top: calc(var(--ann-pad) + 8px); padding-right: calc(var(--ann-pad) + 36px); }

.ann-pop__eyebrow {
  margin: 0;
  color: var(--accent, #0872C6);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ann-pop__title {
  margin: 0;
  font-size: clamp(1.45rem, 3.4vw, 1.75rem);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.ann-pop__body { color: var(--text-2, #6e6e73); font-size: 15.5px; line-height: 1.55; }
.ann-pop__body p { margin: 0 0 0.6em; }
.ann-pop__body p:last-child { margin-bottom: 0; }

.ann-pop__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.ann-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--pill, 999px);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}
.ann-btn--primary {
  flex: 1 1 auto;
  background: var(--btn-primary, #38D7FF);
  color: var(--btn-primary-ink, #fff);
}
.ann-btn--primary:hover { background: var(--btn-primary-hi, #20C8F1); }
.ann-btn--quiet {
  background: transparent;
  color: var(--text, #1d1d1f);
  border-color: var(--line, rgba(29,29,31,.12));
}
.ann-btn--quiet:hover { background: var(--surface-sunk, #f5f5f7); }
.ann-btn:focus-visible { outline: 3px solid var(--accent, #0872C6); outline-offset: 3px; }

/* Picture beside the words, on a screen with the room for it. */
@media (min-width: 720px) {
  .ann-pop--side .ann-pop__panel { flex-direction: row; width: min(820px, 100%); }
  .ann-pop--side .ann-pop__media { flex: 0 0 44%; aspect-ratio: auto; min-height: 380px; }
  .ann-pop--side .ann-pop__content { justify-content: center; padding-right: calc(var(--ann-pad) + 20px); }
}

/* A phone: the window rises from the bottom edge, the way a sheet does. */
@media (max-width: 600px) {
  .ann-pop { place-items: end center; padding: 0; }
  .ann-pop__panel {
    width: 100%;
    max-height: 90dvh;
    border-radius: var(--ann-radius) var(--ann-radius) 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    transform: translateY(40px);
  }
  .ann-pop__actions { flex-direction: column; }
  .ann-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ann-pop__scrim, .ann-pop__panel, .ann-bar__cta svg { transition: none; }
  .ann-pop__panel { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .ann-pop__panel { background: var(--surface, #fff); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .ann-pop__scrim { backdrop-filter: none; -webkit-backdrop-filter: none; }
}
