/**
 * ============================================================================
 * MLDB Library System
 * Component Styles
 * ============================================================================
 */

/* ============================================================================
   Catalog Toolbar
   ============================================================================ */

.catalog-toolbar {
    margin-bottom: 32px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e1e5ea;
    border-radius: 12px;
}

/* Search */

.catalog-toolbar__search {
    margin-bottom: 14px;
}

.catalog-toolbar__search input {
    display: block;
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid #d2d8df;
    border-radius: 8px;
    background: #ffffff;
    color: #222;
    font-size: 15px;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.catalog-toolbar__search input::placeholder {
    color: #8a929b;
}

.catalog-toolbar__search input:focus {
    border-color: #7b8794;
    box-shadow: 0 0 0 3px rgba(123, 135, 148, 0.12);
}

/* Filters */

.catalog-toolbar__filters {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.catalog-toolbar__filters select {
    width: 100%;
    height: 44px;
    padding: 0 36px 0 13px;
    border: 1px solid #d2d8df;
    border-radius: 8px;
    background: #ffffff;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.catalog-toolbar__filters select:hover {
    border-color: #aeb7c1;
}

.catalog-toolbar__filters select:focus {
    border-color: #7b8794;
    box-shadow: 0 0 0 3px rgba(123, 135, 148, 0.12);
}

/* Reset button */

#catalogResetButton {
    height: 44px;
    padding: 0 16px;
    border: 1px solid #d2d8df;
    border-radius: 8px;
    background: #f7f8fa;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.1s ease;
}

#catalogResetButton:hover {
    background: #eef1f4;
    border-color: #aeb7c1;
}

#catalogResetButton:active {
    transform: translateY(1px);
}

/* ============================================================================
   Item Grid
   ============================================================================ */

.item-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* ============================================================================
   Item Card
   ============================================================================ */

.item-card {
    background: #ffffff;
    border: 1px solid #e3e7ec;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.item-card:hover {
    border-color: #b8c1ca;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.10);
    transform: translateY(-4px);
}

.item-card:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.item-card h3 {
    margin-bottom: 12px;
    color: #1d3557;
    font-size: 20px;
    line-height: 1.3;
    transition: color 0.2s ease;
}

.item-card:hover h3 {
    color: #173b68;
}

.item-card__subtitle {
    margin-bottom: 16px;
    color: #666;
}

.item-card__metadata {
    margin-top: 16px;
}

.item-card__metadata p {
    margin-bottom: 8px;
}

.item-card__metadata p:last-child {
    margin-bottom: 0;
}

.item-card__metadata strong {
    font-weight: 600;
}

/* ============================================================================
   Empty Result
   ============================================================================ */

.empty-result {
    width: 100%;
    padding: 48px 24px;
    text-align: center;
    border: 1px dashed #d0d7de;
    border-radius: 8px;
    background: #f8f9fa;
}

.empty-result h2 {
    margin-bottom: 12px;
    font-size: 24px;
}

.empty-result p {
    color: #666;
}

/* ============================================================================
   Buttons
   ============================================================================ */

.button {
    display: inline-block;
    padding: 10px 18px;
    border: 1px solid #222;
    border-radius: 6px;
    background: #222;
    color: #ffffff;
    text-decoration: none;
    cursor: pointer;
    transition:
        opacity 0.2s ease,
        background 0.2s ease;
}

.button:hover {
    opacity: 0.8;
}

.button--secondary {
    background: #ffffff;
    color: #222;
}

/* ============================================================================
   Responsive
   ============================================================================ */

@media (max-width: 1000px) {

    .catalog-toolbar__filters {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 600px) {

    .catalog-toolbar {
        padding: 14px;
    }

    .catalog-toolbar__filters {
        grid-template-columns: 1fr;
    }

    .item-grid {
        grid-template-columns: 1fr;
    }

    .item-card {
        padding: 16px;
    }

}

/* ============================================================================
   Modal
   ============================================================================ */

.modal {
    position: fixed;
    inset: 0;

    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;
}

.modal[hidden] {
    display: none;
}


/* ============================================================================
   Modal — Backdrop
   ============================================================================ */

.modal__backdrop {
    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, 0.45);
}


/* ============================================================================
   Modal — Dialog
   ============================================================================ */

.modal__dialog {
    position: relative;
    z-index: 1;

    width: 100%;
    max-width: 520px;

    background: #ffffff;

    border: 1px solid #dce1e7;
    border-radius: 12px;

    box-shadow:
        0 18px 50px rgba(0, 0, 0, 0.18);
}


