/* Foolproof Step Card Counter Core Execution */
.ce-custom-post .step-card {
  counter-increment: engineering-step;
  background: var(--step-bg);
  color: var(--step-fg);
  border-radius: 8px;
  padding: 40px;
  margin: 40px 0;
  position: relative;
  overflow: hidden;
}
.ce-custom-post .step-card::before {
  content: counter(engineering-step);
  position: absolute;
  top: -10px;
  right: 20px;
  font-family: var(--ce-font-heading);
  font-size: 9rem;
  color: rgba(255,255,255,0.03);
  line-height: 1;
  pointer-events: none;
}
.step-label {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

/* Kanban Board Layout Rules */
.task-board {
  margin: 40px 0;
}
.task-col-label {
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  border-bottom: 2px solid var(--rule);
  padding-bottom: 8px;
  margin-bottom: 16px;
}
.task-chip {
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 12px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 12px;
}
/* Code Snippet Utility Copy Interface Styles */
.ce-custom-post pre {
    position: relative;
    padding-right: 70px !important; /* Prevents text colliding with button */
}

.ce-copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--ink);
    color: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 4px 10px;
    font-family: var(--ce-font-body);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0.7;
}

.ce-copy-btn:hover {
    opacity: 1;
    background: var(--accent);
    border-color: var(--accent);
}

.ce-copy-btn.is-success {
    background: #2e7d32; /* Safe production green indicator status */
    border-color: #2e7d32;
    color: #ffffff;
    opacity: 1;
}

/* --- Checklists with Rounded Icons --- */
.ce-custom-post .checklist {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.ce-custom-post .checklist li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15.5px;
  color: var(--ink-mid);
}
.ce-custom-post .checklist li::before {
  content: '✓';
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  margin-top: 2px;
}

/* --- Tools Grid Component --- */
.ce-custom-post .tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 28px 0;
}
.ce-custom-post .tool-card {
  background: var(--surface);
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  padding: 20px 22px;
}
.ce-custom-post .tool-card .tool-icon {
  font-size: 24px;
  margin-bottom: 10px;
}

/* --- Engineering Data & Workflow Tables --- */
.ce-custom-post .workflow-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 15px;
}
.ce-custom-post .workflow-table th {
  background: var(--ink);
  color: var(--bg);
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ce-custom-post .workflow-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-mid);
  vertical-align: top;
}
.ce-custom-post .workflow-table tr:nth-child(even) td { background: var(--surface); }
.ce-custom-post .time-col { font-weight: 600; color: var(--accent); white-space: nowrap; }

