﻿/* Custom CTA Button */
.btn-view-profile {
    background-color: #3A648A;
    border-color: #3A648A;
    color: #ffffff;
    transition: background-color 0.2s ease-in-out;
    flex-shrink: 0; /* Prevent button from shrinking */
    border-radius: 6px;
}

.btn-view-profile:hover {
    background-color: #2d4058;
    color: #ffffff;
}

/* Card radius (professional, slight rounding) */
.institution-card {
    border-radius: 8px;
    overflow: hidden; /* ensures the image and content respect radius */
}

.ems-border-radius {
    border-radius: 8px;
    overflow: hidden;
}

.institution-card .card-img-top {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

/* Header moved to bottom: keep spacing, allow truncation to work */
.institution-card-header-body {
    min-width: 0;
}

/* Levels / subtitle truncation (single line, ellipsis, no height growth) */
.institution-levels {
    font-style: normal;
    color: #6B7280;           /* muted gray (secondary) */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Levels as semantic tags (muted, single-line, non-interactive) */
/* Brand tokens */
:root {
    --elimys-navy: #3A648A;
    --elimys-pill-bg: transparent; /* outline-only style */
    --elimys-pill-border: rgba(33, 55, 76, 0.35); /* navy-based outline */
    --elimys-pill-text: rgba(33, 55, 76, 0.90); /* brand navy, slightly softened */
}

.institution-levels {
    display: flex;
    flex-wrap: nowrap; /* keep one line */
    gap: 6px;
    min-width: 0; /* important for truncation */
    overflow: hidden; /* prevent wrapping chaos */
}

.inst-level-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: 4px;
    background: rgba(58, 100, 138, 0.1);
    color: var(--elimys);
    white-space: nowrap;
}

/* Optional: last badge fades out instead of hard cut */
.institution-levels {
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent);
    mask-image: linear-gradient(to right, #000 85%, transparent);
}


.inst-level-badge:last-child {
    margin-right: 0;
}

/* Logo overlay badge */
.inst-logo-badge {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 2;
    width: 56px;
    height: 56px;
    padding: 6px;
    background-color: #ffffff;
    border: 1px solid #E3E8EE;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.inst-logo-badge--mobile {
    width: 40px;
    height: 40px;
    padding: 4px;
    border-radius: 6px;
}

.inst-logo-badge-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Ensure intake badge stays visible above overlays when present */
.intake-badge {
    z-index: 3;
    top: 10px;
    right: 10px;
}

/* Metadata Labels (Ownership & Location) */
.card-meta-label {
    display: inline-flex;
    align-items: center;
    min-width: 0;             /* Allow shrinking below content size */
}

/* Ownership - fixed width since it's always "Public" or "Private" */
.card-meta-ownership {
    flex-shrink: 0;           /* Don't shrink ownership */
}

/* Location - takes remaining space and truncates */
.card-meta-location {
    flex: 1;                  /* Take available space */
    min-width: 0;             /* Required for text-overflow to work in flex */
    max-width: 45%;           /* Limit max width */
}

.card-meta-location span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    max-width: 100%;
}

/* Institution name truncation (ellipsis) without truncating verified icon */
.institution-card .Institution-name {
    color: #21374C;           /* dominant */
    font-weight: 600;         /* slightly stronger */
    margin-bottom: 2px;       /* minimal separation from levels */
    display: flex;
    align-items: center;
    min-width: 0; /* allow child text to shrink */
}

.institution-card .Institution-name .institution-name-text {
    color: inherit;
    font-weight: inherit;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Tertiary meta row: muted text + icons, no bolding */
.card-meta-label,
.card-meta-label span,
.card-meta-label i {
    color: #6B7280;
    font-weight: 400;
}

:root {
    --elimys-map-mobile-height: 60vh; /* fallback */
}

/* =========================
   ELIMYS BRAND UTILITIES
   ========================= */

:root {
    --elimys: #3A648A;
    --elimys-soft: #3A648A;
    --elimys-border: #3A648A;
    --elimys-hover: #1b2e3f;
}

/* Background */
.bg-elimys {
    background-color: var(--elimys) !important;
}

/* Text */
.text-elimys {
    color: var(--elimys) !important;
}

/* Border */
.border-elimys {
    border-color: var(--elimys-border) !important;
}

/* Optional: hover helpers */
.hover-bg-elimys:hover {
    background-color: var(--elimys) !important;
    color: #fff !important;
}

.hover-text-elimys:hover {
    color: var(--elimys) !important;
}

@supports (height: 1dvh) {
    :root {
        --elimys-map-mobile-height: 60dvh;
    }
}

#mobileFullMapArea #elimysMap {
    height: var(--elimys-map-mobile-height);
    width: 100%;
}

.pagination .page-item {
    background: transparent !important;
    border: 0 !important;
}

