/* assets/css/news.css */

:root {
  --mscq-navy: #0f1f3d;
  --mscq-gold: #c9a227;
  --mscq-slate: #5c6c82;
  --mscq-muted: #6b7280;
  --mscq-soft: #f8fafd;
  --mscq-border: #e5eaf2;
}
.news-page { font-family: 'Source Sans 3', sans-serif; color: #334155; background: #fff; }

/* Page hero — inherited from main.css (.page-hero system) */
.news-page .page-hero-text p { max-width: 640px; }

/* Filters */
.filters {
  display: flex; flex-wrap: wrap; gap: 12px;
  justify-content: center; margin-bottom: 32px;
}
.filters a {
  display: inline-block; padding: 8px 24px;
  border-radius: 50px; border: 1px solid #cbd5e1;
  color: #64748b; text-decoration: none;
  font-weight: 600; font-size: 0.95rem;
  transition: all 0.2s ease;
}
.filters a:hover { border-color: var(--mscq-navy); color: var(--mscq-navy); }
.filters a[aria-current="true"] {
  background: var(--mscq-navy); border-color: var(--mscq-navy); color: #fff;
}

/* Featured card */
.featured {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 0;
  background: var(--mscq-soft); border: 1px solid var(--mscq-border);
  border-radius: 8px; overflow: hidden; margin-bottom: 40px;
}
@media (max-width: 991px) { .featured { grid-template-columns: 1fr; } }
.featured-media { position: relative; min-height: 300px; background: var(--mscq-navy); overflow: hidden; }
.featured-media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  display: block;
}
.featured-tag {
  position: absolute; top: 16px; left: 16px; z-index: 3;
  background: var(--mscq-gold); color: var(--mscq-navy);
  font-family: 'Oswald', sans-serif; font-size: 0.72rem; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase;
  padding: 6px 14px; border-radius: 4px;
}
.featured-body { padding: 40px; display: flex; flex-direction: column; justify-content: center; }
.featured-body h2 {
  font-family: 'Oswald', sans-serif; font-size: 1.75rem; font-weight: 600;
  line-height: 1.2; margin-bottom: 16px; color: var(--mscq-navy);
  text-transform: uppercase; letter-spacing: 0.2px;
}
.featured-body h2 a { color: inherit; text-decoration: none; }
.featured-body h2 a:hover { text-decoration: underline; }
.featured-body .meta {
  font-size: 0.85rem; color: #64748b;
  margin-bottom: 16px; display: flex; gap: 16px; flex-wrap: wrap;
}
.featured-body .meta i { margin-right: 4px; }
.featured-body p {
  font-family: 'Source Serif 4', serif; font-size: 1.05rem;
  line-height: 1.65; color: #334155; margin-bottom: 24px;
}
.btn-read {
  display: inline-flex; align-items: center; gap: 8px;
  align-self: flex-start; background: var(--mscq-navy); color: #fff;
  padding: 12px 26px; border-radius: 4px;
  font-weight: 600; font-size: 0.95rem;
  text-decoration: none; transition: background 0.2s ease;
}
.btn-read:hover { background: #0a1628; color: #fff; }

/* News grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px; margin-bottom: 40px;
}
.news-card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--mscq-border);
  border-radius: 8px; overflow: hidden;
  transition: all 0.2s ease;
}
.news-card:hover {
  border-color: var(--mscq-navy);
  box-shadow: 0 8px 24px rgba(15,31,61,0.08);
  transform: translateY(-3px);
}
.news-card-media {
  position: relative; height: 180px;
  background: var(--mscq-navy); overflow: hidden;
}
.news-card-media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.news-card-tag {
  position: absolute; top: 12px; left: 12px;
  background: var(--mscq-gold); color: var(--mscq-navy);
  font-family: 'Oswald', sans-serif; font-size: 0.68rem;
  font-weight: 600; padding: 4px 10px; border-radius: 4px; z-index: 3;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.news-card-body {
  padding: 22px 24px; display: flex; flex-direction: column;
  flex: 1; gap: 10px;
}
.news-card-body h3 {
  font-family: 'Oswald', sans-serif; font-size: 1.2rem;
  font-weight: 600; margin: 0; color: var(--mscq-navy);
  text-transform: uppercase; letter-spacing: 0.2px; line-height: 1.3;
}
.news-card-body h3 a { color: inherit; text-decoration: none; }
.news-card-body h3 a:hover { text-decoration: underline; }
.news-card-body .meta {
  font-size: 0.8rem; color: #94a3b8;
  display: flex; gap: 14px; flex-wrap: wrap;
}
.news-card-body p {
  font-size: 0.95rem; line-height: 1.55;
  color: #64748b; margin: 0; flex: 1;
}
.news-card-link {
  font-weight: 600; font-size: 0.88rem;
  color: var(--mscq-navy); text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px; margin-top: 4px;
}
.news-card-link:hover { text-decoration: underline; }

/* Callout */
.callout {
  display: flex; flex-direction: column; align-items: flex-start;
  justify-content: space-between; gap: 24px;
  background: var(--mscq-soft); padding: 32px;
  border-left: 4px solid var(--mscq-navy);
  border-radius: 4px; margin-top: 40px;
}
@media (min-width: 768px) { .callout { flex-direction: row; align-items: center; } }
.callout h3 {
  font-family: 'Oswald', sans-serif; font-size: 1.25rem;
  margin: 0 0 8px; color: var(--mscq-navy);
  text-transform: uppercase; letter-spacing: 0.3px;
}
.callout p { margin: 0; color: #64748b; max-width: 600px; }
.btn-quiet {
  display: inline-block; padding: 12px 24px;
  border: 1.5px solid var(--mscq-navy); color: var(--mscq-navy);
  background: transparent; border-radius: 4px;
  font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: all 0.2s ease;
}
.btn-quiet:hover { background: var(--mscq-navy); color: #fff; }

/* CME flyer grid */
.section-intro { text-align: center; max-width: 720px; margin: 0 auto 32px; }
.section-intro h2 {
  font-family: 'Oswald', sans-serif; font-size: 2rem;
  font-weight: 600; color: var(--mscq-navy);
  text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 12px;
}
.section-intro p {
  font-family: 'Source Serif 4', serif; font-size: 1.05rem;
  line-height: 1.6; color: #64748b; margin: 0;
}

.cme-events-section { margin-bottom: 60px; }
.cme-flyer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.cme-flyer-card {
  display: block; position: relative; border-radius: 8px; overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  border: 1px solid var(--mscq-border); text-decoration: none;
  background: #fff; transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}
.cme-flyer-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(15,31,61,0.12); }
.cme-flyer-img-wrapper { position: relative; width: 100%; padding-top: 130%; overflow: hidden; }
.cme-flyer-img-wrapper img {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
}
.cme-flyer-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(15,31,61,0.95) 0%, rgba(15,31,61,0.4) 50%, transparent 100%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 24px; z-index: 3;
}
.cme-flyer-title {
  color: #fff; font-family: 'Oswald', sans-serif; font-size: 1.3rem;
  font-weight: 600; margin: 0 0 12px 0; text-transform: uppercase;
}
.cme-flyer-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--mscq-gold); color: var(--mscq-navy);
  padding: 10px 18px; border-radius: 4px;
  font-weight: 700; font-size: 0.85rem; width: fit-content;
}
.cme-flyer-badge {
  position: absolute; top: 16px; right: 16px;
  background: var(--mscq-gold); color: var(--mscq-navy);
  font-family: 'Oswald', sans-serif; font-size: 0.75rem;
  font-weight: 600; padding: 6px 12px; border-radius: 4px; z-index: 4;
}

