/*
 * "Our offices" section for magnum index page (seajay style).
 * Italy map with one projected dot per office + tabbed office details.
 */

#offices {
    padding: 5em var(--gutter);
    overflow: hidden;
}

#offices .officesInner {
    display: flex;
    align-items: center;
    gap: 5%;
}

#offices .officesText {
    width: 48%;
}

#offices .officesMap {
    width: 47%;
}

/* Section heading */
#offices .eyebrow {
    display: flex;
    align-items: center;
    gap: .9em;
    text-transform: uppercase;
    letter-spacing: .18em;
    font-size: .8em;
    font-weight: 700;
    color: var(--teal);
    font-family: 'Montserrat', sans-serif;
    margin-bottom: .6em;
}

#offices .eyebrow:before {
    content: "";
    width: 2.6em;
    height: 2px;
    background-color: var(--teal);
}

#offices .title {
    margin-bottom: 1.2em;
}

/* Tabs */
#offices .officeTabs {
    display: flex;
    flex-wrap: wrap;
    gap: .6em;
    margin-bottom: 1.8em;
}

#offices .officeTab {
    font-family: 'Montserrat', sans-serif;
    font-size: .8em;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .85em 1.8em;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background-color: transparent;
    color: var(--ink);
    cursor: pointer;
    transition: all .2s ease-in-out;
}

#offices .officeTab:hover {
    border-color: var(--teal);
    color: var(--teal);
}

#offices .officeTab.active {
    background-color: var(--teal);
    border-color: var(--teal);
    color: var(--white);
}

/* Panels */
#offices .officePanel {
    display: none;
}

#offices .officePanel.active {
    display: block;
}

#offices .officePanel h3 {
    font-size: 1.5em;
    margin-bottom: .8em;
}

#offices .officeDetails {
    margin-bottom: 1.6em;
}

#offices .officeDetails li {
    list-style: none;
    display: flex;
    align-items: flex-start;
    gap: .8em;
    margin-bottom: .7em;
    letter-spacing: 0;
}

#offices .officeDetails li i {
    color: var(--teal);
    width: 1.2em;
    text-align: center;
    margin-top: .25em;
    flex-shrink: 0;
}

#offices .officeDetails li a {
    text-decoration: none;
}

#offices .officeDetails li a:hover {
    color: var(--teal);
}

/* Italy map */
#offices .italyMap {
    position: relative;
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
}

#offices .italyMap .italySvg {
    width: 100%;
    height: 100%;
    display: block;
}

#offices .italyMap .italySvg path {
    fill: #cdd9da;          /* light teal-grey silhouette */
    transition: fill .2s ease-in-out;
}

/* Office markers (positioned in PHP from lat/lng) */
#offices .officeDot {
    position: absolute;
    transform: translate(-50%, -50%);
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    z-index: 2;
    line-height: 1;
}

#offices .officeDotPin {
    display: block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--teal);
    border: 3px solid var(--white);
    box-shadow: 0 1px 4px rgba(3, 21, 33, .35);
    transition: transform .2s ease-in-out, background-color .2s ease-in-out;
}

#offices .officeDot:hover .officeDotPin {
    transform: scale(1.2);
}

#offices .officeDot.active .officeDotPin {
    background-color: var(--sea);
    transform: scale(1.35);
}

/* Marker label */
#offices .officeDot em {
    position: absolute;
    left: 50%;
    top: calc(100% + 6px);
    transform: translateX(-50%);
    font-style: normal;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: .72em;
    letter-spacing: .04em;
    white-space: nowrap;
    color: var(--ink);
    background-color: var(--white);
    padding: .15em .6em;
    border-radius: 3px;
    box-shadow: 0 1px 4px rgba(3, 21, 33, .15);
    opacity: 0;
    transition: opacity .2s ease-in-out;
    pointer-events: none;
}

#offices .officeDot:hover em,
#offices .officeDot.active em {
    opacity: 1;
}

/* Responsive */
@media screen and (max-width: 780px) {

    #offices .officesInner {
        flex-direction: column;
        gap: 3em;
    }

    #offices .officesText,
    #offices .officesMap {
        width: 100%;
    }

    #offices .officeTabs {
        justify-content: center;
    }

    #offices .officePanel {
        text-align: center;
    }

    #offices .officeDetails li {
        justify-content: center;
        text-align: left;
    }

    #offices .italyMap {
        max-width: 320px;
    }
}
