/* --------------------------------------------------------------
   Announcements Banner – Trade in Cool
   -------------------------------------------------------------- */

/* Base wrapper */
.announcement-banner {
  padding: 1.5rem 0;
  width: 100%;
  border-block: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

/* Inner container */
.announcement-banner .announcement-inner {
  position: relative; /* Needed for absolute positioning of the dismiss button */
  max-width: var(--wp--style--global--content-size, 1200px);
  margin-inline: auto;
  padding-inline: var(--wp--style--root--padding-right, 1rem);
}

/* --------------------------------------------------------------
   Alignment (scoped)
   -------------------------------------------------------------- */
.announcement-banner.align-left .announcement-inner {
  text-align: left;
}

.announcement-banner.align-center .announcement-inner {
  text-align: center;
}

.announcement-banner.align-right .announcement-inner {
  text-align: right;
}

/* --------------------------------------------------------------
   Priority color schemes (AAA contrast ratios)
   -------------------------------------------------------------- */
.announcement-banner.priority-normal {
  background-color: #f5f5f5; /* contrast vs #222 = 11.9:1 */
  color: #222;
  border-color: #d9d9d9;
}

.announcement-banner.priority-important {
  background-color: #fff1b8; /* contrast vs #212121 = 10.6:1 */
  color: #212121;
  border-color: #e6c96b;
}

.announcement-banner.priority-urgent {
  background-color: #f7c6c7; /* contrast vs #111 = 9.1:1 */
  color: #111;
  border-color: #d88a8c;
}

/* Links always underlined for accessibility */
.announcement-banner a {
  text-decoration: underline;
  color: inherit;
}

/* --------------------------------------------------------------
   Announcement Items (Accordion)
   -------------------------------------------------------------- */
.announcement-banner .announcement-item {
  margin: 0;
  position: relative;
}

.announcement-banner .announcement-heading {
  margin: 0 2.5rem 0 0; /* room for dismiss button */
  font-size: 1.125rem;
}

.announcement-banner .announcement-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: inherit;
  padding: 0.25rem 0;
  cursor: pointer;
  line-height: 1.3;
}

/* Disclosure chevron */
.announcement-banner .announcement-toggle::after {
  display: inline-block;
  margin-left: 0.5rem;
  transform: translateY(-1px);
}

.announcement-banner .announcement-toggle::after {
  content: '+';
}

.announcement-banner .announcement-toggle[aria-expanded="true"]::after {
  content: '−';
}

/* Accessible focus outline */
.announcement-banner .announcement-toggle:focus-visible,
.announcement-banner .announcement-dismiss:focus-visible {
  outline: 3px solid #005fcc; /* WCAG AAA visible focus color */
  outline-offset: 2px;
}

/* Panel content */
.announcement-banner .announcement-panel {
  margin-top: 0.5rem;
}

/* --------------------------------------------------------------
   Dismiss Button
   -------------------------------------------------------------- */
.announcement-banner .announcement-dismiss {
  position: absolute;
  top: 0.5rem;
  right: clamp(8px, 2vw, 16px);
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.announcement-banner .announcement-dismiss:hover {
  opacity: 0.7;
}

/* --------------------------------------------------------------
   Motion and Responsiveness
   -------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

@media (max-width: 640px) {
  .announcement-banner .announcement-heading {
    font-size: 1rem;
  }

  .announcement-banner .announcement-dismiss {
    font-size: 1.25rem;
  }
}

/* --------------------------------------------------------------
   Utility
   -------------------------------------------------------------- */
.announcement-banner .announcement-panel p:last-child {
  margin-bottom: 0;
}

