/* Breva Map front-end styles. The marker is a classic colored teardrop pin with
   an inlined lucide icon; the path polylines are styled inline by Leaflet. */

.breva-map-container {
    position: relative;
    /* Fill the element the shortcode sits in, so the map can be sized purely by its
       wrapper: pass height="100%" in the shortcode and give the surrounding column /
       div a height. With the default height="480px" the parent is usually auto, so
       100% resolves to auto and the container simply wraps the fixed-height canvas. */
    width: 100%;
    height: 100%;
}

.breva-map-canvas {
    /* height comes from the shortcode `height` attribute (inline), e.g. "480px" or
       "100%"; width fills the container. min-height keeps the map usable if a
       percentage height ever resolves against an unsized parent. */
    width: 100%;
    height: 100%;
    min-height: 240px;
    background: #e8eef0;
}

/* divIcon resets Leaflet's default white box. */
.breva-map-divicon {
    background: none;
    border: 0;
}

.breva-map-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    /* border-box keeps the pin exactly 32x32 in both the front-end (no admin reset)
       and the admin composer, so the tip lands at a fixed offset the icon anchor
       ([16, 38]) can rely on. */
    box-sizing: border-box;
    width: 32px;
    height: 32px;
    background: var(--breva-pin, #2e7d32);
    border: 2px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.breva-map-pin svg {
    width: 17px;
    height: 17px;
    color: var(--breva-icon, #fff);
    /* The round head is a circle centred on the box centre (the three rounded
       corners share one arc centre there; the sharp corner is the rotated-down
       tip). So the flex container already centres the glyph's box exactly on the
       head — only undo the pin's −45° rotation, no positional nudge. */
    transform: rotate(45deg);
}

.breva-map-popup strong {
    display: block;
    margin-bottom: 2px;
    font-size: 14px;
    line-height: 1.3;
}

.breva-map-popup p {
    margin: 4px 0 6px;
}

.breva-map-popup a {
    font-weight: 600;
    color: #2e7d32;
    text-decoration: underline;
}

.breva-map-popup a:hover,
.breva-map-popup a:focus-visible {
    color: #276a2a;
}

/* Consent placeholder - covers the (blank) canvas until the visitor consents. */
.breva-map-consent {
    position: absolute;
    inset: 0;
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 28px 24px;
    text-align: center;
    background: #f3f5f4;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.breva-map-consent-heading {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.3;
    color: #1d2327;
}

.breva-map-consent-body {
    max-width: 46ch;
    margin: 0;
    color: #50575e;
    line-height: 1.5;
}

.breva-map-consent-privacy {
    color: #2e7d32;
    font-size: 13px;
    text-decoration: underline;
}

.breva-map-consent-privacy:hover,
.breva-map-consent-privacy:focus-visible {
    color: #276a2a;
}

/* Self-styled so it looks like a real button on any theme (front-end has no
   wp-admin .button styles). */
.breva-map-consent-btn {
    margin-top: 4px;
    padding: 11px 24px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    background: #2e7d32;
    border: 0;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.05s ease;
}

.breva-map-consent-btn:hover {
    background: #276a2a;
}

.breva-map-consent-btn:active {
    transform: translateY(1px);
}

.breva-map-consent-btn:focus-visible {
    outline: 2px solid #1b4d1f;
    outline-offset: 2px;
}

/* Tag legend: one toggle button per tag (swatch plus name). Dimmed when hidden.
   A header toggle folds the list away so it stops covering markers underneath. */
.breva-map-legend {
    max-width: 220px;
    padding: 6px;
    font-size: 13px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

.breva-map-legend-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 4px 6px;
    background: none;
    border: 0;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    cursor: pointer;
}

.breva-map-legend-toggle:hover {
    background: #f0f0f1;
}

.breva-map-legend-chevron {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid currentColor;
    transition: transform 0.15s ease;
}

.breva-map-legend.is-collapsed .breva-map-legend-chevron {
    transform: rotate(-90deg);
}

.breva-map-legend-items {
    margin-top: 4px;
}

.breva-map-legend.is-collapsed .breva-map-legend-items {
    display: none;
}

.breva-map-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 4px 6px;
    background: none;
    border: 0;
    border-radius: 4px;
    text-align: left;
    color: #1d2327;
    cursor: pointer;
}

.breva-map-legend-item:hover {
    background: #f0f0f1;
}

.breva-map-legend-item:focus-visible {
    outline: 2px solid #1b4d1f;
    outline-offset: -2px;
}

.breva-map-legend-item.is-off {
    opacity: 0.45;
}

.breva-map-legend-name {
    line-height: 1.25;
}

.breva-map-legend-swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    color: #fff;
}

.breva-map-legend-swatch svg {
    width: 12px;
    height: 12px;
}

