/* 1st design "my-advanced-list" used for templates and match major sheets */
/* Turn the main list into a 3-column grid */
ul.my-advanced-list {
    list-style: none !important;
    padding-left: 0 !important;
    margin-left: auto !important;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr); /* Creates 3 equal columns */
    gap: 30px; /* Spacing between columns and rows */
}

/* Style each post as an individual card in the grid */
ul.my-advanced-list li {
    list-style-type: none !important;
    background: #ffffff;
    border: 1px solid #e3e3e3;
    padding: 0; /* Remove padding here so the image can sit flush at the top */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    overflow: hidden; /* Keeps the image corners rounded inside the card */
    
    /* Setup flexbox to force the order of elements */
    display: flex !important;
    flex-direction: column !important;
}

/* 1. TARGET THE IMAGE LINK WRAPPER (Force to top) */
ul.my-advanced-list li a:has(img) {
    order: 1 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}

/* Style the actual image inside that wrapper */
ul.my-advanced-list li img {
    width: 100% !important;
    height: 200px !important; /* Forces a consistent height for a clean grid look */
    display: block;
}

/* 2. TARGET THE POST TITLE LINK ONLY (Force to middle) */
ul.my-advanced-list li a:not(:has(img)) {
    order: 2 !important;
    font-size: 1.25em;
    font-weight: bold;
    text-decoration: none;
    color: #a51c33;
    padding: 20px 20px 20px 20px; /* Adds padding inside the text area */
    line-height: 1.4;
    display: block !important;
}

/* 3. TARGET THE EXCERPT TEXT (Force to bottom) */
ul.my-advanced-list .lcp_excerpt {
    order: 3 !important;
    color: #666666;
    font-size: 0.9em;
    line-height: 1.6;
    padding: 0 20px 20px 20px; /* Adds padding inside the text area */
    margin: 0 !important;
}

/* Responsive fix: Drop to 1 column on mobile screens */
@media (max-width: 768px) {
    ul.my-advanced-list {
        grid-template-columns: 1fr;
    }
}

/* 2nd design, "my-advanced-list2", for Match Major Sheets */
/* -- hiding the title and excerpt -- */
/* To keep images from showing up in the catlist blocks, delete “thumbnail=yes thumbnail_size=medium” from the shortcode. */
/* Turn the main list into a 3-column grid */
ul.my-advanced-list2 {
    list-style: none !important;
    padding-left: 0 !important;
    margin-left: auto !important;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr); /* Creates 3 equal columns */
    gap: 30px; /* Spacing between columns and rows */
}

/* Turn the main list into a 3-column grid */
ul.my-advanced-list2 {
    list-style: none !important;
    padding-left: 0 !important;
    margin-left: auto !important;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr); /* Creates 3 equal columns */
    gap: 30px; /* Spacing between columns and rows */
}

/* Style each post as an individual card in the grid */
ul.my-advanced-list2 li {
    list-style-type: none !important;
    background: #ffffff;
    border: 1px solid #e3e3e3;
    padding: 0; /* Remove padding here so the image can sit flush at the top */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    overflow: hidden; /* Keeps the image corners rounded inside the card */
    
    /* Setup flexbox to force the order of elements */
    display: flex !important;
    flex-direction: column !important;
}

/* 1. TARGET THE IMAGE LINK WRAPPER (Force to top) */
ul.my-advanced-list2 li a:has(img) {
    order: 1 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}

/* Style the actual image inside that wrapper */
ul.my-advanced-list2 li img {
    width: 100% !important;
    height: 200px !important; /* Forces a consistent height for a clean grid look */
    display: block;
}

/* 2. TARGET THE POST TITLE LINK ONLY (Force to middle) */
ul.my-advanced-list2 li a:not(:has(img)) {
    order: 2 !important;
    font-size: 1.25em;
    font-weight: bold;
    text-decoration: none;
    color: #a51c33;
    padding: 20px 20px 20px 20px; /* Adds padding inside the text area */
    line-height: 1.4;
    display: none !important;
}

/* 3. TARGET THE EXCERPT TEXT (Force to bottom) */
ul.my-advanced-list2 .lcp_excerpt {
    order: 3 !important;
    color: #666666;
    font-size: 0.9em;
    line-height: 1.6;
    padding: 0 20px 20px 20px; /* Adds padding inside the text area */
    margin: 0 !important;
		display: none !important;
}

/* Responsive fix: Drop to 1 column on mobile screens */
@media (max-width: 768px) {
    ul.my-advanced-list {
        grid-template-columns: 1fr;
    }
}