:root {
    --grid-item-max-width: calc((100% - 48px) / 4);
    --grid-item-min-width: min(100%, 300px);
}

.content, .center-content {
    display: block;
}

#logo {
    width: 650px;
    max-width: calc(100vw - 66px);
    border-radius: 16px;
}

#banner {
    position: relative;
    text-align: center;
    z-index: 3;
}

.grid-container {
    display: grid;
    flex-direction: column;
    flex-grow: 1;
    max-width: var(--pageWidth);
    margin: 0 auto;
    gap: 14px;
    grid-auto-flow: dense;
    grid-auto-rows: minmax(200px, auto);
    grid-template-columns: repeat(auto-fill, minmax(max(var(--grid-item-min-width), var(--grid-item-max-width)), 1fr));
    row-gap: 32px;
}


.grid-cell {
    position: relative;
    opacity: 0;
    animation: delayedFadeIn 0.3s forwards;
    transform: translateY(20px);
}

.grid-item {
    display: grid;
    position: relative;
    font-family: Cinzel, serif;
    font-size: 18px;
    overflow: hidden;
    align-content: flex-start;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    padding: 12px;
    transition: all 0.4s ease-in-out !important;
    text-transform: uppercase;
    color: var(--secondary);
    border: 1px solid var(--border-container-small);
    border-radius: 16px;
    background-color: var(--bg-container-small);
    box-shadow: var(--shadow-small-container);
    grid-template-rows: 200px 1fr;

}

.grid-item a {
    display: flex;
    color: inherit;
    background-image: none;
}

.grid-item a:hover {
    color: var(--secondary--hover) !important;
    background-image: none;
}

.grid-item a.preview-image-container::after,
.content-container a.title-text::after {
    display: none;
}


.grid-item .preview-image-container,
.grid-item .preview-image {
    overflow: hidden;
    width: 100%;
    height: 100%;
    border-radius: 16px;
}

.grid-item .preview-container {
    display: flex;
    position: relative;
    align-items: flex-end;
    justify-content: flex-end;
    height: 190px;
}

.grid-item .preview-image {
    transition-duration: 4.5s, 0.15s, 0.15s, 0.3s, 3s;
    transition-property: background, filter, mix-blend-mode, opacity, transform;
    transform: scale(var(--bg-scale)) translateZ(1px);
    opacity: 0.85;
    background-repeat: no-repeat;
    background-position: var(--bg-position);
    background-size: cover;
    mix-blend-mode: multiply;
    --bg-position: 50% 50%;
    --bg-scale: 1.15, 1.15;
    will-change: background, transform, box-shadow;
}

.preview-image.fit {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    transform: translate(-50%, -50%);
    background-size: contain;
}


.grid-item .meta-container {
    display: flex;
    position: absolute;
    font-size: 13px;
    font-weight: 600;
    left: 6px;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    color: var(--text-color);
    z-index: 6;
}

.grid-item .meta-container .issue {
    display: none;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 4px 6px;
    text-decoration: none;
    margin-bottom: -1px;
    color: var(--secondary);
    border: 1px solid rgb(from var(--border-color) r g b / 0.8);;
    border-radius: 0 6px 6px 0;
    background: rgb(from var(--bg-container-large) r g b / 0.9);
    animation: fadeIn 0.6s forwards;
}

.meta-container a {
    backdrop-filter: blur(16px);
}


.grid-item .meta-container .issue:hover {
    color: var(--secondary);
    background-color: rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(3px);
}

.grid-item:hover .issue, .grid-item:focus .issue {
    display: flex;
    backdrop-filter: blur(2px);
}

.grid-item .content-container {
    display: grid;
    align-self: stretch;
    box-sizing: border-box;
    height: 100%;
    clip-path: inset(0% 0% round 0 0 18px 18px);
    gap: 14px;
    padding-block: 12px calc(12px + 2px);
}

.grid-item .content-container .title-container {
    overflow: hidden;
    width: 100%;
    height: auto;
    padding-left: 4px;
}


.grid-item .content-container .title-container a.title-text {
    display: -webkit-box;
    font-size: 17px;
    overflow: hidden;
    margin-top: -8px;
    padding-left: 4px;
    white-space: wrap;
    text-rendering: optimizeLegibility;
    font-weight: var(--font-weight-buttons);
    text-decoration: none !important;
    text-overflow: initial;
    -webkit-box-orient: vertical;
}

.grid-item .content-container .title-container a.title-text:hover {
    text-decoration-color: rgba(208, 190, 173, 0.2);
}



.grid-item:not(.featured) .preview-container {
    clip-path: inset(0% 0% round 18px 18px 0 0) !important;
}

.grid-item:hover, .grid-item:focus {
    height: 100%;
    transition: color 0.5s;
    color: var(--secondary--hover);

    box-shadow: var(--shadow-small-container--hover);
}


.grid-item:hover .preview-container, .grid-item:focus .preview-container {
    overflow: hidden;
}

.grid-item:hover .preview-image, .grid-item:focus .preview-image {
    opacity: 1;
    filter: none;
    mix-blend-mode: normal;
    --bg-scale: 1, 1;
}


.grid-cell:nth-of-type(1) .preview-image {
    background-image: url("img/sanskrit_goldS.png");
}

