/**
 * Net Coverage Explorer — /net-coverage/
 *
 * Scoped entirely under .ig-nc so nothing here leaks into the content area
 * and nothing in the content area wins a specificity fight with it.
 *
 * Type floors follow the sitewide legibility standard: body >= 16px,
 * secondary >= 14px, nothing under 13px. No !important.
 *
 * @package InGoal
 */

.ig-nc {
    /* ice + frame */
    --nc-ground: #F6F7FA;
    --nc-panel: #FFFFFF;
    --nc-inset: #FAFBFD;
    --nc-line: #E2E5EC;
    --nc-line-soft: #EFF1F6;

    /* type */
    --nc-ink: var(--ig-navy, #0A1628);
    --nc-body: #2B3242;
    --nc-muted: var(--ig-text-secondary, #4A4A4A);

    /* InGoal navy carries every accent the study used to draw in rust */
    --nc-accent: var(--ig-navy, #0A1628);
    --nc-accent-mid: var(--ig-accent-blue, #31487A);
    --nc-accent-wash: #EDF0F6;

    /* rink */
    --nc-ice: #FFFFFF;
    --nc-ice-line: #D5DAE4;
    --nc-ice-red: rgba(192, 57, 43, 0.22);
    --nc-ice-blue: rgba(42, 92, 170, 0.22);
    --nc-crease: #E7EEF7;
    --nc-ghost: #C3C9D6;
    --nc-shade: rgba(49, 72, 122, 0.10);
    --nc-post: #D42A2A;
    --nc-post-fill: rgba(212, 42, 42, 0.13);

    --nc-display: 'Bebas Neue', 'Oswald', Impact, sans-serif;
    --nc-ui: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --nc-prose: 'Merriweather', Georgia, serif;
    --nc-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --nc-xs: 13px;
    --nc-sm: 14px;
    --nc-cap: 15px;
    --nc-base: 16.5px;
    --nc-lg: 18.5px;
    --nc-xl: 21px;
    --nc-2xl: 26px;
    --nc-3xl: 34px;

    --nc-1: 4px;
    --nc-2: 8px;
    --nc-3: 12px;
    --nc-4: 16px;
    --nc-5: 24px;
    --nc-6: 32px;
    --nc-7: 48px;

    --nc-r-sm: 6px;
    --nc-r-md: 12px;
    --nc-r-lg: 16px;
    --nc-r-pill: 999px;
    --nc-shadow: 0 1px 2px rgba(20, 22, 31, .05), 0 12px 28px rgba(20, 22, 31, .07);

    background: var(--nc-ground);
    color: var(--nc-body);
    font-family: var(--nc-ui);
    font-size: var(--nc-base);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.ig-nc *,
.ig-nc *::before,
.ig-nc *::after { box-sizing: border-box; }

.ig-nc__wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: var(--nc-6) var(--nc-5) var(--nc-7);
}

/* ------------------------------- header ------------------------------- */

.ig-nc__head { margin-bottom: var(--nc-5); }

.ig-nc__eyebrow {
    display: block;
    font-family: var(--nc-ui);
    font-size: var(--nc-xs);
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--nc-accent-mid);
    margin-bottom: var(--nc-2);
}

.ig-nc__title {
    font-family: var(--nc-display);
    font-weight: 400;
    font-size: var(--nc-3xl);
    line-height: 1.02;
    letter-spacing: .012em;
    color: var(--nc-ink);
    margin: 0 0 var(--nc-3);
    text-wrap: balance;
}

@media (min-width: 700px) {
    .ig-nc__title { font-size: 52px; }
}

/* The dek is a disclosure. On a phone the tool is the point and this is
 * introduction a returning visitor does not need, so it collapses to one
 * tappable line instead of being shrunk under the legibility floor. JS opens
 * it on wide screens; without JS it stays closed but still opens on tap. */
.ig-nc__dek {
    margin: 0;
    max-width: 82ch;
}

.ig-nc__dek p {
    margin: 0;
    font-family: var(--nc-prose);
    font-size: var(--nc-base);
    line-height: 1.6;
    color: var(--nc-body);
}

.ig-nc__dek summary {
    display: inline-flex;
    align-items: center;
    gap: var(--nc-2);
    min-height: 44px;
    font-size: var(--nc-sm);
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--nc-accent-mid);
    cursor: pointer;
    list-style: none;
}

.ig-nc__dek summary::-webkit-details-marker { display: none; }

.ig-nc__dek summary::after {
    content: "\25BE";
    font-size: 11px;
    transition: transform .15s ease;
}

.ig-nc__dek[open] summary::after { transform: rotate(180deg); }

.ig-nc__dek[open] summary { margin-bottom: var(--nc-1); }

/* Wide screens read it as the plain paragraph it used to be. */
@media (min-width: 701px) {
    .ig-nc__dek summary { display: none; }
}

/* --------------------------- experimental note --------------------------- */

.ig-nc__flag {
    display: flex;
    gap: var(--nc-4);
    align-items: flex-start;
    background: var(--nc-accent-wash);
    border: 1px solid #D6DCE9;
    border-left: 4px solid var(--nc-accent-mid);
    border-radius: var(--nc-r-md);
    padding: var(--nc-4) var(--nc-5);
    margin: var(--nc-5) 0;
}

.ig-nc__flag-mark {
    flex: 0 0 auto;
    font-size: var(--nc-xl);
    line-height: 1.2;
}

.ig-nc__flag p {
    margin: 0;
    font-size: var(--nc-cap);
    line-height: 1.55;
    color: var(--nc-body);
}

.ig-nc__flag p + p { margin-top: var(--nc-2); }
.ig-nc__flag strong { color: var(--nc-ink); font-weight: 700; }

.ig-nc__flag a {
    color: var(--nc-accent-mid);
    font-weight: 600;
    text-underline-offset: 2px;
}

/* -------------------------------- stage -------------------------------- */

/* DOM order is ice -> view -> controls, which is exactly the order a phone
 * wants: drag the puck, see the result, adjust. Desktop places them
 * explicitly instead, so the rink and its controls stack in column one and
 * the puck's-eye view runs full height beside them. */
.ig-nc__stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--nc-5);
    align-items: start;
}

