/*
 * News & Announcements Bar - Official Theme
 * ==========================================
 * 
 * CUSTOMIZATION GUIDE:
 * --------------------
 * This component uses CSS variables from assets/css/style.css.
 * To change colors, edit the :root block in style.css.
 *
 * Local overrides available:
 *   --news-official-bg          : Section background (default: var(--site-bg, #162448))
 *   --news-official-card-bg     : Card background (default: var(--card-bg, #ffffff))
 *   --news-official-card-shadow : Card shadow (default: rgba(0,0,0,0.08))
 *   --news-official-card-shadow-hover : Hover shadow (default: rgba(0,0,0,0.16))
 *   --news-official-text        : Card title color (default: var(--card-text, #0b1220))
 *   --news-official-text-muted  : Card description color (default: #4a4a5a)
 *   --news-official-accent      : CTA button color (default: var(--accent, #0b5ed7))
 *   --news-official-accent-hover: CTA hover color (default: var(--accent-hover, #3373b5))
 *   --news-official-heading     : Section heading color (default: var(--text-main, #ffffff))
 *
 * REPLACING THUMBNAILS:
 * ---------------------
 * - Recommended dimensions: 1200x675 pixels (16:9 aspect ratio)
 * - Minimum width: 1200px for best quality on large screens
 * - Replace assets/images/news-1.jpg, news-2.jpg, news-3.jpg with your images
 * - Keep filenames the same or update src attributes in index.html
 *
 * CHANGING HEADLINES:
 * -------------------
 * - Edit the <h3 class="news-official__title"> text in index.html
 * - Edit the <p class="news-official__desc"> text for descriptions
 */

/* Section container - uses site main background */
.news-official {
  background: var(--news-official-bg, var(--site-bg, #162448));
  padding: 48px 0 56px;
}

.news-official__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Section heading - light color for dark background */
.news-official__heading {
  font-size: 2rem;
  font-weight: 700;
  color: var(--news-official-heading, var(--text-main, #ffffff));
  text-align: center;
  margin-bottom: 32px;
  letter-spacing: 0.01em;
}

/* Card grid - responsive */
.news-official__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 600px) {
  .news-official__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .news-official__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Individual card - WHITE background with subtle shadow and rounded corners */
.news-official__card {
  background: var(--news-official-card-bg, var(--card-bg, #ffffff));
  border: none;
  border-radius: var(--radius, 12px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 12px var(--news-official-card-shadow, rgba(0, 0, 0, 0.08));
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

/* Card hover/focus: translateY(-4px) and subtle shadow intensify */
.news-official__card:hover,
.news-official__card:focus-within {
  box-shadow: 0 8px 28px var(--news-official-card-shadow-hover, rgba(0, 0, 0, 0.16));
  transform: translateY(-4px);
}

/* Card thumbnail wrapper for gradient overlay */
.news-official__thumb-wrapper {
  position: relative;
  overflow: hidden;
}

/* Card thumbnail - approx 16:9 aspect ratio */
.news-official__thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  background: #e8eef5;
  transition: transform 0.25s ease;
}

/* Thumbnail scales up slightly on card hover */
.news-official__card:hover .news-official__thumb,
.news-official__card:focus-within .news-official__thumb {
  transform: scale(1.03);
}

/* Soft bottom gradient overlay on thumbnail for text contrast */
.news-official__thumb-wrapper::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.15), transparent);
  pointer-events: none;
}

/* Card content - white background */
.news-official__content {
  padding: 18px 20px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--news-official-card-bg, var(--card-bg, #ffffff));
}

/* Card headline - dark text for white background */
.news-official__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--news-official-text, var(--card-text, #0b1220));
  margin: 0 0 10px;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Card description - muted dark text */
.news-official__desc {
  font-size: 0.95rem;
  color: var(--news-official-text-muted, #4a4a5a);
  margin: 0 0 18px;
  line-height: 1.55;
  flex: 1;
}

/* Read more CTA link - accent color button style */
.news-official__cta {
  display: inline-block;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-contrast, #ffffff);
  background: var(--news-official-accent, var(--accent, #0b5ed7));
  border: none;
  border-radius: 6px;
  text-decoration: none;
  text-align: center;
  transition: background-color 0.2s ease, transform 0.2s ease;
  align-self: flex-start;
}

.news-official__cta:hover {
  background: var(--news-official-accent-hover, var(--accent-hover, #3373b5));
  transform: translateY(-1px);
}

/* Keyboard navigability - visible focus outlines for CTA */
.news-official__cta:focus {
  background: var(--news-official-accent-hover, var(--accent-hover, #3373b5));
  outline: none;
}

.news-official__cta:focus-visible {
  outline: 3px solid var(--news-official-accent, var(--accent, #0b5ed7));
  outline-offset: 3px;
  background: var(--news-official-accent-hover, var(--accent-hover, #3373b5));
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .news-official__card,
  .news-official__thumb,
  .news-official__cta {
    transition: none;
  }
  
  .news-official__card:hover,
  .news-official__card:focus-within {
    transform: none;
  }
  
  .news-official__card:hover .news-official__thumb,
  .news-official__card:focus-within .news-official__thumb {
    transform: none;
  }
  
  .news-official__cta:hover {
    transform: none;
  }
}
