/* =============================================================================
   Houses List — "The Book" discovery page
   Light card rows: pastel tile glyph (or real image) + name + serif motto +
   member count only + chevron. Reference-matched, tokens only.
   ============================================================================= */

.houses-list-page {
    padding: var(--space-5) var(--space-4) var(--space-8);
    max-width: 640px;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
}

/* ── Header ── */
.houses-list-header {
    margin-bottom: var(--space-5);
}

.houses-list-eyebrow {
    display: inline-block;
    background: var(--color-yellow-400);
    color: var(--accent-dark);
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 4px var(--space-2);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-3);
}

.houses-list-title {
    font-family: var(--font-heading);
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    line-height: 1.1;
    margin: 0 0 var(--space-1);
}

.houses-list-subline {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: var(--text-base);
    color: var(--text-muted);
    margin: 0;
}

/* ── Search + Create ── */
.houses-list-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.houses-search-form {
    display: flex;
    gap: var(--space-2);
    min-width: 0;
    width: 100%;
}

.houses-search-input-wrapper {
    flex: 1;
    position: relative;
    min-width: 0;
}

.houses-search-input {
    width: 100%;
    padding: var(--space-3) var(--space-3) var(--space-3) 40px;
    background: var(--color-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-family: var(--font-body);
    box-shadow: var(--shadow-xs, 0 1px 2px rgba(0, 0, 0, 0.04));
    transition: border-color var(--duration-normal, 0.2s), box-shadow var(--duration-normal, 0.2s);
}

.houses-search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(51, 230, 88, 0.15);
}

.houses-search-input::placeholder { color: var(--text-muted); }

.houses-search-icon {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    display: inline-flex;
}

/* ── Buttons (green pill, dark text) ── */
.houses-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-full);
    border: none;
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
    font-size: var(--text-sm);
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
    transition: filter var(--duration-normal, 0.15s) var(--ease-default, ease),
                transform var(--duration-normal, 0.15s) var(--ease-default, ease);
}

.houses-btn--primary {
    background: var(--accent-primary);
    color: var(--accent-dark);
    box-shadow: var(--shadow-sm, 0 2px 6px rgba(0, 0, 0, 0.08));
}

.houses-btn--primary:hover { filter: brightness(0.96); }
.houses-btn--primary:active { transform: translateY(1px); }
.houses-btn iconify-icon { font-size: 1.1em; }

.houses-create-btn {
    align-self: flex-start;
}
.houses-create-btn:hover {
    background: var(--color-black);
    color: var(--color-white);
    filter: none;
}

/* ── Search results banner ── */
.houses-search-results-info {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

.houses-search-results-info a {
    color: var(--accent-tertiary);
    text-decoration: none;
    font-weight: var(--font-semibold);
}

.houses-search-results-info a:hover { text-decoration: underline; }

/* ── House rows ── */
.houses-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.house-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--color-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-xs, 0 1px 3px rgba(0, 0, 0, 0.05));
    text-decoration: none;
    color: inherit;
    transition: transform var(--duration-normal, 0.15s) var(--ease-default, ease),
                box-shadow var(--duration-normal, 0.15s) var(--ease-default, ease),
                border-color var(--duration-normal, 0.15s) var(--ease-default, ease);
}

.house-row:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md, 0 6px 18px rgba(0, 0, 0, 0.1));
    border-color: var(--color-gray-300, #d1d5db);
}

/* Pastel tile (fallback) / image tile */
.house-row__tile {
    width: 60px;
    height: 60px;
    min-width: 60px;
    flex-shrink: 0;
    border-radius: var(--radius-md, 14px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.house-row__tile--image { background: var(--color-gray-100, #f3f4f6); }

.house-row__tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.house-row__glyph {
    font-size: 26px;
    color: var(--accent-dark);
    opacity: 0.6;
}

/* Body */
.house-row__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.house-row__topline {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.house-row__name {
    font-family: var(--font-heading);
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    line-height: 1.2;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.house-row__yours {
    flex-shrink: 0;
    background: var(--accent-primary);
    color: var(--accent-dark);
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 7px;
    border-radius: var(--radius-full);
    line-height: 1;
}

.house-row__motto {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: var(--text-sm);
    color: var(--text-secondary, var(--text-muted));
    line-height: 1.35;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.house-row__stats {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: 2px;
}

.house-row__stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-xs);
    color: var(--text-muted);
    white-space: nowrap;
}

.house-row__stat iconify-icon { font-size: 1.1em; }

/* Chevron */
.house-row__chevron {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    font-size: var(--text-lg);
    opacity: 0.55;
}

/* Client-side filter empty state */
.houses-list-empty-filter {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    color: var(--text-muted);
    font-size: var(--text-sm);
}

/* ── Empty state (no houses at all) ── */
.houses-list-page .empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-4);
    color: var(--text-muted);
}

.houses-list-page .empty-state__icon {
    margin-bottom: var(--space-3);
    opacity: 0.4;
    font-size: var(--text-3xl);
}

.houses-list-page .empty-state h2 {
    color: var(--text-primary);
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    font-family: var(--font-heading);
    margin-bottom: var(--space-1);
}

.houses-list-page .empty-state p {
    font-size: var(--text-sm);
}

/* ── Wider screens: search + create side by side ── */
@media (min-width: 620px) {
    .houses-list-actions {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }
    .houses-search-form { flex: 1; }
    .houses-create-btn { align-self: auto; }
}

@media (max-width: 400px) {
    .house-row__tile {
        width: 52px;
        height: 52px;
        min-width: 52px;
    }
    .house-row__glyph { font-size: 22px; }
}
