/* =========================================================
   SURNAMES
========================================================= */

.surname-hero {
    padding: 45px 25px;
    border-radius: 24px;

    background:
        linear-gradient(
            135deg,
            rgba(223, 241, 214, 0.8),
            rgba(255, 255, 255, 0.95)
        );

    border: 1px solid rgba(82, 120, 83, 0.15);
}


.surname-hero-icon,
.surname-cta-icon {
    font-size: 2.4rem;
    color: #527853;
}


.surname-eyebrow {
    color: #527853;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
}


.surname-title {
    font-size: clamp(2.6rem, 7vw, 5rem);
    font-weight: 800;
    color: #355e3b;
    letter-spacing: 0.03em;
}


.surname-intro {
    max-width: 650px;
    color: #5f685f;
    font-size: 1.05rem;
}


.surname-stat-card,
.surname-panel {
    background: #fff;

    border: 1px solid rgba(82, 120, 83, 0.14);
    border-radius: 20px;

    padding: 25px;

    box-shadow:
        0 8px 28px rgba(42, 66, 43, 0.06);
}


.surname-stat-icon {
    display: block;

    font-size: 1.6rem;
    color: #527853;

    margin-bottom: 10px;
}


.surname-stat-value {
    color: #355e3b;
    font-size: 2rem;
    font-weight: 800;
}


.surname-stat-period {
    font-size: 1.65rem;
}


.surname-stat-label {
    color: #737b73;
    font-size: 0.9rem;
}


.surname-section-heading {
    display: flex;
    align-items: center;
    gap: 15px;
}


.surname-section-icon {
    width: 48px;
    height: 48px;

    flex-shrink: 0;

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

    border-radius: 14px;

    background: rgba(82, 120, 83, 0.12);
    color: #527853;

    font-size: 1.3rem;
}


.surname-panel-title {
    color: #355e3b;
    font-weight: 700;
}


.surname-map-placeholder {
    min-height: 380px;

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

    gap: 10px;

    border-radius: 16px;

    background: #f5f8f4;
    color: #788078;

    text-align: center;
}


.surname-map-placeholder i {
    font-size: 3rem;
    color: #527853;
}


.surname-department-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 12px 0;

    border-bottom: 1px solid #edf0ed;
}


.surname-rank {
    width: 30px;
    height: 30px;

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

    border-radius: 50%;

    background: rgba(82, 120, 83, 0.12);

    color: #527853;
    font-weight: 700;
}


.surname-department-code {
    color: #909690;
    font-size: 0.75rem;
}


.surname-department-total {
    font-weight: 700;
    color: #527853;
}


.surname-other {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 14px 16px;

    border-radius: 12px;

    background: #f5f8f4;

    color: #527853;
}


.surname-other small {
    display: block;
    color: #7d857d;
}


.surname-period-card {
    padding: 15px 8px;

    background: #f5f8f4;
    border-radius: 12px;
}


.surname-period-card strong {
    color: #527853;
    font-size: 1.35rem;
}


.surname-period-card small {
    color: #747c74;
}


.surname-peak {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 15px 18px;

    border-radius: 12px;

    background: rgba(82, 120, 83, 0.1);
    color: #465d47;
}


.surname-peak i {
    color: #527853;
    font-size: 1.3rem;
}


.surname-cta {
    padding: 45px 25px;

    border-radius: 24px;

    background:
        linear-gradient(
            135deg,
            #edf6e9,
            #f9fbf8
        );

    border: 1px solid rgba(82, 120, 83, 0.16);
}


.surname-cta p {
    max-width: 620px;
    color: #657065;
}


.surname-source {
    color: #8b918b;
    font-size: 0.78rem;
}

.surname-map-tooltip {
    position: fixed;

    z-index: 9999;

    display: none;
    flex-direction: column;

    min-width: 165px;

    padding: 10px 14px;

    background: #ffffff;

    border:
        1px solid
        rgba(82, 120, 83, 0.22);

    border-radius: 12px;

    box-shadow:
        0 8px 25px
        rgba(42, 66, 43, 0.18);

    pointer-events: none;
}


.surname-map-tooltip.show {
    display: flex;
}


.surname-map-tooltip strong {
    color: #355e3b;

    font-size: 0.9rem;
}


.surname-map-tooltip span {
    margin-top: 3px;

    color: #737b73;

    font-size: 0.8rem;
}