/* ============================================================================
   Modal — Content
   ============================================================================ */

.modal__content {
    padding: 32px;
}


.modal__title {
    margin: 0 0 12px;

    color: #1d3557;

    font-size: 24px;
    line-height: 1.3;
    font-weight: 600;
}


.modal__message {
    margin: 0;

    color: #555;

    font-size: 15px;
    line-height: 1.5;
}


/* ============================================================================
   Modal — Actions
   ============================================================================ */

.modal__actions {
    display: flex;

    justify-content: flex-end;

    gap: 10px;

    margin-top: 28px;
}


.modal__actions .button {
    white-space: nowrap;
}


/* ============================================================================
   Modal — Page Lock
   ============================================================================ */

body.modal-open {
    overflow: hidden;
}


/* ============================================================================
   Modal — Responsive
   ============================================================================ */

@media (max-width: 600px) {

    .modal {
        padding: 16px;
    }


    .modal__content {
        padding: 24px 20px;
    }


    .modal__title {
        font-size: 21px;
    }


    .modal__actions {
        flex-direction: column;
    }


    .modal__actions .button {
        width: 100%;

        text-align: center;
    }

}

.item-card__id {
    margin: 0.25rem 0 0.75rem;
    color: #888;
    font-size: 0.75rem;
}

.item-card__digital-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    margin-bottom: 12px;
    padding: 6px 10px;

    border: 1px solid #7aa7e8;
    border-radius: 5px;

    color: #245a9c;
    background: #f5f9ff;

    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}


/* ============================================================================
   Public Catalog — Light Redesign
   ----------------------------------------------------------------------------
   Легке візуальне оновлення без зміни HTML/JS та логіки каталогу.
   ============================================================================ */

.catalog-toolbar {
    margin-bottom: 24px;
    padding: 22px;
    border: 1px solid #e1e6ee;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.035);
}

.catalog-toolbar__search {
    margin-bottom: 14px;
}

.catalog-toolbar__search input {
    height: 50px;
    padding: 0 16px;
    border-color: #d7deea;
    border-radius: 9px;
    color: #172033;
    font-size: 15px;
}

.catalog-toolbar__search input:focus {
    border-color: #7c9ee8;
    box-shadow: 0 0 0 3px rgba(49, 94, 168, 0.10);
}

.catalog-toolbar__filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.catalog-toolbar__filters select {
    height: 42px;
    border-color: #d7deea;
    border-radius: 8px;
    color: #344054;
    font-size: 13px;
}

.catalog-toolbar__filters select:hover {
    border-color: #b9c4d2;
}

.catalog-toolbar__filters select:focus {
    border-color: #7c9ee8;
    box-shadow: 0 0 0 3px rgba(49, 94, 168, 0.10);
}

#catalogResetButton {
    height: 40px;
    margin-top: 10px;
    padding: 0 13px;
    border: 0;
    background: transparent;
    color: #315ea8;
    font-size: 13px;
    font-weight: 600;
}

#catalogResetButton:hover {
    background: #eef4ff;
    border-color: transparent;
}

.item-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.item-card {
    min-width: 0;
    padding: 20px;
    border: 1px solid #e1e6ee;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.025);
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        border-color 0.16s ease;
}

.item-card:hover {
    border-color: #c9d5e5;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.075);
    transform: translateY(-2px);
}

.item-card h3 {
    margin-bottom: 8px;
    color: #172d52;
    font-size: 19px;
    line-height: 1.32;
}

.item-card:hover h3 {
    color: #1d4f91;
}

.item-card__id {
    margin: 0 0 10px;
    color: #8a95a3;
    font-size: 11px;
}

.item-card__digital-badge {
    margin-bottom: 12px;
    padding: 5px 9px;
    border-color: #c8daf7;
    border-radius: 7px;
    background: #f3f7ff;
    color: #315ea8;
    font-size: 11px;
    font-weight: 600;
}

.item-card__subtitle {
    margin-bottom: 12px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
}

.item-card__metadata {
    margin-top: 14px;
}

.item-card__metadata p {
    margin-bottom: 7px;
    color: #526173;
    font-size: 13px;
    line-height: 1.4;
}

.item-card__metadata strong {
    color: #26384d;
    font-weight: 650;
}

.item-card__metadata p:nth-last-child(-n + 2) {
    color: #718096;
}

.empty-result {
    padding: 56px 24px;
    border: 1px dashed #cfd8e3;
    border-radius: 12px;
    background: #ffffff;
}