@media (min-width: 901px) {
    .ig-nc__stage {
        grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr);
    }
    .ig-nc__panel--ice  { grid-column: 1; grid-row: 1; }
    .ig-nc__panel--ctrl { grid-column: 1; grid-row: 2; }
    .ig-nc__panel--view { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
}

.ig-nc__panel {
    background: var(--nc-panel);
    border: 1px solid var(--nc-line);
    border-radius: var(--nc-r-lg);
    padding: var(--nc-5);
    box-shadow: var(--nc-shadow);
    min-width: 0;
}

.ig-nc__panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--nc-3);
    margin-bottom: var(--nc-4);
}

.ig-nc__panel-head h2 {
    font-family: var(--nc-ui);
    font-size: var(--nc-xs);
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--nc-muted);
    margin: 0;
}

.ig-nc__hint {
    font-size: var(--nc-sm);
    color: var(--nc-muted);
}

/* ------------------------------- the rink ------------------------------- */

.ig-nc__rink-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    background: var(--nc-inset);
    border: 1px solid var(--nc-line-soft);
    border-radius: var(--nc-r-md);
    overflow: hidden;
}

#nc-rink {
    display: block;
    width: 100%;
    height: auto;
    touch-action: none;
    cursor: crosshair;
}

.ig-nc text {
    font-family: var(--nc-ui);
    fill: var(--nc-muted);
}

.ig-nc text.ig-nc__post-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.2px;
}

#nc-eyeMsg {
    font-size: 16px;
    font-weight: 500;
    fill: var(--nc-muted);
}

#nc-puck { cursor: grab; }
#nc-puck:active { cursor: grabbing; }
#nc-puck:focus { outline: none; }
#nc-focusRing { opacity: 0; }
#nc-puck:focus-visible #nc-focusRing { opacity: 1; }

/* The ice ad. Painted under the ice, so it fades up to a wash rather than
 * a full-strength logo — and it sits below every marking in the DOM. */
