.kg-gallery-image {
    cursor: pointer;
}

.kg-image {
    margin-right: auto;
    margin-left: auto;
}

.kg-toggle-heading-text {
    font-size: 1.8rem;
    font-weight: 700;
}

.has-serif-title .kg-toggle-heading-text {
    font-family: var(--font-serif);
}

.kg-toggle-content > * + * {
    margin: 2.4rem 0 0;
}

.kg-canvas {
    display: grid;
    grid-template-columns:
        [full-start]
        minmax(5vw, auto)
        [wide-start]
        minmax(auto, 100px)
        [main-start]
        min(720px, calc(100% - 10vw))
        [main-end]
        minmax(auto, 100px)
        [wide-end]
        minmax(5vw, auto)
        [full-end];
}

.kg-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;
}


/* Galleries
/* ---------------------------------------------------------- */

/* When there galleries are mixed with images, reduce margin
between them, so it looks like 1 big gallery */
.kg-image-card + .kg-gallery-card,
.kg-gallery-card + .kg-image-card,
.kg-gallery-card + .kg-gallery-card {
    margin-top: 0.75em;
}

.kg-image-card.kg-card-hascaption + .kg-gallery-card,
.kg-gallery-card.kg-card-hascaption + .kg-image-card,
.kg-gallery-card.kg-card-hascaption + .kg-gallery-card {
    margin-top: 1.75em;
}

.kg-gallery-container {
    position: relative;
}

.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
/* ---------------------------------------------------------- */

/* These are styled links with structured data, similar to a
Twitter card. These styles roughly match what you see in the
Ghost editor. */

.kg-bookmark-card,
.kg-bookmark-publisher {
    position: relative;
    width: 100%;
}

.kg-bookmark-container,
.kg-bookmark-container:hover {
    display: flex;
    color: currentColor;
    font-family: var(--font-sans-serif);
    text-decoration: none !important;
    background: rgba(255,255,255,0.6);
    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-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    flex-basis: 100%;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 20px;
}

.kg-bookmark-title {
    font-size: 1.5rem;
    line-height: 1.4em;
    font-weight: 600;
    color: #15171A;
}

.kg-bookmark-description {
    display: -webkit-box;
    font-size: 1.4rem;
    line-height: 1.5em;
    margin-top: 3px;
    color: #626d79;
    font-weight: 400;
    max-height: 44px;
    overflow-y: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.kg-bookmark-metadata {
    display: flex;
    align-items: center;
    margin-top: 22px;
    width: 100%;
    color: #394047;
    font-size: 1.4rem;
    font-weight: 500;
}

.kg-bookmark-icon {
    width: 20px;
    height: 20px;
    margin-right: 6px;
}

.kg-bookmark-author,
.kg-bookmark-publisher {
    display: inline;
}

.kg-bookmark-publisher {
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 240px;
    white-space: nowrap;
    display: block;
    line-height: 1.65em;
}

.kg-bookmark-metadata > span:nth-of-type(2) {
    color: #626d79;
    font-weight: 400;
}

.kg-bookmark-metadata > span:nth-of-type(2):before {
    content: "•";
    color: #394047;
    margin: 0 6px;
}

.kg-bookmark-thumbnail {
    position: relative;
    flex-grow: 1;
    min-width: 33%;
}

.kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 0 4px 4px 0;
}


/* 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: 1 / -1;
}

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

figure.kg-card {
    margin-bottom: 32px !important;
}
