/* === News & Events Page Styles (3x3 Grid Like Services) === */

/* Container */
.news-events-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ================================
   NEWS & EVENTS ARCHIVE – FULL FIX
   File: archive-news_event.php
   Scoped to archive grid/classes to avoid theme conflicts
   ================================ */

/* ---------- Header ---------- */
.news-events-header-box{
  padding: 72px 20px 48px;
  background: linear-gradient(135deg,#f8f9fb 0%,#e9edf3 100%);
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.04);
  margin-top: 20px;
}
.news-events-main-title{
  margin: 0 0 10px;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.2;
  color: #1f2a44;
  letter-spacing: .02em;
  font-weight: 800;
}
.news-events-subtitle{
  color:#46566e;
  font-size: clamp(14px, 1.6vw, 18px);
}

/* Spacer */
.news-events-spacer{ height:40px; }

/* ---------- Filters ---------- */
.news-events-filters{
  display:flex;
  justify-content:center;
  align-items:center;
  padding: 0 20px;
}
.filter-buttons-container{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.filter-btn{
  appearance:none;
  border:1px solid #d6deea;
  background:#fff;
  color:#22314d;
  padding:10px 16px;
  border-radius:999px;
  font-weight:600;
  cursor:pointer;
  transition: all .2s ease;
}
.filter-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  border-color:#b6c3d9;
}
.filter-btn.active{
  background:#2b6cb0;
  color:#fff;
  border-color:#2b6cb0;
  box-shadow: 0 6px 16px rgba(43,108,176,.25);
}

/* ---------- Grid ---------- */
.news-events-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:30px;
  padding: 0 20px 60px;
  justify-items: stretch;
}

/* Responsive columns */
@media (max-width: 1024px){
  .news-events-grid{ grid-template-columns: repeat(2, 1fr); gap:24px; }
}
@media (max-width: 680px){
  .news-events-grid{ grid-template-columns: 1fr; gap:18px; padding-left:16px; padding-right:16px; }
}

/* ---------- Card ---------- */
/* IMPORTANT: prevent JS filter from forcing display:flex */
.news-event-card{
  display: block !important;
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:12px;
  padding:22px;
  text-align:center;
  box-shadow:0 4px 20px rgba(0,0,0,.05);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.news-event-card:hover{
  transform: translateY(-4px);
  box-shadow:0 10px 24px rgba(0,0,0,.10);
  border-color:#4299e1;
}
.news-event-card .service-link{
  text-decoration:none;
  color:inherit;
  display:block;
}

/* ---------- Uniform Thumbnail ---------- */
.news-event-image{
  width:100%;
  aspect-ratio: 1 / 1;         /* perfect square */
  margin: 0 auto 14px;
  overflow:hidden;
  border-radius:10px;
  background:#e8ecf4;
  position: relative;
}
.news-event-image img,
.news-event-image .attachment-post-thumbnail{
  width:100%;
  height:100%;
  display:block;
  object-fit: cover;            /* crop consistently */
  object-position: center;      /* center composition */
  transition: transform .3s ease, filter .3s ease;
}
.news-event-card:hover .news-event-image img{
  transform: scale(1.05);
  filter: contrast(1.05) saturate(1.05);
}

/* Placeholder when no featured image */
.news-event-placeholder{
  width:100%;
  height:100%;
  background: linear-gradient(135deg,#dfe7f3,#cfd9ea);
}

/* ---------- Text ---------- */
.news-event-title{
  margin: 10px 0 8px;
  font-size: 1.15rem;
  line-height: 1.25;
  color:#2a4365;
  font-weight: 700;
}
.news-event-description{
  color:#4a5568;
  line-height:1.6;
  margin-bottom:16px;
  font-size: .98rem;
}

/* ---------- Button ---------- */
.news-event-button{
  display:inline-block;
  padding:10px 16px;
  background:#4299e1;
  color:#fff !important;
  border-radius:6px;
  font-weight:700;
  text-decoration:none;
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.news-event-button:hover{
  background:#2b6cb0;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(43,108,176,.25);
}

/* ---------- Empty State ---------- */
.no-news-events{
  text-align:center;
  background:#f7f9fc;
  border:1px dashed #c9d5ea;
  padding:32px 20px;
  border-radius:12px;
  color:#46566e;
}

/* ---------- Pagination (Astra) ---------- */
.pagination, .ast-pagination, .ast-pagination a, .ast-pagination span{
  display:inline-block;
}
.ast-pagination{
  text-align:center;
  margin: 10px 0 50px;
}
.ast-pagination .page-numbers{
  display:inline-block;
  min-width: 40px;
  height: 40px;
  line-height: 40px;
  margin: 0 4px;
  border-radius: 8px;
  background:#f1f5fb;
  color:#324766;
  text-decoration:none;
  font-weight:600;
  padding: 0 10px;
  transition: all .2s ease;
}
.ast-pagination .page-numbers:hover{
  background:#e2e8f0;
}
.ast-pagination .current{
  background:#2b6cb0;
  color:#fff;
  box-shadow: 0 6px 16px rgba(43,108,176,.25);
}

/* ---------- Small tweaks ---------- */
.news-events-header-box,
.news-events-grid,
.news-event-card,
.news-event-image img{ box-sizing: border-box; }

.news-event-card .service-title{ /* keep compatibility with your existing class names */
  margin: 10px 0 8px;
  font-size: 1.15rem;
  color:#2a4365;
  font-weight:700;
}

/* If any card ends up with inline style "display:flex" from JS, fix children layout */
.news-event-card[style*="display: flex"]{
  align-items: stretch;
  flex-direction: column;
}

/* Extra responsiveness for very small screens */
@media (max-width: 380px){
  .filter-btn{ padding:8px 12px; font-size:.92rem; }
  .news-event-button{ padding:9px 14px; }
}

.news-event-card { display:block !important; } /* don't let JS make it flex */

/* The frame */
.news-event-image{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;         /* standard landscape; change to 4/3 or 1/1 if you prefer */
  margin: 0 auto 14px;
  overflow: hidden;
  border-radius: 12px;
  background: #e8ecf4;
}

/* The image inside (absolute cover beats Astra's height:auto) */
.news-event-image img,
.news-event-image .wp-post-image{
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;   /* ignore theme max-width */
  object-fit: cover;            /* fill box without distortion */
  object-position: center 50%;  /* center subject; tweak e.g. 40% if heads are high */
  display: block;
  border-radius: 0;             /* container already rounded */
  transition: transform .3s ease, filter .3s ease;
}

.news-event-card:hover .news-event-image img{
  transform: scale(1.05);
  filter: contrast(1.04) saturate(1.03);
}

/* Fallback for old browsers that don't support aspect-ratio */
@supports not (aspect-ratio: 16/9){
  .news-event-image{ padding-top: 56.25%; height: 0; }
  .news-event-image img{ position:absolute; top:0; left:0; }
}

/* Grid (kept here to ensure consistency) */
.news-events-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:30px;
  padding: 0 20px 60px;
}
@media (max-width:1024px){ .news-events-grid{ grid-template-columns: repeat(2, 1fr); gap:24px; } }
@media (max-width:680px){  .news-events-grid{ grid-template-columns: 1fr; gap:18px;  } }