.grid-cell:nth-of-type(2) .preview-image {
	background-image: url("Jupiter.jpg");
	background-position: top;
	background-size: 90%;
}
.grid-cell:nth-of-type(3) .preview-image {
    background-image: url("artwork/satan-exulting-richard-westall.webp");
}

.grid-cell:nth-of-type(4) .preview-image {
    background-image: url("artwork/1900.384 - The Landing Place.webp");
}

.grid-cell:nth-of-type(5) .preview-image {
    background-image: url("artwork/Apotheosis_of_G._Washington_sm.webp");
}

.grid-cell:nth-of-type(6) .preview-image {
    background-image: url("artwork/Beelzebul-1.jpg");
}

.grid-cell:nth-of-type(7) .preview-image {
    background-image: url("artwork/Da_Vinci_small.webp");
}

.grid-cell:nth-of-type(8) .preview-image {
    background-image: url("artwork/priestess.webp");
}

.grid-cell:nth-of-type(9) .preview-image {
    background-image: url("artwork/osiris.jpeg");
}

.grid-cell:nth-of-type(10) .preview-image {
    background-image: url("artwork/Parthenon.webp");
}

.grid-cell:nth-of-type(11) .preview-image {
    background-image: url("artwork/1987.67 - Italian Landscape with Travelers.webp");
}

.grid-cell:nth-of-type(12) .preview-image {
    background-image: url("artwork/athens.webp");
}

.grid-cell:nth-of-type(13) .preview-image {
    background-image: url("artwork/Sebastiano Conca - The Vision of Aeneas in the Elysian Fields c1735-40 - (MeisterDrucke-66433).jpg");
}

.grid-cell:nth-of-type(14) .preview-image {
    background-image: url("artwork/1ouroboros5499862458560005687.jpg");
}

.grid-cell:nth-of-type(15) .preview-image {
    background-image: url("artwork/celebrations.webp");
}

.grid-cell:nth-of-type(16) .preview-image {
    background-image: url("artwork/library.webp");
}


.grid-cell:nth-child(1)  {
    animation-delay: 0.05s;
}

.grid-cell:nth-child(2)  {
    animation-delay: 0.1s;
}

.grid-cell:nth-child(3)  {
    animation-delay: 0.15s;
}

.grid-cell:nth-child(4)  {
    animation-delay: 0.2s;
}

.grid-cell:nth-child(5)  {
    animation-delay: 0.25s;
}

.grid-cell:nth-child(6)  {
    animation-delay: 0.3s;
}

.grid-cell:nth-child(7)  {
    animation-delay: 0.35s;
}

.grid-cell:nth-child(8)  {
    animation-delay: 0.4s;
}

.grid-cell:nth-child(9)  {
    animation-delay: 0.45s;
}

.grid-cell:nth-child(10)  {
    animation-delay: 0.5s;
}

.grid-cell:nth-child(11)  {
    animation-delay: 0.55s;
}

.grid-cell:nth-child(12)  {
    animation-delay: 0.6s;
}

.grid-cell:nth-child(13)  {
    animation-delay: 0.65s;
}

.grid-cell:nth-child(14)  {
    animation-delay: 0.7s;
}

.grid-cell:nth-child(15)  {
    animation-delay: 0.75s;
}

.grid-cell:nth-child(16)  {
    animation-delay: 0.8s;
}


/* MINI GRID */
.mini-grid-container {
    display: grid;
    flex-direction: column;
    max-width: var(--pageWidth);
    margin: 0 auto;
    gap: 12px;
    grid-auto-flow: dense;
    grid-auto-rows: minmax(auto, auto);
    grid-template-columns: repeat(auto-fill, minmax(max(var(--grid-item-min-width), var(--grid-item-max-width)), 1fr));
    row-gap: 28px;
}

.mini-grid-item {
    display: flex;
    position: relative;
    align-items: center;
    padding: 24px 16px 24px 72px;
    transition: all 0.4s ease-in-out;
    text-decoration: none;
    border: 1px solid var(--border-container-small);
    border-radius: 16px;
    background-color: var(--bg-container-small);
    box-shadow: var(--shadow-small-container);
}

.mini-grid-item:before {
    display: inline-block;
    position: absolute;
    top: 50%;
    left: 16px;
    width: 40px !important;
    height: 40px !important;
    content: "";
    transition: all 1.8s ease-in-out;
    transform: translateY(-50%) scaleX(-1);
    background-image: url("img/icons/eyeofra.png");
    background-size: contain;
    filter: brightness(0) saturate(100%) invert(75%) sepia(57%) saturate(311%) hue-rotate(357deg) brightness(95%) contrast(88%);;
}

.mini-grid-item .title-text {
    font-size: 18px;
    font-weight: bold;
    transition: all 0.5s ease-in-out;
    color: var(--secondary);
}

.mini-grid-item:hover, .mini-grid-item:focus {
    box-shadow: var(--shadow-small-container--hover);
}


.mini-grid-item:hover .title-text {
    color: var(--secondary--hover);
}

a.mini-grid-item {
    background-image: none;
}

a.mini-grid-item:hover {
    border-radius: 16px;
    background-image: none;
}


/* MEDIA QUERIES */
@media  (min-width: 100px) {
    .grid-item .content-container .title-container a.title-text   {
        margin-top: 8px !important;
    }
}

/* ANIMATIONS */
@keyframes textColor {
    0% {
        color: var(--secondary);
    }
    50% {
        color: var(--text-color);
    }
    100% {
        color: var(--secondary);
    }
}
