/*
 * Vanilla HTML Designer — public content styles
 *
 * Load this file on every page that renders HTML generated by VHD:
 * <link rel="stylesheet" href="/lib/Vanilla-HTML-Designer/src/vhd-content.css">
 */

.vhd-content {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
}

.vhd-content *,
.vhd-content *::before,
.vhd-content *::after {
    box-sizing: border-box;
}

/* Rows and responsive column layouts */
.vhd-content .vhd-row {
    display: grid;
    grid-template-columns: repeat(var(--vhd-grid-units), minmax(0, 1fr));
    gap: 1rem;
    width: 100%;
    min-width: 0;
}

.vhd-content .vhd-col {
    grid-column: span var(--vhd-span);
    min-width: 0;
}

/* Text content */
.vhd-content .vhd-text {
    min-width: 0;
}

.vhd-content .vhd-text > :first-child {
    margin-top: 0;
}

.vhd-content .vhd-text > :last-child {
    margin-bottom: 0;
}

/* Images */
.vhd-content .vhd-image {
    margin: 1em 0;
}

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

.vhd-content .vhd-image figcaption {
    margin-top: .4em;
    color: #6b7280;
    font-size: .875em;
}

.vhd-content .vhd-inline-image {
    max-width: 100%;
    height: auto;
}

/* Buttons */
.vhd-content .vhd-button-wrap {
    margin: 1em 0;
}

.vhd-content .vhd-button {
    display: inline-block;
    max-width: 100%;
    text-decoration: none;
}

/* Dividers */
.vhd-content .vhd-divider {
    width: 100%;
    margin: 1em 0;
}

/* Spacer */
.vhd-content .vhd-spacer {
    display: block;
    width: 100%;
}

/* Inline and embedded videos */
.vhd-content .vhd-inline-video {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1em 0;
}

.vhd-content .vhd-inline-video-embed {
    display: block;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    margin: 1em 0;
    border: 0;
}

/* Alignment helper classes retained for imported/legacy content */
.vhd-content .vhd-align-left {
    text-align: left;
}

.vhd-content .vhd-align-center {
    text-align: center;
}

.vhd-content .vhd-align-right {
    text-align: right;
}

/* Citations */
.vhd-content blockquote {
    position: relative;
    margin: 1.25em 0 1.25em 2em;
    padding: 1em 1.25em 1em 2.9em;
    border: 1px solid #d8dde5;
    border-left: 4px solid #9ca3af;
    border-radius: 6px;
    background: #f7f8fa;
    color: inherit;
}

.vhd-content blockquote::before {
    content: "❝";
    position: absolute;
    top: .25em;
    left: .45em;
    color: #9ca3af;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.4em;
    font-weight: 700;
    line-height: 1;
    opacity: .9;
    pointer-events: none;
}

.vhd-content blockquote::after {
    content: "❞";
    position: absolute;
    right: .45em;
    bottom: .15em;
    color: #c2c7cf;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2em;
    font-weight: 700;
    line-height: 1;
    opacity: .65;
    pointer-events: none;
}

.vhd-content blockquote > :first-child {
    margin-top: 0;
}

.vhd-content blockquote > :last-child {
    margin-bottom: 0;
}

/* Tables can occur in imported rich text */
.vhd-content table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
}

.vhd-content th,
.vhd-content td {
    padding: .5em .65em;
    border: 1px solid #d8dde5;
    vertical-align: top;
}

/*
 * On small screens all VHD layouts collapse to one column.
 * This applies equally to 1/1, 1/2, 2/1 and 3–6 column layouts.
 */
@media (max-width: 768px) {
    .vhd-content .vhd-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .vhd-content .vhd-col {
        grid-column: 1;
    }

    .vhd-content blockquote {
        margin-left: 0;
    }
}
