#stacks-container {
    display: flex;
    flex-flow: row wrap;
    justify-content: space-evenly;
    align-items: center;
    width: 100%;
}
.stack {
    aspect-ratio: 0.63;
    width: auto;
    height: auto;
    min-width: 70px;
    min-height: 110px;
    max-width: 140px;
    max-height: 240px;
    outline: solid;
    border-radius: 10px;
    padding: 15px;
    margin: 15px;
    box-shadow: 10px 10px 1px rgb(145, 160, 161);
    /* Vertical center alignment */
    display: flex;
    overflow: auto;
    /* Make clickable */
    cursor: pointer;
    transition: all 0.3s ease;
}

.stack:hover {
    transform: translateY(-5px);
    box-shadow: 10px 15px 1px rgba(145, 160, 161, 0.8);
    filter: brightness(1.5);
}

.stack-description {
    margin: auto;
    text-align: center;
}

/* Modal styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    overflow-y: auto;
    backdrop-filter: blur(0px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, backdrop-filter 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
}

.modal-content {
    /* Use transparent background to inherit page background */
    background-color: inherit;
    margin: 10% auto;
    border-radius: 10px;
    max-width: 600px;
    width: 80%;
    position: relative;
    /* Add shadow for floating effect */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    /* Subtle border for definition */
    border: 1px solid rgba(0, 0, 0, 0.1);
    /* Make it a flex container */
    display: flex;
    flex-direction: column;
    /* Animation properties */
    transform: translateY(-30px) scale(0.95);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: translateY(0) scale(1);
}

.entries-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-top: 1px solid currentColor;
    padding: 30px;
}

.entry-item {
    display: block;
    overflow: hidden; /* Contains floated elements */
    margin-bottom: 20px;
}

.entry-image {
    width: 25%;
    max-width: 120px;
    min-width: 60px;
    height: auto;
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.2);
    /* Float the image to the left so text wraps around it */
    float: left;
    margin: 0 20px 10px 0; /* Right and bottom margin for text padding */
}

/* Accessibility focus styles */
.stack:focus {
    filter: brightness(1.5);
}

/* Center modal title horizontally */
#modal-title {
    text-align: center;
    flex: 15;
    margin: 30px;
}

.entry-title {
    font-size: 1.2em;
    font-weight: bold;
    margin: 0 0 0.2em 0;
    line-height: 1.3;
    color: inherit;
}

.entry-subtitle {
    font-size: 1em;
    font-weight: 500;
    font-style: italic;
    margin: 0.2em 0 0.3em 0;
    line-height: 1.2;
    color: inherit;
    opacity: 0.8;
}

.entry-commentary {
    font-size: 0.95em;
    font-weight: normal;
    margin: 0 0 0.8em 0;
    line-height: 1.4;
    padding: 0;
    color: inherit;
    text-align: justify;
}