/* =====================================================================================================================
   Weather probes: the marker on the map (a wind arrow turned downwind, with the speed under it) and the card with the conditions.
   Mobile first: every button is at least 44 px tall on a phone or any coarse pointer (.hg-touch, sharing.css), the card has no sideways
   scrolling, long text wraps, and the hourly strip is a grid of six (two rows of six hours), never a scrolling row.
   Loaded after app.css and sharing.css so it can build on their variables.
   ===================================================================================================================== */

/* ------------------------------------------------------------------------------------------------ the map marker -- */

/*
 * A probe on the map: a dark disc (44 px, a real touch target) with the wind arrow in it, the speed in a small pill under it and the name under
 * that. Mapbox positions the marker element with an inline transform, so nothing here may use transform on the element itself: the arrow is
 * turned inside it.
 */
.hg-probe {
    position: relative;
    width: 44px;
    height: 44px;
    cursor: pointer;
    outline: none;
}

.hg-probe__disc {
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    background: rgba(18, 22, 15, 0.82);
    color: #e8eddf;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    transition: box-shadow 0.12s ease-out;
}

.hg-probe__arrow {
    display: block;
    transform-origin: 50% 50%;
    transition: transform 0.25s ease-out;
}

.hg-probe__disc > svg {
    pointer-events: none;
}

.hg-probe__speed {
    display: none;
    position: absolute;
    left: 50%;
    bottom: -9px;
    transform: translateX(-50%);
    min-width: 22px;
    padding: 0 5px;
    border-radius: 9px;
    background: #9aa39a;
    color: #1a1a10;
    font-size: 12px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    border: 1px solid rgba(0, 0, 0, 0.45);
    pointer-events: none;
}

.hg-probe__label {
    display: none;
    position: absolute;
    top: 55px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 3px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    color: #ffffff;
    text-shadow: 0 0 3px #000, 0 0 3px #000, 0 1px 2px #000;
    pointer-events: none;
}

.hg-zoom-labels .hg-probe--named .hg-probe__label,
.hg-probe--selected.hg-probe--named .hg-probe__label {
    display: block;
}

.hg-probe:hover .hg-probe__disc {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35), 0 2px 6px rgba(0, 0, 0, 0.6);
}

.hg-probe--selected .hg-probe__disc {
    box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.95), 0 3px 8px rgba(0, 0, 0, 0.65);
}

.hg-probe:focus-visible .hg-probe__disc {
    outline: 2px solid var(--hg-accent);
    outline-offset: 3px;
}

/* Somebody else's probe: the same marker, faded, with a dashed cool-blue ring (like a shared pin). */
.hg-probe--shared .hg-probe__disc {
    border: 2px dashed #8fb4e0;
    opacity: 0.88;
}

/* A probe that has no wind to draw yet (not read, or the read failed) is a plain disc with the wind glyph. */
.hg-probe[data-wind="false"] .hg-probe__disc {
    color: #b9c4aa;
}

/* While the map waits for a click the markers let it through (as the pins do). */
.hg-placing .hg-probe {
    pointer-events: none;
}

/* The list and the card chip. */
.hg-pinchip--probe {
    color: #12160f;
}

/* ------------------------------------------------------------------------------------------------- the card -- */

.hg-weather {
    margin-top: 12px;
    padding-top: 2px;
    min-width: 0;
}

.hg-weather > * {
    max-width: 100%;
}

.hg-weather__head {
    margin-top: 10px;
}

.hg-weather__source {
    margin: 4px 0 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.hg-weather__source i {
    margin-right: 4px;
    color: var(--hg-accent);
}

.hg-weather__source--modelled i {
    color: #8fb4e0;
}

.hg-weather__detail,
.hg-weather__hint {
    margin: 2px 0 0;
    font-size: var(--hg-fs-11);
    line-height: 1.4;
    color: var(--hg-text-dim);
    overflow-wrap: anywhere;
}

.hg-weather__hint {
    margin-top: 4px;
}

.hg-weather__wind {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 6px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--hg-bg);
    border: 1px solid var(--hg-border);
}

.hg-weather__wind .hg-windarrow {
    flex: 0 0 auto;
}

.hg-weather__calm {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9aa39a;
    font-size: 22px;
}

.hg-weather__windtext {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    font-size: 14px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.hg-weather__values {
    margin-top: 4px;
}

.hg-weather__loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hg-weather__actions {
    margin-top: 10px;
    flex-wrap: wrap;
}

.hg-weather__units {
    margin: 8px 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--hg-bg);
    border: 1px solid var(--hg-border);
}

.hg-weather__units .hg-field {
    margin-bottom: 8px;
}

/* The next 12 hours: six to a row, so there is no sideways scrolling. */
.hg-weather__strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
}

.hg-weather__hour {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 4px 0;
    min-width: 0;
    border-radius: 6px;
    background: var(--hg-bg);
    border: 1px solid var(--hg-border);
    font-size: var(--hg-fs-11);
    font-variant-numeric: tabular-nums;
}

