/* Prioritisation matrix, impact × effort (includes/visuals/matrix.php) */
.mx { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "y grid" ". x"; gap: 12px 14px; }

/* axes */
.mx-y { grid-area: y; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.mx-x { grid-area: x; display: flex; align-items: center; gap: 10px; }
.mx-end { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.mx-y-t, .mx-x-t { font-size: 13.5px; font-weight: 600; color: var(--forest); white-space: nowrap; }
.mx-y-t { writing-mode: vertical-rl; transform: rotate(180deg); }
.mx-line { position: relative; flex: 1 1 0; background: #7d8a80; }
.mx-y .mx-line { width: 1.5px; min-height: 12px; }
.mx-x .mx-line { height: 1.5px; min-width: 12px; }
.mx-line--a::after { content: ""; position: absolute; width: 0; height: 0; border: 5px solid transparent; }
.mx-y .mx-line--a::after { top: -4px; left: -4.25px; border-bottom: 8px solid #7d8a80; border-top-width: 0; }
.mx-x .mx-line--a::after { right: -4px; top: -4.25px; border-left: 8px solid #7d8a80; border-right-width: 0; }

/* quadrants */
.mx-grid { grid-area: grid; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mx-q { min-width: 0; display: flex; flex-direction: column; min-height: 200px; padding: 18px 18px 20px; border: 1.5px solid transparent; border-radius: 12px; background: var(--white); }
.mx-q--1 { background: var(--mint); border-color: var(--green-2); }
.mx-q--4 { background: transparent; border: 1.5px dashed #7d8a80; }
.mx-q-pos { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.mx-q-head { display: flex; align-items: center; gap: 10px; margin: 0; }
.mx-rank { position: relative; flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--forest); color: var(--green); font-size: 14px; font-weight: 700; line-height: 1; }
.mx-q--4 .mx-rank { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1.5px #7d8a80; font-size: 17px; }
.mx-q-name { font-family: var(--font-serif); font-size: 22px; line-height: 1.15; color: var(--forest); }
.mx-q-verb { margin: 4px 0 16px 38px; font-size: 13.5px; font-weight: 600; color: var(--green-text); }
.mx-q--4 .mx-q-verb { color: var(--ink-2); }

/* options */
.mx-items { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.mx-b { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 7px 13px 7px 10px; border-radius: 999px; background: var(--paper); color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1.3; }
.mx-b::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--forest); }
.mx-q--1 .mx-b { background: var(--white); box-shadow: 0 6px 14px -10px rgba(12, 43, 21, .5); }
.mx-q--1 .mx-b::before { background: var(--green-2); box-shadow: 0 0 0 2px rgba(111, 226, 79, .25); }
.mx-q--3 .mx-b::before { background: #7d8a80; }
.mx-q--4 .mx-b { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); }
.mx-q--4 .mx-b::before { background: transparent; box-shadow: inset 0 0 0 1.5px #7d8a80; }
.mx-q--4 .mx-b-t { text-decoration: line-through; text-decoration-thickness: 1.5px; text-decoration-color: var(--ink-2); }
.mx-b-tag { flex: none; padding-left: 8px; border-left: 1px solid var(--line); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }

/* shared criteria */
.mx-crit { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 24px; }
.mx-crit .vz-label { margin: 0; }
.mx-crit-l { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }

/* animation: the quadrants appear, then the options fly in from the centre of the matrix and settle in their
   quadrant (1 → 2 → 3 → dropped); the dropped ones are then struck through and the first rank pulses softly */
.js .vz-figure .mx-q { opacity: 0; transform: scale(.97); transition: opacity .5s ease, transform .6s cubic-bezier(.2, .7, .2, 1); }
.js .vz-figure .mx-q--2 { transition-delay: .08s; }
.js .vz-figure .mx-q--3 { transition-delay: .16s; }
.js .vz-figure .mx-q--4 { transition-delay: .24s; }
.js .vz-figure .mx-b { opacity: 0; transition: opacity .4s ease, transform .9s cubic-bezier(.3, 1.35, .5, 1); }
.js .vz-figure .mx-q--1 .mx-b { transform: translate(60px, 56px) scale(.85); }
.js .vz-figure .mx-q--2 .mx-b { transform: translate(-60px, 56px) scale(.85); }
.js .vz-figure .mx-q--3 .mx-b { transform: translate(60px, -56px) scale(.85); }
.js .vz-figure .mx-q--4 .mx-b { transform: translate(-60px, -56px) scale(.85); }
.js .vz-figure .mx-q--1 .mx-i1 { transition-delay: .45s; }
.js .vz-figure .mx-q--1 .mx-i2 { transition-delay: .57s; }
.js .vz-figure .mx-q--1 .mx-i3 { transition-delay: .69s; }
.js .vz-figure .mx-q--2 .mx-i1 { transition-delay: .85s; }
.js .vz-figure .mx-q--2 .mx-i2 { transition-delay: .97s; }
.js .vz-figure .mx-q--3 .mx-i1 { transition-delay: 1.15s; }
.js .vz-figure .mx-q--3 .mx-i2 { transition-delay: 1.27s; }
.js .vz-figure .mx-q--4 .mx-i1 { transition-delay: 1.45s; }
.js .vz-figure .mx-q--4 .mx-i2 { transition-delay: 1.57s; }
.js .vz-figure .mx-q--4 .mx-i3 { transition-delay: 1.69s; }
.js .vz-figure .mx-q--4 .mx-b-t { text-decoration-color: transparent; transition: text-decoration-color .5s ease 2.4s; }
.js .vz-figure .mx-b-tag { opacity: 0; transition: opacity .4s ease 2.5s; }
.js .vz-figure.is-visible .mx-q, .js .vz-figure.is-visible .mx-b { opacity: 1; transform: none; }
.js .vz-figure.is-visible .mx-q--4 .mx-b-t { text-decoration-color: var(--ink-2); }
.js .vz-figure.is-visible .mx-b-tag { opacity: 1; }
.mx-q--1 .mx-rank::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--green-2); opacity: 0; }
.vz-figure.is-visible .mx-q--1 .mx-rank::after { animation: mx-pulse 2.6s ease-out 2.8s infinite; }
@keyframes mx-pulse { 0% { transform: scale(1); opacity: .9; } 70%, 100% { transform: scale(1.9); opacity: 0; } }

/* tablet with the heading beside the matrix: tighter quadrants */
@media (min-width: 1000px) and (max-width: 1200px) {
  .mx-q { padding: 14px 14px 16px; min-height: 200px; }
  .mx-q-name { font-size: 19px; }
  .mx-q-verb { margin-left: 0; }
  .mx-b { font-size: 13.5px; }
  .mx-q--4 .mx-b { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 8px; border-radius: 16px; }
  .mx-q--4 .mx-b-tag { grid-column: 2; padding-left: 0; border-left: 0; font-size: 10.5px; }
}

/* phones: the four quadrants stacked in rank order, each stating its position */
@media (max-width: 640px) {
  .mx { grid-template-columns: minmax(0, 1fr); grid-template-areas: "grid"; }
  .mx-y, .mx-x { display: none; }
  .mx-grid { grid-template-columns: minmax(0, 1fr); }
  .mx-q { min-height: 0; padding: 16px 16px 18px; }
  .mx-q-pos { position: static; width: auto; height: auto; margin: 0 0 10px; overflow: visible; clip: auto; white-space: normal; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
  .mx-q-name { font-size: 20px; }
  .js .vz-figure:not(.is-visible) .mx-q .mx-b { transform: translateY(18px) scale(.95); }
}
