/* mappa-fornello — frontend map styles */

.mf-wrap {
    position: relative;
    width: 100%;
    font-family: inherit;
}

/* ── Toolbar (region select) ──────────────────────────────────────────────── */

.mf-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.mf-toolbar__label {
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

.mf-region-select {
    padding: 5px 10px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
}

.mf-region-select:focus {
    border-color: #364E6E;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */

.mf-layout {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.mf-map-col {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
}

.mf-list-col {
    flex: 0 0 220px;
    width: 220px;
    display: flex;
    flex-direction: column;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
    overflow: hidden;
    align-self: stretch;
}

/* Wider sidebar on large viewports */
@media (min-width: 1280px) {
    .mf-list-col { flex-basis: 260px; width: 260px; }
}
@media (min-width: 1600px) {
    .mf-list-col { flex-basis: 300px; width: 300px; }
}

@media (max-width: 640px) {
    .mf-layout   { flex-direction: column; }
    .mf-list-col { flex: none; width: 100%; max-height: 260px; }
    .mf-toolbar  { justify-content: flex-start; }
}

/* ── Sidebar header ───────────────────────────────────────────────────────── */

.mf-list-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 1;
}

.mf-list-title {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #555;
    white-space: nowrap;
}

.mf-search {
    flex: 1 1 0;
    min-width: 0;
    font-size: 12px;
    padding: 3px 7px;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: none;
    background: #f4f4f4;
}

.mf-search:focus {
    border-color: #364E6E;
    background: #fff;
}

/* ── Entry list ───────────────────────────────────────────────────────────── */

.mf-entry-list,
.mf-prov-entries {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mf-entry-list {
    overflow-y: auto;
    flex: 1 1 0;
    padding: 4px 0;
}

.mf-list-empty {
    padding: 12px 12px;
    font-size: 12px;
    color: #888;
    font-style: italic;
}

.mf-prov-group {
    padding: 0;
}

.mf-prov-heading {
    display: block;
    padding: 6px 10px 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
}

.mf-entry-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    border-radius: 4px;
    margin: 1px 4px;
    transition: background 0.1s;
}

.mf-entry-item:hover,
.mf-entry-item--hover {
    background: #eef4fb;
}

.mf-entry-link {
    font-size: 13px;
    color: #222;
    text-decoration: none;
    line-height: 1.3;
    word-break: break-word;
    cursor: pointer;
}

.mf-entry-item:hover .mf-entry-link,
.mf-entry-item--hover .mf-entry-link {
    color: #364E6E;
}

.mf-entry-item--pinned .mf-entry-link {
    color: #8d6705;
    font-weight: 600;
}

.mf-entry-item--pinned {
    background: #e5b111;
    border-radius: 3px;
}

/* ── Map container ────────────────────────────────────────────────────────── */

/* Default responsive height — overridden by inline style when height="X" is set
   in the shortcode. clamp(min, preferred, max):
   • mobile  (< 640px, map is full-width): min 320px
   • tablet / laptop: grows with viewport height
   • large desktop: capped at 900px                                             */
#mf-map {
    position: relative;
    width: 100%;
    height: clamp(320px, 65vh, 900px);
    background: #364e6e;
    border-radius: 6px;
    overflow: hidden;
}

#mf-map svg {
    display: block;
    width: 100%;
    height: 100%;
}

.mf-loading,
.mf-error {
    margin: 0;
    padding: 16px;
    font-size: 13px;
    color: #888;
    text-align: center;
}

.mf-error {
    color: #c0392b;
}

/* ── Provinces ────────────────────────────────────────────────────────────── */

.mf-province {
    fill: #dde0e0;
    stroke: #fff;
    cursor: pointer;
    stroke-width: 0.6px;
    transition: fill 0.15s ease;
}

.mf-province--active {
    stroke-width: 1px;
}

.mf-province--hover {
    fill: #c8cbcb !important;
    cursor: pointer;
}

.mf-province--active.mf-province--hover {
    filter: brightness(1.1);
    cursor: pointer;
}

.mf-province--pinned {
    fill: #e5b111 !important;
    stroke: #a88012 !important;
}

/* ── Pins (image-based) ───────────────────────────────────────────────────── */

image.mf-pin {
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
    transition: filter 0.15s ease, transform 0.15s ease;
    transform-origin: center center;
    transform-box: fill-box;
}

image.mf-pin--hover,
image.mf-pin:hover {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
    transform: scale(1.25);
}

/* ── Tooltip ──────────────────────────────────────────────────────────────── */

#mf-tooltip {
    position: absolute;
    display: none;
    background: #fff;
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    padding: 12px 16px 12px 14px;
    font-size: 13px;
    line-height: 1.5;
    color: #222;
    width: 300px;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
    z-index: 100;
    transition: opacity 0.1s ease;
    opacity: 0;
}

