/* Article Styles */
article {
    --img-scale: 1.001;
    --title-color: black;
    --link-icon-translate: -20px;
    --link-icon-opacity: 0;
    position: relative;
    border-radius: 16px;
    box-shadow: none;
    background: #fff;
    transform-origin: center;
    transition: all 0.4s ease-in-out;
    overflow: hidden;
    display: flex;
    flex-direction: column;  /* Allow the content to be stacked */
    height: auto;  /* Each article's height adjusts to content */
    max-height: 100%;  /* No fixed height, content should dictate height */
}

article a::after {
    position: absolute;
    inset-block: 0;
    inset-inline: 0;
    cursor: pointer;
    content: "";
}

/* Basic article elements styling */
article h2 {
    margin: 0 0 18px 0;
    font-size: 1.5rem;
    letter-spacing: 0.06em;
    color: #273777;
    transition: color 0.3s ease-out;
}

figure {
    margin: 0;
    padding: 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

article img {
    max-width: 100%;
    transform-origin: center;
    transform: scale(var(--img-scale));
    transition: transform 0.4s ease-in-out;
}

.article-body {
    padding: 24px;
}

.article-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.read-more {
    display: none;  /* Hidden by default */
    margin-top: 10px;
    background-color: white;
    color: #273777;
    border: none;
    cursor: pointer;
}

.read-more:hover {
    text-decoration: underline;
}

article a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #28666e;
}

article a:focus {
    outline: 1px dotted #28666e;
}

article a .icon {
    min-width: 24px;
    width: 24px;
    height: 24px;
    margin-left: 5px;
    transform: translateX(var(--link-icon-translate));
    opacity: var(--link-icon-opacity);
    transition: all 0.3s;
}

/* Hover effect */
article:has(:hover, :focus) {
    --img-scale: 1.1;
    --title-color: #28666e;
    --link-icon-translate: 0;
    --link-icon-opacity: 1;
    box-shadow: rgba(0, 0, 0, 0.16) 0px 10px 36px 0px, rgba(0, 0, 0, 0.06) 0px 0px 0px 1px;
}

/* Grid layout for articles */
.articles {
    display: grid;
    max-width: 1500px !important;
    margin-inline: auto;
    padding-inline: 24px;
    grid-template-columns: repeat(4, minmax(320px, 1fr)); /* 4 columns */
    gap: 24px;
    padding-bottom: 7rem !important;
}

/* Mobile responsiveness: Stack items in one column */
@media screen and (max-width: 768px) {
    .articles {
        grid-template-columns: 1fr !important; /* 1 column on small screens */
    }
    .article-body p {
        display: none; /* Hide paragraph on small screens */
    }
}

/* Tablet Responsiveness: 2 columns on medium-sized screens */
@media screen and (max-width: 1366px) {
    .articles {
        grid-template-columns: repeat(2, minmax(160px, 1fr)); /* 2 columns on medium-sized screens */
    }
}

/* Adjust article image and body layout for smaller screens */
@media screen and (max-width: 600px) {
    article {
        padding: 0; /* Remove padding for mobile */
    }
    .article-wrapper {
        display: block;
    }
    .article-body {
        padding: 16px;
    }
}

/* A11y adjustments */
.sr-only:not(:focus):not(:active) {
    clip: rect(0 0 0 0); 
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap; 
    width: 1px;
}

.c2a1 {
    color: #273777;
    font-weight: 300;
    background-position: center top;
    background-size: cover;
    background-attachment: fixed;
    
  }
  
  .c2a1 h1, .c2a1 h2, .c2a1 h3, .c2a1 h4, .c2a1 h5, .c2a1 h6 {
    color: #3e4555;
  }
  
  .c2a1 .op-8 {
      opacity: 0.8;
      font-size: 18px;
      text-align: justify;
      font-weight: normal;
  }

  .cta-row {
    background-color: #273777d4;
    padding: 3%;
  }
  
  .c2a1 .font-weight-medium {
      font-weight: 500;
      /* color: #273777 !important; */
  }
  
  .c2a1 .btn-md {
      color: white;
      border: 1px solid #fff;
  }

  .c2a1 .btn-md:hover {
    color: white;
    border: none;
}