/*
 * The credits of the maps (assets/map-credits.js), as .tt .attr on the tracking page
 * (track_and_trace.css): small but readable in the bottom-right corner, as the licence asks.
 * Plain CSS, loaded by the module itself, so it works on every page with a map. The extra class
 * beats the margins Leaflet gives every control in a corner.
 */
.leaflet-container .leaflet-control-container .map-credits {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 2px 8px;
    border-top-left-radius: 6px;
    background: rgb(255 255 255 / 0.8);
    color: #57534e;
    font-family: var(--font-sans, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);
    font-size: 11px;
    line-height: 1.4;
}

.leaflet-container .map-credits a,
.leaflet-container .map-credits button {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.leaflet-container .map-credits a:hover,
.leaflet-container .map-credits button:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* The dialog with every credit, its link and its licence */
.map-credits-dialog {
    /* Centred: the reset of Tailwind takes the margin of the browser away */
    margin: auto;
    width: min(30rem, calc(100% - 2rem));
    padding: 1.25rem 1.5rem;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    color: #1c1917;
    font-family: var(--font-sans, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);
    font-size: 14px;
    line-height: 1.5;
}

.map-credits-dialog::backdrop {
    background: rgb(15 23 42 / 0.4);
}

.map-credits-dialog h2 {
    margin: 0 0 0.5rem;
    font-size: 16px;
    font-weight: 600;
}

.map-credits-dialog h3 {
    margin: 1rem 0 0.25rem;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.map-credits-dialog ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Smaller than the rest of the dialog, so a source and its licence fit on one line */
.map-credits-dialog li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.375rem 0;
    border-top: 1px solid #e2e8f0;
    font-size: 13px;
}

.map-credits-dialog li a {
    flex-shrink: 0;
    color: var(--color-primary-600, #155eef);
    font-weight: 500;
    text-decoration: none;
}

.map-credits-dialog li a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.map-credits-dialog li span {
    color: #64748b;
    font-size: 12px;
    text-align: right;
}

.map-credits-close {
    display: block;
    margin: 1.25rem 0 0 auto;
    padding: 0.4rem 0.875rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #1c1917;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}

.map-credits-close:hover {
    background: #f8fafc;
}
