/* ================================
   KOENIG CARD STYLES
   ================================ */

/* General Card Layout */
.kg-card {
    margin: 32px 0;
    width: 100%;
}

.kg-image-card img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* Captions */
.kg-card figcaption {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 12px;
    font-style: italic;
}

/* Image Widths */
.kg-width-wide {
    position: relative;
    width: 85vw;
    min-width: 100%;
    margin-left: calc(50% - 42.5vw);
    transform: translateX(calc(50vw - 50%));
}

.kg-width-full {
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.site-main.with-side-nav .kg-width-wide {
    width: calc(100% + 100px);
    margin-left: -50px;
    margin-right: -50px;
    max-width: none;
    transform: none;
}

.site-main.with-side-nav .kg-width-full {
    width: calc(100% + 96px);
    margin-left: -48px;
    margin-right: -48px;
    border-radius: 0;
    left: auto;
    right: auto;
}

@media (max-width: 1024px) {

    .site-main.with-side-nav .kg-width-wide,
    .site-main.with-side-nav .kg-width-full {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        border-radius: var(--radius-lg);
    }
}

/* Galleries */
.kg-gallery-card+.kg-gallery-card {
    margin-top: 24px;
}

.kg-gallery-container {
    position: relative;
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
}

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

.kg-gallery-image img {
    display: block;
    margin: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
    object-fit: cover;
}

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

/* Bookmark Card */
.kg-bookmark-card {
    background: var(--bg-light);
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-light);
}

.kg-bookmark-card a {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    color: var(--text-primary);
}

.kg-bookmark-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kg-bookmark-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
}

.kg-bookmark-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kg-bookmark-metadata {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

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

.kg-bookmark-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

@media (min-width: 768px) {
    .kg-bookmark-card a {
        flex-direction: row;
    }

    .kg-bookmark-content {
        flex: 1;
    }

    .kg-bookmark-thumbnail {
        flex-shrink: 0;
        width: 200px;
        height: auto;
    }

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

/* Callout Card */
.kg-callout-card {
    display: flex;
    gap: 16px;
    padding: 24px;
    background: var(--bg-light);
    border-left: 4px solid var(--color-primary);
    border-radius: var(--radius-md);
    margin: 32px 0;
}

.kg-callout-emoji {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.kg-callout-text {
    flex: 1;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.6;
}

/* Toggle Card */
.kg-toggle-card {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin: 24px 0;
    overflow: hidden;
}

.kg-toggle-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    cursor: pointer;
    transition: var(--transition);
}

.kg-toggle-heading:hover {
    background: var(--bg-light);
}

.kg-toggle-heading-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.kg-toggle-heading svg {
    width: 24px;
    height: 24px;
    fill: var(--text-secondary);
    transition: var(--transition);
}

.kg-toggle-card[data-kg-card-state="open"] .kg-toggle-heading svg {
    transform: rotate(180deg);
}

.kg-toggle-content {
    padding: 0 24px 24px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.kg-toggle-card[data-kg-card-state="close"] .kg-toggle-content {
    display: none;
}

/* Button Card */
.kg-button-card {
    display: flex;
    justify-content: center;
    margin: 32px 0;
}

.kg-btn {
    display: inline-block;
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: var(--radius-lg);
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.kg-btn-accent {
    background: var(--color-primary);
    color: var(--bg-body);
    box-shadow: var(--shadow-primary);
}

.kg-btn-accent:hover {
    background: var(--color-primary-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* Header Card */
.kg-header-card {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 40px;
    background: var(--color-primary);
    color: var(--bg-body);
    border-radius: var(--radius-xl);
    margin: 48px 0;
}

.kg-header-card h2 {
    font-size: 3rem;
    font-weight: 900;
    margin: 0 0 16px;
    color: var(--bg-body);
}

.kg-header-card p {
    font-size: 1.25rem;
    color: var(--bg-body);
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}