/* --- Font Import (Example using Google Fonts) --- */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:wght@400;500;700&family=Open+Sans:wght@400;600;700&display=swap');

/* --- Wrapper for Layout Width Control --- */
#custom-list-wrapper {
    width: 100%; /* Default */
    box-sizing: border-box;
    margin-top: 0;
    margin-bottom: 0;
}

/* --- Main List Container (Grid Setup) --- */
#custom-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Default 3 columns */
    gap: 1.875rem; /* 30px */
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
}

/* --- Layout Width Options for #custom-list-wrapper --- */
#custom-list-wrapper.custom-list--layout-content {
    max-width: 46.875rem; /* 750px */
    margin-left: auto;
    margin-right: auto;
    padding-left: 0.9375rem; /* 15px */
    padding-right: 0.9375rem; /* 15px */
}

#custom-list-wrapper.custom-list--layout-wide {
    max-width: none !important;
    width: 100vw !important;
    position: relative;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
}

#custom-list-wrapper.custom-list--layout-wide #custom-list {
    max-width: 85rem; /* 1360px */
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.25rem;  /* 20px */
    padding-right: 1.25rem; /* 20px */
}

#custom-list-wrapper.custom-list--layout-full {
    max-width: none !important;
    width: 100vw !important;
    position: relative;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
}

#custom-list-wrapper.custom-list--layout-full #custom-list {
    max-width: 100%;
    padding-left: 1.5625rem;  /* 25px */
    padding-right: 1.5625rem; /* 25px */
    margin-left: auto;
    margin-right: auto;
}


/* --- Individual Article Tile --- */
.custom-list-item {
    background-color: #ffffff;
    border: 1px solid #e9e9e9;
    border-radius: 1px; /* Kept px for small radius */
    box-shadow: 0 0.3125rem 0.9375rem rgba(0, 0, 0, 0.07); /* 0 5px 15px */
    overflow: hidden;
    transition: box-shadow 0.3s ease-in-out, transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.custom-list-item:hover {
    box-shadow: 0 0.5rem 1.5625rem rgba(0, 0, 0, 0.1); /* 0 8px 25px */
    transform: translateY(-0.1875rem); /* -3px */
}

/* --- Image & Title Container --- */
.custom-list-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.custom-list-image-container::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 70%;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0) 100%);
    z-index: 1;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.custom-list-image-container:hover::after {
    opacity: 0;
}

.custom-list-featured-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.custom-list-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background-color: #e0e0e0;
    color: #777777;
    font-family: 'Open Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
}

/* --- Title Link (becomes the large animated white card) --- */
.custom-list-title-link {
    position: absolute;
    top: 1rem;    /* 10px */
    bottom: 1rem; /* 10px */
    left: 1rem;   /* 10px */
    right: 1rem;  /* 10px */
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.93);
    padding: 0.9375rem; /* 15px */
    border-radius: 1px; /* Kept px */
    box-shadow: 0 0.3125rem 1.5625rem rgba(0, 0, 0, 0.25); /* 0 5px 25px */
    text-decoration: none;
    opacity: 0;
    transform: translateY(-105%);
    visibility: hidden;
    transition: transform 0.45s cubic-bezier(0.23, 1, 0.32, 1),
                opacity 0.4s ease-out,
                visibility 0s 0.45s;
}

.custom-list-image-container:hover .custom-list-title-link {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    transition-delay: 0s, 0s, 0s;
}

