/* =================================================================
   tools/endianness.css
   Auto-extracted from math.css (2026-05-11).
   Loaded via config/js-manifest.php → templates/partials/head-styles.php.
   ================================================================= */

/* =================================================================
   NEW TOOL UTILITIES
   ================================================================= */

/* ─── Byte boxes (Endianness) ─────────────────────────── */
.math-byte-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: stretch;
}

/* Legacy simple box (kept for any other callers) */
.math-byte-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 44px;
    padding: 0 10px;
    border-radius: 8px;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    opacity: 0;
    transform: scale(0.8);
    animation: math-byte-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes math-byte-pop {
    from { opacity: 0; transform: scale(0.8) translateY(6px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Rich memory-cell layout for Endianness */
.math-byte-cell {
    --cell-color: var(--math-primary);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 58px;
    padding: 8px 10px 10px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--cell-color) 14%, var(--math-surface));
    border: 1.5px solid color-mix(in srgb, var(--cell-color) 55%, transparent);
    box-shadow: 0 1px 0 color-mix(in srgb, var(--cell-color) 30%, transparent) inset;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    opacity: 0;
    transform: translateY(6px);
    animation: math-byte-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.math-byte-cell:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--cell-color) 28%, transparent);
}

.math-byte-cell::before {
    /* Subtle top accent stripe coloured by the stable palette */
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--cell-color);
    opacity: 0.9;
}

.math-byte-cell__addr {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--cell-color) 70%, var(--math-text-muted));
    margin-top: 2px;
}

.math-byte-cell__hex {
    font-size: 17px;
    font-weight: 800;
    color: color-mix(in srgb, var(--cell-color) 85%, var(--math-text));
    letter-spacing: 0.02em;
    line-height: 1.1;
}

.math-byte-cell__bin {
    font-size: 11px;
    font-weight: 600;
    color: var(--math-text-soft);
    letter-spacing: 0.04em;
    line-height: 1.1;
    white-space: nowrap;
}

.math-byte-cell--bin .math-byte-cell__bin {
    font-size: 13px;
    font-weight: 700;
    color: color-mix(in srgb, var(--cell-color) 80%, var(--math-text));
}

/* Row wrapper with header and subtitle */
.math-endian-rows {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.math-endian-row-wrap {
    background: var(--math-surface-alt);
    border: 1px solid var(--math-border);
    border-radius: 12px;
    padding: 12px 14px;
}

.math-endian-row-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.math-endian-row-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--math-text);
    letter-spacing: 0.02em;
}

.math-endian-row-sub {
    font-size: 11px;
    color: var(--math-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.math-endian-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    justify-content: center;
}

.math-endian-summary__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--math-surface-alt);
    border: 1px solid var(--math-border);
    border-radius: 999px;
    font-size: 12px;
}

.math-endian-summary__k {
    color: var(--math-text-muted);
    text-transform: uppercase;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.06em;
}

.math-endian-summary__v {
    color: var(--math-text);
    font-weight: 700;
}

.math-endian-summary__v--mono {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    color: var(--math-primary);
}

.math-endian-legend {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    font-size: 12px;
    color: var(--math-text-muted);
}

.math-endian-legend i {
    color: var(--math-primary);
}