.button {
    border-radius: 8px;
}

@media (max-width: 1100px) {
    .item-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .catalog-toolbar {
        padding: 16px;
        border-radius: 12px;
    }

    .catalog-toolbar__filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .item-grid {
        grid-template-columns: 1fr;
    }
}

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

    .item-card {
        padding: 17px;
    }
}


/* ============================================================================
   Public Catalog — Final Compact Polish
   ============================================================================ */

/* Compact search/filter panel */
.catalog-toolbar {
    margin-bottom: 22px;
    padding: 18px;
    border-radius: 12px;
}

.catalog-toolbar__search {
    margin-bottom: 10px;
}

.catalog-toolbar__search input {
    height: 46px;
    padding: 0 15px;
    border-radius: 8px;
}

.catalog-toolbar__filters {
    gap: 8px;
}

.catalog-toolbar__filters select {
    height: 40px;
    padding-left: 12px;
    border-radius: 8px;
    font-size: 13px;
}

#catalogResetButton {
    height: auto;
    min-height: 32px;
    margin-top: 1px;
    padding: 4px 2px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #315ea8;
    font-size: 13px;
    font-weight: 600;
    justify-self: start;
}

#catalogResetButton:hover {
    background: #f1f5fb;
    border-color: transparent;
    color: #264f8d;
}

#catalogResetButton:active {
    transform: none;
}

/* More compact catalog cards */
.item-grid {
    gap: 18px;
}

.item-card {
    padding: 18px;
    border-radius: 11px;
}

.item-card h3 {
    margin-bottom: 7px;
    font-size: 18px;
    line-height: 1.3;
}

.item-card__id {
    margin: 0 0 9px;
    color: #8a95a3;
    font-size: 11px;
}

.item-card__digital-badge {
    margin-bottom: 10px;
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 11px;
}

.item-card__subtitle {
    margin-bottom: 11px;
    color: #667085;
    font-size: 13px;
    line-height: 1.45;
}

.item-card__metadata {
    margin-top: 13px;
    padding-top: 11px;
    border-top: 1px solid #edf0f4;
}

.item-card__metadata p {
    margin-bottom: 6px;
    color: #526173;
    font-size: 12.5px;
    line-height: 1.42;
}

.item-card__metadata p:last-child {
    margin-bottom: 0;
}

.item-card__metadata strong {
    color: #25364d;
    font-weight: 650;
}

/* Keep cards visually consistent when content differs */
.item-card {
    min-height: 0;
}

@media (max-width: 600px) {
    .catalog-toolbar {
        padding: 14px;
        margin-bottom: 18px;
    }

    .catalog-toolbar__filters {
        gap: 8px;
    }

    #catalogResetButton {
        margin-top: 0;
    }

    .item-card {
        padding: 16px;
    }
}


/* ============================================================================
   Public Catalog — Final Controls
   ============================================================================ */

/* Custom public filter dropdowns */
.catalog-custom-select {
    position: relative;
    width: 100%;
    min-width: 0;
}

.catalog-custom-select__button {
    width: 100%;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    padding: 0 12px;

    box-sizing: border-box;

    border: 1px solid #d2dbe7;
    border-radius: 8px;

    background: #ffffff;
    color: #344054;

    font: inherit;
    font-size: 13px;
    font-weight: 500;

    text-align: left;
    cursor: pointer;

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background-color 0.15s ease;
}

.catalog-custom-select__button:hover {
    border-color: #b9c6d6;
    background: #fbfcfe;
}

.catalog-custom-select.is-open
.catalog-custom-select__button,
.catalog-custom-select__button:focus-visible {
    border-color: #5578ad;

    box-shadow:
        0 0 0 3px rgba(
            85,
            120,
            173,
            0.10
        );
}

.catalog-custom-select__content {
    min-width: 0;

    display: flex;
    align-items: center;

    gap: 8px;

    overflow: hidden;
}

.catalog-custom-select__icon {
    width: 16px;
    height: 16px;

    flex-shrink: 0;

    color: #5578ad;
}

