/* =========================================
   Blog Grid — Uniform Card Heights (LEMS)
   ========================================= */

/* Container for the entire blog section */
.blog-container {
    display: grid;
    /* Use auto-fit so cards stretch nicely; reduce min width for better wrap */
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    background-color: #fff;
    align-items: stretch;        /* ensure equal height tracks */
    justify-items: stretch;      /* make cards fill the grid cell */
}

/* Individual blog card styling */
.blog-card {
    display: flex;               /* make card a flex column to stretch content */
    flex-direction: column;
    height: 100%;                /* fill grid cell height */
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(21, 44, 71, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(21, 44, 71, 0.1);
    animation: fadeIn 0.5s ease forwards;
    /* remove margin-bottom; grid gap handles spacing */
}

/* Hover */
.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(21, 44, 71, 0.2);
}

/* Blog image styling — fixed height keeps rows aligned */
.blog-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-bottom: 3px solid #BE1823;
    transition: transform 0.3s ease;
    flex: 0 0 auto;              /* don't let image shrink/grow */
}
.blog-card:hover .blog-image { transform: scale(1.02); }

/* Blog content section — flex to push text cleanly */
.blog-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
    flex: 1 1 auto;              /* take remaining height */
}

/* Heading styles */
.blog-content h3 {
    color: #152C47;
    font-size: clamp(1.1rem, 1.2vw + 0.8rem, 1.25rem);
    margin: 0;
    font-weight: 700;
    position: relative;
    padding-bottom: 0.5rem;
}
.blog-content h3::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 50px; height: 3px;
    background: linear-gradient(90deg, #BE1823, #D3D800);
}

/* Paragraph styles — allow it to grow/shrink within content */
.blog-content p {
    color: #666;
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
    /* if you add buttons later, this pushes them to the bottom */
    /* margin-top: auto; */
}

/* Responsive design */
@media screen and (max-width: 768px) {
    .blog-container {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        padding: 1rem;
        gap: 1rem;
    }
    .blog-image { height: 180px; }
    .blog-content { padding: 1rem; }
    .blog-content h3 { font-size: 1.1rem; }
}

/* Animation for card loading */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================
   Nav buttons (unchanged)
   ============================ */
.nav-buttons-1 {
    position: absolute; top: 50%; left: 0; right: 0;
    transform: translateY(-50%);
    display: flex; justify-content: space-between;
    padding: 0 20px; pointer-events: none;
}
.nav-button-1 {
    width: 50px; height: 50px; border-radius: 50%;
    background: #fff; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,.2);
    pointer-events: auto; transition: var(--transition);
    font-size: 1.2rem; color: var(--primary);
}
.nav-button-1:hover {
    background: var(--primary); color: #fff; transform: scale(1.1);
}
/* ============================
   LEMS Modal — Full CSS Snippet
   ============================ *//* ===== Add image to activity card (right aligned) ===== */
.activity-card {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
}



.activity-image {
  flex: 0 0 35%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(21, 44, 71, 0.1);
}

.activity-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  transition: transform 0.3s ease;
}

.activity-card:hover .activity-image img {
  transform: scale(1.03);
}

/* ===== Responsive tweak for smaller screens ===== */
@media (max-width: 720px) {
  .activity-card {
    flex-direction: column;
  }
  .activity-image {
    width: 100%;
    height: 200px;
  }
}


/* Brand tokens */
:root {
  --lems-navy: #152c47;
  --lems-red:  #BE1823;
  --lems-lime: #d3d800;

  --bg: #ffffff;
  --ink: #1f2b3e;
  --muted: #5b677d;

  --surface: #f7f9fc;
  --stroke: #e5ebf4;
  --stroke-strong: #d8e1ee;
  --shadow-1: 0 2px 10px rgba(7, 18, 39, .08);
  --shadow-2: 0 24px 80px rgba(7, 18, 39, .28);
}