/* --- Pattern Interrupt Section (Reality Check) --- */
.ce-custom-post .pattern-interrupt {
  background: var(--surface);
  border: 1.5px solid var(--rule);
  border-top: 4px solid var(--ink);
  border-radius: 0 0 8px 8px;
  padding: 36px 40px;
  margin: 40px 0;
}
.ce-custom-post .reality-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ce-custom-post .reality-list li::before {
  content: '✕';
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: #1A1714;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}

/* --- Technical FAQ Accordion Section --- */
.ce-custom-post .faq-section { margin-top: 56px; }
.ce-custom-post .faq-item {
  border-bottom: 1px solid var(--rule);
  padding: 22px 0;
}
.ce-custom-post .faq-item:first-of-type { border-top: 1px solid var(--rule); }
.ce-custom-post .faq-q {
  font-family: var(--ce-font-heading);
  font-size: 1.2rem;
  color: var(--ink);
  margin-bottom: 10px;
  font-weight: 600;
}

/* --- Core Callout Overrides --- */
.ce-content .callout {
  border-left: 3px solid var(--accent) !important;
  background: var(--accent-lt) !important;
  padding: 18px 24px !important;
  border-radius: 0 6px 6px 0 !important;
  margin: 28px 0 !important;
  font-size: 15.5px;
  color: var(--ink);
}
.ce-content .callout p {
  margin: 0;
}
.ce-content .callout strong {
  color: var(--accent);
}

/* --- Kanban Gutenberg Conversions --- */
.task-board {
  background: var(--bg);
  border: 1.5px solid var(--rule);
  border-radius: 6px;
  padding: 20px 24px;
  margin: 20px 0;
}
.task-board-cols {
  display: flex;
  gap: 16px;
  margin-top: 12px;
}
.task-col-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.task-col-label.todo   { color: var(--ink-light); }
.task-col-label.inprog { color: var(--accent); }
.task-col-label.done   { color: #3A8C5C; }

.task-chip {
  background: var(--surface) !important;
  border: 1px solid var(--rule) !important;
  border-radius: 4px !important;
  padding: 7px 10px !important;
  font-size: 13px !important;
  color: var(--ink-mid) !important;
  margin-bottom: 8px !important;
}
.task-chip.active { 
  border-color: var(--accent) !important; 
  color: var(--ink) !important; 
}
.task-chip.done-chip { 
  opacity: 0.55; 
  text-decoration: line-through; 
}

/* --- Step Card Bullet Enhancements --- */
.step-card ul {
  padding-left: 0 !important;
  list-style: none !important;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.step-card ul li {
  padding-left: 20px !important;
  position: relative;
  color: rgba(245,242,236,0.8);
  font-size: 15.5px;
}
.step-card ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
}


/* Table of Contents Box Layout */
.table-of-contents {
    background: #FFFFFF; /* ce-surface */
    border: 1px solid #E2DBD3; /* ce-rule */
    border-left: 4px solid #C8622A; /* ce-accent highlight line */
    padding: 32px;
    margin: 32px 0;
    border-radius: 4px;
}

.table-of-contents h3 {
    margin: 8px 0 16px 0 !important;
    color: #1A1714; /* ce-ink */
}

/* List Configuration */
ul.toc-list {
    list-style-type: none !important;
    padding-left: 0 !important;
    margin: 0 !important;
}

ul.toc-list li {
    margin-bottom: 12px !important;
    font-size: 16px;
}

ul.toc-list li:last-child {
    margin-bottom: 0 !important;
}

/* Link Actions */
ul.toc-list li a {
    color: #4A4540; /* ce-ink-mid */
    text-decoration: none;
    transition: color 0.15s ease-in-out;
    font-weight: 500;
}

ul.toc-list li a:hover {
    color: #C8622A; /* ce-accent */
    text-decoration: underline;
}

/* Workflow Grid Presentation Styles */
.workflow-grid-container {
    width: 100%;
    margin: 32px 0;
    border: 1px solid var(--rule, #E2DBD3);
    border-radius: 6px;
    background: var(--surface, #FFFFFF);
    overflow: hidden;
}

/* Individual Rows */
.workflow-header-row,
.workflow-data-row {
    margin: 0 !important;
    padding: 14px 20px;
    display: flex;
}

/* Bottom Divider Rules */
.workflow-header-row {
    background: rgba(26, 23, 20, 0.02);
    border-bottom: 2px solid var(--rule, #E2DBD3);
}

.workflow-data-row:not(:last-child) {
    border-bottom: 1px solid var(--rule, #E2DBD3);
}

/* Text Padding Normalization */
.workflow-header-row p,
.workflow-data-row p {
    margin: 0 !important;
    font-size: 15px;
    line-height: 1.5;
}

/* Time/Frequency column specific branding color */
.workflow-data-row .time-col p {
    font-weight: 600;
    color: var(--accent, #C8622A);
}

/* Mobile Responsiveness Execution Layout */
@media (max-width: 600px) {
    .workflow-header-row {
        display: none !important; /* Hide column labels on small phones */
    }
    .workflow-data-row {
        flex-direction: column !important;
        gap: 6px;
        padding: 16px;
    }
    .workflow-data-row .wp-block-column {
        flex-basis: 100% !important;
        width: 100% !important;
    }
}