/* =========================================================
   CATEGORY CARDS
   ========================================================= */

.portal-category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px 20px;

    width: 100%;
    box-sizing: border-box;

    align-items: stretch;
}

.portal-category-card {
    background-color: #fff;

    border: 1px solid #dcdcdc;
    border-radius: 10px;

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);

    display: flex;
    flex-direction: column;

    /*
	 * The Grid sizes cards according to the row height.
	 * The full height allows each card to occupy the available
	 * space without defining a fixed height.
	 */
    height: 100%;
    min-height: 0;

    box-sizing: border-box;

    padding: 22px;
}


/* =========================================================
   CATEGORY TITLE
   ========================================================= */

.portal-category-title {
    color: #1182c8;

    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;

    margin: 0 0 10px;
}


/* =========================================================
   DESCRIPTION
   ========================================================= */

.portal-category-description {
    color: #54595f;

    font-size: 14px;
    line-height: 1.5;

    margin: 0 0 18px;
}


/* =========================================================
   CATEGORY LINKS
   ========================================================= */

.portal-category-links {
    list-style: none;

    margin: 0 0 12px;

    padding: 0;
}

.portal-category-item+.portal-category-item {
    margin-top: 9px;
}

.portal-category-link {
    background-color: #f8f9fa;

    border: 1px solid #dcdcdc;
    border-radius: 7px;

    color: #54595f;

    display: block;

    padding: 11px 14px;

    text-decoration: none;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.portal-category-link:hover {
    background-color: #f1f8fc;

    border-color: #1182c8;

    color: #1182c8;
}


/* =========================================================
   "VIEW MORE" BUTTON
   ========================================================= */

.portal-category-toggle {
    appearance: none;

    background-color: #1182c8;

    border: 1px solid #1182c8;
    border-radius: 7px;

    color: #fff;

    cursor: pointer;

    display: block;

    font-size: 14px;
    font-weight: 600;

    /*
	 * Pushes the button to the bottom of the card,
	 * regardless of the amount of content.
	 */
    margin-top: auto;

    padding: 10px 16px;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

.portal-category-toggle:hover {
    background-color: #0d6fa8;

    border-color: #0d6fa8;

    color: #fff;
}


/*
 * Elementor or the theme may apply custom styles to the
 * button when it receives focus or after user interaction.
 *
 * These rules preserve the portal's visual identity.
 */
.portal-category-toggle:focus,
.portal-category-toggle:focus-visible {
    background-color: #1182c8 !important;

    border-color: #1182c8 !important;

    color: #fff !important;

    box-shadow:
        0 0 0 3px rgba(17, 130, 200, 0.25) !important;

    outline: none !important;
}

.portal-category-toggle:active {
    background-color: #0d6fa8 !important;

    border-color: #0d6fa8 !important;

    color: #fff !important;
}


/* =========================================================
   MODAL
   ========================================================= */

.portal-category-modal {
    align-items: center;

    background-color: rgba(0, 0, 0, 0.48);

    display: flex;

    inset: 0;

    justify-content: center;

    opacity: 0;

    padding: 24px;

    pointer-events: none;

    position: fixed;

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;

    visibility: hidden;

    z-index: 9999;
}

.portal-category-modal-content {
    background-color: #fff;

    border: 1px solid #e1e1e1;
    border-radius: 12px;

    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.18);

    max-height: 82vh;
    max-width: 680px;

    overflow-y: auto;

    padding: 30px;

    position: relative;

    width: 100%;

    box-sizing: border-box;
}


/* =========================================================
   MODAL HEADER
   ========================================================= */

.portal-category-modal-header {
    align-items: center;

    display: flex;

    justify-content: space-between;

    margin-bottom: 8px;
}

.portal-category-modal-title {
    color: #1182c8;

    font-size: 26px;
    font-weight: 700;
    line-height: 1.25;

    margin: 0;
}


/* =========================================================
   MODAL CLOSE BUTTON
   ========================================================= */

.portal-category-modal .portal-category-modal-close {
    align-items: center;

    appearance: none;

    background-color: #f1f3f5 !important;

    border: 1px solid #dcdcdc !important;
    border-radius: 7px !important;

    color: #1182c8 !important;

    cursor: pointer;

    display: flex;

    font-size: 24px;
    font-weight: 400;

    height: 40px;
    width: 40px;

    justify-content: center;

    line-height: 1;

    margin: 0;
    padding: 0;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

.portal-category-modal .portal-category-modal-close:hover {
    background-color: #1182c8 !important;

    border-color: #1182c8 !important;

    color: #fff !important;
}

.portal-category-modal .portal-category-modal-close:focus,
.portal-category-modal .portal-category-modal-close:focus-visible {
    background-color: #f1f3f5 !important;

    border-color: #1182c8 !important;

    color: #1182c8 !important;

    box-shadow:
        0 0 0 3px rgba(17, 130, 200, 0.25) !important;

    outline: none !important;
}

.portal-category-modal .portal-category-modal-close:active {
    background-color: #1182c8 !important;

    border-color: #1182c8 !important;

    color: #fff !important;
}


/* =========================================================
   CATEGORY DESCRIPTION IN MODAL
   ========================================================= */

.portal-category-modal-category {
    color: #7a7a7a;

    font-size: 15px;
    line-height: 1.5;

    margin: 0 0 20px;
}


/* =========================================================
   MODAL LINKS
   ========================================================= */

.portal-category-modal-links {
    list-style: none;

    margin: 0;
    padding: 0;
}

.portal-category-modal-item+.portal-category-modal-item {
    margin-top: 10px;
}

.portal-category-modal-link {
    background-color: #f8f9fa;

    border: 1px solid #dcdcdc;
    border-radius: 8px;

    color: #54595f;

    display: block;

    font-size: 16px;
    line-height: 1.4;

    padding: 14px 16px;

    text-decoration: none;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.portal-category-modal-link:hover {
    background-color: #f1f8fc;

    border-color: #1182c8;

    color: #1182c8;
}

.portal-category-modal-link:focus,
.portal-category-modal-link:focus-visible {
    background-color: #f1f8fc;

    border-color: #1182c8;

    color: #1182c8;

    outline: 3px solid rgba(17, 130, 200, 0.2);
    outline-offset: 2px;
}


/* =========================================================
   OPEN MODAL
   ========================================================= */

.portal-category-modal.portal-category-modal-open {
    opacity: 1;

    pointer-events: auto;

    visibility: visible;
}