.surname-history-chart {
    display: flex;
    align-items: flex-end;

    gap: 10px;

    min-height: 300px;
    padding: 25px 10px 5px;

    border-bottom: 1px solid #e5e9e5;
}


.surname-chart-column {
    flex: 1;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;

    height: 260px;

    min-width: 45px;
}


.surname-chart-value {
    margin-bottom: 7px;

    color: #527853;

    font-size: 0.78rem;
    font-weight: 700;
}


.surname-chart-bar-wrapper {
    width: 100%;
    height: 200px;

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


.surname-chart-bar {
    width: 65%;
    max-width: 45px;

    min-height: 4px;

    border-radius: 8px 8px 3px 3px;

    background:
        linear-gradient(
            180deg,
            #527853,
            #7fa36f
        );

    transition:
        transform 0.2s ease,
        opacity 0.2s ease;

    cursor: default;
}


.surname-chart-column:hover,
.surname-chart-bar {
    transform: translateY(-4px);
    opacity: 0.85;
}


.surname-chart-period {
    margin-top: 9px;

    color: #7a827a;

    font-size: 0.68rem;
    white-space: nowrap;
}

/* =========================================================
   LÉGENDE CARTE
========================================================= */

.surname-map-legend {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 10px;

    color: #6f786f;
    font-size: 0.78rem;
}


.surname-map-gradient {
    width: 140px;
    height: 12px;

    border-radius: 999px;

    background: linear-gradient(
        to right,
        rgba(82, 120, 83, 0.25),
        #527853
    );

    border: 1px solid rgba(82, 120, 83, 0.15);
}


@media (max-width: 767.98px) {

    .surname-history-chart {
        overflow-x: auto;

        justify-content: flex-start;

        padding-bottom: 12px;
    }


    .surname-chart-column {
        flex: 0 0 58px;
    }

}

/* =========================================================
   AUTOCOMPLÉTION — NOMS DE FAMILLE
========================================================= */

.surname-search-form {
    width: 100%;
    max-width: 680px;
}


.surname-autocomplete-results {
    position: absolute;

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

    z-index: 1050;

    overflow: hidden;

    padding: 7px;

    background: rgba(255, 255, 255, 0.98);

    border: 1px solid rgba(82, 120, 83, 0.15);
    border-radius: 16px;

    box-shadow:
        0 14px 40px rgba(48, 77, 48, 0.14);

    text-align: left;
}


.surname-autocomplete-results[hidden] {
    display: none !important;
}


/* Résultat */

.surname-autocomplete-item {
    display: flex;
    align-items: center;

    gap: 12px;

    width: 100%;

    padding: 10px 12px;

    background: transparent;

    border: 0;
    border-radius: 11px;

    color: #354435;

    text-align: left;

    cursor: pointer;

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


.surname-autocomplete-item:hover,
.surname-autocomplete-item:focus {
    background: rgba(82, 120, 83, 0.09);

    outline: none;
}


.surname-autocomplete-item:active {
    transform: scale(0.99);
}


/* Icône */

.surname-autocomplete-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 38px;
    height: 38px;

    flex: 0 0 38px;

    background: rgba(82, 120, 83, 0.11);

    border-radius: 50%;

    color: #527853;

    font-size: 1rem;
}


/* Texte */

.surname-autocomplete-content {
    display: flex;
    flex-direction: column;

    min-width: 0;

    flex: 1;
}


.surname-autocomplete-name {
    color: #304630;

    font-size: 0.95rem;
    font-weight: 700;

    letter-spacing: 0.02em;
}


.surname-autocomplete-subtitle {
    margin-top: 1px;

    color: #899189;

    font-size: 0.72rem;
}


/* Flèche */

.surname-autocomplete-arrow {
    margin-left: auto;

    color: #9eaa9e;

    font-size: 0.85rem;

    transition: transform 0.15s ease;
}


.surname-autocomplete-item:hover
.surname-autocomplete-arrow {
    transform: translateX(3px);

    color: #527853;
}


/* Aucun résultat */

.surname-autocomplete-empty {
    padding: 18px;

    color: #7d877d;

    font-size: 0.88rem;

    text-align: center;
}

@media (max-width: 767.98px) {

    .surname-hero {
        padding: 35px 18px;
    }

    .surname-map-placeholder {
        min-height: 260px;
    }

    .surname-panel {
        padding: 20px;
    }

}

@media (max-width: 575.98px) {

    .surname-map-gradient {
        width: 90px;
    }

    .surname-map-legend {
        font-size: 0.7rem;
        gap: 7px;
    }

}