/* ===================================
   MRI NEWS - Compact Horizontal Headlines
   Optimized for WP block columns
   =================================== */

.mri-news-container {
    display: grid !important; /* Force grid even inside WP blocks */
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8em;
    padding: 0.8em;
    margin: 0;
    background: #fff;
}

/* Individual news item */
.mri-news-container .mri-feed-item {
    display: flex !important; /* Horizontal layout */
    flex-direction: row;
    align-items: inherit;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 0.4em 0.6em;
    overflow: hidden;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.mri-news-container .mri-feed-item:hover {
    background: #f0f6ff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Thumbnail image on the left */
.mri-news-container .mri-feed-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 0.5em;
    flex-shrink: 0;
}

/* Text container */
.mri-news-container .mri-feed-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.1em;
    min-width: 0; /* allow text to shrink */
}

/* Title */
.mri-news-container .mri-feed-item h3 {
    font-size: 0.85em;
    margin: 0;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;  /* limit to 2 lines */
    -webkit-box-orient: horizontal;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;  /* wrap long words */
}


.mri-news-container .mri-feed-item h3 a {
    color: #111;
    text-decoration: none;
    font-weight: 600;
}

.mri-news-container .mri-feed-item h3 a:hover {
    color: #0073aa;
}

/* Meta info: source + date */
.mri-news-container .mri-feed-meta {
    display: inline-flex;
    gap: 0.3em;
    font-size: 0.75em;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hide description for compact layout */
.mri-news-container .mri-feed-item p {
    display: none;
}

/* Remove WP block column padding for news container */
.wp-block-column .mri-news-container {
    margin: 0;
    padding: 0;
}

/* -----------------------------
   Responsive Adjustments
   ----------------------------- */

/* 3 columns for large screens under 1200px */
@media (max-width: 1200px) {
    .mri-news-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 2 columns for tablets */
@media (max-width: 900px) {
    .mri-news-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 1 column for small phones */
@media (max-width: 600px) {
    .mri-news-container {
        grid-template-columns: 1fr;
    }

    .mri-news-container .mri-feed-image {
        width: 50px;
        height: 50px;
    }

    .mri-news-container .mri-feed-item h3 {
        font-size: 0.9em;
        white-space: normal; /* allow wrapping on very small screens */
    }

    .mri-news-container .mri-feed-meta {
        font-size: 0.7em;
    }
}

/* --- Scrolling News Ticker (with thumbnails) --- */
.mri-news-ticker {
  position: relative;
  overflow: hidden;
  width: 100%;
  background: #f9f9f9;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
  white-space: nowrap;
  padding: 0.5em 0;
}

.mri-news-track {
  display: inline-flex;
  align-items: center;
  gap: 2em;
  animation: ticker-scroll 150s linear infinite;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-20%); }
}

.mri-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  white-space: nowrap;
  font-size: 0.9em;
  color: #333;
}

.mri-ticker-thumb {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.mri-ticker-item a {
  color: #0073aa;
  text-decoration: none;
  font-weight: 500;
}

.mri-ticker-item a:hover {
  text-decoration: underline;
}

.mri-ticker-meta {
  color: #777;
  font-size: 0.85em;
  margin-left: 0.3em;
}

.mri-news-ticker:hover .mri-news-track {
  animation-play-state: paused;
}

