/**
 * NAJLAH.EU ANNOUNCEMENT BANNER STYLES
 * Matches the existing site design with smooth animations
 */

/* Banner container - fixed at top */
.najlah-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background-color: #254583; /* Matching the existing welcome bar color */
  color: #ffffff;
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-100%);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Banner is visible when active */
.najlah-banner.is-visible {
  transform: translateY(0);
}

/* Banner is hidden when dismissed */
.najlah-banner.is-hidden {
  transform: translateY(-100%);
}

/* Content wrapper - flex layout for text and close button */
.najlah-banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  max-width: 100%;
  margin: 0 auto;
  padding: 6px 20px 6px 20px; /* Symmetric padding, text stays centered */
  min-height: 36px; /* Reduced height */
}

/* Banner text/link */
.najlah-banner-text {
  flex: 0 1 auto;
  text-align: center;
  color: #ffffff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.2px;
  transition: opacity 0.2s ease;
  cursor: pointer;
  padding: 4px 16px;
  margin: 0;
}

.najlah-banner-text:hover,
.najlah-banner-text:focus {
  opacity: 0.85;
  text-decoration: underline;
  outline: none;
}

.najlah-banner-text:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Close button - positioned at absolute far right edge */
.najlah-banner-close {
  position: absolute;
  right: 20px; /* 20px from the right edge of banner */
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  transition: background-color 0.2s ease, transform 0.1s ease;
  z-index: 10; /* Ensure button stays on top */
}

.najlah-banner-close:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.najlah-banner-close:active {
  transform: translateY(-50%) scale(0.95);
}

.najlah-banner-close:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.najlah-banner-close svg {
  display: block;
  width: 16px;
  height: 16px;
}

/* Body offset when banner is visible - prevents content jump */
body.najlah-banner-active {
  padding-top: 0; /* Will be set dynamically by JavaScript */
}

/* Responsive design */
@media screen and (max-width: 768px) {
  .najlah-banner-content {
    padding: 5px 45px 5px 16px; /* Thinner on mobile */
  }

  .najlah-banner-text {
    font-size: 14px;
    padding: 3px 12px;
  }

  .najlah-banner-close {
    right: 8px;
    width: 26px;
    height: 26px;
    padding: 5px;
  }
}

@media screen and (max-width: 480px) {
  .najlah-banner-content {
    padding: 4px 40px 4px 12px;
  }

  .najlah-banner-text {
    font-size: 13px;
    padding: 2px 8px;
  }

  .najlah-banner-close {
    right: 6px;
    width: 24px;
    height: 24px;
  }
}

/* Ensure banner doesn't interfere with WordPress admin bar */
body.admin-bar .najlah-banner {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar .najlah-banner {
    top: 46px;
  }
}

/* Print styles - hide banner when printing */
@media print {
  .najlah-banner {
    display: none !important;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .najlah-banner {
    transition-duration: 0.01ms;
  }
}