/* Content cards
/* ---------------------------------------------------------- */
/* Styling for the structural card types a post's markdown body can embed:
   images/galleries, bookmarks (link previews), callouts, toggles, and file
   downloads. Adapted from Ghost's card taxonomy but restyled from scratch
   for this site's dark palette — Ghost's own card CSS assumes a light
   editor background and wouldn't read correctly here. */

.kg-card + .kg-card {
    margin-top: 1.5em;
}

/* Images & galleries
/* ---------------------------------------------------------- */

.kg-image-card {
    text-align: center;
}

.kg-image-card img {
    width: 100%;
    border-radius: 6px;
}

figure.kg-card figcaption,
.kg-image-card figcaption {
    margin-top: .6em;
    font-size: var(--font-metadata-size);
    color: var(--color-metadata-font);
    text-align: center;
}

.kg-gallery-container {
    display: flex;
    flex-direction: column;
}

.kg-gallery-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: .5em;
}

.kg-gallery-row + .kg-gallery-row {
    margin-top: .5em;
}

.kg-gallery-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

/* Bookmark (link preview) cards
/* ---------------------------------------------------------- */

.kg-bookmark-card {
    width: 100%;
}

.kg-bookmark-container {
    display: flex;
    min-height: 96px;
    border-radius: 6px;
    background: #0d0d0d;
    box-shadow: inset 0 0 0 1px #ffffff1a;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
}

.kg-bookmark-container:hover {
    box-shadow: inset 0 0 0 1px #ffffff33;
}

.kg-bookmark-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1em 1.25em;
    flex: 1 1 auto;
    min-width: 0;
}

.kg-bookmark-title {
    font-size: 15px;
    font-weight: var(--font-bold);
    color: var(--color-content-heading);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.kg-bookmark-description {
    margin-top: .35em;
    font-size: var(--font-metadata-size);
    color: var(--color-content-font);
    opacity: .8;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.kg-bookmark-metadata {
    display: flex;
    align-items: center;
    gap: .5em;
    margin-top: .8em;
    font-size: var(--font-metadata-size);
    color: var(--color-metadata-font);
}

.kg-bookmark-icon {
    width: 18px;
    height: 18px;
    border-radius: 3px;
}

.kg-bookmark-thumbnail {
    flex: 0 0 auto;
    width: 33%;
    max-width: 220px;
}

.kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 600px) {
    .kg-bookmark-container {
        flex-direction: column;
    }

    .kg-bookmark-thumbnail {
        width: 100%;
        max-width: none;
        order: -1;
        aspect-ratio: 2 / 1;
    }
}

/* Callout cards
/* ---------------------------------------------------------- */

.kg-callout-card {
    display: flex;
    align-items: flex-start;
    gap: .75em;
    padding: 1em 1.25em;
    border-radius: 6px;
    background: #ffffff0d;
    border-left: 3px solid var(--color-content-heading);
}

.kg-callout-emoji {
    flex: 0 0 auto;
    font-size: 1.2em;
    line-height: 1.4;
}

.kg-callout-text {
    color: var(--color-content-font);
}

.kg-callout-text :last-child {
    margin-bottom: 0;
}

/* Toggle (collapsible) cards
/* ---------------------------------------------------------- */

.kg-toggle-card {
    border-radius: 6px;
    box-shadow: inset 0 0 0 1px #ffffff1a;
    padding: 1em 1.25em;
}

.kg-toggle-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-weight: var(--font-bold);
    color: var(--color-content-heading);
}

.kg-toggle-content {
    margin-top: .75em;
    color: var(--color-content-font);
}

.kg-toggle-content :last-child {
    margin-bottom: 0;
}

/* File download cards
/* ---------------------------------------------------------- */

.kg-file-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

.kg-file-card-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1em 1.25em;
    border-radius: 6px;
    box-shadow: inset 0 0 0 1px #ffffff1a;
}

.kg-file-card-title {
    font-weight: var(--font-bold);
    color: var(--color-content-heading);
}

.kg-file-card-caption,
.kg-file-card-filename,
.kg-file-card-filesize {
    font-size: var(--font-metadata-size);
    color: var(--color-metadata-font);
}

.kg-file-card-icon {
    flex: 0 0 auto;
    margin-right: 1em;
}

/* Buttons
/* ---------------------------------------------------------- */

.kg-button-card {
    display: flex;
    justify-content: center;
}

.kg-btn {
    display: inline-block;
    padding: .6em 1.4em;
    border-radius: 4px;
    box-shadow: inset 0 0 0 1px var(--color-content-heading);
    color: var(--color-content-heading);
    text-decoration: none;
    font-weight: var(--font-bold);
}

.kg-btn:hover {
    box-shadow: inset 0 0 0 1px var(--color-link-hover);
    color: var(--color-link-hover);
}
