/* ============================================================
   CATALOG MODAL —modal-catalog.css
   Self-contained Bauhaus component.
   --bh-* variables are re-declared locally so this stylesheet
   works independently of download.css on any page.
   ============================================================ */

:root {
    --bh-bg:           #FCFBF9;
    --bh-fg:           #2B2A27;
    --bh-gray:         #757371;
    --bh-gray-light:   #F4F3F0;
    --bh-border:       1px solid rgba(43, 42, 39, 0.15);
    --bh-border-hover: 1px solid rgba(43, 42, 39, 0.5);
}


/* ============================================================
   TRIGGER BUTTON
   Standalone style —no dependency on download.css
   ============================================================ */
.catalog-modal-trigger-btn {
    display: inline-block;
    margin-top: 28px;
    padding: 14px 36px;
    background: var(--bh-fg);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.catalog-modal-trigger-btn:hover {
    opacity: 0.85;
}


/* ============================================================
   OVERLAY
   ============================================================ */
.bh-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(43, 42, 39, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    padding: 24px;

    /* Hidden state */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.bh-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}


/* ============================================================
   CONTAINER
   ============================================================ */
.bh-modal-container {
    background: var(--bh-bg);
    border: var(--bh-border);
    box-shadow: 6px 6px 0 rgba(43, 42, 39, 0.12);
    width: 100%;
    max-width: 800px;
    max-height: 82vh;
    display: flex;
    flex-direction: column;

    transform: translateY(12px);
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bh-modal-overlay.is-open .bh-modal-container {
    transform: translateY(0);
}


/* ============================================================
   HEADER
   ============================================================ */
.bh-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    border-bottom: var(--bh-border);
    flex-shrink: 0;
}

.bh-modal__title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--bh-fg);
    margin: 0;
}

.bh-modal__close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--bh-fg);
    padding: 4px;
    line-height: 1;
    font-size: 1.4rem;
    transition: opacity 0.2s;
}

.bh-modal__close:hover {
    opacity: 0.55;
}


/* ============================================================
   BODY / LIST
   ============================================================ */
.bh-modal__body {
    overflow-y: auto;
    flex: 1;
    padding: 8px 0;
}

/* Loading state */
.bh-modal__loading {
    padding: 40px 28px;
    color: var(--bh-gray);
    font-size: 0.9rem;
    text-align: center;
}

/* Empty state */
.bh-modal__empty {
    padding: 40px 28px;
    color: var(--bh-gray);
    font-size: 0.9rem;
    text-align: center;
}

/* List */
.bh-modal__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Row */
.bh-modal__item {
    display: flex;
    align-items: baseline;
    gap: 24px;
    padding: 16px 28px;
    border-bottom: var(--bh-border);
    transition: background 0.15s;
}

.bh-modal__item:last-child {
    border-bottom: none;
}

.bh-modal__item:hover {
    background: var(--bh-gray-light);
}

/* Left: title */
.bh-modal__item-title {
    flex: 0 0 220px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--bh-fg);
    line-height: 1.4;
}

/* Centre: description */
.bh-modal__item-desc {
    flex: 1;
    font-size: 0.9rem;
    color: var(--bh-gray);
    line-height: 1.55;
    font-family: ui-serif, Georgia, 'Times New Roman', Times, serif;
}

/* Right: download action */
.bh-modal__item-action {
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bh-fg);
    text-decoration: none;
    padding: 7px 14px;
    border: 1px solid var(--bh-fg);
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.bh-modal__item-action:hover {
    background: var(--bh-fg);
    color: #fff;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
    .bh-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .bh-modal-container {
        max-width: 100%;
        max-height: 88vh;
        box-shadow: none;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }

    .bh-modal__item {
        flex-wrap: wrap;
        gap: 8px;
    }

    .bh-modal__item-title {
        flex: 0 0 100%;
    }

    .bh-modal__item-desc {
        flex: 0 0 100%;
    }
}

