/*
 * location-map - the office map inside the contact block
 * (resources/views/components/maps/location-map.blade.php).
 *
 * Loaded only on a page that renders the component. Restyled from the
 * starter's example on this site's own tokens; the shape is the one the
 * keyless embed had in this column, so the contact block's proportions did
 * not move when the map changed underneath it.
 *
 * The canvas needs a size of its own: the Maps JavaScript API draws into an
 * element it does not size, so a container with no height renders nothing at
 * all and looks exactly like a refused key.
 */

.location-map {
    margin-top: 1.5rem;
}

/* 16/9, and box-sizing keeps the border inside the width so it can never
   push the page wider than the column - the rule the old .map-frame carried
   and the reason it was written. */
.location-map__canvas {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: var(--site-bg);
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius);
}

/* 16/9 on a phone is about 189px of map, roughly two blocks at zoom 15, which
   is too little to place the office against anything. Taller only where the
   column is narrow; above phone width the 16/9 above stands. */
@media (max-width: 575.98px) {
    .location-map__canvas {
        aspect-ratio: 4 / 3;
    }
}

/* What a visitor reads where the map would be, until the map replaces it.
   Centred both ways so it reads as a message rather than a stray line. */
.location-map__fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: var(--site-space-md);
    color: var(--site-muted);
    text-align: center;
}

/* A text link rather than a button, but still a tap target: 44px is the
   site's floor, the same as the footer links and the detail list above it.
   The 600 weight is the site's convention for a tappable row that is not a
   button - .phone-link in template.css carries the same - and without it this
   reads as one more sentence beside the email address above (Ray Castillo). */
.location-map__actions {
    margin-top: var(--site-space-sm);
}

.location-map__actions a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-weight: 600;
}

/* A live map does not print, and the script has already removed the sentence
   that would have explained the empty box. Printed, the component is an
   address a reader can type in, so the link prints its URL. */
@media print {
    .location-map__canvas {
        display: none;
    }

    .location-map__actions a::after {
        content: ' (' attr(href) ')';
        font-size: 0.8125rem;
        word-break: break-all;
    }
}