/* --- Title Text Styling (within the large white card) --- */
.custom-list-title {
    font-family: 'EB Garamond', Garamond, serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: #2c3e50;
    margin: 0;
    line-height: 1.8;
    text-shadow: none;
    text-align: center;
    max-width: 95%;
    overflow-wrap: break-word;
    text-transform: uppercase;
    /* letter-spacing: 0.03125rem; */ /* Optional 0.5px for uppercase */

    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Content Area (Below Image) --- */
.custom-list-content-area {
    padding: 0.9375rem; /* 15px */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.custom-list-excerpt {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #4a4a4a;
    margin-top: 0;
    margin-bottom: 0.75rem; /* 12px */
    flex-grow: 1;
}

.custom-list-excerpt:empty {
    display: none;
}

/* --- Meta Information (Below Excerpt) --- */
.custom-list-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.3125rem 0.625rem; /* 5px 10px */
    padding-top: 0.625rem; /* 10px */
    border-top: 1px solid #f0f0f0;
    margin-top: auto;
}

.custom-list-meta small {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.7rem;
    color: #888888;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.01875rem; /* 0.3px */
    margin-bottom: 0;
}

/* --- Load More Button --- */
#load-more {
    display: block;
    margin: 2.8125rem auto 1.5625rem; /* 45px auto 25px */
    padding: 0.875rem 2.1875rem; /* 14px 35px */
     cursor: pointer;
    
   
    text-transform: uppercase;
 
}

#load-more:hover,
#load-more:focus {
   
}

#load-more:active {
   
}

/* --- Error Message --- */
.error-message {
    color: #c0392b;
    text-align: center;
    font-family: 'Open Sans', sans-serif;
    padding: 0.9375rem; /* 15px */
    background-color: #fdecea;
    border: 1px solid #f5c6cb;
    border-radius: 4px; /* Kept px */
    margin: 1.25rem auto; /* 20px auto */
}

/* --- Responsive Adjustments --- */

@media (min-width: 75rem) { /* 1200px */
    #custom-list-wrapper.custom-list--layout-full #custom-list,
    #custom-list-wrapper.custom-list--layout-wide #custom-list {
        /* grid-template-columns: repeat(4, 1fr); */
    }
}

@media (min-width: 100rem) { /* 1600px */
    #custom-list-wrapper.custom-list--layout-full #custom-list {
        /* grid-template-columns: repeat(5, 1fr); */
    }
    #custom-list-wrapper.custom-list--layout-full {
        /* padding-left: 2.5rem; */ /* 40px */
        /* padding-right: 2.5rem; */ /* 40px */
    }
}

@media (max-width: 64rem) { /* 1024px (Tablets) */
    #custom-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5625rem; /* 25px */
    }

    .custom-list-title-link {
        top: 0.5rem; bottom: 0.5rem; left: 0.5rem; right: 0.5rem; /* 8px */
        padding: 0.75rem; /* 12px */
    }
    .custom-list-title {
        font-size: 1.8rem;
        -webkit-line-clamp: 4;
        line-height: 1.25;
    }
    .custom-list-excerpt { font-size: 0.8rem; }
    .custom-list-meta small { font-size: 0.65rem; }
}

@media (max-width: 47.9375rem) { /* 767px (Mobile phones) */
    #custom-list {
        grid-template-columns: 1fr;
        gap: 1.25rem; /* 20px */
    }

    #custom-list-wrapper.custom-list--layout-content,
    #custom-list-wrapper.custom-list--layout-wide,
    #custom-list-wrapper.custom-list--layout-full {
        padding-left: 0.625rem; /* 10px */
        padding-right: 0.625rem; /* 10px */
    }
    #custom-list-wrapper.custom-list--layout-full #custom-list {
        padding-left: 0.625rem; /* 10px */
        padding-right: 0.625rem; /* 10px */
    }

    .custom-list-title-link {
        top: 0.3125rem; bottom: 0.3125rem; left: 0.3125rem; right: 0.3125rem; /* 5px */
        padding: 0.625rem; /* 10px */
    }
    .custom-list-image-container:hover .custom-list-title-link { /* Adjust slide-in for mobile if needed */
        transform: translateY(0.3125rem); /* 5px from top */
    }
    .custom-list-title {
        font-size: 1.6rem;
        -webkit-line-clamp: 4;
        line-height: 1.3;
    }
    .custom-list-content-area { padding: 0.75rem; } /* 12px */
    .custom-list-excerpt { font-size: 0.9rem; }
    .custom-list-meta small { font-size: 0.75rem; }
}