/* ===========================
   NEWS BULLETIN — COMPLETE CSS
   =========================== */

/* Vars: single source of truth */
:root {
  --nb-width: min(560px, 94vw); /* overall max width */
  --nb-height: 280px; /* fixed card height */
  --nb-media-height: 110px; /* reserved image area height */
}

/* Wrapper around the card so buttons can overlay/align */
.news-bulletin-carousel {
  position: relative;
  width: 100%;
  max-width: var(--nb-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible; /* allow buttons to show fully */
  box-sizing: border-box;
  padding: 0 8px; /* a little gutter on tiny screens */
}

/* Stage holds all cards */
.news-bulletin-stage {
  position: relative;
  width: 100%;
  max-width: var(--nb-width);
  margin: 0 auto;
}

/* Show one card at a time (JS controls visibility) */
.news-bulletin-stage > .news-bulletin-container {
  display: none;
}
/* First card visible if JS is disabled */
.news-bulletin-stage > .news-bulletin-container:first-child {
  display: block;
}

/* The card itself */
.news-bulletin-container {
  width: 100%;
  height: var(--nb-height);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;

  box-sizing: border-box;

  /* visual styles from your original */
  text-align: center;
  background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
  border: 1px solid rgb(170, 186, 200);
  border-radius: 16px;
  padding: 18px 22px;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.12);
  font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
  color: #5a6b7a;
}

/* Subtle top accent bar */
.news-bulletin-accent {
  height: 4px;
  width: 100%;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  border-radius: 999px;
  margin-bottom: 12px;
}

/* Fixed-height media box that centers images/links */
.news-bulletin-media {
  height: var(--nb-media-height);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

/* Link fills the media box and centers its contents */
.news-bulletin-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-decoration: none;
  line-height: 0; /* removes inline gap around img */
}

/* Image shrinks to fit the media area */
.news-bulletin-media .news-bulletin-logo {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain; /* preserve aspect, no crop */
  display: block;
  border-radius: 12px;
  filter: drop-shadow(0 4px 10px rgba(15, 23, 42, 0.12));
  margin: 0;
}

/* Title text */
.news-bulletin-title {
  margin: 6px 0 4px 0;
  font-size: 1.25rem;
  letter-spacing: 0.2px;
  color: #3c4a55;
}

/* Subtitle text */
.news-bulletin-subtitle {
  margin: 0 0 12px 0;
  font-weight: 600;
  color: #64748b;
}

/* Nav buttons (shared) */
.news-bulletin-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 44px;
  width: 44px;
  border-radius: 999px;
  border: 1px solid rgba(100, 116, 139, 0.35);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.15);
  color: #334155;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 2;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  backdrop-filter: blur(4px);
}

.news-bulletin-btn:hover {
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.22);
  transform: translateY(-50%) scale(1.04);
}

.news-bulletin-btn:active {
  transform: translateY(-50%) scale(0.98);
}

.news-bulletin-btn:focus-visible {
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
}

/* Left/Right positions (keep inside edges) */
.news-bulletin-btn-prev {
  left: 4px;
}
.news-bulletin-btn-next {
  right: 4px;
}

/* Disabled state for nav buttons (e.g., only one card) */
.news-bulletin-btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Respect reduced motion users */
@media (prefers-reduced-motion: reduce) {
  .news-bulletin-btn {
    transition: none;
  }
}

/* ---------- Responsive Tweaks ---------- */
@media (max-width: 480px) {
  :root {
    --nb-width: 95vw;
    --nb-height: 250px;
    --nb-media-height: 100px;
  }

  .news-bulletin-container {
    padding: 14px 14px;
  }
  .news-bulletin-title {
    font-size: 1.1rem;
  }
  .news-bulletin-subtitle {
    font-size: 0.92rem;
  }

  .news-bulletin-btn {
    height: 40px;
    width: 40px;
  }
  .news-bulletin-btn-prev {
    left: 2px;
  }
  .news-bulletin-btn-next {
    right: 2px;
  }
}

@media (max-width: 360px) {
  :root {
    --nb-height: 240px;
    --nb-media-height: 90px;
  }
}

/* --- DESKTOP CLIP HOT-FIX --- */

/* Ensure nothing in the chain clips the card/buttons */
.news-bulletin-carousel,
.news-bulletin-stage,
.news-bulletin-container {
  overflow: visible !important;
}

/* Make the stage the positioning context and keep buttons INSIDE the card */
.news-bulletin-stage {
  position: relative;
}
.news-bulletin-btn {
  position: absolute;
  z-index: 5;
  top: 50%;
  transform: translateY(-50%);
}
.news-bulletin-btn-prev {
  left: 8px;
}
.news-bulletin-btn-next {
  right: 8px;
}

/* Allow the card to grow on environments where fonts render taller */
.news-bulletin-container {
  min-height: var(--nb-height) !important;
  height: auto !important;
}

/* Reserve image area height without stretching the card */
.news-bulletin-media {
  flex: 0 0 var(--nb-media-height);
  height: var(--nb-media-height);
}

/* Guard against a global border-radius/overflow on an ancestor */
.news-bulletin-carousel {
  clip-path: inset(0 round 0) !important;
}

/* If the card sits inside a flex/grid parent, avoid overflow quirks */
.news-bulletin-carousel {
  min-width: 0;
}
