/* R8 section: feature cards in two columns, one column on narrow screens,
   as the rtemis theme's breakpoint at 768px. */
.feature-cards-container.cards-2 {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 768px) {
    .feature-cards-container.cards-2 {
        grid-template-columns: 1fr;
    }
}

/* The navbar is dark in both color schemes, so its logo, dark artwork, is
   inverted in both; the theme's .inv inverts in the dark scheme only. */
.navbar .navbar-logo {
    filter: invert(1);
}

/* Diagrams (_diagrams/diagrams.py): inline SVGs in the page's fonts, with
   text and lines in the theme's text color and translucent fills, so each
   reads in both color schemes. Teal marks R, orange marks Rust. A click
   opens a figure in .r8-zoom (_components/_diagram-zoom.html). */
.r8-figure {
    cursor: zoom-in;
}

.r8-figure:focus-visible {
    outline: 2px solid #6CA3A0;
    outline-offset: 4px;
}

.r8-diagram {
    display: block;
    width: 100%;
    height: auto;
    color: var(--bs-body-color);
    font-family: var(--bs-font-sans-serif);
}

.r8-diagram text {
    fill: currentColor;
    font-size: 13px;
    white-space: pre;
}

.r8-diagram .s {
    font-size: 11.5px;
}

.r8-diagram .h {
    font-size: 13.5px;
    font-weight: 650;
}

.r8-diagram .mono {
    font-family: var(--bs-font-monospace);
    font-size: 0.92em;
}

.r8-diagram .muted {
    fill-opacity: 0.62;
}

.r8-diagram .box {
    fill: currentColor;
    fill-opacity: 0.04;
    stroke: currentColor;
    stroke-opacity: 0.35;
}

.r8-diagram .r {
    fill: #6CA3A0;
    fill-opacity: 0.2;
    stroke: #6CA3A0;
    stroke-opacity: 0.9;
}

.r8-diagram .rust {
    fill: #F08904;
    fill-opacity: 0.15;
    stroke: #F08904;
    stroke-opacity: 0.85;
}

.r8-diagram .panel {
    fill-opacity: 0.05;
    stroke-opacity: 0.25;
}

.r8-diagram .chip {
    fill-opacity: 0.12;
    stroke-opacity: 0.5;
}

.r8-diagram .tile {
    stroke-opacity: 0.18;
}

.r8-diagram .value {
    fill: currentColor;
    fill-opacity: 0.03;
    stroke-width: 2.5;
}

.r8-diagram .title {
    font-size: 17px;
    font-weight: 700;
}

.r8-diagram .code {
    font-size: 11.5px;
}

.r8-diagram .icon {
    fill: none;
    stroke: currentColor;
    stroke-opacity: 0.75;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.r8-diagram .icon.accent {
    stroke: #6CA3A0;
    stroke-opacity: 1;
}

.r8-diagram .faint-fill {
    fill-opacity: 0.06;
}

.r8-diagram .line {
    fill: none;
    stroke: currentColor;
    stroke-opacity: 0.55;
    stroke-width: 1.4;
}

.r8-diagram .line.faint {
    stroke-opacity: 0.3;
    stroke-width: 1;
}

.r8-diagram .head {
    fill: currentColor;
    fill-opacity: 0.7;
}

/* The enlarged diagram: a copy of the SVG on the page's background, as large
   as the window allows, with the figure's caption. */
.r8-zoom {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.82);
    cursor: zoom-out;
}

.r8-zoom-panel {
    max-width: 96vw;
    max-height: 96vh;
    overflow: auto;
    padding: 16px;
    border-radius: 10px;
    background: var(--bs-body-bg);
}

.r8-zoom-caption {
    margin-top: 0.5rem;
    color: var(--bs-secondary-color);
    font-size: 0.9rem;
}
