
/* popup.css - News Organizations Popup Styling */

/* Popup overlay */
.news-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(2px);
}

/* Popup container */
.news-popup-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #eeeeee;
    border-radius: 30px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
}

/* Popup header */
.news-popup-header {
    background-color: #f7f7f7;
    padding: 1.5em 2em;
    border-bottom: 1px solid #dee2e6;
    border-radius: 30px 30px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-popup-title {
    margin: 0;
    font-size: 1.5em;
    color: #444;
    font-weight: 300;
    font-family: "Segoe UI", sans-serif;
}

/* Close button */
.news-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-weight: bold;
}

.news-close-btn:hover,
.news-close-btn:focus {
    background-color: #f56505;
    color: white;
    transform: scale(1.1);
}

/* Popup content */
.news-popup-content {
    padding: 2em;
    font-family: "Segoe UI", sans-serif;
    font-weight: 600;
    color: #333;
}

.news-popup-content p {
    margin: 0 0 1.5em 0;
    font-size: 1rem;
    line-height: 1.6;
}

/* Grid layout for links (3 per row) */
.news-link-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 1em;
}

/* Individual link styling */
.news-link-item {
    display: block;
    padding: 12px 16px;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-decoration: none;
    color: #003975;
    text-align: center;
    transition: all 0.3s ease;
    font-size: 0.9em;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-link-item:hover,
.news-link-item:focus {
    background-color: #f56505;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 101, 5, 0.3);
    border-color: #f56505;
}

/* Focus styles for accessibility */
.news-link-item:focus,
.news-close-btn:focus {
    outline: 2px solid #f56505;


/* === Long-label handling & tooltip (appended overrides) === */

/* Let items wrap onto multiple lines instead of clipping */
.news-link-item {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-break: break-word;
  overflow-wrap: anywhere;
  position: relative; /* for tooltip positioning */
}

/* Make grid flexible so long labels can breathe */
.news-link-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
  overflow: visible; /* allow tooltip to extend beyond cells */
}

/* Hover/focus tooltip with full label text (uses data-label set by JS) */
.news-link-item[data-label]::after {
  content: attr(data-label);
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.3;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: min(28rem, 90vw);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  pointer-events: none;
  z-index: 1100; /* above popup card */
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.news-link-item:hover::after,
.news-link-item:focus::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Small screens: slightly wider minimum so two columns look good */
@media (max-width: 640px) {
  .news-link-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
  }
}
