/**
 * Directory pubblica dei Team.
 *
 * I colori provengono esclusivamente dal master globale:
 * tfm-design-tokens.css
 *
 * @package TFM_Teams
 */


/* =========================================================
   BASE
   ========================================================= */

.tfm-team-directory {
    width: 100vw;
    max-width: none;
    min-height: 100vh;

    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);

    background: var(--tfm-background);

    color: var(--tfm-text);
}


/* =========================================================
   HERO
   ========================================================= */

.tfm-team-directory__hero {
    padding: 76px 0 68px;

    border-bottom:
        1px solid var(--tfm-border);

    background:
        linear-gradient(135deg,
            var(--tfm-primary-soft) 0%,
            var(--tfm-background) 100%);
}

.tfm-team-directory__eyebrow {
    margin: 0 0 10px;

    color: var(--tfm-primary);

    font-size: 11px;
    font-weight: 800;
    line-height: 1.3;

    letter-spacing: 0.12em;

    text-transform: uppercase;
}

.tfm-team-directory__title {
    max-width: 760px;

    margin: 0;

    color: var(--tfm-text);

    font-size: clamp(42px, 5vw, 64px);
    font-weight: 850;
    line-height: 1.02;

    letter-spacing: -0.035em;
}

.tfm-team-directory__intro {
    max-width: 720px;

    margin: 20px 0 0;

    color: var(--tfm-text-secondary);

    font-size: 17px;
    line-height: 1.65;
}


/* =========================================================
   CONTENUTO DIRECTORY
   ========================================================= */

.tfm-team-directory__content {
    padding: 42px 0 64px;
}

.tfm-team-directory__content-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 24px;

    margin-bottom: 24px;
}

.tfm-team-directory__content-header h2 {
    margin: 0;

    color: var(--tfm-text);

    font-size: 30px;
    font-weight: 820;
    line-height: 1.15;
}

.tfm-team-directory__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 34px;

    padding: 7px 13px;

    border: 1px solid var(--tfm-border);
    border-radius: 999px;

    background: var(--tfm-surface);

    color: var(--tfm-text-secondary);

    font-size: 12px;
    font-weight: 750;

    white-space: nowrap;
}


/* =========================================================
   GRIGLIA
   ========================================================= */

.tfm-team-directory__grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 20px;
}


/* =========================================================
   CARD TEAM
   ========================================================= */

.tfm-team-directory__card {
    min-width: 0;

    overflow: hidden;

    border: 1px solid var(--tfm-border);
    border-radius: 20px;

    background: var(--tfm-surface);

    box-shadow:
        0 8px 24px rgba(16, 24, 32, 0.045);

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.tfm-team-directory__card:hover {
    transform: translateY(-3px);

    border-color: var(--tfm-border-strong);

    box-shadow:
        0 14px 34px rgba(16, 24, 32, 0.09);
}

.tfm-team-directory__card-link {
    display: flex;
    flex-direction: column;

    min-height: 100%;

    color: inherit;

    text-decoration: none;
}

.tfm-team-directory__card-link:hover {
    color: inherit;
}


/* =========================================================
   TESTATA CARD
   ========================================================= */

.tfm-team-directory__card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 14px;

    padding: 22px 22px 0;
}

.tfm-team-directory__logo {
    display: grid;
    place-items: center;

    width: 72px;
    height: 72px;

    flex: 0 0 72px;

    overflow: hidden;

    border: 1px solid var(--tfm-border);
    border-radius: 17px;

    background: var(--tfm-primary-soft);
}

.tfm-team-directory__logo img {
    width: 100%;
    height: 100%;

    padding: 8px;

    object-fit: contain;
}

.tfm-team-directory__logo span {
    color: var(--tfm-primary-hover);

    font-size: 30px;
    font-weight: 850;
    line-height: 1;
}


/* =========================================================
   BADGE
   ========================================================= */

.tfm-team-directory__badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;

    gap: 6px;
}

.tfm-team-directory__badge {
    display: inline-flex;
    align-items: center;

    min-height: 27px;

    padding: 5px 9px;

    border-radius: 999px;

    font-size: 10px;
    font-weight: 750;
    line-height: 1.2;
}


/* Team verificato */

.tfm-team-directory__badge--verified {
    background: var(--tfm-info-soft);

    color: var(--tfm-info);
}


/* Reclutamento aperto */