.hg-weather__hourlabel {
    color: var(--hg-text-dim);
    font-size: var(--hg-fs-10);
    white-space: nowrap;
}

.hg-weather__hourspeed {
    font-weight: 700;
    font-size: 13px;
}

.hg-weather__nodir {
    height: 26px;
    line-height: 26px;
    color: var(--hg-text-dim);
}

.hg-weather__limits {
    margin-top: 12px;
}

.hg-weather__credit {
    margin: 6px 0 4px;
    font-size: var(--hg-fs-11);
    color: var(--hg-text-dim);
    overflow-wrap: anywhere;
}

.hg-weather__credit a {
    color: var(--hg-text-dim);
    text-decoration: underline;
}

.hg-windarrow {
    display: block;
    transform-origin: 50% 50%;
}

@media (max-width: 640px), (pointer: coarse) {
    /* The Done button of the probe banner (app.css gives the banner buttons 40 px). */
    .hg-modebar .hg-button.hg-touch {
        min-height: 44px;
        min-width: 44px;
    }

    /* The credit link is a link in a footer: a 44 px tap area without changing how it looks. */
    .hg-weather__credit a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }
}

/* =====================================================================================================================
   Hunting stands (docs/10-weather-design.md): the mark on the map, the chip in the tree, the editor part and the card with the scent cone.
   ===================================================================================================================== */

/* A stand is a pin with a mark of its own: a rounded-square head (a plain pin is round) with a dark inner ring. */
.hg-pin--stand .hg-pin__head {
    border-radius: 9px;
    box-shadow: 0 0 0 2px rgba(18, 22, 15, 0.9), 0 2px 6px rgba(0, 0, 0, 0.6);
}

/* The wind blowing now is one of the stand's favoured winds: a small green disc with the wind glyph at the top right of the head. */
.hg-pin--windgood::before {
    content: "";
    position: absolute;
    top: -5px;
    right: -6px;
    z-index: 2;
    width: 14px;
    height: 14px;
    box-sizing: border-box;
    border-radius: 50%;
    background: #5fd068;
    border: 2px solid #12160f;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

/* The chip in a tree row. */
.hg-chip--wind {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    margin-left: 6px;
    font-size: var(--hg-fs-10);
    font-weight: 700;
    line-height: 1.5;
    color: #12160f;
    background: #5fd068;
    border: 1px solid #3fa84a;
    border-radius: 999px;
    cursor: inherit;
}

/* The plain chip turns its text light under the pointer (and under a finger that stays "hovering" after a tap): on this green that is 1.6:1. */
.hg-chip--wind:hover {
    color: #12160f;
    border-color: #3fa84a;
}

.hg-tree__row--hidden .hg-chip--wind {
    opacity: 0.5;
}

.hg-tree__cones {
    margin: 4px 0 8px;
    min-height: 44px;
}

/* The editor part. */
.hg-stand-editor {
    margin: 4px 0 10px;
    padding: 6px 10px 2px;
    border-radius: 8px;
    background: var(--hg-bg);
    border: 1px solid var(--hg-border);
}

.hg-stand-editor__toggle {
    margin-bottom: 6px;
}

.hg-stand-editor__row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.hg-stand-editor__row .hg-input {
    flex: 1 1 auto;
    min-width: 0;
}

.hg-stand-editor__winds {
    gap: 6px;
}

.hg-stand-editor__winds .hg-chip {
    min-width: 44px;
    min-height: 44px;
    padding: 0 8px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

/* The card. */
.hg-stand {
    margin-top: 12px;
    min-width: 0;
}

.hg-stand > * {
    max-width: 100%;
}

.hg-stand__time {
    margin: 6px 0 4px;
}

.hg-stand__slider {
    display: block;
    min-height: 44px;
    margin: 0;
}

.hg-stand__ticks {
    display: flex;
    justify-content: space-between;
    margin-top: -6px;
    font-size: var(--hg-fs-10);
    color: var(--hg-text-dim);
}

.hg-stand__cone {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 2px;
    font-size: 13px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.hg-stand__swatch {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.hg-stand__status {
    margin: 4px 0;
    font-size: 13px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.hg-stand__status--good { color: #8be092; }
.hg-stand__status--caution { color: #f2b134; }
.hg-stand__status--poor { color: #ff8a80; }

.hg-stand__note {
    margin-top: 8px;
}

.hg-stand__good {
    margin: 8px 0 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

@media (max-width: 640px), (pointer: coarse) {
    .hg-stand-editor .hg-input,
    .hg-stand-editor .hg-button {
        min-height: 44px;
    }
}

/* A reading older than half an hour is dimmed: the arrow is what the wind was, not what it is. */
.hg-probe--old .hg-probe__disc,
.hg-probe--old .hg-probe__speed { opacity: 0.45; }