.catalog-custom-select__icon svg {
    width: 100%;
    height: 100%;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.catalog-custom-select__value {
    min-width: 0;

    overflow: hidden;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.catalog-custom-select__arrow {
    width: 7px;
    height: 7px;

    flex-shrink: 0;

    margin-top: -4px;

    border-right: 1.5px solid #667085;
    border-bottom: 1.5px solid #667085;

    transform: rotate(45deg);

    transition:
        transform 0.15s ease;
}

.catalog-custom-select.is-open
.catalog-custom-select__arrow {
    margin-top: 4px;
    transform: rotate(225deg);
}

.catalog-custom-select__menu {
    position: absolute;

    z-index: 100;

    top: calc(100% + 6px);
    left: 0;
    right: 0;

    max-height: 280px;

    overflow-y: auto;

    padding: 5px;

    box-sizing: border-box;

    border: 1px solid #d9e1eb;
    border-radius: 9px;

    background: #ffffff;

    box-shadow:
        0 14px 30px rgba(
            15,
            23,
            42,
            0.13
        );
}

.catalog-custom-select__menu[hidden] {
    display: none;
}

.catalog-custom-select__option {
    width: 100%;

    display: block;

    padding: 9px 10px;

    border: 0;
    border-radius: 6px;

    background: transparent;
    color: #344054;

    font: inherit;
    font-size: 13px;

    line-height: 1.35;
    text-align: left;

    cursor: pointer;

    transition:
        background-color 0.12s ease,
        color 0.12s ease;
}

.catalog-custom-select__option:hover {
    background: #f1f5f9;
    color: #1d3557;
}

.catalog-custom-select__option.is-selected {
    background: #edf3ff;
    color: #315ea8;
    font-weight: 600;
}

.catalog-toolbar__filters > select.catalog-filter-native {
    display: none;
}

/* Real bordered button appearance for reset */
#catalogResetButton {
    height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    justify-self: start;

    margin-top: 2px;

    padding: 0 13px;

    border: 1px solid #b9c8da;
    border-radius: 8px;

    background: #ffffff;
    color: #315ea8;

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        color 0.15s ease;
}

#catalogResetButton:hover {
    background: #f3f7fd;
    border-color: #8ea8c8;

    box-shadow:
        0 2px 7px rgba(
            49,
            94,
            168,
            0.08
        );

    color: #264f8d;
}

#catalogResetButton:active {
    transform: translateY(1px);
    box-shadow: none;
}

@media (max-width: 600px) {

    .catalog-custom-select__button {
        height: 42px;
    }

    #catalogResetButton {
        width: auto;
        min-width: 150px;
    }

}


/* ============================================================================
   PUBLIC CATALOG — FINAL CONTROL FIX
   ============================================================================ */

/*
 * The custom catalog dropdowns are rendered alongside the original
 * <select> elements. Keep the native selects in the DOM for the existing
 * catalog logic, but hide their visual representation.
 */
.catalog-toolbar__filters > select,
.catalog-toolbar__filters select.catalog-native-select {
    display: none !important;
}

/* If the native select is wrapped, hide only the native control. */
.catalog-toolbar__filters .catalog-native-select,
.catalog-toolbar__filters .catalog-filter-native {
    display: none !important;
}


/* --------------------------------------------------------------------------
   Custom catalog dropdowns
   -------------------------------------------------------------------------- */

.catalog-toolbar__filters .librarian-custom-dropdown,
.catalog-toolbar__filters .catalog-custom-dropdown {
    position: relative;
    width: 100%;
    min-width: 0;
}

.catalog-toolbar__filters
.librarian-custom-dropdown__button,
.catalog-toolbar__filters
.catalog-custom-dropdown__button {
    width: 100%;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    padding: 0 12px;

    box-sizing: border-box;

    border: 1px solid #d7deea;
    border-radius: 8px;

    background: #ffffff;
    color: #344054;

    font: inherit;
    font-size: 13px;
    font-weight: 500;

    text-align: left;
    cursor: pointer;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background-color 0.15s ease;
}

.catalog-toolbar__filters
.librarian-custom-dropdown__button:hover,
.catalog-toolbar__filters
.catalog-custom-dropdown__button:hover {
    border-color: #b9c4d2;
    background: #fcfdff;
}

.catalog-toolbar__filters
.librarian-custom-dropdown--open
.librarian-custom-dropdown__button,
.catalog-toolbar__filters
.catalog-custom-dropdown--open
.catalog-custom-dropdown__button {
    border-color: #5578ad;
    box-shadow: 0 0 0 3px rgba(85, 120, 173, 0.10);
}

