/* Course map pins and popups
   -------------------------
   Shared by the listing's map view and the map on a course page. They draw the
   same pin and the same popup card, so this lives in its own file that both
   pages load rather than in either page's stylesheet — the course page had its
   own thinner popup for a while and the two immediately drifted apart.

   Markup for both is built in `public/js/courses-map.js`. */

/* ── Pins ─────────────────────────────────────────────────────────────────── */

/* Leaflet sizes a divIcon from CSS when iconSize is null; the label has to be
   free to grow with its price, so the wrapper takes no width of its own. */
.course-pin-wrap {
    width: auto !important;
    height: auto !important;
}

.course-pin {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px 3px 3px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 5px rgba(0, 0, 0, .32);
    white-space: nowrap;
}

.course-pin-photo {
    width: 22px;
    height: 22px;
    flex: none;
    border-radius: 50%;
    background: #DFDFDF center/cover no-repeat;
}

.course-pin-price {
    font-size: 12px;
    font-weight: 700;
    color: #8A8A8A;
    line-height: 1;
}

/* Bookable courses are the ones a golfer can act on today. */
.course-pin.is-bookable .course-pin-price {
    color: #161F42;
}

.leaflet-marker-icon:hover .course-pin {
    box-shadow: 0 2px 9px rgba(0, 0, 0, .45);
}

.course-cluster-wrap {
    background: none;
    border: 0;
}

.course-cluster {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #161F42;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 0 0 5px rgba(22, 31, 66, .22);
}

/* ── Popup ────────────────────────────────────────────────────────────────── */

.course-map-popup-shell .leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .22);
}

.course-map-popup-shell .leaflet-popup-content {
    margin: 0;
    width: 280px !important;
    line-height: 1.35;
}

/* Leaflet's ✕ sits in the padding box by default and lands on top of the club
   name. Pull it into its own corner and give the name room to clear it. */
.course-map-popup-shell .leaflet-popup-close-button {
    top: 6px;
    right: 8px;
    width: 20px;
    height: 20px;
    font-size: 18px;
    line-height: 18px;
    color: #8A8A8A;
}

.course-map-popup {
    display: block;
    padding: 12px;
    text-decoration: none;
    color: inherit;
}

.course-map-popup:hover {
    text-decoration: none;
    color: inherit;
    background: #F7F8FB;
}

/* Thumbnail left, text right. A full-width photo header was mostly grey
   placeholder on the many courses with no photo on file. */
.course-map-popup-head {
    display: flex;
    gap: 11px;
    /* Clears the close button. */
    padding-right: 18px;
}

.course-map-popup-thumb {
    flex: none;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background: #EDEFF4 center/cover no-repeat;
}

.course-map-popup-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.course-map-popup-name {
    font-size: 14px;
    font-weight: 600;
    color: #000101;
    line-height: 1.3;
    /* Two lines is plenty for a club name; a third pushes the price out of the
       card and some names here run very long. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-map-popup-meta {
    margin-top: 4px;
    font-size: 12px;
    color: #8A8A8A;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Directly under the name: the rating is what a golfer reads next, and it
   keeps the grey detail line last where it belongs. */
.course-map-popup-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #000101;
}

/* Same yellow the listing cards use for their stars. */
.course-map-popup-rating::before {
    content: '★';
    color: #FFC800;
    font-size: 13px;
    line-height: 1;
}

.course-map-popup-rating span {
    font-weight: 400;
    color: #8A8A8A;
}

/* A footer across the whole card, so the price lines up with the thumbnail's
   left edge rather than starting halfway across under the text. */
.course-map-popup-foot {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-top: 11px;
    padding-top: 10px;
    border-top: 1px solid #EDEFF4;
}

.course-map-popup-price {
    font-size: 16px;
    font-weight: 700;
    color: #4681EB;
    line-height: 1;
}

.course-map-popup-cta {
    font-size: 12px;
    font-weight: 600;
    color: #161F42;
    text-decoration: underline;
    white-space: nowrap;
}

/* The course a page is already about: its pin names itself and nothing more,
   because everything else is on the page around it. */
.course-map-popup-solo {
    display: block;
    padding: 4px 6px;
    font-size: 13.5px;
    font-weight: 600;
    color: #000101;
    line-height: 1.3;
}
