/* nw-unit-pages.css — shared chrome for the three per-unit pages
   (Work Here / Outages & Power / Specs & Records). See includes/nw_unit_pages.php.
   Colours come from the site tokens in nw-components.css, so dark mode follows. */

/* ---- Header ------------------------------------------------------------ */
.nwu-head {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 55%, #346699 100%);
    color: #fff;
    border-radius: 12px;
    padding: 20px 20px 0;
    margin-bottom: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    text-align: center;
}
.nwu-head-top {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 14px;
}
.nwu-head h1.nwu-name {
    margin: 0;
    font-size: 2em;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #fff !important;
    text-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
.nwu-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.95em;
    font-weight: 700;
    /* White pill, coloured dot: the status colours include a navy that would
       vanish against the header if the pill itself were painted with them. */
    background: #fff;
    color: #1a2a3a;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.nwu-status-dot {
    width: 10px; height: 10px; border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.08);
}
.nwu-status-extra { font-weight: 600; color: #475569; }
.nwu-head a.nwu-tool,
.nwu-head a.nwu-tool:link,
.nwu-head a.nwu-tool:visited { color: rgba(255,255,255,0.65) !important; font-size: 0.95em; }
.nwu-head a.nwu-tool:hover { color: #fff !important; }
.nwu-facts {
    margin: 8px 0 0;
    font-size: 1em;
    color: rgba(255,255,255,0.92);
}
.nwu-sep { margin: 0 8px; opacity: 0.55; }
.nwu-meta {
    margin: 4px 0 0;
    font-size: 0.82em;
    color: rgba(255,255,255,0.78);
}
.nwu-meta .data-freshness { color: inherit; }

/* ---- Tab switch (attached to the bottom edge of the header) ------------- */
.nwu-tabs {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 16px;
}
.nwu-head a.nwu-tab,
.nwu-head a.nwu-tab:link,
.nwu-head a.nwu-tab:visited {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    min-height: 44px;
    box-sizing: border-box;
    border-radius: 10px 10px 0 0;
    font-size: 0.98em;
    font-weight: 700;
    text-decoration: none;
    color: #fff !important;
    background: rgba(255,255,255,0.12);
    transition: background 0.15s;
}
.nwu-head a.nwu-tab:hover { background: rgba(255,255,255,0.24); }
.nwu-head a.nwu-tab.is-active,
.nwu-head a.nwu-tab.is-active:link,
.nwu-head a.nwu-tab.is-active:visited {
    background: var(--bg-light, #f8f9fa);
    color: var(--nuke-blue-dark, #1e3c72) !important;
    cursor: default;
}
html[data-theme="dark"] .nwu-head a.nwu-tab.is-active,
html[data-theme="dark"] .nwu-head a.nwu-tab.is-active:link,
html[data-theme="dark"] .nwu-head a.nwu-tab.is-active:visited {
    background: var(--bg-white, #1b2430);
    color: var(--text-main, #d8dde3) !important;
}

/* ---- Section headings ---------------------------------------------------- */
h2.nwu-section {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 26px 0 12px;
    padding: 0 0 8px;
    font-size: 1.2em;
    font-weight: 800;
    letter-spacing: 0.2px;
    color: var(--text-main, #2c3e50);
    border-bottom: 2px solid var(--border-color, #e1e4e8);
    background: none;
}
h2.nwu-section i { color: var(--nuke-blue, #346699); font-size: 0.95em; }

/* ---- Cross-page teaser --------------------------------------------------- */
.nwu-teasers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin: 0 0 16px;
}
a.nwu-teaser,
a.nwu-teaser:link,
a.nwu-teaser:visited {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--bg-white, #fff);
    border: 1px solid var(--border-color, #e1e4e8);
    border-left: 4px solid var(--nuke-blue, #346699);
    box-shadow: var(--shadow-sm, 0 2px 4px rgba(0,0,0,0.04));
    text-decoration: none;
    color: var(--text-main, #2c3e50) !important;
    transition: box-shadow 0.15s, transform 0.15s;
}
a.nwu-teaser:hover { box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.08)); transform: translateY(-1px); }
.nwu-teaser-icon {
    flex: 0 0 auto;
    width: 40px; height: 40px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--chip-bg, #e8f0fa);
    color: var(--nuke-blue, #346699);
    font-size: 1.05em;
}
.nwu-teaser-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nwu-teaser-body strong { font-size: 1em; }
.nwu-teaser-body span { font-size: 0.86em; color: var(--text-muted, #6b7778); }
.nwu-teaser-cta { flex: 0 0 auto; font-size: 0.86em; font-weight: 700; color: var(--nuke-blue, #346699); white-space: nowrap; }

/* ---- KPI strip: one neutral tile style on every unit page ----------------
   The tiles carry a per-metric accent colour inline (purple B2B, orange CF ...)
   that means nothing, next to red/green quartile labels that do. .nwu-kpis
   keeps colour for meaning only: tiles opt in with .nwu-kpi, and a tile whose
   colour IS the message (live power, the Excellence band) adds .nwu-kpi-keep. */
.nwu-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}
.nwu-kpi-grid > a { min-width: 0; }
.nwu-kpis .nwu-kpi:not(.nwu-kpi-keep) { border-top-color: var(--gray-300, #cbd5e1) !important; }
.nwu-kpis .nwu-kpi .nwu-kpi-num { color: var(--text-main, #2c3e50) !important; }
@media (max-width: 1100px) { .nwu-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px)  { .nwu-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- Calmer canvas -------------------------------------------------------
   The tiled logo watermark shows through every gap between cards and competes
   with the data. Unit pages sit on a flat tint; the masthead keeps the pattern.
   Light theme only: the dark theme already paints a flat surface here. */
html:not([data-theme="dark"]) .wrapper:has(.nwu-head) {
    background-image: none;
    background-color: #eef2f7;
}

/* ---- Work Here: the facility cards flow in two balanced columns ---------- */
.facility-grid.nwu-work { display: block; }
.facility-grid.nwu-work .facility-map-side { columns: 2; column-gap: 24px; }
.facility-grid.nwu-work .facility-map-side > * { break-inside: avoid; }
@media (max-width: 900px) {
    .facility-grid.nwu-work .facility-map-side { columns: 1; }
}

/* ---- Phones --------------------------------------------------------------- */
@media (max-width: 768px) {
    .nwu-head { padding: 16px 12px 0; }
    .nwu-head h1.nwu-name { font-size: 1.55em; }
    .nwu-facts { font-size: 0.9em; }
    .nwu-sep { margin: 0 5px; }
    .nwu-tabs { gap: 3px; margin-top: 14px; }
    .nwu-head a.nwu-tab { flex: 1 1 0; justify-content: center; padding: 10px 6px; font-size: 0.82em; gap: 5px; text-align: center; line-height: 1.2; }
    .nwu-head a.nwu-tab i { display: none; }
    .nwu-canvas { padding: 8px; }
    a.nwu-teaser { padding: 12px; gap: 10px; }
    .nwu-teaser-cta { display: none; }
    /* The section sub-nav stays put instead of following the reader down a long page. */
    nav.nw-t2-nav { position: static !important; }
}
