/* Root styles */
:root {
    --max-content-width: calc(100vw - 2.5rem);
    --fontSizeSmall: 1rem;
    --fontSizeBig: 1rem

    --postBoxWidthB: calc(((var(--max-content-width) - 3rem ) / 6) - 12px);
    --postBoxHeight: calc(((var(--max-content-width) - 3rem ) / 6) - 12px);
}
    @media screen and (max-width: 1800px) {
        :root {
            --postBoxWidthB: calc(((var(--max-content-width) - 3rem ) / 5) - 10px);
            --postBoxHeight: calc(((var(--max-content-width) - 3rem ) / 5) - 10px);
        }
    }
    @media screen and (max-width: 1500px) {
        :root {
            --postBoxWidthB: calc(((var(--max-content-width) - 3rem ) / 4) - 7px);
            --postBoxHeight: calc(((var(--max-content-width) - 3rem ) / 4) - 7px);
        }
    }
    @media screen and (max-width: 1000px) {
        :root {
            --fontSizeSmall: .9rem;

            --postBoxWidth: calc(((var(--max-content-width) - 2rem ) / 3) - 5px);
            --postBoxHeight: calc(((var(--max-content-width) - 2rem ) / 3) - 5px);
        }
    }
    @media screen and (max-width: 700px) {
        :root {
            --fontSizeSmall: .7rem;
            --fontSizeBig: .85rem;

            --postBoxWidth: calc(((var(--max-content-width) - 1rem ) / 2) - 5px);
            --postBoxHeight: calc(((var(--max-content-width) - 1rem ) / 2) - 5px);
        }
    }

/* Elements */
img {
    display: block;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
h1, :is(h1, h2, h3, h4, h5, h6) {
    all: unset;
    font-size: 1.5em;
}

body {
    font-size: var(--fontSizeBig);
    overflow-x: hidden;
}

#posts-container {
    width: var(--max-content-width);
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}
#posts-container .box {
    font-family: 'RobotoVariable', Arial, Helvetica, sans-serif;
    line-height: 1.5;
}
.small#posts-container article .box {
    line-height: 1.2;
}
#posts-container :is(h1, h2, h3, h4, h5, h6) {
    font-family: var(--globalFontFamily);
}

.small article {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    transition: opacity .3s ease-in-out;
}

.small article:hover {
    cursor: pointer;
    opacity: 0.7;
}
.small article:not(:has(img.featured)):hover .box {
    border-color: var(--globalFadedColor);
}

.box {
    overflow: hidden;
    position: relative;
}
.small .box {
    width: var(--postBoxHeight);
    height: var(--postBoxHeight);
}
/* Hide everything but the featured element inside the box */
.small .box > :not(.featured) {
    display: none;
}
/* Add padding and border to certain elements inside the box */
.small .box > :not(img.featured) {
    padding: .5rem;
}
/* Add border to posts with featured text */
.small .box {
    border: 2px solid var(--globalBackgroundColor); /* This keeps posts without visible borders in line with other posts */
    transition: opacity .3s ease-in-out;
    transition: border-color .3s ease-in-out;
    font-size: var(--fontSizeSmall);
}
.small .box:not(:has(img.featured)) {
    border: 2px solid var(--globalBackgroundFade);
}
/* Center featured h in the box */
.small .box:has(h1.featured) {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.small .box h1.featured {
    text-align: center;
}
/* Add fading effect when displaying a featrued paragraph */
.small .box p.featured::after, .small .box h1.featured::after {
    content: "";
    position: absolute;
    inset: 70% 0 0 0;
    background: linear-gradient(to top, var(--globalBackgroundColor), transparent);
}
/* Displaying featured images */
.small .box img.featured {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.small .info {
    text-align: center;
    font-size: var(--fontSizeSmall);
    padding: 5px 0;
}
.small .info .close-button {
    display: none;
}

.big#posts-container {
    width: 100%;
    display: block;
    margin: 0 auto;
}

.big article {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    align-items: flex-start;
    margin-bottom: 2rem;
}
.big article:not(.active) {
    display: none;
}
.big .info {
    position: sticky;
    top: 0;
    padding: 2.2rem 1rem 1rem 0;
}
.big .info .close-button {
    cursor: pointer;
    background-color: var(--globalBackgroundFade);
    transition: background-color .3s ease-in-out;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
.big .info .close-button:hover {
    background-color: var(--globalFadedColor);
}
.big .info time {
    display: none;
}
.big .box {
    width: 700px;
    max-width: 100%;
    padding: 2rem .5rem 2rem 0;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 1rem;
}

.big .box img {
    width: 500px;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}
.big .box img.tiny {
    width: 200px;
}

.big .box p {
    width: 100%;
}

@media screen and (max-width: 700px) {
    .small .box h1.featured {
        font-size: 1rem;
    }
    .small .info {
        opacity: 1;
    }
}