/*
 * crowe-components.css
 * Componentes visuales compartidos del Archivo Nathaniel Crowe.
 *
 * Objetivo:
 * - Una única implementación para componentes reutilizables.
 * - Los CSS específicos de cada vista solo deben contener variaciones reales.
 */

/* ============================================================
   SYSTEM TOPBAR
   Barra superior común para home, archives y singles.
   ============================================================ */

.crowe-system-topbar {
    position: relative;
    z-index: 2;
    background: var(--crowe-accent-dark);
    border-bottom: 2px solid var(--crowe-accent);
    /* El elemento no tiene ancho propio (correcto), pero su
       contenedor (#page.container, limitado a 1200px por el tema)
       lo recorta antes de llegar al borde de la pantalla, a
       diferencia de .site-header. Este truco de "sangrado completo"
       hace que el fondo llegue a los bordes reales del viewport sin
       depender del ancho del contenedor padre, y sin tocar PHP. */
    box-shadow: 0 0 0 100vmax var(--crowe-accent-dark);
    clip-path: inset(0 -100vmax);
}

.crowe-system-topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 8px 0;
    /* Altura mínima fija: sin esto, la barra mide distinto en cada
       vista según lleve stamps (.crowe-system-topbar__stamp, con
       borde y relleno propio, más altos) o solo texto plano
       (.crowe-system-topbar__status, como en el archive). Con
       min-height, la barra mide siempre lo mismo en todas las
       páginas independientemente de su contenido. */
    min-height: 48px;
}

.crowe-system-topbar__left,
.crowe-system-topbar__right {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.crowe-system-topbar__left {
    flex: 1 1 auto;
}

.crowe-system-topbar__right {
    flex: 0 0 auto;
}

.crowe-system-topbar__text,
.crowe-system-topbar__code,
.crowe-system-topbar__status {
    font-family: var(--crowe-mono);
    text-transform: uppercase;
}

.crowe-system-topbar__text {
    font-size: 0.6rem;
    letter-spacing: 0.26em;
    color: #dbc3a9;
}

.crowe-system-topbar__sep {
    color: #8a6846;
}

.crowe-system-topbar__code {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: #c8a870;
}

.crowe-system-topbar__status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.6rem;
    letter-spacing: 0.22em;
    color: #dbc3a9;
}

.crowe-system-topbar__dot {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-radius: 50%;
    background: #6a9a50;
    box-shadow: 0 0 0 2px rgba(106, 154, 80, 0.2);
}

.crowe-system-topbar__stamp {
    font-family: var(--crowe-mono);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 6px 10px;
    border: 1px solid currentColor;
    border-radius: 2px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.crowe-system-topbar__stamp--public {
    color: #b7dfb7;
    border-color: rgba(183, 223, 183, 0.7);
    background: rgba(70, 125, 70, 0.2);
}

.crowe-system-topbar__stamp--internal {
    color: #ddd995;
    border-color: rgba(221, 217, 149, 0.7);
    background: rgba(130, 125, 55, 0.2);
}

.crowe-system-topbar__stamp--restricted {
    color: #f0ae72;
    border-color: rgba(240, 174, 114, 0.75);
    background: rgba(160, 80, 25, 0.22);
}

.crowe-system-topbar__stamp--confidential {
    color: #f08b78;
    border-color: rgba(240, 139, 120, 0.75);
    background: rgba(139, 32, 16, 0.25);
}

@media (max-width: 760px) {
    .crowe-system-topbar__inner {
        width: min(100% - 28px, 1180px);
        gap: 10px;
    }

    .crowe-system-topbar__left,
    .crowe-system-topbar__right {
        gap: 6px;
    }

    .crowe-system-topbar__text,
    .crowe-system-topbar__status {
        font-size: 0.55rem;
        letter-spacing: 0.16em;
    }

    .crowe-system-topbar__code {
        font-size: 0.56rem;
        letter-spacing: 0.14em;
    }

    .crowe-system-topbar__stamp {
        font-size: 0.58rem;
        letter-spacing: 0.1em;
        padding: 5px 7px;
    }
}

@media (max-width: 560px) {
    .crowe-system-topbar__inner {
        align-items: flex-start;
        flex-direction: column;
        padding: 9px 0;
    }

    .crowe-system-topbar__right {
        flex-wrap: wrap;
    }
}
