/* ARC-306: the LINZ imagery credit and the Road / Satellite switch that wwwroot/js/archerBasemap.js
   puts on the portal's maps. */

/* The credit is the first item in Azure's copyright row (.map-copyright) and carries Azure's own
   .azure-map-copyright class, so it takes Azure's font, colour and shadow for the current style. It wraps
   upward (max-width is set from the map's width) and is never truncated (a licence condition, mr-design). */
.map-copyright .archer-linz-credit {
    display: inline-block;
    vertical-align: bottom;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: right;
    margin-right: 4px;
}

.map-copyright .archer-linz-credit a:hover,
.map-copyright .archer-linz-credit a:focus-visible {
    text-decoration: underline;
}

.map-copyright .archer-linz-credit[hidden] {
    display: none;
}

/* No room beside Azure's items (archerBasemap.js placeCredit): the credit takes its own full-width line above them,
   right-aligned, its left padding (set in JS) keeping the text clear of Azure's logo. */
.map-copyright.archer-linz-stacked {
    flex-wrap: wrap;
}

.map-copyright.archer-linz-stacked .archer-linz-credit {
    flex: 0 0 100%;
    box-sizing: border-box;
    margin-left: 0;
    padding-right: 4px;
}

/* Its full-width box reaches over the logo's top edge: let the pointer through to the logo, except on the link. */
.map-copyright.archer-linz-stacked .archer-linz-credit {
    pointer-events: none;
}

.map-copyright.archer-linz-stacked .archer-linz-credit a {
    pointer-events: auto;
}

/* Road / Satellite cross-fade (archerBasemap.js addCrossFade): the outgoing picture, held over the map until the new
   style has drawn, then faded out. Opacity only (design-language). */
.archer-style-fade {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .archer-style-fade {
        transition: none;
    }
}

/* The /maps header's Road / Satellite switch (Maps.razor.css .maps-style-switcher), over the map's
   top-right corner on maps without one of their own. */
.archer-map-style {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    background: var(--pg-surface-raised);
    border: 1px solid var(--pg-border);
    border-radius: var(--radius-md);
    box-shadow: var(--pg-shadow);
    padding: 2px;
    gap: 2px;
}

.archer-map-style-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: var(--pg-text-tertiary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    line-height: 1;
    transition: background 0.12s, color 0.12s;
}

.archer-map-style-pill:hover {
    color: var(--pg-text-secondary);
    background: var(--pg-surface-raised);
}

.archer-map-style-pill:focus-visible {
    outline: 2px solid var(--pg-accent);
    outline-offset: 1px;
}

.archer-map-style-pill:active {
    background: var(--pg-surface);
}

.archer-map-style-pill.active {
    color: var(--pg-text);
    background: var(--pg-surface);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.archer-map-style-pill i {
    font-size: 12px;
}