/* Empty state */
.no-results {
  text-align: center; padding: 60px 20px;
  background: var(--mscq-soft); border-radius: 8px;
  border: 1px dashed #cbd5e1; margin-bottom: 40px;
}
.no-results i { font-size: 32px; color: #cbd5e1; display: block; margin-bottom: 12px; }
.no-results p { font-size: 1.1rem; margin: 0 0 4px; color: var(--mscq-navy); font-weight: 600; }
.no-results small { color: #64748b; }
.no-results a { color: var(--mscq-navy); font-weight: 600; text-decoration: underline; }

/* Gallery */
.gallery-head { margin-bottom: 24px; }
.gallery-head h2 {
  font-family: 'Oswald', sans-serif; font-size: 2rem;
  font-weight: 600; color: var(--mscq-navy);
  text-transform: uppercase; margin-bottom: 12px;
}
.gallery-head p {
  font-family: 'Source Serif 4', serif; font-size: 1.05rem;
  color: #64748b; max-width: 800px; line-height: 1.6; margin: 0;
}
.gallery-topics {
  display: flex; flex-wrap: wrap; gap: 24px;
  border-bottom: 1px solid var(--mscq-border);
  padding-bottom: 16px; margin-bottom: 32px;
}
.gallery-topics a {
  color: #64748b; text-decoration: none; font-weight: 600;
  font-size: 0.95rem; transition: color 0.2s; padding-bottom: 14px; margin-bottom: -16px;
}
.gallery-topics a:hover { color: var(--mscq-navy); }
.gallery-topics a span {
  display: inline-block; background: #f1f5f9; color: #94a3b8;
  padding: 2px 8px; border-radius: 12px;
  font-size: 0.75rem; margin-left: 4px; transition: background 0.2s, color 0.2s;
}
.gallery-topics a[aria-current="true"] {
  color: var(--mscq-navy); border-bottom: 2px solid var(--mscq-navy);
}
.gallery-topics a[aria-current="true"] span {
  background: #e2e8f0; color: var(--mscq-navy);
}

.gallery-section { margin-bottom: 48px; }
.gallery-section-head {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 12px; margin-bottom: 20px;
}
.gallery-section-head h3 {
  font-family: 'Oswald', sans-serif; font-size: 1.8rem;
  font-weight: 600; color: var(--mscq-navy);
  margin: 0; text-transform: uppercase;
}
.gallery-count { color: #94a3b8; font-size: 0.9rem; font-weight: 600; }
.gallery-section-head p {
  width: 100%; font-family: 'Source Serif 4', serif;
  color: #64748b; margin: 0; font-size: 1.05rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px; list-style: none; padding: 0; margin: 0;
}
.gallery-grid li { margin: 0; }

/* Placeholder background for gallery items while loading */
.gallery-grid a {
  display: block; position: relative; border-radius: 12px;
  overflow: hidden; 
  background: var(--mscq-navy);
  aspect-ratio: 1 / 1;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
}
.gallery-grid a:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(15,31,61,0.15); }

.gallery-grid img {
  width: 100%; height: 100%; object-fit: cover;
  display: block; 
  transition: transform 0.5s ease, opacity 0.4s ease;
  opacity: 0; /* Fades in via .loaded class */
}
.gallery-grid img.loaded { opacity: 1; }

.gallery-grid a:hover img { transform: scale(1.05); }
.gallery-cap {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(15,31,61,0.95) 0%, rgba(15,31,61,0) 100%);
  color: #fff; padding: 40px 20px 20px;
  font-size: 0.9rem; line-height: 1.4;
  opacity: 0; transition: opacity 0.3s ease;
}
.gallery-grid a:hover .gallery-cap { opacity: 1; }

@media (max-width: 768px) {
  .featured-body { padding: 24px; }
  .featured-body h2 { font-size: 1.3rem; }
  .gallery-section-head h3 { font-size: 1.35rem; }
}

/* Video Thumbnail Enhancements */
.video-item { position: relative; }
.video-play-btn {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 64px; height: 64px;
    background: rgba(15, 31, 61, 0.85);
    border: 2px solid var(--mscq-gold);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--mscq-gold);
    font-size: 2rem; z-index: 2;
    transition: all 0.3s ease;
    padding-left: 4px;
}
.video-item:hover .video-play-btn {
    background: var(--mscq-gold); color: var(--mscq-navy);
    transform: translate(-50%, -50%) scale(1.1);
}
.video-badge {
    position: absolute; top: 12px; right: 12px;
    background: var(--mscq-gold); color: var(--mscq-navy);
    font-family: 'Oswald', sans-serif;
    font-size: 0.7rem; font-weight: 600;
    padding: 4px 10px; border-radius: 4px;
    z-index: 2; text-transform: uppercase;
    display: flex; align-items: center; gap: 4px;
}
.video-item .gallery-cap {
    opacity: 1;
    background: linear-gradient(to top, rgba(15,31,61,0.95) 0%, rgba(15,31,61,0.5) 60%, transparent 100%);
    padding-top: 60px;
}
.glightbox-clean .gslide-description { background: transparent !important; padding-top: 10px; }
.glightbox-clean .gslide-title {
    color: var(--mscq-gold) !important; 
    font-family: 'Oswald', sans-serif;
    font-size: 1.25rem; font-weight: 500;
    letter-spacing: 0.5px; text-transform: uppercase;
    margin-bottom: 0;
}
.glightbox-clean .gslide-media { box-shadow: 0 10px 40px rgba(0,0,0,0.5); }

