/* RoomCard Molecule */
/* Room status card for housekeeping allocation boards */
/* State-driven background + border. Composes Badge atom for clean type. */

.room-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-1);
    padding: var(--space-2);
    border-radius: var(--border-radius-md);
    border: var(--border-width-1) solid var(--border-subtle);
    background: var(--bg-surface);
    text-align: left;
    min-width: 80px;
    transition: border-color var(--duration-200) var(--easing-out);
}

/* Line one: number and type on one baseline, the situation glyph pushed to the right
   edge (PO 2026-09-10 -- two lines, not three). */
.room-card-head {
    display: flex;
    align-items: baseline;
    gap: var(--space-1);
    min-width: 0;
}

/* Room number */
.room-card-number {
    font-size: var(--text-sm);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    line-height: 1;
}

/* Room type code */
.room-card-type {
    font-size: var(--text-2xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Occupancy context: a glyph at the right of line one, its word in the title. */
.room-card-context {
    display: inline-flex;
    align-items: center;
    align-self: center;
    margin-left: auto;
    color: var(--text-secondary);
    line-height: 1;
}

/* OOO/OOS overlay label */
.room-card-overlay {
    font-size: var(--text-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--text-muted);
}

/* ===================================
   STATES (background + border)
   =================================== */

/* Needs cleaning - dirty/pickup, unassigned */
.room-card--needs-cleaning {
    background: var(--color-warning-light);
    border-color: var(--color-warning);
}

/* Already clean - no action needed */
.room-card--clean {
    background: var(--bg-surface);
    border-color: var(--border-subtle);
    opacity: 0.6;
}

.room-card--clean .room-card-number {
    color: var(--text-muted);
}

/* Out of Order */
.room-card--ooo {
    background: var(--color-error-light);
    border-color: var(--color-error);
}

/* Out of Service */
.room-card--oos {
    background: var(--bg-muted);
    border-color: var(--border-default);
    opacity: 0.5;
}

/* Ghost - room known from config, status not yet fetched */
.room-card--ghost {
    background: var(--bg-surface);
    border-color: var(--border-subtle);
    border-style: dashed;
    opacity: 0.4;
}

.room-card--ghost .room-card-number {
    color: var(--text-muted);
}

.room-card--ghost .room-card-type,
.room-card--ghost .room-card-context {
    display: none;
}

/* ===================================
   VIP ACCENT
   =================================== */

.room-card--vip {
    border-left: 3px solid var(--color-warning);
}

/* ===================================
   COMPACT VARIANT
   =================================== */

.room-card--compact {
    padding: var(--space-1) var(--space-1_5);
    min-width: 64px;
    gap: 0;
}

.room-card--compact .room-card-type,
.room-card--compact .room-card-context {
    display: none;
}

/* ===================================
   GRID LAYOUT
   =================================== */

.room-card-grid {
    display: grid;
    /* Line one now carries number, type AND the glyph: 96px keeps "1006 DBL" and the
       icon on one line at the sm/2xs sizes; 88 wrapped the type under the number. */
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: var(--space-2);
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 640px) {
    .room-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    }

    .room-card {
        min-width: 64px;
        padding: var(--space-1_5);
    }
}

/* ===================================
   BOARD STATES
   Selected, sent, and the two board gestures. Every one of these is opt-in from
   RoomCard.build(), so a card built without them is byte-identical to before.
   =================================== */

/* Picked for a partial send. The ring is the selection, not a colour change, so a
   selected checkout still reads as a checkout. */
.room-card--selectable {
    cursor: pointer;
}

.room-card--selectable:hover {
    border-color: var(--border-default);
}

.room-card--selected {
    box-shadow: 0 0 0 var(--border-width-2) var(--color-primary);
    border-color: var(--color-primary);
}

.room-card--selectable:focus-visible {
    outline: var(--border-width-2) solid var(--border-focus);
    outline-offset: var(--space-1);
}

/* Already sent to a team today. Marked, never removed: the manager needs to see that
   the room IS handled rather than watch it disappear from her morning. */
.room-card--sent {
    opacity: 0.55;
}

.room-card-sent {
    font-size: var(--text-2xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-success);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.room-card[draggable="true"] {
    cursor: grab;
}

.room-card[draggable="true"]:active {
    cursor: grabbing;
}

/* ===================================
   ROW LAYOUT
   Cards at their natural width, flowing and wrapping -- the same shape as
   AvailabilityStrip's `.as-slot-cells`, because a labelled run of cells reads as
   one unit of work. On the room-turn board that unit is a cleaner's round.
   =================================== */

.room-card-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: flex-start;
    /* Explicit, not inherited. Something in the ambient layout resolves this row to
       space-between, which strings a short last line of rooms across the full width --
       three rooms at the left, middle and right edge of a 1264px row read as three
       unrelated things rather than the tail of one section. A row of rooms packs from
       the left, always. */
    justify-content: flex-start;
}
