/* ============================================================
   components-v2.css
   -----------------
   V2 additions and post-launch overrides: progress dashboard,
   architecture diagram, migration map, journey, phase cards,
   status pills, permissions matrix, ticker, plus the readability-
   fixes overlay layer.

   MUST load LAST so its overrides win the cascade.
   ============================================================ */
/* ============================================================
   V2 ADDITIONS — Progress Dashboard, Architecture, Migration
   ============================================================ */

/* --- Progress Ring --- */
.progress-ring { display: inline-block; position: relative; }
.progress-ring__circle { transition: stroke-dashoffset 1.5s var(--ease-out); transform: rotate(-90deg); transform-origin: 50% 50%; }
.progress-ring__text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-family: var(--font-heading); font-weight: 700; font-size: 1.5rem; }
.section--dark .progress-ring__text { color: var(--gold); }

/* --- Status Badges --- */
.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; }
.status--done    { background: rgba(46,125,50,0.18);   color: #66BB6A; }
.status--success { background: rgba(46,125,50,0.18);   color: #66BB6A; }
.status--active  { background: rgba(212,168,75,0.18);  color: var(--gold); animation: pulse-gold 2s ease-in-out infinite; }
.status--pending { background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.78); }
.status--skipped { background: rgba(120,144,156,0.18); color: #B0BEC5; }
.status--blocked { background: rgba(239,83,80,0.18);   color: var(--danger-on-dark); }
.status--danger  { background: rgba(239,83,80,0.18);   color: var(--danger-on-dark); }
@media (prefers-reduced-motion: reduce) {
  .status--active { animation: none; box-shadow: none; }
}
@keyframes pulse-gold { 0%, 100% { box-shadow: 0 0 0 0 rgba(212,168,75,0.3); } 50% { box-shadow: 0 0 0 8px rgba(212,168,75,0); } }

/* --- Architecture Diagram --- */
.arch { max-width: 100%; margin: 0 auto; }
.arch__tenant { border: 2px solid rgba(255,255,255,0.1); border-radius: 24px; padding: clamp(24px, 4vw, 48px); position: relative; }
.arch__tenant-label { position: absolute; top: -12px; left: 32px; background: var(--teal-deeper); padding: 0 12px; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.4); }
.arch__hubs { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 3vw, 32px); }
@media (max-width: 1023px) { .arch__hubs { grid-template-columns: 1fr; } }

.arch__hub { border-radius: 16px; padding: clamp(16px, 2vw, 24px); }
.arch__hub--corp { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); }
.arch__hub--brand { background: rgba(212,168,75,0.06); border: 2px solid rgba(212,168,75,0.25); }
.arch__hub-title { font-family: var(--font-heading); font-size: 1rem; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.arch__hub--corp .arch__hub-title { color: rgba(255,255,255,0.7); }
.arch__hub--brand .arch__hub-title { color: var(--gold); }

.arch__sites { display: flex; flex-direction: column; gap: 6px; }
.arch__site { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; font-size: 0.8125rem; transition: background 0.3s ease; }
.arch__site:hover { background: rgba(255,255,255,0.06); }
.arch__site-icon { font-size: 18px; flex-shrink: 0; }
.arch__site-name { color: rgba(255,255,255,0.8); }
.arch__site-type { margin-left: auto; font-size: 0.6875rem; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 0.05em; }

.arch__connector { text-align: center; padding: 16px 0; color: rgba(255,255,255,0.15); font-size: 0.75rem; }
.arch__connector span { display: block; }

/* --- Migration Map --- */
.migration { display: flex; flex-direction: column; gap: 0; }

.migration__row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(8px, 2vw, 24px);
  align-items: center;
  padding: 4px 0;
}
@media (max-width: 1023px) {
  .migration__row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .migration__row:last-child { border-bottom: none; }
}

.migration__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 20px;
}
@media (max-width: 1023px) {
  .migration__arrow { transform: rotate(90deg); }
}