.tfm-team-directory__badge--open {
    background: var(--tfm-success-soft);

    color: var(--tfm-success);
}


/* =========================================================
   CONTENUTO CARD
   ========================================================= */

.tfm-team-directory__card-copy {
    flex: 1 1 auto;

    padding: 20px 22px 22px;
}

.tfm-team-directory__card-copy h3 {
    margin: 0;

    color: var(--tfm-text);

    font-size: 21px;
    font-weight: 820;
    line-height: 1.2;
}

.tfm-team-directory__location {
    margin: 8px 0 0;

    color: var(--tfm-primary);

    font-size: 12px;
    font-weight: 650;
    line-height: 1.4;
}

.tfm-team-directory__description {
    display: -webkit-box;

    margin: 15px 0 0;

    overflow: hidden;

    color: var(--tfm-text-secondary);

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

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}


/* =========================================================
   FOOTER CARD
   ========================================================= */

.tfm-team-directory__card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    min-height: 50px;

    margin-top: auto;

    padding: 13px 22px;

    border-top:
        1px solid var(--tfm-border);

    background: var(--tfm-surface-muted);

    color: var(--tfm-primary-hover);

    font-size: 12px;
    font-weight: 800;
}

.tfm-team-directory__card-footer span:last-child {
    font-size: 17px;

    transition:
        transform 0.18s ease;
}

