/* Newswire Snapper Map — widget styles */

.nsm-widget {
    font-family: "Source Serif Pro", "Source Serif", Georgia, serif;
    color: #1f2937;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin: 32px 0;
    max-width: 100%;
    box-sizing: border-box;
}

.nsm-widget *,
.nsm-widget *::before,
.nsm-widget *::after {
    box-sizing: border-box;
}

.nsm-loading {
    color: #64748b;
    text-align: center;
    padding: 40px 0;
    font-style: italic;
}

.nsm-noscript {
    color: #64748b;
    font-size: 15px;
}

.nsm-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.nsm-title {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.2;
}

.nsm-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 4px 0 0 0;
}

.nsm-spot-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
}

.nsm-spot-btn {
    font: inherit;
    font-size: 14px;
    padding: 7px 12px;
    background: #ffffff;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.nsm-spot-btn:hover { border-color: #64748b; background: #f1f5f9; }
.nsm-spot-btn.is-active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

/* Grouped picker (used when there are more than 10 spots) */
.nsm-spot-picker-grouped { display: block; }
.nsm-spot-region-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin: 10px 0 6px 0;
}
.nsm-spot-region-label:first-of-type { margin-top: 0; }
.nsm-spot-region-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }

.nsm-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 600px) {
    .nsm-main { grid-template-columns: 1fr; }
}

.nsm-score-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
}

.nsm-score-big {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}
.nsm-score-number {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 56px;
    font-weight: 700;
    line-height: 1;
}
.nsm-score-outof {
    font-size: 17px;
    color: #64748b;
}

.nsm-score-label {
    font-size: 14px;
    color: #475569;
    margin-bottom: 14px;
}
.nsm-score-label strong { color: #0f172a; }

.nsm-best-hour {
    font-size: 13px;
    color: #475569;
    background: #f1f5f9;
    border-left: 3px solid #0ea5e9;
    padding: 8px 10px;
    border-radius: 4px;
    margin-top: 14px;
}
.nsm-best-hour strong { color: #0c4a6e; }

.nsm-chart {
    width: 100%;
    height: 180px;
    display: block;
    overflow: visible;
}

.nsm-chart-wrap {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
}
.nsm-chart-title {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 8px 0;
    font-family: "Source Serif Pro", Georgia, serif;
}

.nsm-chart path.nsm-chart-line {
    fill: none;
    stroke: #0ea5e9;
    stroke-width: 2;
}
.nsm-chart path.nsm-chart-area {
    fill: rgba(14, 165, 233, 0.12);
    stroke: none;
}
.nsm-chart circle.nsm-chart-now {
    fill: #0f172a;
    stroke: #ffffff;
    stroke-width: 2;
}
.nsm-chart line.nsm-chart-grid {
    stroke: #e2e8f0;
    stroke-width: 1;
}
.nsm-chart text.nsm-chart-axis {
    fill: #94a3b8;
    font-size: 11px;
    font-family: system-ui, sans-serif;
}

.nsm-factors {
    margin-top: 18px;
}
.nsm-factors-title {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #0f172a;
}

.nsm-factor {
    display: grid;
    grid-template-columns: 110px 60px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}
.nsm-factor:last-child { border-bottom: 0; }

.nsm-factor-name {
    font-weight: 600;
    color: #0f172a;
}
.nsm-factor-value {
    font-variant-numeric: tabular-nums;
    color: #334155;
    font-size: 13px;
    font-family: system-ui, sans-serif;
}
.nsm-factor-bar {
    background: #e2e8f0;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}
.nsm-factor-bar-fill {
    background: #0ea5e9;
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}
.nsm-factor-confidence {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    white-space: nowrap;
    font-family: system-ui, sans-serif;
}
.nsm-factor-confidence.is-strong   { background: #dcfce7; color: #166534; }
.nsm-factor-confidence.is-moderate { background: #fef9c3; color: #854d0e; }
.nsm-factor-confidence.is-folk     { background: #f1f5f9; color: #475569; }

.nsm-factor-explain {
    grid-column: 1 / -1;
    font-size: 12px;
    color: #64748b;
    padding: 0 0 0 0;
    margin-top: 4px;
    font-style: italic;
}

@media (max-width: 600px) {
    .nsm-factor {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        row-gap: 6px;
    }
    .nsm-factor-bar { grid-column: 1 / 3; }
    .nsm-factor-value { grid-column: 1 / 2; }
}

.nsm-footer {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
    font-family: system-ui, sans-serif;
}
.nsm-footer a { color: #0369a1; }
.nsm-footer .nsm-safety {
    color: #b45309;
    display: block;
    margin-bottom: 6px;
}
.nsm-footer .nsm-safety strong { color: #78350f; }

.nsm-error {
    text-align: center;
    padding: 30px 20px;
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
}

/* Score colour scale cue on the big number */
.nsm-score-number.is-excellent { color: #15803d; }
.nsm-score-number.is-good      { color: #0369a1; }
.nsm-score-number.is-fair      { color: #b45309; }
.nsm-score-number.is-poor      { color: #b91c1c; }

.nsm-degraded {
    margin-bottom: 12px;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 4px;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
    font-family: system-ui, sans-serif;
}