.ig-nc__icead {
    opacity: 0;
    animation: nc-ad-in 1400ms ease-out 350ms forwards;
}

@keyframes nc-ad-in {
    from { opacity: 0; }
    to   { opacity: .46; }
}

@media (prefers-reduced-motion: reduce) {
    .ig-nc__icead { opacity: .46; animation: none; }
}

/* Hollow, and smaller than the puck. Same size and fill as the puck dot
 * made three navy circles on the ice with nothing to say which one you were
 * dragging. */
/* Empty and inert on desktop; the phone rules below give it a home. */
.ig-nc__eye-overlay { display: none; }

.ig-nc__path-mark {
    fill: var(--nc-panel);
    stroke: var(--nc-accent-mid);
    stroke-width: 3.5;
}

.ig-nc text.ig-nc__path-label {
    font-size: 17px;
    font-weight: 700;
    fill: var(--nc-accent-mid);
    text-anchor: middle;
}

/* ------------------------------- controls ------------------------------- */

.ig-nc__controls {
    margin-top: var(--nc-4);
    display: flex;
    flex-direction: column;
    gap: var(--nc-3);
}

.ig-nc__row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--nc-2);
    align-items: center;
}

.ig-nc__row-label {
    font-size: var(--nc-xs);
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--nc-muted);
    flex-basis: 100%;
    margin-bottom: calc(var(--nc-1) * -1);
}

.ig-nc button {
    font-family: var(--nc-ui);
    font-size: var(--nc-sm);
    font-weight: 500;
    color: var(--nc-body);
    background: var(--nc-inset);
    border: 1px solid var(--nc-line);
    border-radius: var(--nc-r-pill);
    padding: 9px 15px;
    min-height: 40px;
    cursor: pointer;
    transition: border-color .12s ease, color .12s ease, background-color .12s ease;
}

.ig-nc button:hover:not(:disabled) {
    border-color: var(--nc-accent-mid);
    color: var(--nc-accent-mid);
}

.ig-nc button:disabled { opacity: .45; cursor: not-allowed; }

.ig-nc button:focus-visible,
.ig-nc input:focus-visible,
.ig-nc select:focus-visible,
.ig-nc a:focus-visible {
    outline: 2px solid var(--nc-accent-mid);
    outline-offset: 2px;
}

.ig-nc__btn--go {
    background: var(--nc-accent);
    border-color: var(--nc-accent);
    color: #FFFFFF;
    font-weight: 600;
    min-width: 108px;
}

.ig-nc__btn--go:hover:not(:disabled) {
    background: var(--nc-accent-mid);
    border-color: var(--nc-accent-mid);
    color: #FFFFFF;
}

.ig-nc__slider {
    display: flex;
    align-items: center;
    gap: var(--nc-3);
    font-size: var(--nc-sm);
    color: var(--nc-muted);
    min-height: 44px;
}

.ig-nc__slider label { white-space: nowrap; }

.ig-nc__slider input[type="range"] {
    flex: 1;
    min-width: 90px;
    accent-color: var(--nc-accent-mid);
    height: 44px;
}

