/* ==========================================================================
   Security architecture & hardening page (/security-architecture).
   Builds on e8.css and vciso.css. The before/after switch is a CSS-only
   checkbox toggle (no JavaScript; the CSP blocks inline styles and scripts).
   ========================================================================== */

/* Before / after --------------------------------------------------------- */
.ar-flip { position: relative; margin-top: 26px; padding: 26px; border-radius: 22px; background: var(--navy); color: var(--white); }
.ar-in { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ar-flip-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 28px; }

.ar-switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.ar-switch-label { font-weight: 700; font-size: 15px; color: var(--slate-300); transition: color .2s ease; }
.ar-switch-label--off { color: var(--white); }
.ar-switch-track { position: relative; width: 64px; height: 34px; border-radius: 999px; background: #c4541a; transition: background .25s ease; }
.ar-switch-knob { position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: var(--white); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .25s ease; }
.ar-in:checked ~ .ar-flip-head .ar-switch-track { background: #1f8a5b; }
.ar-in:checked ~ .ar-flip-head .ar-switch-knob { transform: translateX(30px); }
.ar-in:checked ~ .ar-flip-head .ar-switch-label--off { color: var(--slate-300); }
.ar-in:checked ~ .ar-flip-head .ar-switch-label--on { color: var(--white); }
.ar-in:focus-visible ~ .ar-flip-head .ar-switch-track { outline: 3px solid var(--cream); outline-offset: 3px; }

.ar-meter { display: flex; align-items: center; gap: 12px; flex: 1 1 220px; max-width: 340px; }
.ar-meter-label { font-size: 13px; font-weight: 600; color: var(--slate-300); white-space: nowrap; }
.ar-meter-track { position: relative; flex: 1; height: 12px; border-radius: 6px; background: #16293f; overflow: hidden; }
.ar-meter-fill { position: absolute; inset: 0 auto 0 0; width: 92%; border-radius: 6px; background: linear-gradient(90deg, #f4a03a, #e0452b); transition: width .45s ease, background .45s ease; }
.ar-in:checked ~ .ar-flip-head .ar-meter-fill { width: 22%; background: linear-gradient(90deg, #2bb673, #1f8a5b); }

.ar-rows { list-style: none; padding: 0; margin-top: 22px; display: grid; gap: 8px; }
.ar-rows li { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 12px; align-items: center; padding: 13px 16px; border-radius: 12px; background: #16293f; }
.ar-name { font-weight: 600; font-size: 15px; color: var(--white); }
.ar-state { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; line-height: 1.4; }
.ar-state::before { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--white); }
.ar-state--default { color: #ffd2b8; }
.ar-state--default::before { content: "!"; background: #c4541a; }
.ar-state--hard { display: none; color: #c9f2dc; }
.ar-state--hard::before { content: "\2713"; background: #1f8a5b; }
.ar-in:checked ~ .ar-rows .ar-state--default { display: none; }
.ar-in:checked ~ .ar-rows .ar-state--hard { display: inline-flex; }
.ar-note { margin-top: 16px; font-size: 13px; color: var(--slate-300); }

/* Layer stack ------------------------------------------------------------ */
.ar-stack { list-style: none; padding: 0; margin-top: 28px; display: grid; gap: 8px; }
.ar-stack li { display: grid; grid-template-columns: 170px minmax(0, 1fr); align-items: center; gap: 18px; padding: 14px 18px; border-radius: 14px; background: var(--cream); }
.ar-stack li:nth-child(1) { margin-inline: 0; background: var(--navy); }
.ar-stack li:nth-child(2) { margin-inline: 12px; background: #16314d; }
.ar-stack li:nth-child(3) { margin-inline: 24px; background: var(--blue-900); }
.ar-stack li:nth-child(4) { margin-inline: 36px; background: var(--blue-700); }
.ar-stack li:nth-child(5) { margin-inline: 48px; background: #e6edf5; }
.ar-stack li:nth-child(6) { margin-inline: 60px; background: #f4f6f9; }
.ar-stack li:nth-child(7) { margin-inline: 72px; background: var(--orange); }
.ar-layer { font-weight: 700; font-size: 16px; color: var(--white); }
.ar-stack p { font-size: 14px; line-height: 1.5; color: #d6e4ee; }
.ar-stack li:nth-child(5) .ar-layer, .ar-stack li:nth-child(6) .ar-layer { color: var(--ink); }
.ar-stack li:nth-child(5) p, .ar-stack li:nth-child(6) p { color: var(--blue-900); }
.ar-stack li:nth-child(7) p { color: var(--white); }

.page-arch #vulns > p:last-child { margin-top: 20px; }

/* Responsive -------------------------------------------------------------- */
@media (max-width: 640px) {
    .ar-flip { padding: 20px 14px; border-radius: 16px; }
    .ar-rows li { grid-template-columns: minmax(0, 1fr); gap: 6px; }
    .ar-meter { max-width: none; }
    .ar-stack li { grid-template-columns: minmax(0, 1fr); gap: 4px; margin-inline: 0 !important; }
}
@media (prefers-reduced-motion: reduce) {
    .ar-switch-track, .ar-switch-knob, .ar-meter-fill, .ar-switch-label { transition: none; }
}
