/* Announcements modal — first-load popup, Sanity-editable, capped at 5 items internally. */

#ann-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(6, 12, 11, 0.72);
  opacity: 0;
  visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 0.24s ease;
}
#ann-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

.ann-modal {
  position: relative;
  width: min(720px, 100%);
  background: var(--forest-ink);
  border: 1px solid rgba(168, 132, 42, 0.28);
  border-radius: 3px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.3);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  overflow: hidden;
  transform: translateY(14px) scale(0.985);
  opacity: 0;
  transition: transform 0.28s ease, opacity 0.28s ease;
}
#ann-backdrop.is-active .ann-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.ann-modal.no-media { grid-template-columns: 1fr; }

.ann-body {
  padding: 44px 40px 34px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ann-tag {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-lt);
  font-weight: 600;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ann-tag::before {
  content: "";
  width: 14px;
  height: 1px;
  background: var(--gold);
  display: inline-block;
}
.ann-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 25px;
  line-height: 1.24;
  color: var(--white);
  margin: 0 0 14px;
}
.ann-text {
  font-size: 13.5px;
  line-height: 1.75;
  color: rgba(228, 235, 246, 0.72);
  margin: 0 0 24px;
}
.ann-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.ann-cta {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--forest-ink);
  background: linear-gradient(180deg, var(--gold-lt), var(--gold));
  padding: 12px 20px;
  border-radius: 2px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
/* The class's own `display` above beats the UA stylesheet's [hidden] rule
   (same-origin author CSS always wins over UA defaults), so an item with no
   link — `hidden` set in JS — would otherwise stay visible with whatever
   href/label was left over from the previously rendered item. */
.ann-cta[hidden] { display: none; }
.ann-cta svg { width: 13px; height: 13px; flex: none; }
.ann-dismiss {
  font-family: var(--sans);
  font-size: 12px;
  color: rgba(228, 235, 246, 0.5);
  background: none;
  border: 0;
  letter-spacing: 0.03em;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
}
.ann-dismiss:hover { color: rgba(228, 235, 246, 0.75); }

.ann-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(201, 160, 64, 0.45);
  background: rgba(6, 12, 11, 0.55);
  color: rgba(244, 240, 230, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  z-index: 2;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.ann-close:hover {
  color: var(--forest-ink);
  background: linear-gradient(180deg, var(--gold-lt), var(--gold));
  border-color: var(--gold-lt);
  transform: scale(1.06);
}
.ann-close:focus-visible { outline: 2px solid var(--gold-lt); outline-offset: 2px; }

.ann-media {
  position: relative;
  background: var(--forest-md);
  overflow: hidden;
}
.ann-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(200deg, rgba(10, 30, 36, 0) 30%, rgba(10, 30, 36, 0.55) 100%);
}
.ann-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 320px;
}
.ann-media .ann-corner {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 22px;
  height: 22px;
  border-top: 1px solid rgba(201, 160, 64, 0.5);
  border-left: 1px solid rgba(201, 160, 64, 0.5);
  z-index: 1;
}

/* Pager — only rendered/shown when more than one announcement is active */
.ann-pager {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}
.ann-dots { display: flex; gap: 6px; }
.ann-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(228, 235, 246, 0.38);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s ease, width 0.15s ease;
}
.ann-dot:hover { background: rgba(228, 235, 246, 0.6); }
.ann-dot.is-on { background: var(--gold-lt); width: 18px; border-radius: 3px; }
.ann-count {
  font-size: 11px;
  color: rgba(228, 235, 246, 0.45);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.ann-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(6, 12, 11, 0.72);
  border: 1px solid rgba(201, 160, 64, 0.5);
  color: rgba(244, 240, 230, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.ann-arrow svg { width: 18px; height: 18px; }
/* Kept inside the modal's own box (it has overflow:hidden) instead of the
   earlier negative offset, which let the modal clip off the outer half of
   each button. */
.ann-arrow.prev { left: 10px; }
.ann-arrow.next { right: 10px; }
.ann-arrow:hover {
  color: var(--forest-ink);
  background: linear-gradient(180deg, var(--gold-lt), var(--gold));
  border-color: var(--gold-lt);
  transform: translateY(-50%) scale(1.08);
}
.ann-arrow:focus-visible { outline: 2px solid var(--gold-lt); outline-offset: 2px; }

@media (max-width: 720px) {
  #ann-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .ann-modal {
    width: 100%;
    grid-template-columns: 1fr;
    border-radius: 18px 18px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    transform: translateY(100%);
    max-height: 88vh;
    overflow-y: auto;
  }
  #ann-backdrop.is-active .ann-modal { transform: translateY(0); }
  .ann-modal::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(228, 235, 246, 0.25);
    margin: 10px auto 0;
    grid-column: 1 / -1;
  }
  .ann-media { order: -1; height: 150px; }
  .ann-media img { min-height: 0; height: 150px; }
  .ann-body { padding: 4px 22px 26px; }
  .ann-title { font-size: 20px; }
  .ann-actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .ann-cta { justify-content: center; padding: 13px; }
  .ann-dismiss { text-align: center; }
  .ann-pager { justify-content: center; }
  .ann-arrow { display: none; }
  .ann-close { top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  #ann-backdrop, .ann-modal { transition: none; }
}
