/*
 * Instant Alerts: rapid card share icon and share menu.
 *
 * Reuses the full alert page share bar's look: the icon button and the menu
 * buttons are .share-btn inside .share-bar-compact (site css/content.css), so
 * colors, sizes and hover match. This file only places them on a card: the
 * wrapper drops the bar's padding and background, and the menu floats above
 * the icon so opening it never shifts the card's layout.
 */
.share-bar-compact.rapid-share {
  position: relative;
  display: inline-flex;
  margin: 0 0 0 auto;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
}

.share-bar-compact.rapid-share__menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 20;
  margin: 0;
  gap: var(--space-1, 0.25rem);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

/*
 * On phones the menu opens leftwards from an icon that sits well inside the
 * card, so one row of ten would run off the screen: lay it out as rows of
 * five instead (480px is the site's phone breakpoint).
 */
@media (max-width: 480px) {
  .share-bar-compact.rapid-share__menu {
    display: grid;
    grid-template-columns: repeat(5, auto);
  }
}

.rapid-share .share-btn:focus-visible {
  color: var(--accent-primary);
  outline: 2px solid var(--accent-primary);
  outline-offset: 1px;
}

.rapid-share .share-btn--copied {
  color: var(--accent-primary);
}

.rapid-share__copied-note {
  padding: 0 0.25rem;
  font-size: var(--text-xs, 0.75rem);
  font-weight: 600;
  color: var(--accent-primary);
}

/*
 * The card's share icon as a filled pill in the site accent colour: white
 * icon, 32px tall, with an invisible 40px hit area (the ::before) so it stays
 * easy to tap. Hover darkens the fill slightly.
 */
.share-bar-compact.rapid-share .rapid-share__pill {
  position: relative;
  width: 44px;
  height: 32px;
  min-height: 32px;
  border-radius: 999px;
  color: #fff;
  background: var(--accent-primary);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.share-bar-compact.rapid-share .rapid-share__pill::before {
  content: "";
  position: absolute;
  inset: -4px -2px;
  border-radius: 999px;
}

.share-bar-compact.rapid-share .rapid-share__pill:hover,
.share-bar-compact.rapid-share .rapid-share__pill[aria-expanded="true"] {
  color: #fff;
  background: color-mix(in srgb, var(--accent-primary) 82%, #000);
}

.share-bar-compact.rapid-share .rapid-share__pill:focus-visible,
.share-bar-compact.rapid-share .rapid-share__pill.share-btn--copied {
  color: #fff;
}

.share-bar-compact.rapid-share .rapid-share__pill:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

.share-bar-compact.rapid-share .rapid-share__pill svg {
  width: 16px;
  height: 16px;
}

/* One soft glow, played once by share-link.js when the pill first scrolls into view. */
@keyframes rapid-share-pill-glow {
  0%   { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.45); }
  100% { box-shadow: 0 0 0 10px rgba(var(--accent-rgb), 0); }
}

.share-bar-compact.rapid-share .rapid-share__pill--glow {
  animation: rapid-share-pill-glow 1.2s ease-out 1;
}

@media (prefers-reduced-motion: reduce) {
  .share-bar-compact.rapid-share .rapid-share__pill--glow { animation: none; }
}

/* The translated-alert note and its Show original toggle. */
.alert-translation__note {
  margin: var(--space-1, 0.25rem) 0;
  font-size: 0.8rem;
}
/* Same outline button as the Rapid Alerts page's .ra-tab-message__btn, whose
   colours need no theme variable: not every theme defines --border-subtle. */
.alert-translation__button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.85rem;
  border: 1px solid rgba(148,163,184,.45);
  border-radius: 0.4rem;
  font-size: 0.88rem;
  white-space: nowrap;
  cursor: pointer;
}
.alert-translation__button:hover {
  background: rgba(148,163,184,.16);
}
.alert-translation__button:focus-visible {
  outline: 2px solid var(--accent-primary, currentColor);
  outline-offset: 2px;
}
.alert-translation__title {
  font-weight: 600;
}

/*
 * An official statement shown as its body's words: the attribution on a card and
 * on the alert page, and the quoted block on the alert page. Colours come from the
 * site's theme variables, so both themes follow; widths are left to the text, so a
 * phone wraps it.
 */
.statement-frame__label {
  font-weight: 600;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

p.statement-frame__label {
  margin: 0 0 var(--space-2, 0.5rem);
}

.statement-frame__quote {
  margin: 0 0 var(--space-4, 1rem);
  padding: 0 0 0 var(--space-4, 1rem);
  border-left: 3px solid var(--border-subtle);
}