.catalog-toolbar__filters
.librarian-custom-dropdown__menu,
.catalog-toolbar__filters
.catalog-custom-dropdown__menu {
    position: absolute;
    z-index: 200;

    top: calc(100% + 5px);
    left: 0;
    right: 0;

    max-height: 250px;
    overflow-y: auto;

    padding: 5px;

    box-sizing: border-box;

    border: 1px solid #d9e0e8;
    border-radius: 9px;

    background: #ffffff;

    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.catalog-toolbar__filters
.librarian-custom-dropdown__menu[hidden],
.catalog-toolbar__filters
.catalog-custom-dropdown__menu[hidden] {
    display: none;
}

.catalog-toolbar__filters
.librarian-custom-dropdown__option,
.catalog-toolbar__filters
.catalog-custom-dropdown__option {
    width: 100%;
    min-height: 36px;

    display: flex;
    align-items: center;

    padding: 8px 10px;

    box-sizing: border-box;

    border: 0;
    border-radius: 6px;

    background: transparent;
    color: #344054;

    font: inherit;
    font-size: 13px;

    text-align: left;
    cursor: pointer;
}

.catalog-toolbar__filters
.librarian-custom-dropdown__option:hover,
.catalog-toolbar__filters
.catalog-custom-dropdown__option:hover {
    background: #f1f5f9;
    color: #253b5c;
}

.catalog-toolbar__filters
.librarian-custom-dropdown__option--selected,
.catalog-toolbar__filters
.catalog-custom-dropdown__option--selected {
    background: #edf3ff;
    color: #315ea8;
    font-weight: 600;
}



/* --------------------------------------------------------------------------
   Reset filters button
   -------------------------------------------------------------------------- */

#catalogResetButton {
    min-height: 34px;
    height: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 12px;

    border: 1px solid #cbd5e1;
    border-radius: 7px;

    background: #ffffff;
    color: #315ea8;

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

#catalogResetButton:hover {
    background: #f5f8fd;
    border-color: #9fb4d3;
    color: #274f8f;
}

#catalogResetButton:active {
    transform: translateY(1px);
}


@media (max-width: 700px) {

    .page-header__links {
        width: 100%;
        gap: 8px;
    }

}

/* ============================================================================
   Public Catalog — Librarian Login Button
   ============================================================================ */

.page-header .page-header__links .page-header__librarian-link {
    height: 36px;
    min-height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;
    padding: 0 15px;

    box-sizing: border-box;

    border: 1px solid #315ea8;
    border-radius: 6px;

    background: #315ea8;
    color: #ffffff !important;

    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;

    text-decoration: none !important;

    cursor: pointer;

    box-shadow: none;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.1s ease;
}

.page-header .page-header__links .page-header__librarian-link:visited {
    color: #ffffff !important;
    text-decoration: none !important;
}

.page-header .page-header__links .page-header__librarian-link:hover,
.page-header .page-header__links .page-header__librarian-link:focus-visible {
    background: #2b5597;
    border-color: #2b5597;

    color: #ffffff !important;
    text-decoration: none !important;

    box-shadow: 0 2px 6px rgba(49, 94, 168, 0.16);

    outline: none;
}

.page-header .page-header__links .page-header__librarian-link:active {
    background: #264b87;
    border-color: #264b87;

    color: #ffffff !important;

    transform: translateY(1px);

    box-shadow: none;
}

.page-header .page-header__links .page-header__librarian-icon {
    width: 14px;
    height: 14px;

    flex: 0 0 14px;

    display: block;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 700px) {

    .page-header .page-header__links .page-header__librarian-link {
        height: 36px;
        min-height: 36px;
        padding: 0 15px;
    }

}

/* ============================================================================
   Catalog Item Modal
   ============================================================================ */

.catalog-item-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    padding: 24px;
    box-sizing: border-box;

    background: rgba(15, 23, 42, 0.45);
}

.catalog-item-modal[hidden] {
    display: none !important;
}


/* ============================================================================
   Catalog Item Modal — Backdrop
   ============================================================================ */

.catalog-item-modal__backdrop {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    background: transparent;
}


/* ============================================================================
   Catalog Item Modal — Dialog
   ============================================================================ */

.catalog-item-modal__dialog {
    position: relative;
    z-index: 1;

    width: min(760px, 100%);
    max-width: 760px;
    max-height: calc(100vh - 48px);

    overflow-y: auto;

    box-sizing: border-box;

    padding: 30px;

    background: #ffffff;

    border: 1px solid #dfe5ee;
    border-radius: 12px;

    box-shadow:
        0 20px 60px rgba(15, 23, 42, 0.22);
}


/* ============================================================================
   Catalog Item Modal — Close
   ============================================================================ */