/* ===== Overlay & Container ===== */
.modal {
  position: fixed; inset: 0;
  display: none; align-items: center; justify-content: center;
  background: rgba(10, 15, 25, .55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  z-index: 9999;
}
.modal.active { display: flex; }

/* Entrance animation */
@keyframes lemsModalIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Modal card */
.modal-content {
  position: relative;
  width: min(880px, 94vw);
  max-height: 90vh;
  overflow: hidden; /* hide inner edges while header sticks */
  border-radius: 16px;
  background: var(--bg);
  box-shadow: var(--shadow-2), var(--shadow-1);
  animation: lemsModalIn .22s ease-out both;
  border: 1px solid var(--stroke);
  display: grid;
  grid-template-rows: auto 1fr;
}

/* Sticky header area (title + close) */
.modal-title {
  margin: 0;
  padding: 18px 64px 12px 22px;
  color: var(--lems-navy);
  font-weight: 800;
  letter-spacing: .2px;
  background: linear-gradient(180deg, #fff 0%, #fff 75%, rgba(255,255,255,.9) 100%);
  position: sticky; top: 0; z-index: 2;
  border-bottom: 1px solid var(--stroke);
}

/* Close button */
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px;
  background: #fff; color: var(--lems-navy);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  font-size: 20px; line-height: 34px;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: transform .12s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.modal-close:hover   { transform: translateY(-1px); }
.modal-close:active  { transform: translateY(0); }
.modal-close:focus-visible {
  outline: 2px solid var(--lems-lime);
  outline-offset: 2px;
}

/* Scrollable body area */
.modal-activities {
  overflow-y: auto;
  padding: 16px;
  background: var(--surface);
}

/* ===== Activity Cards ===== */
.activity-card {
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 10px 0;
  box-shadow: 0 6px 18px rgba(18, 36, 61, .06);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.activity-card:hover {
  transform: translateY(-1px);
  border-color: var(--stroke-strong);
  box-shadow: 0 12px 28px rgba(18, 36, 61, .10);
}

.activity-title {
  margin: 0 0 6px;
  color: var(--lems-navy);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: .1px;
}

.activity-meta {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
  display: flex; gap: 12px; flex-wrap: wrap;
}
.activity-meta i { opacity: .9; }

.activity-desc {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

/* CTA link */
.activity-link {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none;
  font-weight: 700; font-size: 13px;
  color: var(--lems-navy);
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--lems-navy);
  background: #fff;
  transition: background .2s ease, color .2s ease, transform .08s ease, border-color .2s ease;
}
.activity-link i { font-size: 14px; }
.activity-link:hover {
  background: var(--lems-navy);
  color: #fff;
  transform: translateY(-1px);
}
.activity-link:focus-visible {
  outline: 2px solid var(--lems-lime);
  outline-offset: 2px;
}

/* ===== Scrollbar polish (WebKit) ===== */
.modal-activities::-webkit-scrollbar { width: 10px; }
.modal-activities::-webkit-scrollbar-track { background: transparent; }
.modal-activities::-webkit-scrollbar-thumb {
  background: #dfe6f1; border-radius: 999px; border: 2px solid transparent; background-clip: content-box;
}
.modal-activities::-webkit-scrollbar-thumb:hover { background: #cfd8ea; }

/* ===== Responsive ===== */
@media (max-width: 720px) {
  .modal-content { width: min(94vw, 720px); }
  .modal-title { padding: 16px 56px 10px 16px; }
  .modal-activities { padding: 12px; }
  .activity-card { padding: 12px 12px; border-radius: 12px; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .modal-close, .activity-card { transition: none; }
  .modal-content { animation: none; }
}

/* ===== Optional dark-mode refinement ===== */
@media (prefers-color-scheme: dark) {
  .modal { background: rgba(5,8,14,.7); }
  .modal-content { background: #0f1320; border-color: #1f2740; }
  .modal-title { color: #eaf0ff; background: linear-gradient(180deg, #0f1320 0%, #0f1320 75%, rgba(15,19,32,.92) 100%); border-bottom-color: #1f2740; }
  .modal-activities { background: #0b0f1a; }
  .activity-card { background: #12172a; border-color: #1f2740; box-shadow: none; }
  .activity-title { color: #eaf0ff; }
  .activity-meta  { color: #a9b4cc; }
  .activity-desc  { color: #d9e2f2; }
  .activity-link  { color: #eaf0ff; border-color: #eaf0ff; background: transparent; }
  .activity-link:hover { background: #eaf0ff; color: #0f1320; }
}