.migration__item { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; font-size: 0.8125rem; transition: all 0.3s ease; }
.migration__item:hover { transform: translateX(4px); }
.migration__item--folder { background: rgba(239,83,80,0.08); border: 1px solid rgba(239,83,80,0.15); color: rgba(255,255,255,0.8); }
.migration__item--site { background: rgba(46,125,50,0.08); border: 1px solid rgba(46,125,50,0.15); color: rgba(255,255,255,0.8); }
.migration__item--corp { background: rgba(0,107,94,0.08); border: 1px solid rgba(0,107,94,0.2); color: rgba(255,255,255,0.8); }
.migration__item .material-symbols-outlined { font-size: 18px; flex-shrink: 0; }
.migration__item-count { margin-left: auto; font-size: 0.6875rem; color: rgba(255,255,255,0.35); }

.migration__header-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(8px, 2vw, 24px);
  margin-bottom: 8px;
}
@media (max-width: 1023px) {
  .migration__header-row { display: none; }
}
.migration__header {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.3);
  padding-left: 14px;
}

/* --- Folder Chaos Visual --- */
.chaos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.chaos__folder { padding: 12px; border-radius: 10px; text-align: center; font-size: 0.75rem; transition: transform 0.3s ease; }
.chaos__folder:hover { transform: scale(1.05); }
.chaos__folder--danger { background: rgba(239,83,80,0.1); border: 1px solid rgba(239,83,80,0.2); color: var(--danger-on-dark); }
.chaos__folder--warn { background: rgba(251,140,0,0.08); border: 1px solid rgba(251,140,0,0.15); color: #FB8C00; }
.chaos__folder--ok { background: rgba(46,125,50,0.08); border: 1px solid rgba(46,125,50,0.15); color: #4CAF50; }
.chaos__folder-icon { font-size: 28px; margin-bottom: 4px; display: block; }
.chaos__folder-perms { font-size: 0.625rem; margin-top: 4px; color: rgba(255,255,255,0.35); }

/* --- User Journey --- */
.journey { display: flex; flex-direction: column; gap: 2px; }
.journey__step { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: 12px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); transition: all 0.3s ease; }
.journey__step:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); }
.journey__step-num { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-heading); font-weight: 700; font-size: 0.875rem; background: rgba(212,168,75,0.15); color: var(--gold); }
.journey__step-content { flex: 1; }
.journey__step-title { font-weight: 600; font-size: 0.9375rem; color: #FFF; margin-bottom: 2px; }
.journey__step-desc { font-size: 0.8125rem; color: rgba(255,255,255,0.5); }
.journey__step-prop { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 0.6875rem; background: rgba(0,107,94,0.15); color: var(--teal-on-dark); margin-top: 4px; }

/* --- Phase Cards --- */
.phase-card { border-radius: 16px; padding: clamp(20px, 3vw, 32px); transition: transform 0.4s var(--ease-out); }
.phase-card:hover { transform: translateY(-4px); }
.phase-card--done    { background: rgba(46,125,50,0.08);   border: 1px solid rgba(46,125,50,0.28); }
.phase-card--active  { background: rgba(212,168,75,0.08);  border: 2px solid rgba(212,168,75,0.35); }
.phase-card--pending { background: rgba(255,255,255,0.02); border: 1px dashed rgba(255,255,255,0.18); }
.phase-card--skipped { background: rgba(120,144,156,0.05); border: 1px dashed rgba(120,144,156,0.32); }
.phase-card__header { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.phase-card__title { font-family: var(--font-heading); font-size: 1.125rem; font-weight: 600; white-space: nowrap; }
.phase-card--done    .phase-card__title { color: #66BB6A; }
.phase-card--active  .phase-card__title { color: var(--gold); }
.phase-card--pending .phase-card__title { color: rgba(255,255,255,0.7); }
.phase-card--skipped .phase-card__title { color: #B0BEC5; }
.phase-card__header .status { align-self: flex-start; }
.phase-card__items { display: flex; flex-direction: column; gap: 6px; }
.phase-card__item { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; color: rgba(255,255,255,0.7); }
.phase-card__item .material-symbols-outlined { font-size: 16px; }

/* --- Permissions Table Visual --- */
.perm-matrix { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.8125rem; }
.perm-matrix th { padding: 10px 12px; text-align: left; font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(255,255,255,0.4); border-bottom: 1px solid rgba(255,255,255,0.08); }
.perm-matrix td { padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); color: rgba(255,255,255,0.7); }
.perm-matrix tr:hover td { background: rgba(255,255,255,0.03); }
.perm-cell--full { color: #4CAF50; }
.perm-cell--edit { color: var(--gold); }
.perm-cell--read { color: var(--teal-on-dark); }
.perm-cell--none { color: rgba(255,255,255,0.15); }

/* --- Section Variant: Danger/Red --- */
.section--danger {
  background: linear-gradient(160deg, #1A0A0A 0%, #2A0F0F 50%, #1A0A0A 100%);
  color: var(--text-inverse);
}
.section--danger h2, .section--danger h3, .section--danger h4 { color: #FFF; }
.section--danger p { color: rgba(255,255,255,0.82); }
.section--danger .label { color: var(--danger-on-dark); }

/* --- Comparison Table --- */
.transform-compare { display: grid; grid-template-columns: 1fr 48px 1fr; gap: 0; align-items: stretch; }
@media (max-width: 1023px) { .transform-compare { grid-template-columns: 1fr; } }
.transform-compare__col { padding: clamp(20px, 3vw, 32px); border-radius: 16px; }
.transform-compare__before { background: rgba(239,83,80,0.06); border: 1px solid rgba(239,83,80,0.15); }
.transform-compare__after { background: rgba(46,125,50,0.06); border: 1px solid rgba(46,125,50,0.15); }
.transform-compare__arrow { display: flex; align-items: center; justify-content: center; color: var(--gold); font-size: 28px; }
@media (max-width: 1023px) { .transform-compare__arrow { padding: 12px 0; } .transform-compare__arrow .material-symbols-outlined { transform: rotate(90deg); } }

/* --- Ticker/Scroll Stats Bar --- */
.ticker { display: flex; justify-content: center; gap: clamp(24px, 4vw, 48px); flex-wrap: wrap; padding: 20px 0; border-top: 1px solid rgba(255,255,255,0.06); border-bottom: 1px solid rgba(255,255,255,0.06); }
.ticker__item { text-align: center; min-width: 100px; padding: 12px; }
.ticker__value { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700; color: var(--gold); white-space: nowrap; }
.ticker__label { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.35); margin-top: 4px; white-space: nowrap; }

/* Stat cards at bottom - ensure no overflow */
.cta-section .stats { gap: clamp(24px, 4vw, 48px); }
.cta-section .stat { min-width: 100px; padding: 16px; }
.cta-section .stat__value { white-space: nowrap; }
.cta-section .stat__label { white-space: nowrap; margin-top: 8px; }

/* --- Responsive Grid: 5 columns for phases --- */
/* Sidebar-aware: viewport > 1407 has content well >= 1120px so 5 cols fit.
   Below that, content well drops to ~990-1120px and 5 cols squeezes content.
   Breakpoints align to canonical 640 / 1023 / 1407 scale (see audit H4). */
.grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1407px) { .grid--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1023px) { .grid--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .grid--5 { grid-template-columns: 1fr; } }

/* --- Corporate Folders Grid --- */
/* Note: .grid--3 base columns + breakpoints are now defined once above
   in the unified base-grid block. Only card-specific child rules remain. */
.grid--3 .card--glass {
  min-width: 0;
  word-wrap: break-word;
}
.grid--3 .card--glass strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Mobile Nav Toggle --- */
.nav__toggle { display: none; background: none; border: none; color: rgba(255,255,255,0.7); cursor: pointer; padding: 8px; }
@media (max-width: 640px) { .nav__toggle { display: block; margin-left: auto; } }

/* ============================================================
   READABILITY FIXES — Added 2025-04-13
   ============================================================ */

/* Fix: Ensure readable text on all backgrounds */
.text-readable { color: var(--text) !important; }
.text-readable-secondary { color: var(--text-secondary) !important; }

.bg-light .card--glass,
.section:not(.section--dark) .card--glass {
  color: var(--text);
}
.bg-light .card--glass h4,
.section:not(.section--dark) .card--glass h4 {
  color: var(--teal);
}

/* Simple table component for better readability */
.simple-table { 
  background: var(--surface-card);
  border-radius: 12px;
  padding: 24px;
  margin: 24px 0;
}
.simple-table h3 {
  color: var(--teal);
  margin-bottom: 16px;
  font-size: 1.25rem;
}
.simple-table table {
  width: 100%;
  border-collapse: collapse;
}
.simple-table th {
  background: var(--teal);
  color: white;
  padding: 12px;
  text-align: left;
  font-weight: 600;
}
.simple-table td {
  padding: 12px;
  border-bottom: 1px solid var(--surface-dim);
  color: var(--text);
}
.simple-table tr:hover td {
  background: var(--surface-dim);
}

/* ============================================================
   Plain-language summary (WCAG 3.1.5 supplementary version)
   ------------------------------------------------------------
   A small, refined disclosure pill that sits at the top of <main>
   on every public page. Opening it reveals a deliberately simple
   (Flesch-Kincaid ~3-4) version of the page content.

   This file is loaded by index.html, operations.html, AND msp.html
   so the styling applies on all three pages.

   Verified color pairs (see tests/accessibility_static_audit.py):
   - rgba(255,255,255,0.92) on var(--teal-deeper) = 12.59:1 (AAA)
   - var(--gold-light)      on var(--teal-deeper) =  9.50:1 (AAA)
   ============================================================ */

.plain-summary {
  background: var(--teal-deeper);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
}

.plain-summary .container {
  padding-top: 14px;
  padding-bottom: 14px;
}

.plain-summary__details {
  font-family: var(--font-body);
}

/* Native <summary> defaults to display:list-item which paints the ▶/▼
   disclosure marker. Switching display kills that, and the explicit
   ::-webkit/::marker rules belt-and-suspenders it across all engines. */
.plain-summary__details > summary.plain-summary__summary {
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(232, 201, 137, 0.28);
  border-radius: 999px;
  color: var(--gold-light);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  gap: 9px;
  letter-spacing: 0.06em;
  list-style: none;
  padding: 6px 14px 6px 12px;
  text-transform: uppercase;
  transition: background 180ms var(--ease-out), border-color 180ms var(--ease-out), color 180ms var(--ease-out);
  user-select: none;
}

.plain-summary__summary::-webkit-details-marker { display: none; }
.plain-summary__summary::marker { content: ''; display: none; }

.plain-summary__summary:hover,
.plain-summary__details[open] > .plain-summary__summary {
  background: rgba(232, 201, 137, 0.12);
  border-color: rgba(232, 201, 137, 0.55);
  color: #FFFFFF;
}

.plain-summary__summary:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 3px;
}

.plain-summary__summary::after {
  content: '\002B'; /* + */
  color: var(--gold-light);
  font-size: 1.05em;
  font-weight: 700;
  line-height: 1;
  margin-left: 2px;
}

.plain-summary__details[open] .plain-summary__summary::after {
  content: '\2212'; /* − */
}

.plain-summary__details[open] .plain-summary__summary::after,
.plain-summary__details[open]:hover .plain-summary__summary::after {
  color: #FFFFFF;
}

.plain-summary__icon {
  color: var(--gold-light);
  font-size: 1.05rem;
  transition: color 180ms var(--ease-out);
}

.plain-summary__summary:hover .plain-summary__icon,
.plain-summary__details[open] .plain-summary__icon {
  color: #FFFFFF;
}

.plain-summary__body {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.98rem;
  line-height: 1.7;
  margin-top: 14px;
  max-width: 720px;
  padding: 18px 22px;
}

.plain-summary__body p {
  margin: 0 0 8px;
}

.plain-summary__body p:last-child {
  margin-bottom: 0;
}