#mf-tooltip.mf-tooltip--visible {
    display: block;
    pointer-events: auto;
    opacity: 1;
}

#mf-tooltip.mf-tooltip--pinned {
    display: block;
    pointer-events: auto;
    opacity: 1;
}

/* Close button — hidden until tooltip is pinned */
.mf-tooltip__close {
    display: none;
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    font-size: 16px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 2px 4px;
}
.mf-tooltip__close:hover { color: #222; }
#mf-tooltip.mf-tooltip--pinned .mf-tooltip__close { display: block; }

#mf-tooltip strong {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #111;
    padding-right: 20px; /* room for close button when pinned */
}

#mf-tooltip strong a.mf-tt-title-link {
    color: #111;
    text-decoration: none;
}
#mf-tooltip strong a.mf-tt-title-link:hover {
    text-decoration: underline;
    color: #364E6E;
}

.mf-tt-year {
    font-size: 11px;
    font-weight: 400;
    color: #888;
    margin-left: 5px;
    vertical-align: middle;
}

.mf-tt-role-label {
    font-weight: 600;
    color: #555;
    margin-right: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

#mf-tooltip p {
    margin: 3px 0 0;
    color: #444;
    font-size: 12px;
}

#mf-tooltip ul {
    margin: 4px 0 0;
    padding-left: 16px;
}

#mf-tooltip ul li {
    margin: 2px 0;
    font-size: 12px;
}

/* ── Mobile: fullwidth fixed overlay ──────────────────────────────────────── */
@media (max-width: 640px) {
    #mf-tooltip.mf-tooltip--visible,
    #mf-tooltip.mf-tooltip--pinned {
        position: fixed;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        width: 100%;
        max-width: 100%;
        border-radius: 12px 12px 0 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        padding: 16px 20px 24px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.18);
        pointer-events: auto;
    }
    .mf-tooltip__close {
        display: block; /* always show X on mobile */
        top: 10px;
        right: 14px;
        font-size: 20px;
    }
}

#mf-tooltip a {
    color: #364E6E;
    text-decoration: none;
}

#mf-tooltip a:hover {
    text-decoration: underline;
}

/* Tooltip — righe info associazione */

.mf-tt-row {
    margin: 3px 0 0 !important;
    font-size: 12px !important;
    color: #444 !important;
}

.mf-tt-referente::before { content: "👤\00a0"; }
.mf-tt-tel::before       { content: "📞\00a0"; }

.mf-tt-email {
    color: #364E6E !important;
    text-decoration: none;
    word-break: break-all;
}

.mf-tt-email:hover { text-decoration: underline; }

/* Social links */

.mf-tt-socials {
    display: flex;
    gap: 5px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.mf-social {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    color: #fff !important;
    text-decoration: none !important;
    transition: opacity 0.15s;
}

.mf-social:hover { opacity: 0.85; }

.mf-social--ig { background: #E1306C; }
.mf-social--fb { background: #1877F2; }
.mf-social--tt { background: #333; }

/* Pulsante Candidati nel tooltip */

.mf-candidatura-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    background: #364E6E;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    text-align: center;
}

.mf-candidatura-btn:hover { background: #2a3d57; }

.mf-tooltip__prov {
    display: inline-block;
    margin-top: 5px;
    font-size: 11px;
    color: #888;
    font-style: italic;
}

.mf-prov-name {
    color: #555;
    font-size: 12px;
}

/* Modal: gestito interamente da Avada Off-Canvas / Popup Builder.
   Nessuno stile custom necessario qui. */

/* ── Single club page (/club-affiliati/{slug}) ──────────────────────────── */

.mf-club-page {
    max-width: 720px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: inherit;
}

.mf-club-header {
    margin-bottom: 32px;
    border-bottom: 2px solid #364E6E;
    padding-bottom: 16px;
}

.mf-club-title {
    font-size: 2rem;
    font-weight: 700;
    color: #111;
    margin: 0 0 6px;
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.mf-club-year {
    font-size: 1rem;
    font-weight: 400;
    color: #888;
}

.mf-club-province {
    margin: 0;
    font-size: 0.95rem;
    color: #555;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.mf-club-section {
    margin-bottom: 28px;
}

.mf-club-section h2 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #364E6E;
    margin: 0 0 10px;
}

.mf-club-dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 16px;
    margin: 0;
}

.mf-club-dl dt {
    font-weight: 600;
    color: #555;
    font-size: 0.875rem;
}

.mf-club-dl dd {
    margin: 0;
    color: #222;
    font-size: 0.875rem;
}

.mf-club-socials {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
