/* The home page (Pages/Public/Index.cshtml): a globe across the top with the key of its nets
   along its lower edge, the page's name and whether a net is on, then the list of nets and
   the site's numbers in the width every page has. Written for a phone first: the globe is
   about half the screen, the page scrolls past it with one finger (the map kit asks for two
   to move the map), and everything pressed is 44 pixels. On a wide screen the globe is at
   the left and the lists are at the right (the last block but one). The colours and the
   type are site.css's own; the map in the box is map.css's. */

.home { flex: 1; min-width: 0; }

/* ── The globe ───────────────────────────────────────────────────────────── */
.home-hero { position: relative; }
.home-stage {
    position: relative;
    height: clamp(300px, 50vh, 520px);
    overflow: hidden;
    isolation: isolate;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
}
/* With no net on, the list of nets is what a visitor came for: it begins higher up. */
.home-hero.quiet .home-stage { height: clamp(260px, 40vh, 440px); }

/* The page's name and whether a net is on. Under the globe on a phone, where the globe is
   the width of the screen and nothing should lie over it; over its corner on a wide screen. */
.home-title { width: min(1080px, 100% - 24px); margin: 14px auto 0; }
.home-title h1 { font-size: 24px; line-height: 1.25; }
.home-title .net-state { margin: 4px 0 0; align-items: flex-start; }
.home-title .net-light { margin-top: 7px; }
.home-title .info-btn { align-self: center; }

/* The key: one net to a pill, in the colour its stations are drawn in. A press turns the
   globe to that net's stations. One row along the lower edge, clear of the map's credit,
   that scrolls sideways inside itself when the nets do not fit. */
.home-key {
    position: absolute;
    z-index: 3;
    left: 8px;
    right: 60px;
    bottom: 8px;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    pointer-events: none;
}
.home-key::-webkit-scrollbar { display: none; }
.home-key-item {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: min(78vw, 300px);
    min-height: var(--tap);
    padding: 0 14px 0 12px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: rgba(var(--panel-rgb), 0.9);
    color: var(--text);
    font: 500 14px/1.2 var(--font);
    white-space: nowrap;
    cursor: pointer;
    pointer-events: auto;
}
.home-key-item:hover { border-color: var(--amber-dim); text-decoration: none; }
.home-key-item:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--adm-ring); }
.home-key-item[aria-pressed="true"] { border-color: var(--amber); background: var(--amber-panel); }
.home-key-item.all { padding: 0 14px; color: var(--muted); }
.home-key-item.all[aria-pressed="true"] { color: var(--text); }
.home-key-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.home-key-num { flex: none; color: var(--muted); font-size: 13px; }
.home-key-num b { color: var(--text); font-family: var(--mono); font-weight: 600; }
.home-key-when::before { content: "\00a0\00b7\00a0"; color: var(--muted); }
/* A net that is on says so, in the green of the light beside "On now". */
.home-key-when.on { color: var(--ok); }

/* A net's colour, as a dot: in the key, and on its card in the list. The same five colours
   the map kit draws the stations in (map.js, APRSNETS.map.colors); a test holds them equal. */