.ig-nc__slider output {
    font-family: var(--nc-mono);
    font-size: var(--nc-sm);
    color: var(--nc-body);
    min-width: 6ch;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* The box itself is 18px; the row carries the tap target so a thumb has
 * something to hit, and the label is inside it. */
.ig-nc__check {
    display: flex;
    align-items: center;
    gap: var(--nc-2);
    font-size: var(--nc-sm);
    color: var(--nc-muted);
    min-height: 44px;
}

.ig-nc__check label {
    flex: 1;
    padding: 11px 0;
    cursor: pointer;
}

.ig-nc__check input {
    accent-color: var(--nc-accent-mid);
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.ig-nc select {
    font-family: var(--nc-ui);
    font-size: var(--nc-sm);
    color: var(--nc-body);
    background: var(--nc-inset);
    border: 1px solid var(--nc-line);
    border-radius: var(--nc-r-pill);
    padding: 9px 12px;
    min-height: 40px;
}

/* [hidden] must beat any display we set on the same element. */
.ig-nc [hidden] { display: none; }

.ig-nc__scrub { flex: 1 1 220px; }

.ig-nc__flag--noscript { margin-top: var(--nc-5); }

.ig-nc__divider {
    border: 0;
    border-top: 1px solid var(--nc-line-soft);
    margin: var(--nc-2) 0 0;
}

/* ------------------------------- readout ------------------------------- */

.ig-nc__readout {
    margin-top: var(--nc-4);
    border-top: 1px solid var(--nc-line);
    padding-top: var(--nc-4);
}

.ig-nc__measures {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--nc-5);
}

.ig-nc__mline {
    display: flex;
    align-items: baseline;
    gap: var(--nc-2);
    flex-wrap: wrap;
}

.ig-nc__bignum {
    font-family: var(--nc-display);
    font-weight: 400;
    font-size: 56px;
    line-height: .9;
    color: var(--nc-accent);
    font-variant-numeric: tabular-nums;
    letter-spacing: .01em;
}

.ig-nc__bigunit {
    font-size: var(--nc-cap);
    color: var(--nc-body);
    font-weight: 500;
}

.ig-nc__mcap {
    margin: var(--nc-2) 0 0;
    font-size: var(--nc-xs);
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--nc-muted);
}

.ig-nc__barwrap {
    margin-top: var(--nc-3);
    height: 7px;
    background: var(--nc-line-soft);
    border-radius: var(--nc-r-pill);
    overflow: hidden;
}

.ig-nc__bar {
    height: 100%;
    background: var(--nc-accent-mid);
    border-radius: var(--nc-r-pill);
    width: 100%;
}

.ig-nc__stats {
    margin-top: var(--nc-4);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: var(--nc-line);
    border: 1px solid var(--nc-line);
    border-radius: var(--nc-r-md);
    overflow: hidden;
}

.ig-nc__stat {
    background: var(--nc-panel);
    padding: var(--nc-3) var(--nc-4);
    min-height: 76px;
}

.ig-nc__stat dt {
    font-size: var(--nc-xs);
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--nc-muted);
    margin: 0 0 var(--nc-1);
}

.ig-nc__stat dd {
    margin: 0;
    font-family: var(--nc-ui);
    font-size: var(--nc-lg);
    font-weight: 600;
    color: var(--nc-ink);
    font-variant-numeric: tabular-nums;
}

.ig-nc .nc-sub {
    font-size: var(--nc-sm);
    color: var(--nc-muted);
    font-weight: 400;
}

.ig-nc__stat--post dt { color: var(--nc-post); }

.ig-nc__note {
    margin-top: var(--nc-4);
    padding-left: var(--nc-4);
    border-left: 3px solid var(--nc-accent-mid);
    font-size: var(--nc-cap);
    line-height: 1.55;
    color: var(--nc-body);
    min-height: 62px;
}

.ig-nc__note strong { color: var(--nc-ink); font-weight: 700; }

/* ------------------------------- explainer ------------------------------- */

.ig-nc__foot {
    margin-top: var(--nc-6);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--nc-5);
}

.ig-nc__foot h3 {
    font-family: var(--nc-ui);
    font-size: var(--nc-xs);
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--nc-accent-mid);
    margin: 0 0 var(--nc-3);
}

.ig-nc__foot p,
.ig-nc__foot li {
    font-size: var(--nc-sm);
    line-height: 1.6;
    color: var(--nc-body);
    margin: 0 0 var(--nc-3);
    max-width: 62ch;
}

.ig-nc__foot ul { margin: 0; padding-left: 1.15em; }
.ig-nc__foot code { font-family: var(--nc-mono); font-size: .94em; color: var(--nc-ink); }
.ig-nc__foot strong { color: var(--nc-ink); font-weight: 700; }

/* Merged: the experimental disclaimer and the "tell us" ask were making the
 * same request in two places, so they are one block at the foot of the page. */
.ig-nc__close {
    margin-top: var(--nc-6);
    background: var(--nc-accent-wash);
    border: 1px solid #D6DCE9;
    border-top: 4px solid var(--nc-accent-mid);
    border-radius: var(--nc-r-lg);
    padding: var(--nc-5);
    text-align: center;
    box-shadow: var(--nc-shadow);
}