/* =========================================================
   NEWS ARTICLE MODAL
   ========================================================= */
.news-modal .modal-dialog {
  max-width: 880px;
}
.news-modal .modal-content {
  border: none;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(15, 31, 61, 0.28);
}
.news-modal .modal-header {
  border-bottom: 1px solid var(--mscq-border);
  padding: 16px 20px;
  background: #fff;
}
.news-modal .modal-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--mscq-navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}
.news-modal .btn-close { opacity: 0.6; }
.news-modal .btn-close:hover { opacity: 1; }

.news-modal-media {
  position: relative;
  width: 100%;
  height: 280px;
  background: linear-gradient(135deg, var(--mscq-navy), #1e3a6e);
  overflow: hidden;
}
.news-modal-media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.news-modal-tag {
  position: absolute; top: 16px; left: 16px; z-index: 3;
  background: var(--mscq-gold); color: var(--mscq-navy);
  font-family: 'Oswald', sans-serif; font-size: 0.72rem; font-weight: 600;
  letter-spacing: 1.2px; text-transform: uppercase;
  padding: 6px 14px; border-radius: 4px;
}

.news-modal-body { padding: 28px 32px 8px; }
.news-modal-body h2 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--mscq-navy);
  text-transform: uppercase;
  line-height: 1.25;
  letter-spacing: 0.2px;
  margin: 0 0 12px;
}
.news-modal-meta {
  display: flex; flex-wrap: wrap; gap: 16px;
  font-size: 0.85rem; color: #64748b;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--mscq-border);
}
.news-modal-meta i { margin-right: 4px; }
.news-modal-excerpt {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #334155;
  margin-bottom: 20px;
}

