/* ========== Layout ========== */
#card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(490px, 1fr));
    gap: 40px;
    max-width: 1200px;
    min-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
    justify-items: space-between;
  }
  

  .search {
    max-width: 620px;
  }
  
  /* ========== Cards ========== */
  .card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    width: 100%;
    max-width: 700px;
    max-height: 425px;
    margin-bottom: 20px;
    border: 1px solid #000;
    border-radius: 9px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    transition: transform 0.3s ease;
  }
  
  .card:hover {
    transform: translateY(-10px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2);
  }
  
  .card p {
    padding: 0;
  }
  
  .card .entry-header {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    overflow: hidden;
    min-height: 140px;
    object-fit: cover;
    object-position: center;
  }
  
  .entry-header img {
    min-height: 120px;
  }
  
  .card img {
    max-width: 100%;
  }
  
  .card .card-title {
    margin: 0;
    padding: 17px 10px;
    font-family: 'Inter';
    font-size: 20px;
    font-weight: 500;
    background-color: #ddd;
    border-top: 1px solid #52525286;
    border-bottom: 1px solid #52525286;
    text-align: left;
  }
  
  .card .card-content {
    flex-grow: 1;
    height: 195px;
    background-color: var(--gray-bg);
    flex: 1 0 40%;
  }
  
  .card .card-content a {
    color: #0073e6;
    font-weight: bold;
    background-color: #f0f0f0;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 5px;
    margin-bottom: 5px;
  }
  
  .card .card-description {
    max-height: 100%;
    font-size: 13px;
    margin: 0;
    padding: 7px 10% 0 0.75rem;
  }
  
  .card .card-description p {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
  }
  
  /* Hover Sub-elements */
  .card:hover .modal-date,
  .card:hover .official-check {
    display: block;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  }
  
  .card:hover .official-check {
    background-color: #003366;
  }
  
  .card-footer {
    display: flex;
    flex-direction: column;
    padding: 10px 0.75rem;
    background-color: rgba(128, 128, 128, 0.581);
    border-top: 1px solid #00000078;
  }
  
  /* ========== Modals ========== */
  .modal-overlay.active .official-check {
    top: 1rem;
    right: 3rem;
    border-radius: 5px;
    margin: 0;
    z-index: 3;
  }

  .case-modal-title-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    position: relative;
    z-index: 4;
    text-align: left;
    line-height: 2.25rem;
  }

  .case-modal-title-container h2 {
    margin: 0;
    padding-right: 2rem;
    color: white;
    font-size: calc(1.6rem - 20%);
    font-weight: 400;
    word-spacing: 0.75px;
  }
  
  .case-modal-image-container img {
    width: 100%;
    height: 500px;
    max-height: 600px;
    object-fit: cover;
    object-position: center;
  }
  
  .case-modal-description {
    background-color: #fff;
    margin: 0;
    width: auto;
    max-height: 300px;
    padding: 30px 1rem;
    border-radius: 0 0 10px 10px;
    text-align: left;
  }
  
  .case-modal-description p {
    padding: 0;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
  }
  
  .case-modal-content p {
    text-align: center;
    margin-right: 10px;
  }
  
  .modal-details-container {
    display: flex
    ;
        flex-direction: column;
        flex-wrap: wrap;
        align-items: stretch;
        text-align: left;
        position: absolute;
        color: white;
        background-color: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 0 1rem;
        /* margin: 0 1rem; */
        border-radius: 10px;
        width: 100%;
        height: 100%;
        z-index: 1;
        justify-content: space-around;
        margin: auto;
  }
  
  /* ========== Modal Components ========== */
  .modal-contact,
  .modal-investors,
  .modal-authors {
    display: flex;
        flex-wrap: wrap;
        align-self: self-start;
        font-size: calc(1.2rem - 30%);
        justify-content: space-between;
        border-bottom: 2px solid #ffffff87;
        gap: 10px;
        padding: 0 70px;
        margin: auto;
        white-space: nowrap;
        align-content: flex-start;
        align-items: baseline;
  }
  
  .modal-investors h6,
  .modal-authors h6,
  .modal-contact h6 {
    margin: 0;
    color: white;
    font-family: 'Inter';
    font-weight: 450;
  }
  
  .modal-investors p {
    margin-top: 0;
  }
  
  .modal-contact p,
  .modal-contact h6 {
    margin: 0;
    font-weight: bold;
  }
  
  .author-info,
  .contact-person-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-wrap: break-word;
  }
  
  .author-info p {
    margin: 0;
  }
  
  .modal-authors {
    flex-direction: row;
    padding-top: 5px;
  }
  
  .organisation {
    text-align: left;
    font-size: 0.6rem;
    padding-bottom: 10px;
  }
  
  .modal-pdf-link {
    right: 20vw;
  }
  
  .modal-read {
    right: 1rem;
  }
  
  .modal-link:hover,
  .modal-read:hover,
  .tag-link:hover,
  .method-link:hover {
    background-color: #5a6468;
  }
 
  
  .close-btn {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 25px;
    cursor: pointer;
  }
  
  .close-btn:hover,
  .close-btn:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
  }
  
  /* ========== Skeleton Loading ========== */
  .skeleton-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
    margin: 1rem 1rem 3rem;
    padding: 2rem;
    border-radius: 8px;
    min-height: 350px;
    min-width: 100px;
    background-color: var(--primary-color);
  }
  
  .skeleton-image {
    height: 150px;
    background: #1f1f1f5d;
    border-radius: 4px;
  }
  
  .skeleton-text {
    height: 16px;
    width: 80%;
    background: #c6c6c6;
    border-radius: 4px;
  }
  
  .skeleton-text.small {
    width: 60%;
  }
  

  /* ========== Empty State Message ========== */
.no-results-message {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 300px;
    grid-column: 1 / -1;
}

.empty-state {
    text-align: center;
    padding: 40px;
    background-color: #f5f5f5;
    border-radius: 8px;
    border: 2px dashed #ccc;
    max-width: 400px;
}

.empty-state p {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.empty-state p:first-child {
    font-size: 20px;
    font-weight: 600;
    color: #000;
    margin-bottom: 8px;
}

.empty-state-hint {
    color: #666;
    font-size: 14px;
}

  /* ========== Responsive Media Queries ========== */
  @media (max-width: 1051px) {
    #card-container {
      display: flex;
      flex-direction: column;
      gap: 5px;
      max-width: 980px;
      min-width: 480px;
      align-items: center;
    }
    .modal-details-container {
      border-radius: 0;
    }
  
    .skeleton-card {
      min-width: 300px;
      max-width: 400px;
    }

    .modal-authors {
      justify-content: center;
    }
  }
  
  @media (max-width: 500px) {
    #card-container {
      display: flex;
      flex-direction: column;
      gap: 5px;
      max-width: 480px;
      min-width: 280px;
    }

   .modal-authors, .modal-contact, .modal-investors {
    padding: 10px;
   }  
   .modal-details-container{
    padding: 0;
   }
  
    .case-modal-title-container h2 {
      font-size: 10px;
    }
  
    .partner-match-card {
      max-width: 200px;
      max-height: 300px;
    }
  
    .card {
      min-width: 280px;
      max-width: 400px;
      max-height: 450px;
    }
  }