.ig-nc__close .ig-nc__flag-mark {
    display: block;
    margin-bottom: var(--nc-2);
}

.ig-nc__close h3 {
    font-family: var(--nc-display);
    font-weight: 400;
    font-size: var(--nc-2xl);
    letter-spacing: .012em;
    color: var(--nc-ink);
    margin: 0 0 var(--nc-2);
}

.ig-nc__close p {
    margin: 0 auto var(--nc-3);
    max-width: 62ch;
    font-size: var(--nc-cap);
    color: var(--nc-body);
}

.ig-nc__close p:last-of-type { margin-bottom: var(--nc-4); }

.ig-nc__cta {
    display: inline-block;
    background: var(--nc-accent);
    color: #FFFFFF;
    font-weight: 600;
    font-size: var(--nc-cap);
    text-decoration: none;
    padding: 13px 26px;
    min-height: 48px;
    border-radius: var(--nc-r-pill);
    transition: background-color .12s ease;
}

.ig-nc__cta:hover { background: var(--nc-accent-mid); color: #FFFFFF; }

/* --------------------------- rotate-me nudge --------------------------- */

.ig-nc__rotate {
    display: none;
    align-items: center;
    gap: var(--nc-2);
    margin: 0 0 var(--nc-3);
    font-size: var(--nc-sm);
    color: var(--nc-muted);
}

/* ------------------------------ responsive ------------------------------ */

/* Phones held upright. Size the two drawings by HEIGHT so the rink and the
 * puck's-eye view are both on screen while you drag — a tool, not an
 * article. Controls scroll below. */
@media (max-width: 700px) and (orientation: portrait) {
    .ig-nc__wrap { padding: var(--nc-5) var(--nc-4) var(--nc-6); }
    .ig-nc__panel { padding: var(--nc-4); }
    .ig-nc__rotate { display: flex; }

    /* Width is the binding constraint on a phone, so let it govern and keep
     * height auto — fixing the height letterboxed the drawing inside its own
     * box. The svh cap is only a guard for short, wide handsets. */
    #nc-rink {
        width: 100%;
        height: auto;
        max-height: 46vh;
        max-height: 46svh;
        margin: 0 auto;
    }

    .ig-nc__bignum { font-size: 46px; }
    .ig-nc__measures { gap: var(--nc-4); }

    /* The eye view moves on top of the rink, so the ice ad and the now
     * drawing-less panel header both come off. */
    .ig-nc__icead { display: none; }
    .ig-nc__panel--view .ig-nc__panel-head { display: none; }
    .ig-nc__panel--view { padding-top: var(--nc-3); }

    .ig-nc__eye-overlay {
        display: block;
        position: absolute;
        top: 3%;
        left: 50%;
        transform: translateX(-50%);
        width: 66%;
        pointer-events: none;      /* drag the ice straight through it */
        background: var(--nc-panel);
        border: 1px solid var(--nc-line);
        border-radius: var(--nc-r-md);
        box-shadow: 0 2px 6px rgba(20, 22, 31, .10), 0 10px 22px rgba(20, 22, 31, .10);
        padding: 4px;
    }

    .ig-nc__eye-overlay #nc-eye {
        width: 100%;
        height: auto;
        max-height: none;
        margin: 0;
        display: block;
    }
}

/* A phone turned sideways is the best view of this: put the rink and the
 * eye back beside each other and give the rink the full height. */
@media (max-width: 900px) and (orientation: landscape) {
    .ig-nc__stage { grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr); }

    #nc-rink {
        width: auto;
        height: 76vh;
        height: 76svh;
        max-width: 100%;
        margin: 0 auto;
    }
}

@media (max-width: 430px) {
    .ig-nc__measures { grid-template-columns: minmax(0, 1fr); }
    .ig-nc__stats { grid-template-columns: minmax(0, 1fr); }
    .ig-nc__flag { flex-direction: column; gap: var(--nc-2); }
}