.btn-elimys {
    color: #fff !important;
    background-color: var(--elimys) !important;
    border: 1px solid var(--elimys-border) !important;
}

    .btn-elimys:hover,
    .btn-elimys:focus {
        color: #fff !important;
        background-color: var(--elimys-hover) !important;
        border-color: var(--elimys-hover) !important;
    }

    .btn-elimys:focus-visible {
        box-shadow: 0 0 0 0.2rem rgba(33, 55, 76, 0.35);
    }

    .btn-elimys:active,
    .btn-elimys.active {
        background-color: var(--elimys-hover) !important;
        border-color: var(--elimys-hover) !important;
    }

    .btn-elimys:disabled,
    .btn-elimys.disabled {
        background-color: rgba(33, 55, 76, 0.55) !important;
        border-color: rgba(33, 55, 76, 0.55) !important;
        color: #fff !important;
        opacity: 0.75;
    }


/* Outline Elimys button */
.btn-outline-elimys {
    color: var(--elimys) !important;
    background-color: transparent !important;
    /* visual weight sweet spot */
    border: 1.5px solid var(--elimys-border) !important;
    /* subtle rounding */
    border-radius: 6px;
    /* optional polish */
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}


    .btn-outline-elimys:hover,
    .btn-outline-elimys:focus {
        color: #fff !important;
        background-color: var(--elimys) !important;
        border-color: var(--elimys) !important;
    }

    .btn-outline-elimys:focus-visible {
        box-shadow: 0 0 0 0.2rem rgba(33, 55, 76, 0.35);
    }

    .btn-outline-elimys:active,
    .btn-outline-elimys.active {
        color: #fff !important;
        background-color: var(--elimys-hover) !important;
        border-color: var(--elimys-hover) !important;
    }

    .btn-outline-elimys:disabled,
    .btn-outline-elimys.disabled {
        color: rgba(33, 55, 76, 0.55) !important;
        border-color: rgba(33, 55, 76, 0.35) !important;
        background-color: transparent !important;
        opacity: 0.75;
    }

/* =========================
   MOBILE INSTITUTION CARD
   ========================= */

.mobile-inst-card {
    border-radius: 10px;
    border: 1px solid #E5E7EB;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Header row: logo + title */
.mobile-inst-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 12px 8px;
    border-bottom: 1px solid #F3F4F6;
}

.mobile-inst-logo {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: contain;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    flex-shrink: 0;
}

.mobile-inst-title-wrap {
    flex: 1;
    min-width: 0;
}

.mobile-inst-name {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 0 4px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #21374C;
    line-height: 1.3;
}

.mobile-inst-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.mobile-inst-verified {
    height: 16px;
    flex-shrink: 0;
}

/* Badge pills */
.mobile-inst-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mobile-inst-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: 4px;
    background: rgba(58, 100, 138, 0.1);
    color: var(--elimys);
    white-space: nowrap;
}

.mobile-inst-badge--muted {
    background: #F3F4F6;
    color: #6B7280;
}

/* Info grid */
.mobile-inst-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
}

.mobile-inst-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    color: #4B5563;
    min-width: 0;
}

.mobile-inst-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-inst-icon {
    width: 16px;
    text-align: center;
    color: #9CA3AF;
    flex-shrink: 0;
    font-size: 0.8rem;
}

/* Footer row */
.mobile-inst-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #F9FAFB;
    border-top: 1px solid #F3F4F6;
    gap: 8px;
}

.mobile-inst-contact {
    display: flex;
    gap: 8px;
}

.mobile-inst-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #E5E7EB;
    color: var(--elimys);
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
}

.mobile-inst-contact-btn:hover {
    background: var(--elimys);
    color: #fff;
    border-color: var(--elimys);
    text-decoration: none;
}

.mobile-inst-contact-btn i {
    font-size: 0.75rem;
}

.mobile-inst-cta {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 6px;
    flex-shrink: 0;
}

/* =========================
   ELIMYS MAP INFO WINDOW
   ========================= */

.elimys-iw__clickable {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.elimys-iw__clickable:hover,
.elimys-iw__clickable:focus {
    text-decoration: none;
    color: inherit;
}

/* Make the footer CTA look/feel like a button but keep it non-anchor */
.elimys-iw__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    background: var(--elimys);
    color: #fff;
    font-weight: 600;
}

.elimys-iw__footer {
    margin-top: 8px;
}

/* Mobile: keep action visible + conserve space */
@media (max-width: 576px) {
    .elimys-iw {
        max-height: min(60dvh, 380px);
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    .elimys-iw__footer {
        position: sticky;
        bottom: 0;
        background: #fff;
        padding: 8px 0;
        border-top: 1px solid #E5E7EB;
    }

    .elimys-iw__cover {
        max-height: 120px;
        overflow: hidden;
    }

    .elimys-iw__cover img {
        width: 100%;
        height: 120px;
        object-fit: cover;
    }

    .elimys-iw__desc {
        max-height: 60px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
    }
}

/* Desktop: larger touch targets */
@media (min-width: 577px) {
    .elimys-iw__link {
        display: inline-block;
        padding: 8px 16px;
    }
}

/* InfoWindow card: make whole surface interactive */
.elimys-iw__card {
    cursor: pointer;
}

/* Optional: subtle hover feedback on desktop */
@media (hover: hover) {
    .elimys-iw__card:hover {
        filter: brightness(0.98);
    }
}