.news-modal .modal-footer {
  border-top: 1px solid var(--mscq-border);
  padding: 16px 32px 20px;
  background: #fff;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.news-modal .modal-footer .btn-quiet {
  padding: 10px 22px;
  font-size: 0.9rem;
}
.news-modal .modal-footer .btn-primary {
  background: var(--mscq-navy);
  border: 1.5px solid var(--mscq-navy);
  color: #fff;
  padding: 10px 22px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s ease;
}
.news-modal .modal-footer .btn-primary:hover {
  background: #0a1628;
  border-color: #0a1628;
  color: #fff;
}

/* =========================================================
   CME WEBINAR MODAL — portrait, full-screen flyer
   ========================================================= */
.cme-modal .modal-dialog {
  max-width: 720px;
  margin: 1.75rem auto;
}
.cme-modal .modal-content {
  max-height: calc(100vh - 3.5rem);
  display: flex;
  flex-direction: column;
}
.cme-modal .modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
}

.cme-modal-media {
  position: relative;
  width: 100%;
  aspect-ratio: 400 / 520;
  max-height: 70vh;
  margin: 0 auto;
  background: linear-gradient(135deg, var(--mscq-navy), #1e3a6e);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--mscq-border);
}
.cme-modal-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.cme-modal-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  right: auto;
  z-index: 3;
}

@media (max-width: 991.98px) {
  .cme-modal .modal-content {
    max-height: 100vh;
    height: 100vh;
  }
  .cme-modal-media {
    aspect-ratio: auto;
    max-height: none;
    flex: 1 1 auto;
    min-height: 0;
  }
  .cme-modal-media img {
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
  }
  .cme-modal .modal-body {
    flex: 0 0 auto;
    max-height: 30vh;
  }
}

@media (max-width: 768px) {
  .news-modal-media { height: 200px; }
  .news-modal-body { padding: 20px 20px 8px; }
  .news-modal-body h2 { font-size: 1.3rem; }
  .news-modal .modal-footer { padding: 14px 20px 18px; }
  .news-modal .modal-footer .btn-quiet,
  .news-modal .modal-footer .btn-primary { width: 100%; justify-content: center; }
}

/* /* =========================================================
   PERFORMANCE OPTIMIZATIONS
   ========================================================= */

/* Skip rendering heavy sections until they scroll into view.
   NOTE: do NOT add content-visibility to .gallery-section —
   it interferes with the load-more button's rendering. */
.cme-events-section,
.news-grid {
  content-visibility: auto;
  contain-intrinsic-size: auto 500px;
}