.news-flash-badge {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--color-gov-primary);
  color: #ffffff;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-left: 8px;
}

.news-flash-badge:hover {
  background: var(--color-gov-primary-dark);
  transform: scale(1.1);
}

.news-flash-badge-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #d4351c;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Screen reader only utility */
.news-flash-carousel .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.news-flash-carousel {
  position: fixed;
  top: 130px;
  /* Below the sticky header */
  right: 20px;
  width: 380px;
  max-width: calc(100% - 40px);
  z-index: 51000;
  /* Just below header z-index (50) */
  padding: 12px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(255, 255, 255, 0.95) 100%
  );
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

/* Minimize button */
.news-flash-minimize {
  position: absolute;
  top: 12px;
  right: 19px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #505a5f;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.news-flash-minimize:hover {
  background: #f3f2f1;
  color: var(--color-gov-text);
}

.news-flash-minimize:focus {
  outline: 3px solid #ffdd00;
  background: #ffdd00;
}

/* Scrollable content area */
.news-flash-container {
  max-height: 200px;
  overflow-y: auto;
  flex: 1;
}

/* Custom scrollbar styling */
.news-flash-container::-webkit-scrollbar {
  width: 6px;
}

.news-flash-container::-webkit-scrollbar-track {
  background: transparent;
}

.news-flash-container::-webkit-scrollbar-thumb {
  background: #b1b4b6;
  border-radius: 3px;
}

.news-flash-container::-webkit-scrollbar-thumb:hover {
  background: #505a5f;
}

/* Focus styles for keyboard navigation */
.news-flash-carousel:focus {
  outline: 3px solid var(--color-gov-primary);
  outline-offset: 2px;
  border-radius: 8px;
}

.news-flash-carousel:focus:not(:focus-visible) {
  outline: none;
}

.news-flash-carousel:focus-visible {
  outline: 3px solid var(--color-gov-primary);
  outline-offset: 2px;
  border-radius: 8px;
}

.news-flash-container {
  position: relative;
}

/* Card-style items */
.news-flash-item {
  position: relative;
  padding: 20px 24px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.08),
    0 2px 4px rgba(0, 0, 0, 0.04);
  border-top: 4px solid var(--flash-color, var(--color-gov-primary));
  animation: fadeIn 0.4s ease-out;
  overflow: hidden;
}

/* Type-specific accent colors using CSS custom properties */
.news-flash-info {
  --flash-color: var(--color-gov-primary);
}

.news-flash-warning {
  --flash-color: #f47738;
}

.news-flash-alert {
  --flash-color: #d4351c;
}

.news-flash-success {
  --flash-color: #00703c;
}

.news-flash-promotion {
  --flash-color: #28a197;
}

.news-flash-maintenance {
  --flash-color: #505a5f;
}

/* Pulse animation for alerts */
.news-flash-pulse {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 12px;
  height: 12px;
  background: #d4351c;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.5);
    opacity: 0.4;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Alert items get extra left padding for pulse indicator */
.news-flash-alert .news-flash-content {
  padding-left: 28px;
}

.news-flash-content {
  position: relative;
}

/* Header row: icon + title + close button */
.news-flash-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Icon badge styling */
.news-flash-icon-badge {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--flash-color, var(--color-gov-primary));
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.news-flash-icon-badge svg {
  width: 18px;
  height: 18px;
  stroke: #ffffff !important;
}

.news-flash-icon-badge svg path,
.news-flash-icon-badge svg line,
.news-flash-icon-badge svg circle,
.news-flash-icon-badge svg polyline,
.news-flash-icon-badge svg polygon {
  stroke: #ffffff !important;
}

.news-flash-title {
  flex: 1;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
  margin: 0;
  /* Keep readable when Google Translate wraps content in <font> or overrides inline theme colours. */
  color: var(--color-gov-text, #0b0c0c) !important;
}

.news-flash-message {
  color: var(--color-gov-text);
  font-size: 14px;
  line-height: 1.5;
  margin-top: 10px;
  width: 100%;
}

.news-flash-message p {
  margin: 0;
}

.news-flash-message p + p {
  margin-top: 6px;
}

/* Close button */
.news-flash-close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: #505a5f;
  border-radius: 6px;
  transition: all 0.2s ease;
  margin-left: auto;
}

.news-flash-close:hover {
  background: #f3f2f1;
  color: var(--color-gov-text);
}

.news-flash-close:focus {
  outline: 3px solid var(--color-gov-focus);
  outline-offset: 0;
  background: var(--color-gov-focus);
  color: var(--color-gov-text);
}

.news-flash-close:focus:not(:focus-visible) {
  outline: none;
  background: transparent;
}

.news-flash-close:focus-visible {
  outline: 3px solid var(--color-gov-focus);
  outline-offset: 0;
  background: var(--color-gov-focus);
  color: var(--color-gov-text);
}

/* Carousel controls - kept at bottom */
.news-flash-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-shrink: 0;
  padding-top: 12px;
  border-top: 1px solid #e5e5e5;
  margin-top: 12px;
  position: relative;
  z-index: 10;
}

.news-flash-prev,
.news-flash-next {
  background: var(--color-gov-primary);
  border: 2px solid var(--color-gov-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ffffff;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.news-flash-prev:hover,
.news-flash-next:hover {
  background: var(--color-gov-primary-dark);
  border-color: var(--color-gov-primary-dark);
}

.news-flash-prev:focus,
.news-flash-next:focus {
  outline: 3px solid #ffdd00;
  outline-offset: 0;
  background: var(--color-gov-primary-dark);
  border-color: var(--color-gov-primary-dark);
}

.news-flash-prev:focus:not(:focus-visible),
.news-flash-next:focus:not(:focus-visible) {
  outline: none;
  background: var(--color-gov-primary);
  border-color: var(--color-gov-primary);
}

.news-flash-prev:focus-visible,
.news-flash-next:focus-visible {
  outline: 3px solid #ffdd00;
  outline-offset: 0;
  background: var(--color-gov-primary-dark);
  border-color: var(--color-gov-primary-dark);
}

/* Pill indicators */
.news-flash-indicators {
  display: flex;
  gap: 8px;
  align-items: center;
}

.news-flash-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #b1b4b6;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.news-flash-indicator.active {
  background: var(--color-gov-primary);
  width: 32px;
  border-radius: 6px;
}

.news-flash-indicator:hover:not(.active) {
  background: #505a5f;
}

.news-flash-indicator:focus {
  outline: 3px solid #ffdd00;
  outline-offset: 2px;
}

.news-flash-indicator:focus:not(:focus-visible) {
  outline: none;
}

.news-flash-indicator:focus-visible {
  outline: 3px solid #ffdd00;
  outline-offset: 2px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .news-flash-carousel {
    padding: 0 12px;
  }

  .news-flash-item {
    padding: 16px 18px;
  }

  .news-flash-content {
    gap: 12px;
  }

  .news-flash-icon-badge {
    width: 38px;
    height: 38px;
    border-radius: 8px;
  }

  .news-flash-icon-badge svg {
    width: 18px;
    height: 18px;
  }

  .news-flash-title {
    font-size: 15px;
  }

  .news-flash-message {
    font-size: 14px;
  }

  .news-flash-alert .news-flash-content {
    padding-left: 20px;
  }

  .news-flash-pulse {
    width: 10px;
    height: 10px;
    top: 16px;
    left: 14px;
  }

  .news-flash-prev,
  .news-flash-next {
    width: 36px;
    height: 36px;
  }

  .news-flash-indicator {
    width: 10px;
    height: 10px;
  }

  .news-flash-indicator.active {
    width: 24px;
  }
}
