/* THE ASSET TYPE / BARRIER MATRIX.
   Used by Problems and solutions and by Barriers and bottlenecks. It lived in
   full inside both pages from 13 Nov to 21 Nov, which meant every fix had to be
   made twice, and the mobile rebuild on 21 Nov was made twice before this file
   existed. One copy now.
   BOTH THIS FILE AND assets/matrix.js MUST STAY IN 'List the pages to copy' in
   the page deploy, or they never reach the server and both pages lose the
   table with nothing reported. */

  .headline { font-size:17px; font-weight:500; border-left:4px solid var(--accent); padding-left:16px; margin:0 0 26px; max-width:48em; }
  .hint { font-size:13px; color:var(--muted); margin:0 0 14px; }
  .key { display:flex; flex-wrap:wrap; gap:6px 18px; font-size:12px; color:var(--muted); margin:14px 0 0; }
  .kbox { display:inline-block; width:12px; height:12px; vertical-align:-2px; margin-right:6px; border:1px solid var(--line); }
  .k1 { background:var(--accent); border-color:var(--accent); }
  .k2 { background:var(--band-soft); }
  .matrix-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; }
  table.matrix { border-collapse:collapse; width:100%; min-width:720px; font-size:13px; }
  table.matrix th, table.matrix td { border:1px solid var(--line); padding:0; vertical-align:middle; }
  table.matrix thead th { background:var(--bg); border:none; border-bottom:1px solid var(--line); padding:0; }
  .colbtn { width:100%; background:none; border:none; border-radius:0; font-family:var(--font); cursor:pointer;
            font-size:11px; font-weight:700; letter-spacing:.8px; text-transform:uppercase; color:var(--muted);
            padding:12px 8px; text-align:center; line-height:1.3; }
  .colbtn:hover { color:var(--ink); background:var(--band-warm); }
  .rowbtn { width:100%; background:none; border:none; border-radius:0; font-family:var(--font); cursor:pointer;
            text-align:left; padding:14px 14px; color:var(--ink); font-size:15px; font-weight:600;
            letter-spacing:normal; text-transform:none; line-height:1.3; }
  .rowbtn span { display:block; font-size:12px; font-weight:400; color:var(--muted); margin-top:2px; }
  .rowbtn:hover { background:var(--band-warm); }
  th.rowhead { width:210px; background:var(--bg); }
  .cellbtn { width:100%; height:100%; min-height:54px; background:none; border:none; border-radius:0;
             cursor:pointer; font-family:var(--font); font-size:12px; color:var(--ink); padding:8px 6px;
             letter-spacing:normal; text-transform:none; line-height:1.25; }
  .cellbtn.p { background:var(--accent); color:#000023; font-weight:700; }
  .cellbtn.s { background:var(--band-soft); }
  .cellbtn.n { cursor:default; }
  .cellbtn:not(.n):hover { outline:2px solid var(--ink); outline-offset:-2px; }
  .on { outline:3px solid var(--ink) !important; outline-offset:-3px; }
  .faded { opacity:.25; }
  .readout { border:1px solid var(--line); border-top:4px solid var(--accent); padding:22px; margin-top:26px; }
  .readout h3 { font-size:21px; text-transform:none; letter-spacing:0; margin:0 0 2px; }
  .readout .r-sub { color:var(--muted); font-size:13px; margin:0 0 14px; }
  .readout > p { margin:0 0 12px; max-width:52em; }
  .r-label { font-size:11px; font-weight:700; letter-spacing:1.2px; text-transform:uppercase; color:var(--muted); margin:18px 0 8px; }
  .r-stat { border-left:3px solid var(--accent); padding-left:14px; }
  .pill { display:inline-block; font-size:12px; border:1px solid var(--line); padding:3px 9px; margin:0 6px 6px 0; }

  tr.drawer > td { padding:0; border:1px solid var(--line); border-top:3px solid var(--accent); background:var(--band-warm); }
  .drawer-inner { padding:22px 20px 24px; }
  .drawer-inner h3 { font-size:21px; text-transform:none; letter-spacing:0; margin:0 0 2px; }
  .drawer-inner > p { margin:0 0 12px; max-width:56em; font-size:14.5px; }
  .drawer-close { float:right; background:none; border:1px solid var(--line); font-family:var(--font);
                  font-size:11px; letter-spacing:1px; text-transform:uppercase; color:var(--muted);
                  padding:4px 10px; cursor:pointer; border-radius:0; margin-left:16px; }
  .drawer-close:hover { color:var(--ink); border-color:var(--ink); }
  .rowbtn.open, .colbtn.open, .cellbtn.open { outline:3px solid var(--ink); outline-offset:-3px; }
  /* The combined mapper results are the real page, embedded. Its own header and
     footer are dropped by its embed mode, and it tells us how tall it is, so the
     frame grows rather than scrolling inside itself. A starting height is set so
     the frame is never a zero-sized box. */
  /* No frame and no white panel: the mapper's own background is the same sand
     as this band, so a white box around it only drew a seam. */
  .mapframe { border:0; background:transparent; overflow:hidden; margin-top:18px; }
  .mapframe iframe { display:block; width:100%; height:900px; border:0; }
  .maplinks { margin-top:18px; display:flex; flex-wrap:wrap; gap:12px; }

  /* THE MATRIX ON A PHONE.
     As a table it was 720px wide in a side-scrolling box: the headings wrapped
     to three lines, most of the grid was off-screen, and the empty cells took
     up as much room as the full ones. Below 760px it stops being a table and
     becomes one card per asset type, listing only the barriers that actually
     apply to it. The cells are still the same buttons, so tapping one still
     opens it. Every cell already carries the barrier's name, which is what
     makes this work without a second set of markup.
     The empty cells are hidden by a class on the <td>, not by :has() on the
     button inside it, so an older phone browser is not relied on. */
  @media (max-width: 760px) {
    .matrix-wrap { overflow-x: visible; }
    table.matrix { display: block; min-width: 0; font-size: 14px; }
    table.matrix thead { display: none; }
    table.matrix tbody { display: block; }
    table.matrix tr { display: block; border: 1px solid var(--line); margin-bottom: 14px; }
    table.matrix th, table.matrix td { display: block; width: auto; border: 0; }
    table.matrix td.c-n { display: none; }
    th.rowhead { width: auto; border-bottom: 1px solid var(--line); }
    .rowbtn { padding: 14px 16px; font-size: 17px; }
    .cellbtn { min-height: 0; text-align: left; padding: 13px 16px 13px 14px;
               font-size: 14px; border-left: 5px solid transparent; }
    .cellbtn.s { border-left-color: var(--band-soft); }
    .cellbtn.p { border-left-color: #c14521; }
    .matrix-wrap + .key { margin-top: 18px; }
    /* A row with nothing in it would otherwise be a bare heading with no
       explanation, which reads as a fault rather than a finding. */
    table.matrix tr::after {
      content: "No binding constraint recorded for this type.";
      display: none; padding: 12px 16px; font-size: 13px; color: var(--muted);
    }
    table.matrix tr.empty::after { display: block; }
  }
  .hint-narrow { display: none; }
  @media (max-width: 760px) {
    .hint-wide { display: none; }
    .hint-narrow { display: block; }
  }
