/* Sidebar Video Thumbnails */

.yt_video_container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 2px;
}

.yt_video_container > img {
    width: 100%;
    height: auto;
    cursor: pointer;
}

/* Featured Sites */

.featured-sites a {
    padding: 7px;
    transition: background .4s;
    border-radius: 7px;
    display: block;
    text-align: center;
}

.featured-sites a img {
    max-width: 100%;
    max-height: 30px;
}

.featured-sites a:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Blog Feature Cards (Multiple Sizes) */

.blog-card img.thumbnail {
    width: 100%;
    height: 100%;
    border-radius: 3px 0 0 3px;
    object-fit: cover;
}

@media (min-width: 767.98px) { /* Thumbnail on the left */
    .blog-card {
        display: grid;
        grid-template-columns: 230px 1fr;
    }
}

@media (max-width: 767.98px) { /* Thumbnail as the background */
    .blog-card {
        display: block;
        background: transparent;
    }
    .blog-card div.thumbnail-wrapper {
        position: absolute;
        display: block;
        height: 100%;
        width: 100%;
        z-index: -1;
        opacity: 0.1;
    }
    .blog-card img.thumbnail {
        display: block;
        max-height: 100%;
        max-width: 100%;
        filter: blur(2px);
    }
}

/* YouTube Embedding */

.embedded_yt {
    width: 100%;
    max-width: 650px;
    margin: auto;
}

.embedded_yt > div {
    position: relative;
    padding-bottom: 56.25%;
    padding-top: 25px;
    height: 0;
}

.embedded_yt > div > iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Navigation hash offset. An amazing solution: https://stackoverflow.com/a/28824157 */

:target::before {
  content: "";
  display: block;
  height: 58px;
  margin: -58px 0 0;
}

/* Post Styling */

.post-hits {
    height: 18px;
    margin-top: -2px;
}

.post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: auto;
}

.post-content > .toc > ul > li > ul > li *:not(a) {
    display: none; /* Hide any points that are more than two headings deep in the table of contents */
}

.post-content > .toc > ul {
    border-bottom: 1px solid rgb(230, 230, 230);
    padding-bottom: 1rem;
}

.blog-navigation-in-post {
    display: flex;
    gap: 6px;
    justify-content: center;
}

@media (max-width: 575.98px) { 
    /* Up to sm */
    .blog-navigation-in-post {
        flex-direction: column;
    }
 }

.blog-navigation-in-post .btn {
    display: flex;
    gap: 4px;
    overflow: hidden;
}

.blog-navigation-in-post .btn .btn-content {
    flex-grow: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

blockquote { /* Blockquotes */
    border-left: .25em solid #dfe2e5;
    color: #6a737d;
    padding: 0 1em;
}

h1, h2, h3, h4, h5, h6 {
    word-break: break-word;
}

/* GitHub Styled Tables */

table {
    display: block;
    width: 100%;
    overflow: auto;
    margin-top: 0;
    margin-bottom: 16px;
}

table th {
    font-weight: 600
}

table th, table td {
    padding: 6px 13px;
    border: 1px solid #dfe2e5
}

table tr {
    background-color: #fff;
    border-top: 1px solid #c6cbd1
}

table tr:nth-child(2n) {
    background-color: #f6f8fa
}

table img {
    background-color: initial
}

/* kbd tag */

kbd {
    padding: 1.5px 4px;
}

/* Sidebar */

.blog-sidebar > div {
    overflow: hidden;
}

@media (max-width: 992px) {
    /* Add margin to the top of the sidebar when under content */
    .col-blog-sidebar {
        margin-top: 1rem;
    }
}

/* GitHub Component */

.github-summary {
    transform: translate(0); /* Need to put this here as the bootstrap stretched-link class will expand too far out */
    cursor: pointer;
    transition: background-color 0.3s;
}

.github-summary:hover {
    background: rgba(0, 0, 0, 0.05);
}

.github-summary .repo-name {
    display: inline-flex;
    align-items: center;
}

.github-summary .repo-name img {
    max-height: 20px;
    max-width: 20px;
}

/* Header link icons (for HeaderLinkExtension) */

.anchor {
    position: absolute;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    padding-right: 4px;
}

h1 .anchor svg,
h2 .anchor svg,
h3 .anchor svg,
h4 .anchor svg,
h5 .anchor svg,
h6 .anchor svg {
    visibility: hidden;
}

h1:hover .anchor svg,
h2:hover .anchor svg,
h3:hover .anchor svg,
h4:hover .anchor svg,
h5:hover .anchor svg,
h6:hover .anchor svg,
h1 .anchor:focus svg,
h2 .anchor:focus svg,
h3 .anchor:focus svg,
h4 .anchor:focus svg,
h5 .anchor:focus svg,
h6 .anchor:focus svg {
    visibility: visible;
}

/* Blog double column sizing (bootstrap override)  */

.col-blog-content, .col-blog-sidebar {
    position: relative;
    width: 100%;
    min-height: 1px;
    padding-right: 15px;
    padding-left: 15px
}

@media (min-width: 992px) {
    .col-blog-content {
        -webkit-box-flex: 0;
        -ms-flex: 0 0 72%;
        flex: 0 0 72%;
        max-width: 72%
    }

    .col-blog-sidebar {
        -webkit-box-flex: 0;
        -ms-flex: 0 0 28%;
        flex: 0 0 28%;
        max-width: 28%
    }
}

/* Blur-up Images */

.blur-up {
    -webkit-filter: blur(5px);
    filter: blur(5px);
    transition: filter 400ms, -webkit-filter 400ms;
}

.blur-up.lazyloaded {
    -webkit-filter: blur(0);
    filter: blur(0);
}
