/* ════════════════════════════════════════════════════════════════
   IT Certification Framework — framework.css
   Merged from both inline <style> blocks in the original file.
   ════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&display=swap');

/* ── Design tokens ── */
:root {
  --bg:           #ffffff;
  --surface:      #ffffff;
  --border:       #d8d4cc;
  --border-light: #e8e4dc;
  --text:         #0d2040;
  --text-muted:   #6b6660;

  --col-market:    #0a2a5c;  /* deep navy blue   */
  --col-govern:    #2a1a5c;  /* deep indigo      */
  --col-track:     #005c3a;  /* deep emerald     */
  --col-exam-plan: #4a1a5c;  /* deep violet      */
  --col-sme:       #5c3300;  /* deep amber       */
  --col-exam-dev:  #5c1a1a;  /* deep red         */
  --col-insight:   #004a5c;  /* deep cyan        */
  --col-ext:       #3d5c00;  /* deep olive       */
  --col-int:       #005c52;  /* deep teal        */
  --col-gtm:       #5c1a3a;  /* deep rose        */
  --col-cand-s:    #1a3a5c;  /* deep steel blue  */
  --col-partner:   #5c5000;  /* deep gold        */
  --col-engage:    #c2410c;  /* burnt orange     */

  --tactical-color:  #c0392b;
  --strategic-color: #2c5f8a;

  --cell-radius: 5px;
  --col-gap:     6px;
  --row-gap:     4px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 28px 20px 48px;
}

/* ── Page header ── */
.page-header {
  max-width: 1760px;
  margin: 0 0 24px 0;
}
.page-header h1 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
}
.page-header p {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
  max-width: 680px;
}

/*
 * Outer layout:
 *   col1: left Y-axis (40px)
 *   col2: framework (1fr)
 *   col3: right Y-axis (40px)
 *
 *   row1: top corner labels (auto)
 *   row2: framework (1fr)
 *   row3: bottom corner labels (auto)
 */
.outer {
  max-width: 1760px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  grid-template-rows: auto 1fr auto;
  gap: 0;
  zoom: 1.35;
}

/* Framework occupies centre cell.
   CSS grid with grid-auto-flow:column means each col's 3 children
   (zone-tactical, col-header, zone-strategic) share rows across ALL
   columns — browser aligns headers natively, no JS measurement needed. */
.framework {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-rows: auto auto auto;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  column-gap: var(--col-gap);
}

/* ── Corner axis labels ── */
.corner {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  user-select: none;
  display: flex;
  align-items: center;
  padding: 4px 0;
  writing-mode: vertical-rl;
}

/* Top-right / bottom-left: empty spacers */
.corner.tr { grid-column: 3; grid-row: 1; }
.corner.bl { grid-column: 1; grid-row: 1; }

/* Left axis column — spans all 3 rows, stacks Tactical on top and Strategic on bottom */
.axis-left {
  grid-column: 1;
  grid-row: 1 / 4;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Tactical (red) — top portion, last letter flush with header */
.corner.tl {
  flex: 1;
  color: var(--tactical-color);
  transform: rotate(180deg);
  writing-mode: vertical-rl;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 4px 0;
}

/* Strategic (blue) — bottom portion, same orientation as Tactical */
.corner.br {
  flex: 1;
  color: var(--strategic-color);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 4px 0;
}

.side-left  { grid-column: 1; grid-row: 2; }
.side-right { grid-column: 3; grid-row: 2; }

/* ── Columns ── */
/* Each .col spans all 3 rows of the parent grid and uses subgrid so its
   three children (zone-tactical, col-header, zone-strategic) inherit the
   parent's shared row heights. All headers land on the same row across
   every column. Subgrid: Safari 16+, Chrome 117+, Firefox 71+. */
.col {
  grid-row: 1 / -1;
  display: grid;
  grid-template-rows: subgrid;
  min-width: 0;
}

/* Tactical zone — TOP; cells press down onto header */
.zone-tactical {
  grid-row: 1;       /* explicit row — all tacticals share row 1 */
  align-self: end;   /* zone bottom-aligns within the shared row  */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--row-gap);
  padding-bottom: var(--row-gap);
  min-width: 0;
}

/* Strategic zone — BOTTOM; cells press up from header */
.zone-strategic {
  grid-row: 3;       /* explicit row — all strategics share row 3 */
  align-self: start;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: var(--row-gap);
  padding-top: var(--row-gap);
  min-width: 0;
}

