#hero.no-thumbnail {
    background: var(--dark-bg-1);
}

#hero a {
    color: white;
}

#hero .meta-data {
    display: grid;
    gap: 10px
}

#hero .material-icon {
    color: var(--accent-color);
}

#article > .container {
    max-width: 900px;
}

#article .toc-wrapper {
    border-radius: min(var(--border-radius), 32px);
    overflow: hidden;
    margin-bottom: calc(var(--padding-v) / 2);
}

#article .toc-toggle {
    display: block;
    padding: 20px;
    background: var(--bright-bg-2);
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
    position: relative;
}

#article .toc-wrapper.open .toc-toggle,
#article .toc-toggle:hover {
    filter: brightness(0.95);
}

#article .toc-toggle::after {
    content: '';
    width: 1.3em;
    height: 1.3em;
    position: absolute;
    right: 1em;
    top: 50%;
    transform: translateY(-50%);
    background: url(/wp-content/themes/hemsida/assets/chevron_open.svg);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

#article .toc-wrapper.open .toc-toggle::after {
    transform: translateY(-50%) scaleY(-100%);
}

#article .toc {
    display: grid;
    gap: 7px;
    background: var(--bright-bg-2);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: 0.5s opacity;
    margin: 0;
}

#article .toc-wrapper.open .toc {
    max-height: unset;
    padding: 20px;
    opacity: 1;
}

#article .toc li {
    margin-left: 20px;
}

#article .toc a {
    color: black !important;
    text-decoration-thickness: 1px;
}

#article .article-content > h2:first-child,
#article .article-content > h3:first-child,
#article .article-content > h4:first-child,
#article .article-content > h5:first-child {
    margin-top: 0;
}

#article .article-content h2:not(:first-child) {
    padding-top: 30px;
    margin-top: 40px;
    border-top: dashed 1px rgb(220, 220, 220);
    display: block;
}

#article .article-content img {
    width: auto;
    min-width: 150px;
    max-width: 100%;
    height: auto;
    min-height: 200px;
    height: 40vh;
    max-height: 500px;
    object-fit: contain;
    object-position: left;
    border-radius: var(--border-radius);
    margin-top: 40px;
}

#article .article-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-1);
    margin-bottom: 1.5em;
}

#article .article-content table th {
    font-weight: bold;
    text-align: left;
    padding: 5px 10px;
    border-bottom: 1px solid rgb(235, 235, 235);
}

#article .article-content table td {
    text-align: left;
    padding: 5px 10px;
    border-bottom: 1px solid rgb(235, 235, 235);
}

#article .article-content table th:first-child,
#article .article-content table td:first-child {
    padding-left: 0;
}

#article .article-content table th:last-child,
#article .article-content table td:last-child {
    padding-right: 0;
}

#article .article-content table tr:last-child td {
    border-bottom: none;
}

#related {
    padding-top: 0;
}

#related .container {
    max-width: 900px;
}

#related .related-posts {
    display: grid;
    gap: 20px;
}

#related .card {
    background-color: rgb(0,0,0,.05);
    border-radius: calc(var(--border-radius) / 2);
    display: grid;
    align-content: flex-end;
    overflow: hidden;
    position: relative;
    min-height: 200px;
    z-index: 1;
    text-decoration: none;
    box-shadow: 0 10px 15px rgb(0,0,0,.1);
    transition: all 0.2s;
    opacity: 0.9;
    filter: saturate(0.8);
}

#related .card:hover {
    box-shadow: 0 10px 15px rgb(0,0,0,.3);
    opacity: 1;
    filter: saturate(1);
}

#related .card::after {
    content: '';
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: linear-gradient(0deg, rgb(0,0,0,.5), transparent);
    z-index: -1;
    transition: 0.3s opacity;
}

#related .card:hover::after {
    opacity: 0.5;
}

#related .card.no-thumbnail {
    background: var(--dark-bg-1);
    min-height: 200px !important
}

#related .card .card-label {
    position: absolute;
    display: block;
    left: 20px;
    top: 20px;
    background: rgb(255,255,255,.9);
    padding: 3px 12px;
    border-radius: calc(var(--border-radius) / 4);
    color: black;
}

#related .card:hover .card-label {
    background: var(--accent-fg-color);
    color: var(--accent-color);
    transition: all 0.3s
}

#related .card .card-content {
    padding: 10px 20px 20px 20px;
    color: white;
}

@media screen and (max-width: 749px) {
    #article .toc-toggle {
        font-size: var(--fs-1);
        padding: 10px 20px;
    }
    
    #article .article-content img {
        width: 100%;
        height: auto;
        max-height: 40vh;
        object-fit: contain;
        object-position: center;
        border-radius: var(--border-radius);
        margin-top: 40px;
    }
    
    #article .article-content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
}

@media screen and (min-width: 750px) {
    #article .article-content h2:not(:first-child) {
        padding-top: 40px;
    }
    
    #article .article-content img {
        width: auto;
        min-width: 150px;
        max-width: 100%;
        height: auto;
        min-height: 200px;
        height: 40vh;
        max-height: 500px;
        object-fit: contain;
        object-position: left;
        border-radius: var(--border-radius);
        margin-top: 40px;
    }
}

@media screen and (min-width: 1000px) {
    #hero {
        padding-top: calc(var(--header-height) + var(--padding-v) + 20px) !important;
    }

    #hero .meta-data {
        display: flex;
        gap: 20px;
        margin-top: 20px;
    }

    #related .related-posts {
        grid-template-columns: 1fr 1fr;
    }

    #related .card {
        min-height: 300px;
    }

    #related .card:last-child .card-label {
        left: unset;
        right: 20px;
    }
}