.tfm-team-directory__card:hover .tfm-team-directory__card-footer span:last-child {
    transform: translateX(3px);
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.tfm-team-directory__empty {
    padding: 44px 28px;

    border: 1px solid var(--tfm-border);
    border-radius: 20px;

    background: var(--tfm-surface);

    text-align: center;
}

.tfm-team-directory__empty strong {
    display: block;

    color: var(--tfm-text);

    font-size: 18px;
    font-weight: 800;
}

.tfm-team-directory__empty p {
    max-width: 520px;

    margin: 10px auto 0;

    color: var(--tfm-text-secondary);

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


/* =========================================================
   RESPONSIVE DIRECTORY
   ========================================================= */

@media (max-width: 980px) {

    .tfm-team-directory__grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {

    .tfm-team-directory__hero {
        padding: 50px 0 44px;
    }

    .tfm-team-directory__title {
        font-size: 40px;
    }

    .tfm-team-directory__intro {
        font-size: 15px;
    }

    .tfm-team-directory__content {
        padding-top: 28px;
    }

    .tfm-team-directory__content-header {
        align-items: flex-start;
        flex-direction: column;

        gap: 14px;
    }

    .tfm-team-directory__grid {
        grid-template-columns: 1fr;
    }

    .tfm-team-directory__card-top {
        padding: 18px 18px 0;
    }

    .tfm-team-directory__card-copy {
        padding: 18px;
    }

    .tfm-team-directory__card-footer {
        padding-right: 18px;
        padding-left: 18px;
    }
}


/* =========================================================
   MAPPA TEAM
   ========================================================= */

.tfm-team-directory__map-section {
    margin-bottom: 42px;
}

.tfm-team-directory__map-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 24px;

    margin-bottom: 18px;
}

.tfm-team-directory__map-header h2 {
    margin: 0;

    color: var(--tfm-text);
}

.tfm-team-directory__map-count {
    flex: 0 0 auto;

    color: var(--tfm-text-secondary);

    font-size: 14px;
    font-weight: 600;
}

.tfm-team-directory__map {
    width: 100%;
    height: 520px;

    overflow: hidden;

    border: 1px solid var(--tfm-border);
    border-radius: 18px;

    background: var(--tfm-background);
}

.tfm-team-directory-map-popup {
    min-width: 170px;
}

.tfm-team-directory-map-popup__title {
    display: block;

    margin-bottom: 4px;

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

.tfm-team-directory-map-popup__location {
    margin: 0 0 10px;

    color: var(--tfm-text-secondary);

    font-size: 13px;
}

.tfm-team-directory-map-popup__link {
    font-weight: 600;

    text-decoration: none;
}

@media (max-width: 767px) {

    .tfm-team-directory__map-header {
        align-items: flex-start;
        flex-direction: column;

        gap: 8px;
    }

    .tfm-team-directory__map {
        height: 420px;
    }
}


/* =========================================================
   MARKER MAPPA TEAM
   ========================================================= */

.tfm-team-directory-map-marker {
    background: transparent;

    border: 0;
}

.tfm-team-directory-map-marker span {
    position: relative;

    display: block;

    width: 34px;
    height: 34px;

    border: 3px solid var(--tfm-surface);
    border-radius: 50% 50% 50% 0;

    background: var(--tfm-primary);

    box-shadow:
        0 4px 12px rgba(16, 24, 32, 0.26);

    transform: rotate(-45deg);
}

.tfm-team-directory-map-marker span::after {
    position: absolute;

    top: 50%;
    left: 50%;

    width: 9px;
    height: 9px;

    border-radius: 50%;

    background: var(--tfm-surface);

    content: "";

    transform: translate(-50%, -50%);
}


/* =========================================================
   STATO MARKER
   ========================================================= */

.tfm-team-directory-map-marker--open span {
    background: var(--tfm-primary);
}

.tfm-team-directory-map-marker--closed span {
    border-color: var(--tfm-primary);

    background: var(--tfm-surface);
}

.tfm-team-directory-map-marker--closed span::after {
    background: var(--tfm-primary);
}


/* =========================================================
   CLUSTER MAPPA TEAM
   ========================================================= */

.tfm-team-directory-map-cluster {
    display: flex !important;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 50%;

    background:
        color-mix(in srgb,
            var(--tfm-primary) 22%,
            transparent);

    box-shadow:
        0 3px 12px rgba(16, 24, 32, 0.20);
}

.tfm-team-directory-map-cluster span {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    border: 2px solid var(--tfm-surface);
    border-radius: 50%;

    background: var(--tfm-primary);

    color: var(--tfm-surface);

    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}


/* =========================================================
   POPUP MAPPA TEAM
   ========================================================= */

.tfm-team-directory-map-popup {
    min-width: 220px;

    padding: 3px 2px;

    color: var(--tfm-text);

    font-family:
        "Outfit",
        sans-serif;
}

.tfm-team-directory-map-popup__header {
    display: flex;
    align-items: center;

    gap: 12px;
}

.tfm-team-directory-map-popup__logo {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    flex: 0 0 44px;

    overflow: hidden;

    border: 1px solid var(--tfm-border);
    border-radius: 11px;

    background: var(--tfm-primary-soft);

    color: var(--tfm-primary-hover);

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

.tfm-team-directory-map-popup__logo img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

.tfm-team-directory-map-popup__heading {
    min-width: 0;
}

.tfm-team-directory-map-popup__title {
    display: block;

    margin: 0;

    color: var(--tfm-text);

    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.tfm-team-directory-map-popup__location {
    margin: 3px 0 0;

    color: var(--tfm-text-secondary);

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

.tfm-team-directory-map-popup__badges {
    display: flex;
    flex-wrap: wrap;

    gap: 6px;

    margin-top: 12px;
}

.tfm-team-directory-map-popup__badge {
    display: inline-flex;
    align-items: center;

    padding: 4px 8px;

    border-radius: 999px;

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


/* Reclutamento aperto */

.tfm-team-directory-map-popup__badge--open {
    background: var(--tfm-success-soft);

    color: var(--tfm-success);

    font-weight: 700;
}


/* Reclutamento chiuso */

.tfm-team-directory-map-popup__badge--closed {
    border: 1px solid var(--tfm-border);

    background: var(--tfm-surface);

    color: var(--tfm-text-secondary);
}


/* Team verificato */

.tfm-team-directory-map-popup__badge--verified {
    background: var(--tfm-info-soft);

    color: var(--tfm-info);
}

.tfm-team-directory-map-popup__description {
    display: -webkit-box;

    margin: 12px 0 0;

    overflow: hidden;

    color: var(--tfm-text-secondary);

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

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.tfm-team-directory-map-popup__link {
    display: inline-flex;

    margin-top: 13px;

    padding-top: 10px;

    border-top:
        1px solid var(--tfm-border);

    color: var(--tfm-primary-hover) !important;

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

    text-decoration: none;
}

.tfm-team-directory-map-popup__link:hover {
    color: var(--tfm-primary) !important;

    text-decoration: underline;
}


/* =========================================================
   CONTENITORE LEAFLET
   ========================================================= */

.tfm-team-directory .leaflet-popup-content {
    margin: 14px 16px;
}

.tfm-team-directory .leaflet-popup-content-wrapper {
    border-radius: 14px;
}

.tfm-team-directory .leaflet-popup-close-button {
    color: var(--tfm-text-secondary);
}