/* --- PAFA DIGITAL ARCHIVES: UNIFIED RESOURCE GRID (ITEMS & ITEM-SETS) --- */

/* 1. Desktop View: Force 4 columns for both Items and Item-Sets */
body.item.resource.browse ul.resource-list,
body.item-set.resource.browse ul.resource-list {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    padding: 0 !important;
    margin: 30px 0 !important;
    list-style: none !important;
}

/* 2. Responsive: Tablet & Mobile View (2 columns) */
@media (max-width: 1000px) {
    body.item.resource.browse ul.resource-list,
    body.item-set.resource.browse ul.resource-list {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }

    body.item.resource.browse ul.resource-list li.item.resource,
    body.item-set.resource.browse li.item-set.resource {
        min-height: auto !important;
    }
}

/* 3. Card Styling */
body.item.resource.browse ul.resource-list li.item.resource,
body.item-set.resource.browse li.item-set.resource {
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #dedede !important;
    background: #ffffff !important;
    display: flex !important;
    flex-direction: column !important;
    transition: all 0.2s ease-in-out !important;
    box-sizing: border-box !important;
}

/* 4. Image Handling (Uniform Squares) */
body.item.resource.browse .resource-link img,
body.item-set.resource.browse .resource-link img {
    float: none !important;
    display: block !important;
    width: 100% !important;
    height: 180px !important;
    object-fit: contain !important;
    margin: 0 !important;
    padding: 10px !important; /* Adds breathing room for archival thumbnails */
    border-bottom: 1px solid #dedede !important;
    background-color: #f8f8f8 !important;
    box-sizing: border-box !important;
}

/* 5. Title Styling */
body.item.resource.browse .resource-name,
body.item-set.resource.browse .resource-name {
    display: block !important;
    width: 100% !important;
    padding: 12px !important;
    font-size: 15px !important;
    line-height: 1.3 !important;
    text-align: center;
    box-sizing: border-box !important;
    font-family: 'Open Sans', sans-serif !important;
    color: #000000 !important;
    text-decoration: none !important;
}

/* Force links inside titles to behave */
body.item.resource.browse .resource-name a,
body.item-set.resource.browse .resource-name a {
    color: inherit !important;
    text-decoration: none !important;
}

/* 6. Hide Descriptions (keeps grid clean) */
body.item.resource.browse .description,
body.item-set.resource.browse .description {
    display: none !important;
}

/* 7. Hover States */
body.item.resource.browse li.item.resource:hover,
body.item-set.resource.browse li.item-set.resource:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 8px 15px rgba(0,0,0,0.1) !important;
    border-color: #ef4135 !important;
}

body.item.resource.browse li.item.resource:hover .resource-name,
body.item-set.resource.browse li.item-set.resource:hover .resource-name {
    color: #ef4135 !important;
}

<style type="text/css">#myBtn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 30px;
    z-index: 99;
    font-size: 18px;
    border: none;
    outline: none;
    background-color: #222222;
    color: #ffffff;
    cursor: pointer;
    padding: 15px;
    border-radius: 100px;
  }
  
  #myBtn:hover {
    background-color: #fcb122;
color: #000;
</style>
<p><button id="myBtn" onclick="topFunction()" title="Go to top">Top</button><script>
//Get the button
var mybutton = document.getElementById("myBtn");

// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function() {scrollFunction()};

function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
  mybutton.style.display = "block";
} else {
  mybutton.style.display = "none";
}
}

// When the user clicks on the button, scroll to the top of the document
function topFunction() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
</script></p>
