/* ===================================================================
   Network footer — shared by every site in the network.

   This file is identical in all four projects. If you change it,
   copy it to the others so the footers stay the same:
     TypeWhirl        (KeyWise repo)          assets/css/network-footer.css
     NumberKite       (MathFacts repo)        assets/css/network-footer.css
     FlipCardFox      (MyStudyCards repo)     assets/css/network-footer.css
     ClassroomSearch  (ClassroomSearch repo)  assets/css/network-footer.css

   The footer is always a dark band (it does not follow each site's
   light/dark theme), so it looks the same everywhere. Colors are
   --nf-* variables; a site can override them, e.g. for high contrast.
   Load this file before the site's own stylesheet so its overrides win.
=================================================================== */
.network-footer {
    --nf-bg: #263238;
    --nf-text: #FFFFFF;
    --nf-muted: rgba(255, 255, 255, 0.78);
    --nf-rule: rgba(255, 255, 255, 0.24);
    --nf-hover: rgba(255, 255, 255, 0.08);
    --nf-accent: #FFD54F;
    --nf-on-accent: #1A1A1A;
    --nf-pad-bottom: 32px;

    background: var(--nf-bg);
    color: var(--nf-text);
    padding: 40px 16px calc(var(--nf-pad-bottom) + env(safe-area-inset-bottom));
    font-size: 1rem;
    line-height: 1.4;
    letter-spacing: normal;
    text-align: center;
}

.network-footer *,
.network-footer *::before,
.network-footer *::after { box-sizing: border-box; }

.nf-inner {
    max-width: 1040px;
    margin: 0 auto;
}

.nf-label {
    margin: 0 0 20px;
    color: var(--nf-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Row of sites, separated by thin vertical rules. The sites share the row
   equally (never wrapping into a lopsided 3 + 1); tablets get two rows. */
.nf-sites {
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 0;
    list-style: none;
}
.nf-site {
    flex: 1 1 0;
    max-width: 260px;
    margin: 0;
    padding: 0 12px;
    border-left: 1px solid var(--nf-rule);
}
.nf-site:first-child { border-left: 0; }

/* Tablets: two sites per row */
@media (min-width: 600px) and (max-width: 899px) {
    .nf-sites { flex-wrap: wrap; row-gap: 12px; }
    .nf-site { flex: 0 0 50%; max-width: 320px; }
    .nf-site:nth-child(odd) { border-left: 0; }
}

.network-footer .nf-link {
    display: block;
    height: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--nf-text);
    text-decoration: none;
}
.network-footer .nf-link:hover { background: var(--nf-hover); }
.network-footer .nf-link:hover .nf-name { text-decoration: underline; }
.network-footer .nf-link:focus-visible {
    outline: 3px solid var(--nf-accent);
    outline-offset: 2px;
}

/* Each site's app icon, centered above its name */
.nf-logo {
    display: block;
    width: 40px;
    height: 40px;
    margin: 0 auto 8px;
}

.nf-name {
    display: block;
    font-size: 1rem;
    font-weight: 700;
}
.nf-desc {
    display: block;
    margin-top: 4px;
    color: var(--nf-muted);
    font-size: 0.8125rem;
}
.nf-here {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--nf-accent);
    color: var(--nf-on-accent);
    font-size: 0.6875rem;
    font-weight: 700;
    vertical-align: 2px;
}

.nf-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 24px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--nf-rule);
    color: var(--nf-muted);
    font-size: 0.8125rem;
}
.nf-bottom p { margin: 0; }
/* The "by using this site" sentence gets a row of its own */
.nf-bottom .nf-agree { flex-basis: 100%; text-align: center; }
.network-footer .nf-policy { color: var(--nf-text); text-decoration: underline; text-underline-offset: 2px; }
.network-footer .nf-policy:hover { color: var(--nf-accent); }
.network-footer .nf-policy:focus-visible { outline: 3px solid var(--nf-accent); outline-offset: 2px; border-radius: 2px; }

/* Phones: stack the sites, with rules between rows instead of columns */
@media (max-width: 599px) {
    .nf-sites { flex-direction: column; align-items: stretch; }
    .nf-site { flex: none; max-width: none; padding: 6px 0; border-left: 0; border-top: 1px solid var(--nf-rule); }
    .nf-site:first-child { border-top: 0; }
    /* Logo to the left of the name and description */
    .network-footer .nf-link {
        display: grid;
        grid-template-columns: 40px 1fr;
        column-gap: 12px;
        align-items: center;
        text-align: left;
    }
    .nf-logo { grid-row: span 2; margin: 0; }
}

@media print {
    .network-footer { display: none !important; }
}