/* Column header */
.col-header {
  grid-row: 2;       /* explicit row — all headers share row 2    */
  padding: 10px 6px;
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.3;
  color: #fff;
  position: relative;
}
.col-header .new-badge {
  position: absolute;
  top: -7px; right: 3px;
  background: #777;
  color: #fff;
  font-size: 8.5px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

/* ── Cells ── */
.cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--cell-radius);
  padding: 5px 6px;
  font-size: 10px;
  line-height: 1.3;
  color: var(--text);
  text-align: center;
  position: relative;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.15s, transform 0.15s;
  cursor: default;
}
.cell:hover {
  box-shadow: 0 3px 14px rgba(0,0,0,0.13);
  transform: translateY(-1px);
  z-index: 20;
  border-color: #999;
}
.cell.empty {
  background: transparent;
  border: 1px dashed var(--border-light);
  opacity: 0.25;
  min-height: 22px;
  pointer-events: none;
}

/* ── Tooltips ── */
.cell[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1814;
  color: #f7f6f3;
  font-size: 11px;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: 6px;
  width: 230px;
  white-space: normal;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.28);
  font-weight: 400;
  text-align: left;
}
.zone-tactical .cell[data-tip]:hover::after {
  top: calc(100% + 6px);
  bottom: auto;
}
.zone-strategic .cell[data-tip]:hover::after {
  bottom: calc(100% + 6px);
  top: auto;
}

/* ── Footer ── */
.footer-section {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  align-items: start;
  font-family: 'DM Sans', sans-serif;
}
.footer-section .f-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 600;
}
.footer-section h4 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 10px;
  letter-spacing: -0.3px;
  line-height: 1.2;
}
.footer-section p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  max-width: 42ch;
}
.footer-section ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
}
.footer-section ul li a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: border-color 0.2s;
}
.footer-section ul li a:hover {
  border-color: var(--text);
}
.footer-section ul li {
  color: var(--text-muted);
}
.footer-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 12px 22px;
  background: var(--text);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.2s, background 0.2s;
}
.footer-cta:hover {
  transform: translateY(-1px);
  background: #000;
}
.footer-cta .arrow {
  display: inline-block;
  transition: transform 0.2s;
}
.footer-cta:hover .arrow { transform: translateX(3px); }

.copyright {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  padding-bottom: 48px;
}

/* ════════════════════════════════════════════════════════════════
   LINK SYSTEM — cell selection states + panel
   ════════════════════════════════════════════════════════════════ */

.cell { cursor: pointer; }

.cell.selected {
  outline: 2.5px solid #0d2040;
  outline-offset: 1px;
  z-index: 30;
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(13,32,64,0.22);
}
.cell.predecessor {
  background: #fff3cd !important;
  border-color: #d4a017 !important;
  outline: 2px solid #d4a017;
  outline-offset: 1px;
  z-index: 25;
}
.cell.successor {
  background: #d1f5e8 !important;
  border-color: #0f6e56 !important;
  outline: 2px solid #0f6e56;
  outline-offset: 1px;
  z-index: 25;
}
.cell.dimmed {
  opacity: 0.22;
  filter: grayscale(0.4);
}

/* ── Link panel ── */
#link-panel {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 290px;
  background: #ffffff;
  border: 1px solid #d8d4cc;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  z-index: 200;
  overflow: hidden;
  display: none;
}
#link-panel.visible { display: block; }
#lp-header {
  background: #0d2040;
  color: #fff;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#lp-title { font-size: 12px; font-weight: 700; line-height: 1.3; max-width: 220px; }
#lp-close {
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: rgba(255,255,255,0.7);
  background: none;
  border: none;
  padding: 0;
  margin-left: 8px;
}
#lp-close:hover { color: #fff; }
.lp-section { padding: 10px 14px; border-bottom: 1px solid #e8e4dc; }
.lp-section:last-child { border-bottom: none; }
.lp-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.lp-label.pred { color: #b08000; }
.lp-label.succ { color: #0f6e56; }
.lp-label.none { color: #999; }
.lp-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 4px;
  cursor: pointer;
  border-radius: 4px;
  padding: 3px 4px;
  transition: background 0.12s;
}
.lp-item:hover { background: #f4f2ee; }
.lp-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
}
.lp-dot.pred { background: #d4a017; }
.lp-dot.succ { background: #0f6e56; }
.lp-item-text { color: #0d2040; line-height: 1.35; }
.lp-hint {
  font-size: 10.5px;
  color: #999;
  padding: 8px 14px;
  line-height: 1.5;
}
#lp-legend {
  display: flex;
  gap: 14px;
  padding: 8px 14px;
  border-bottom: 1px solid #e8e4dc;
  font-size: 10.5px;
  color: #666;
  align-items: center;
}
.leg-item { display: flex; align-items: center; gap: 5px; }
.leg-swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