.home-dot { flex: none; display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.tone-one { background: #f2b84b; }
.tone-a { background: #c98500; }
.tone-b { background: #3987e5; }
.tone-c { background: #d55181; }
.tone-other { background: #8b95ab; }
/* The same for the light look, where the map's ground is light: the kit's light colours
   (APRSNETS.map.lightColors), held equal by the same test. */
:root[data-theme="light"] .tone-one { background: #b06a00; }
:root[data-theme="light"] .tone-a { background: #a86500; }
:root[data-theme="light"] .tone-b { background: #1c5cab; }
:root[data-theme="light"] .tone-c { background: #c2255c; }
:root[data-theme="light"] .tone-other { background: #5f6b80; }

/* Full screen takes the key along with the globe. */
.home-stage:fullscreen, .home-hero.quiet .home-stage:fullscreen, .home-stage.map-fill, .home-hero.quiet .home-stage.map-fill { height: 100%; border-bottom: 0; }

/* When the map cannot be drawn its box says so in one line, in the width of the page, and the
   key is a plain row of links under that line: the list and the numbers are all still there. */
.home-hero.no-map { display: flex; flex-direction: column; }
.home-hero.no-map .home-title { order: -1; margin-top: 18px; }
.home-hero.no-map .home-stage, .home-hero.quiet.no-map .home-stage {
    width: min(1080px, 100% - 24px);
    height: auto;
    margin: 12px auto 0;
    overflow: visible;
    border-bottom: 0;
    background: none;
}
.home-hero.no-map .map.stage { position: static; border: 1px solid var(--line); border-radius: var(--radius); }
.home-hero.no-map .home-key { position: static; flex-wrap: wrap; margin-top: 10px; overflow: visible; pointer-events: auto; }
.home-hero.no-map .home-key-item.all { display: none; }

/* ── Under the globe ─────────────────────────────────────────────────────── */
.home-section { margin: 0 0 22px; }
.home-section > h2 { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.home-section > h2 .info-btn { margin-left: -2px; }

.net-card .home-dot { margin-right: 8px; }
.net-card.on-now { border-color: rgba(var(--ok-rgb), 0.3); }
/* How many are on a net that is on: the number the card is for. */
.net-card .home-count { margin: 2px 0 0; border-radius: 6px; color: var(--muted); font-size: 14px; line-height: 1.3; }
.net-card .home-count b { display: inline; margin-right: 4px; color: var(--text); font-family: var(--mono); font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.net-card .about { color: var(--text); }

/* The site's three numbers, three across on a phone too. */
.counts.home-numbers { grid-template-columns: repeat(3, 1fr); margin: 0; }
.counts.home-numbers > div { min-width: 0; padding: 10px 12px; }

.home-start h2 { margin-bottom: 6px; }
.home-start p { margin: 0 0 12px; color: var(--muted); }
.home-start p:last-child { margin-bottom: 0; }

/* ── Wider screens ───────────────────────────────────────────────────────── */
@media (min-width: 761px) {
    .home-stage, .home-hero.quiet .home-stage { height: clamp(420px, 62vh, 720px); }
    /* The name lies over the globe's upper left corner, which is sky. A touch on it goes
       through to the globe; only its button takes one. */
    .home-title {
        position: absolute;
        z-index: 3;
        top: 16px;
        left: 18px;
        width: auto;
        max-width: 340px;
        margin: 0;
        padding: 10px 14px 11px;
        border-radius: var(--radius);
        border: 1px solid var(--line);
        background: rgba(var(--panel-rgb), 0.8);
        backdrop-filter: blur(8px);
        pointer-events: none;
    }
    .home-title h1 { font-size: 20px; }
    .home-title .net-state { margin-top: 2px; font-size: 14px; }
    .home-title .net-light { margin-top: 6px; }
    .home-title .info-btn { pointer-events: auto; }
    .home-key { left: 18px; right: 80px; bottom: 14px; flex-wrap: wrap; overflow: visible; }
    .home-body { padding-top: 24px; }
    .counts.home-numbers { max-width: 620px; }

    .home-hero.no-map .home-title { position: static; width: min(1080px, 100% - 36px); max-width: none; margin: 26px auto 0; padding: 0; border: 0; background: none; backdrop-filter: none; pointer-events: auto; }
    .home-hero.no-map .home-title h1 { font-size: 26px; }
    .home-hero.no-map .home-stage, .home-hero.quiet.no-map .home-stage { width: min(1080px, 100% - 36px); }
}

/* ── A wide screen: the globe at the left, the nets at the right ─────────── */
/* Alex, 6 October 2026: "Maybe instead of top and bottom on this watch screen, it should be
   left and right." The window is the page: the globe is as tall as it, the lists scroll in
   a column of their own, one net to a row, and the footer stays in sight. home.js reads the
   same words (SIDE_BY_SIDE) and lets one finger or the wheel move the globe there, because
   there is no page under it to scroll. Not when the map cannot be drawn (home-no-map, which
   home.js sets): the page is one column then, as on any screen. */
@media (min-width: 1101px) and (min-height: 561px) {
    body.home-page:not(.home-no-map) { height: 100vh; height: 100dvh; overflow: hidden; }
    body.home-page:not(.home-no-map) .home { display: grid; grid-template-columns: minmax(0, 1fr) clamp(400px, 32vw, 540px); grid-template-rows: minmax(0, 1fr); min-height: 0; }
    body.home-page:not(.home-no-map) .home-hero { grid-column: 1; grid-row: 1; min-height: 0; }
    body.home-page:not(.home-no-map) .home-stage { height: 100%; border-bottom: 0; border-right: 1px solid var(--line); }
    body.home-page:not(.home-no-map) .home-body { grid-column: 2; grid-row: 1; width: auto; min-height: 0; margin: 0; padding: 20px 18px 28px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
    body.home-page:not(.home-no-map) .home-body .net-list { grid-template-columns: 1fr; }
    body.home-page:not(.home-no-map) .counts.home-numbers { max-width: none; }
}

/* Somebody who asked their device for less motion: a number that changes does not flash. The
   globe does not turn, draws no rings and goes to no station for them; the map kit and
   home.js see to that. */
@media (prefers-reduced-motion: reduce) {
    .net-card .home-count.new { animation: none; }
}