.catalog-item-modal__close {
    position: absolute;
    top: 12px;
    right: 14px;

    z-index: 2;

    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid transparent;
    border-radius: 6px;

    background: transparent;
    color: #667085;

    font-family: inherit;
    font-size: 24px;
    font-weight: 400;
    line-height: 1;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.catalog-item-modal__close:hover {
    background: #f2f4f7;
    border-color: #e4e7ec;
    color: #1d2939;
}

.catalog-item-modal__close:focus-visible {
    outline: 2px solid #315ea8;
    outline-offset: 2px;
}


/* ============================================================================
   Catalog Item Modal — Content
   ============================================================================ */

.catalog-item-modal__content {
    position: relative;

    width: 100%;

    box-sizing: border-box;

    padding-right: 28px;
}


/* ============================================================================
   Catalog Item Modal — Header
   ============================================================================ */

.catalog-item-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    padding-right: 42px;
}

.catalog-item-modal__heading {
    min-width: 0;
}

.catalog-item-modal__title {
    margin: 0;

    color: #17345f;

    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
}

.catalog-item-modal__id {
    margin-top: 5px;

    color: #8a96a8;

    font-size: 11px;
    line-height: 1.4;
}

.catalog-item-modal__badge {
    flex: 0 0 auto;

    display: inline-flex;
    align-items: center;

    min-height: 28px;

    padding: 0 9px;

    box-sizing: border-box;

    border: 1px solid #c9d8f5;
    border-radius: 6px;

    background: #f7faff;
    color: #315ea8;

    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}


/* ============================================================================
   Catalog Item Modal — Subtitle
   ============================================================================ */

.catalog-item-modal__subtitle {
    margin-top: 10px;

    color: #64748b;

    font-size: 14px;
    line-height: 1.5;
}


/* ============================================================================
   Catalog Item Modal — Metadata
   ============================================================================ */

.catalog-item-modal__metadata {
    margin-top: 22px;

    border-top: 1px solid #e7ebf0;
}

.catalog-item-modal__row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);

    gap: 20px;

    padding: 10px 0;

    border-bottom: 1px solid #eef1f5;
}

.catalog-item-modal__label {
    color: #17345f;

    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
}

.catalog-item-modal__value {
    min-width: 0;

    color: #334155;

    font-size: 13px;
    line-height: 1.45;
}


/* ============================================================================
   Catalog Item Modal — Annotation
   ============================================================================ */

.catalog-item-modal__annotation {
    margin-top: 22px;
    padding-top: 20px;

    border-top: 1px solid #e7ebf0;
}

.catalog-item-modal__annotation h3,
.catalog-item-modal__file h3 {
    margin: 0 0 9px;

    color: #17345f;

    font-size: 15px;
    font-weight: 700;
}

.catalog-item-modal__annotation p,
.catalog-item-modal__file p {
    margin: 0;

    color: #475569;

    font-size: 13px;
    line-height: 1.6;
}


/* ============================================================================
   Catalog Item Modal — Digital File
   ============================================================================ */

.catalog-item-modal__file {
    margin-top: 22px;
    padding-top: 20px;

    border-top: 1px solid #e7ebf0;
}

.catalog-item-modal__file-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 36px;

    margin-top: 14px;
    padding: 0 14px;

    box-sizing: border-box;

    border: 1px solid #315ea8;
    border-radius: 6px;

    background: #315ea8;
    color: #ffffff;

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.catalog-item-modal__file-button:hover {
    background: #274f8f;
    border-color: #274f8f;

    box-shadow:
        0 2px 6px rgba(49, 94, 168, 0.16);
}

.catalog-item-modal__file-button:active {
    background: #24477f;
    border-color: #24477f;

    box-shadow: none;
}


/* ============================================================================
   Catalog Item Modal — Responsive
   ============================================================================ */

@media (max-width: 700px) {

    .catalog-item-modal {
        align-items: flex-start;
        padding: 12px;
    }

    .catalog-item-modal__dialog {
        width: 100%;
        max-width: none;

        max-height: calc(100vh - 24px);

        padding: 22px 18px;

        border-radius: 10px;
    }

    .catalog-item-modal__content {
        padding-right: 24px;
    }

    .catalog-item-modal__header {
        display: block;

        padding-right: 36px;
    }

    .catalog-item-modal__badge {
        margin-top: 12px;
    }

    .catalog-item-modal__title {
        font-size: 19px;
    }

    .catalog-item-modal__row {
        grid-template-columns: 1fr;

        gap: 3px;

        padding: 9px 0;
    }

}
