/* Main
/* ---------------------------------------------------------- */
.gh-main {
    margin-bottom: 2rem;
}

/* Content grid
/* ---------------------------------------------------------- */
.gh-canvas {
    display: grid;
    grid-template-columns:
    [full-start]
      minmax(calc(calc(100% - 1000px) / 2), 1fr)
        [wide-start]
            1fr
                [main-start]
                    repeat(10, [col-start] 1fr)
                [main-end]
            1fr
        [wide-end]
      minmax(calc(calc(100% - 1000px) / 2), 1fr)
    [full-end]
    ;
}

@media (max-width: 600px) {
    .gh-canvas {
        grid-template-columns:
            [full-start]
              minmax(calc(calc(100% - 720px) / 2), 1fr)
                [wide-start main-start]
                    repeat(10, [col-start] 1fr)
                [main-end wide-end]
              minmax(calc(calc(100% - 720px) / 2), 1fr)
            [full-end]
        ;
    }
}

.gh-canvas > * {
    grid-column: main-start / main-end;
}

.kg-width-wide {
    grid-column: wide-start / wide-end;
}

.kg-width-full {
    grid-column: full-start / full-end;
}


/* Tables
/* ---------------------------------------------------------- */

.gh-content table {
    border-collapse: collapse;
    width: 100%;
}

.gh-content th {
    padding: 0.5em 0.8em;
    text-align: left;
    font-size: .75em;
    text-transform: uppercase;
}

.gh-content td {
    padding: 0.4em 0.7em;
}

.gh-content tbody tr:nth-child(2n + 1) {
    background-color: rgba(0,0,0,0.1);
    padding: 1px;
}

.gh-content tbody tr:nth-child(2n + 2) td:last-child {
    box-shadow:
        inset 1px 0 rgba(0,0,0,0.1),
        inset -1px 0 rgba(0,0,0,0.1);
}

.gh-content tbody tr:nth-child(2n + 2) td {
    box-shadow: inset 1px 0 rgba(0,0,0,0.1);
}

.gh-content tbody tr:last-child {
    border-bottom: 1px solid rgba(0,0,0,.1);
}

/* Post header
/* ---------------------------------------------------------- */
.gh-page.no-image {
    margin-top: 2rem;
}

.gh-header {
    grid-row-gap: 2rem;
    margin-bottom: 1.5em;
}

.gh-title,
.gh-image {
    grid-row: 1 / 2;
    align-self: end;
}

.gh-excerpt {
    grid-row: 2 / 3;
}

.gh-image {
    grid-column: full-start / full-end;
}

.gh-title {
    margin-top: 2rem;
}

.gh-image + .gh-title {
    color: #fff;
}

.gh-post-footer {
    margin: 2rem 0;
}

/* Standard content
/* ---------------------------------------------------------- */

.gh-content h1,
.gh-content h2,
.gh-content h3,
.gh-content h4,
.gh-content h5,
.gh-content h6,
.gh-content table,
.gh-content blockquote {
    margin: 0.6em 0 0.3em;
}

.gh-content > [id] + [id] {
    margin-top: 0;
}

.gh-content h1 + .kg-card,
.gh-content h2 + .kg-card,
.gh-content h3 + .kg-card,
.gh-content h4 + .kg-card,
.gh-content h5 + .kg-card,
.gh-content h6 + .kg-card,
.gh-content table + .kg-card,
.gh-content blockquote + .kg-card,
.gh-content blockquote {
    margin-top: 1.5em;
}

.gh-content h5 {
    display: block;
    margin: 1.5em 0;
    text-align: center;
}

.gh-content hr {
    margin: 2em 0;
    border-color: currentColor;
    opacity: 0.2;
}

.gh-content ul,
.gh-content ol,
.gh-content dl {
    padding-left: 1.9em;
}

.gh-content blockquote {
    position: relative;
    padding-left: 1.5em;
}

.gh-content blockquote::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: .5em;
    background: currentColor;
    opacity: 0.3;
}

/* Cards
/* ---------------------------------------------------------- */

.kg-gallery-container,
.kg-bookmark-card,
.kg-bookmark-publisher {
    position: relative;
}

.gh-content > * + * {
    margin-top: 1.5rem;
}
.gh-content > h1 + *,
.gh-content > h2 + *,
.gh-content > h3 + *,
.gh-content > h4 + *,
.gh-content > h5 + *,
.gh-content > h6 + * {
    margin-top: 0;
}

:not(.kg-card):not(h1):not(h2):not(h3):not(h4):not(h5):not(h6) + .kg-card,
.gh-post-footer {
    margin-top: 7vw;
}

.kg-card + :not(.kg-card):not(h1):not(h2):not(h3):not(h4):not(h5):not(h6) {
    margin-top: 7vw;
}

.gh-post-footer {
    margin-bottom: 7vw;
}

.kg-card figcaption {
    padding: 1.5rem 1.5rem 0;
    font-size: 1.3rem;
    line-height: 1.4em;
    font-weight: 600;
    text-align: center;
    opacity: 0.4;
}

.gh-canvas > pre {
    overflow: scroll;
    padding: 16px 20px;
    border-radius: 5px;
    background: rgba(255,255,255,0.6);
    box-shadow: 0 2px 6px -2px rgba(0,0,0,.1), 0 0 1px rgba(0,0,0,.4);
}

.kg-embed-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Card captions
/* ---------------------------------------------------------- */
.kg-width-full.kg-card-hascaption {
    display: grid;
    grid-template-columns: inherit;
}

.kg-width-wide.kg-card-hascaption img {
    grid-column: wide-start / wide-end;
}
.kg-width-full.kg-card-hascaption img {
    grid-column: full-start / full-end;
}

.kg-width-full.kg-card-hascaption figcaption {
    grid-column: main-start / main-end;
}


/* Galleries
/* ---------------------------------------------------------- */
.kg-gallery-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.kg-gallery-image img {
    display: block;
    margin: 0;
    width: 100%;
    height: 100%;
}

.kg-gallery-row:not(:first-of-type) {
    margin: 0.75em 0 0 0;
}

.kg-gallery-image:not(:first-of-type) {
    margin: 0 0 0 0.75em;
}


/* Bookmark Cards
/* ---------------------------------------------------------- */

.kg-bookmark-container {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row-reverse;
    min-height: 148px;
    color: currentColor;
    background: rgba(255,255,255,0.6);
    font-family: inherit;
    text-decoration: none;
    border-radius: 5px;
    box-shadow: 0 2px 6px -2px rgba(0, 0, 0, 0.1), 0 0 1px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.kg-bookmark-container:hover {
    text-decoration: none;
}

.kg-bookmark-content {
    flex-basis: 0;
    flex-grow: 999;
    padding: 20px;
    order: 1;
}

.kg-bookmark-title {
    font-weight: 600;
}

.kg-bookmark-metadata {
    margin-top: .5em;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kg-bookmark-description {
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.kg-bookmark-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: text-bottom;
    margin-right: .5em;
    margin-bottom: .05em;
}

.kg-bookmark-thumbnail {
    display: flex;
    flex-basis: 24rem;
    flex-grow: 1;
}

.kg-bookmark-thumbnail img {
    max-width: 100%;
    height: auto;
    vertical-align: bottom;
    object-fit: cover;
}

.kg-bookmark-author::after {
    content: "•";
    margin: 0 .5em;
}