/* Mask Grid Styles for mask-demo directive */

/* Individual cells */
.mask-cell {
    width: 100%;
    height: 100%;
}

/* Light theme colors */
html[data-theme="light"] .mask-cell-bg {
    background-color: #ffffff;
}

html[data-theme="light"] .mask-cell-fg {
    background-color: #4a90d9;
}

/* Dark theme colors */
html[data-theme="dark"] .mask-cell-bg {
    background-color: #2a2a2a;
}

html[data-theme="dark"] .mask-cell-fg {
    background-color: #6ab0ff;
}

/* Fallback for no theme attribute (treat as light) */
.mask-cell-bg {
    background-color: #ffffff;
}

.mask-cell-fg {
    background-color: #4a90d9;
}

/* Figure with caption */
.mask-figure {
    display: inline-block;
    margin: 1em 0;
}

.mask-figure figcaption {
    text-align: center;
    font-style: italic;
    margin-top: 0.5em;
    color: #666;
}

html[data-theme="dark"] .mask-figure figcaption {
    color: #aaa;
}

/* Inline mask grids for mask-demo */
.mask-grid-inline {
    display: inline-grid;
    gap: 1px;
    background-color: #888;
    border: 1px solid #888;
    border-radius: 2px;
    vertical-align: middle;
}

html[data-theme="light"] .mask-grid-inline {
    background-color: #aaa;
    border-color: #aaa;
}

html[data-theme="dark"] .mask-grid-inline {
    background-color: #555;
    border-color: #555;
}

/* mask-demo container */
.mask-demo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5em;
    margin: 1em 0;
    font-family: var(--pst-font-family-monospace, monospace);
    font-size: 1.1em;
}

/* Text segments in mask-demo */
.mask-demo-text {
    vertical-align: middle;
    white-space: pre;
}

/* Inline empty placeholder */
.mask-grid-inline-empty {
    display: inline-block;
    width: 40px;
    height: 40px;
    background-color: #f0f0f0;
    border: 1px dashed #ccc;
    border-radius: 2px;
    vertical-align: middle;
}

html[data-theme="dark"] .mask-grid-inline-empty {
    background-color: #333;
    border-color: #555;
}

/* Rectangle border overlay for largest_interior_rectangle etc. */
.rect-border-top {
    border-top: 2px solid #e63946 !important;
}

.rect-border-bottom {
    border-bottom: 2px solid #e63946 !important;
}

.rect-border-left {
    border-left: 2px solid #e63946 !important;
}

.rect-border-right {
    border-right: 2px solid #e63946 !important;
}
