/* Golf course map page (map.php) — Leaflet/OSM based, replaces JP-only iframe */
#govigo-map {
    width: 100%;
    height: 800px;
    border-radius: 4px;
    background: #e9eef0;
}

@media (max-width: 768px) {
    #govigo-map {
        height: 70vh;
    }
}

.govigo-map-empty {
    padding: 40px 0;
    text-align: center;
    color: #888;
}

/* Custom marker: round orange badge with a white golf-flag icon */
.govigo-marker {
    background: transparent;
    border: 0;
}

.govigo-marker__pin {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: #e14f00;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.govigo-marker__pin svg {
    width: 18px;
    height: 18px;
}

/* Bootstrap-modal–like card rendered inside the Leaflet popup */
.govigo-gmaps-popup .leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.govigo-gmaps-popup .leaflet-popup-content {
    margin: 0;
    width: 340px !important;
    line-height: 1.5;
}

.gmaps-modal {
    width: 340px;
    max-width: 100%;
}

/* Mobile: keep the popup inside the viewport. Desktop shows full remark with no
   scroll, but a long remark on a phone would overflow the screen, so bound the
   content area and let only the body scroll while header/footer stay put. */
@media (max-width: 768px) {
    .govigo-gmaps-popup .leaflet-popup-content {
        width: min(340px, 82vw) !important;
    }

    .gmaps-modal {
        width: 100%;
    }

    .gmaps-modal__body.golf-club-content {
        max-height: 40vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Keep Leaflet's close button aligned with the modal header */
.govigo-gmaps-popup .leaflet-popup-close-button {
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    font-size: 20px;
    color: #6c757d;
}

.gmaps-modal__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 40px 12px 16px;
    border-bottom: 1px solid #dee2e6;
}

.gmaps-modal__title {
    margin: 0;
    flex: 0 1 auto;
    min-width: 0;
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Directions: floating round button on the image (Google-style FAB) */
.gmaps-modal__dir {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.gmaps-modal__dir img {
    display: block;
    width: 20px;
    height: auto;
}

/* Fallback when the club has no image: show the button inline in the body */
.gmaps-modal__dir-row {
    position: relative;
    height: 38px;
}

.gmaps-modal__dir-row .gmaps-modal__dir {
    right: 0;
    bottom: 0;
}

.gmaps-modal__img {
    position: relative;
    width: 100%;
    height: 140px;
    background-size: cover;
    background-position: center;
    background-color: #e9eef0;
}

.gmaps-modal__body {
    padding: 14px 16px;
}

/* golf_club_detail.php .golf-club-content parity: remark stacked above address */
.gmaps-modal__body.golf-club-content {
    display: flex;
    flex-direction: column;
    text-align: left;
    font-size: 13px;
    color: #495057;
}

.gmaps-modal__remark {
    overflow-wrap: break-word;
    word-break: break-word;
}

.gmaps-modal__body.golf-club-content .flex {
    align-items: flex-start;
    overflow-wrap: break-word;
    word-break: break-word;
}

.gmaps-modal__body.golf-club-content .flex a {
    flex: 0 0 auto;
}

.gmaps-modal__body.golf-club-content .flex > span {
    flex: 1 1 auto;
    min-width: 0;
}

.gmaps-modal__row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 13px;
    color: #495057;
}

.gmaps-modal__ico {
    flex: 0 0 auto;
    font-size: 18px;
    line-height: 1.4;
    color: #0071be;
}

/* Text next to the icon takes the remaining width and wraps on word
   boundaries instead of collapsing to one word per line. */
.gmaps-modal__row > span:not(.gmaps-modal__ico),
.gmaps-modal__row > a {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

.gmaps-modal__row + .gmaps-modal__row {
    margin-top: 6px;
}

.gmaps-modal__row a {
    color: #495057;
    text-decoration: none;
}

.gmaps-modal__footer {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
}

/* Buttons follow the site palette (primary blue #0071be), not Bootstrap defaults */
.gmaps-modal__footer .btn {
    border-radius: 5px;
    text-decoration: none;
}

.gmaps-modal__footer .btn-primary,
.gmaps-modal__footer .btn-primary:focus {
    background: #0071be;
    border: 1px solid #0071be;
    color: #fff;
}

.gmaps-modal__footer .btn-primary:hover,
.gmaps-modal__footer .btn-primary:active {
    background: #207ab7;
    border-color: #207ab7;
    color: #fff;
}
