/* CSS for both catalog AND library! Name simply hasn't been updated to reflect this. */
/* vibecoded */

.hh-catalog {
    --catalog-bg:     #3c4550;
    --catalog-accent: #c64e8b;
    --catalog-text:   #ffffff;

    background: var(--catalog-bg);
    color: var(--catalog-text);
    padding: 2rem 3rem 4rem;
    min-height: 100vh;
}

/* ---------- FILTERS ---------- */
.hh-catalog-filters {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.hh-catalog-search {
    width: 100%;
    max-width: 400px;
    padding: 0.6rem 1rem;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: var(--catalog-text);
}

.hh-catalog-search:focus {
    outline: none;
    border-color: var(--catalog-accent);
}

.hh-catalog-select {
    padding: 0.5rem 0.9rem;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.08);
    color: var(--catalog-text);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    color-scheme: dark;
}

.hh-catalog-select:focus {
    outline: none;
    border-color: var(--catalog-accent);
}

.hh-catalog-select option {
    background: #fff;
    color: #000;
}

/* -- GENERAL -- */

.hh-catalog-title {
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 2rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.hh-catalog-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    padding: 3rem 0;
}

/* ---------- GRID ---------- */
.hh-catalog-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.5rem;
}

.hh-load-more-tile {
    aspect-ratio: 2 / 3;
    width: 100%;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.04);
    color: var(--catalog-text);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.2;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.hh-load-more-tile:hover {
    background:    rgba(255, 255, 255, 0.1);
    border-color:  var(--catalog-accent);
    color:         var(--catalog-accent);
}

.hh-load-more-tile:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* el telephono */
@media (max-width: 1200px) {
    .hh-catalog-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 1000px) {
    .hh-catalog-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
    .hh-catalog {
        padding: 1.5rem 1rem 3rem;
    }
    .hh-catalog-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    .hh-comic-tile-title {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .hh-catalog-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Catalog filters layout ---- */
.hh-catalog-filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.hh-catalog-filters-top {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.hh-catalog-search {
    flex: 1 1 240px;
    min-width: 200px;
}

.hh-catalog-control {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hh-catalog-control-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.hh-catalog-filters-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 999px;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.hh-catalog-filters-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
}

.hh-catalog-filters-count {
    display: inline-block;
    min-width: 1.4em;
    padding: 0 0.4em;
    border-radius: 999px;
    background: var(--catalog-accent);
    color: #fff;
    font-size: 0.75em;
    text-align: center;
    line-height: 1.4em;
}

.hh-catalog-filters-count[hidden] {
    display: none;
}

.hh-catalog-filters-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.hh-catalog-filters-panel[hidden] {
    display: none;
}

/* ---- Multi-select widget (genres, tags, …) ---- */
.hh-multiselect {
    position: relative;
}
.hh-multiselect-toggle {
    display: inline-flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    min-width: 200px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-align: left;
}
.hh-multiselect-toggle:hover {
    border-color: rgba(255, 255, 255, 0.4);
}
.hh-multiselect-summary {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hh-multiselect-caret {
    flex-shrink: 0;
    font-size: 0.7em;
    opacity: 0.7;
}
.hh-multiselect-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 10;
    min-width: 100%;
    display: flex;
    flex-direction: column;
    padding: 6px;
    background: #2c3540;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.hh-multiselect-panel[hidden] {
    display: none;
}
.hh-multiselect-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
}
.hh-multiselect-option:hover {
    background: rgba(255, 255, 255, 0.06);
}
.hh-multiselect-option input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

/* Mini-search: pinned above the scrolling option list */
.hh-multiselect-search {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 6px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: var(--catalog-text);
    font: inherit;
}
.hh-multiselect-search:focus {
    outline: none;
    border-color: var(--catalog-accent);
}
.hh-multiselect-search::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.hh-multiselect-options {
    max-height: 240px;
    overflow-y: auto;
}
.hh-multiselect-option[hidden] {
    display: none;
}

.hh-multiselect-empty {
    padding: 8px 10px;
    opacity: 0.6;
    font-size: 0.85rem;
}
.hh-multiselect-empty[hidden] {
    display: none;
}

/* library members gate */
.hh-library-gate a {
    color: var(--catalog-accent);
    text-decoration: underline;
}