/**
 * Minimal Theme - Canonical Certifications Directory Stylesheet
 * Phase E2 /exam/ Certifications Directory Redesign
 *
 * Scoped strictly to /exam/ (assessment-catalog.php)
 * Professional Certification + Modern Technical Learning.
 */

/* ==========================================================================
   Accessibility Utilities
   ========================================================================== */

.screen-reader-text,
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ==========================================================================
   Base Layout & Shell Contract
   ========================================================================== */

.scp-exam-directory-main {
  /* Inherits margin-top: var(--header-height, 64px) from header-footer.css */
  background-color: #F8FAFC;
  min-height: calc(100vh - 64px);
  width: 100%;
  max-width: 100%;
  padding: 0;
  box-sizing: border-box;
}

.scp-exam-container {
  max-width: 1140px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

/* ==========================================================================
   Compact Directory Intro (Deep Navy #0A192F)
   ========================================================================== */

.scp-exam-intro {
  background-color: #0A192F;
  color: #FFFFFF;
  border-bottom: 1px solid #1E293B;
}

.scp-exam-breadcrumbs {
  font-size: 13px;
  line-height: 1.4;
  color: #94A3B8;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.scp-exam-breadcrumb-link {
  color: #94A3B8;
  text-decoration: none;
  transition: color 0.15s ease;
}

.scp-exam-breadcrumb-link:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

.scp-exam-breadcrumb-sep {
  color: #475569;
  user-select: none;
}

.scp-exam-breadcrumb-current {
  color: #E2E8F0;
  font-weight: 500;
}

.scp-exam-intro-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  color: #FFFFFF;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.scp-exam-intro-copy {
  font-size: 15px;
  line-height: 1.55;
  color: #94A3B8;
  margin: 0 0 16px;
  max-width: 680px;
}

.scp-exam-intro-summary {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 4px;
  padding: 4px 10px;
}

/* ==========================================================================
   Available Certifications Grid Section
   ========================================================================== */

.scp-exam-section {
  padding: 44px 0 56px;
}

.scp-exam-section-header {
  margin-bottom: 24px;
}

.scp-exam-section-title {
  font-size: 20px;
  font-weight: 700;
  color: #0F172A;
  margin: 0;
  letter-spacing: -0.01em;
}

.scp-exam-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
  box-sizing: border-box;
}

/* ==========================================================================
   Certification Card Model
   ========================================================================== */

.scp-cert-card {
  background-color: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  min-width: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.scp-cert-card:hover {
  border-color: #CBD5E1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.scp-cert-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.scp-cert-skill-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  background-color: #F1F5F9;
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

a.scp-cert-skill-badge {
  text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

a.scp-cert-skill-badge:hover {
  background-color: #E2E8F0;
  color: #0F172A;
  text-decoration: underline;
}

a.scp-cert-skill-badge:focus-visible {
  outline: 2px solid #2563EB;
  outline-offset: 2px;
}

.scp-cert-status-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #059669;
  background-color: #ECFDF5;
  padding: 3px 10px;
  border-radius: 4px;
  white-space: nowrap;
}

.scp-cert-card-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.scp-cert-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  color: #0A192F;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.scp-cert-level {
  font-size: 13px;
  font-weight: 500;
  color: #64748B;
  margin-bottom: 20px;
}

.scp-cert-level-label {
  color: #475569;
  font-weight: 600;
}

.scp-cert-specs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background-color: #F8FAFC;
  border: 1px solid #F1F5F9;
  border-radius: 6px;
  margin-bottom: 24px;
  font-size: 13px;
  color: #334155;
  box-sizing: border-box;
}

.scp-cert-spec-item {
  font-weight: 500;
  white-space: nowrap;
}

.scp-cert-spec-sep {
  color: #CBD5E1;
  user-select: none;
}

.scp-cert-action {
  margin-top: auto;
}

.scp-cert-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 18px;
  background-color: #2563EB;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  box-sizing: border-box;
  text-align: center;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.scp-cert-btn:hover {
  background-color: #1D4ED8;
  color: #FFFFFF;
}

.scp-cert-btn:focus-visible {
  outline: 2px solid #2563EB;
  outline-offset: 2px;
}

/* ==========================================================================
   Continuation Section (Curriculum / Practice)
   ========================================================================== */

.scp-exam-continuation {
  background-color: #FFFFFF;
  border-top: 1px solid #E2E8F0;
  padding: 44px 0 52px;
}

.scp-exam-continuation-box {
  background-color: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  box-sizing: border-box;
}

.scp-exam-continuation-text {
  flex: 1 1 340px;
  min-width: 0;
}

.scp-exam-continuation-title {
  font-size: 17px;
  font-weight: 700;
  color: #0F172A;
  margin: 0 0 6px;
}

.scp-exam-continuation-copy {
  font-size: 14px;
  line-height: 1.5;
  color: #64748B;
  margin: 0;
}

.scp-exam-continuation-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.scp-continuation-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  background-color: #0A192F;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  box-sizing: border-box;
  transition: background-color 0.15s ease;
}

.scp-continuation-btn-primary:hover {
  background-color: #1E293B;
  color: #FFFFFF;
}

.scp-continuation-btn-primary:focus-visible {
  outline: 2px solid #0A192F;
  outline-offset: 2px;
}

.scp-continuation-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  background-color: #FFFFFF;
  color: #334155;
  border: 1px solid #CBD5E1;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  box-sizing: border-box;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.scp-continuation-btn-secondary:hover {
  background-color: #F1F5F9;
  border-color: #94A3B8;
  color: #0F172A;
}

.scp-continuation-btn-secondary:focus-visible {
  outline: 2px solid #2563EB;
  outline-offset: 2px;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 960px) {
  .scp-exam-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .scp-exam-intro {
    padding: 0 0 24px;
  }

  .scp-exam-intro-title {
    font-size: 26px;
  }

  .scp-exam-intro-copy {
    font-size: 14px;
    margin-bottom: 12px;
  }

  .scp-exam-section {
    padding: 28px 0 40px;
  }

  .scp-exam-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .scp-cert-card {
    padding: 20px;
  }

  .scp-cert-title {
    font-size: 17px;
  }

  .scp-cert-specs {
    margin-bottom: 20px;
    padding: 10px 12px;
    font-size: 12px;
  }

  /* §36 — Fix: reduce excess vertical whitespace in continuation on mobile */
  .scp-exam-continuation {
    padding: 28px 0 36px;
  }

  .scp-exam-continuation-box {
    padding: 20px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
  }

  /* Reset the 340px flex-basis that inflates the box on column layouts */
  .scp-exam-continuation-text {
    flex: 0 0 auto;
    width: 100%;
  }

  .scp-exam-continuation-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .scp-continuation-btn-primary,
  .scp-continuation-btn-secondary {
    width: 100%;
    text-align: center;
  }
}

/* ==========================================================================
   Phase E2.1 — Catalog Toolbar (Search + Filters)
   ========================================================================== */

/* ── Desktop (≥ 1024px): 4-column grid — Search | Skill | Level | Filter ──── */
.scp-exam-toolbar {
  display: grid;
  grid-template-columns:
    minmax(280px, 1fr)
    minmax(170px, 200px)
    minmax(160px, 190px)
    auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
}

/*
 * Dissolve the selects wrapper so Skill and Level become direct grid items.
 * .scp-exam-toolbar-selects has no visual properties (no border/bg/padding),
 * so display:contents is safe — it participates in no CSS layout itself.
 */
.scp-exam-toolbar-selects {
  display: contents;
}

/* Wrapper divs inside the selects container — fill their grid cell */
.scp-exam-toolbar-select-wrap {
  min-width: 0;
}

/* ── Search input ─────────────────────────────────────────────────────────── */
.scp-exam-toolbar-search-wrap {
  min-width: 0;
}

.scp-exam-toolbar-search {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  font-size: 14px;
  color: #0F172A;
  background-color: #FFFFFF;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
}

.scp-exam-toolbar-search::placeholder {
  color: #94A3B8;
}

.scp-exam-toolbar-search:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* ── Selects ──────────────────────────────────────────────────────────────── */
.scp-exam-toolbar-select {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 36px 0 12px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  font-size: 14px;
  color: #0F172A;
  background-color: #FFFFFF;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  box-sizing: border-box;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.scp-exam-toolbar-select:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* ── Filter button ────────────────────────────────────────────────────────── */
.scp-exam-toolbar-btn {
  height: 44px;
  width: auto;
  padding: 0 20px;
  background-color: #2563EB;
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-sizing: border-box;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.scp-exam-toolbar-btn:hover {
  background-color: #1D4ED8;
}

.scp-exam-toolbar-btn:focus-visible {
  outline: 2px solid #2563EB;
  outline-offset: 2px;
}

/* ==========================================================================
   Phase E2.1 — Results Meta (count + clear link)
   ========================================================================== */

.scp-exam-results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  min-height: 24px;
}

.scp-exam-results-count {
  font-size: 13px;
  color: #64748B;
  margin: 0;
  line-height: 1.4;
}

.scp-exam-clear-filters {
  font-size: 13px;
  font-weight: 500;
  color: #2563EB;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.scp-exam-clear-filters:hover {
  color: #1D4ED8;
  text-decoration: underline;
}

/* ==========================================================================
   Phase E2.1 — Empty State
   ========================================================================== */

.scp-exam-empty-state {
  background-color: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 48px 24px;
  text-align: center;
  box-sizing: border-box;
}

.scp-exam-empty-title {
  font-size: 17px;
  font-weight: 700;
  color: #0F172A;
  margin: 0 0 8px;
}

.scp-exam-empty-copy {
  font-size: 14px;
  color: #64748B;
  margin: 0 0 24px;
}

.scp-exam-empty-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.scp-exam-empty-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  background-color: #2563EB;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  box-sizing: border-box;
  transition: background-color 0.15s ease;
}

.scp-exam-empty-btn-primary:hover {
  background-color: #1D4ED8;
  color: #FFFFFF;
}

.scp-exam-empty-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  background-color: #FFFFFF;
  color: #334155;
  border: 1px solid #CBD5E1;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  box-sizing: border-box;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.scp-exam-empty-btn-secondary:hover {
  background-color: #F1F5F9;
  border-color: #94A3B8;
  color: #0F172A;
}

/* ==========================================================================
   Phase E2.1 — Pagination
   ========================================================================== */

.scp-exam-pagination {
  margin-top: 40px;
  display: flex;
  justify-content: center;
}

.scp-exam-pagination-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.scp-exam-pagination-item {
  display: flex;
  align-items: center;
}

.scp-exam-pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  background-color: #FFFFFF;
  box-sizing: border-box;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.scp-exam-pagination-link:hover {
  background-color: #F1F5F9;
  border-color: #CBD5E1;
  color: #0F172A;
}

.scp-exam-pagination-link:focus-visible {
  outline: 2px solid #2563EB;
  outline-offset: 2px;
}

.scp-exam-pagination-current {
  background-color: #2563EB;
  border-color: #2563EB;
  color: #FFFFFF;
  cursor: default;
}

.scp-exam-pagination-current:hover {
  background-color: #2563EB;
  border-color: #2563EB;
  color: #FFFFFF;
}

.scp-exam-pagination-prev .scp-exam-pagination-link,
.scp-exam-pagination-next .scp-exam-pagination-link {
  padding: 6px 14px;
}

.scp-exam-pagination-ellipsis span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  font-size: 14px;
  color: #94A3B8;
  user-select: none;
}

/* Mobile toolbar and pagination adjustments */
/* ── Tablet: 768–1023px — 2-row layout ───────────────────────────────────── */
/* Row 1: Search (full-width)                                                */
/* Row 2: [ Skill | Level (flex, grows) ] [ Filter (auto col 2) ]           */
@media (max-width: 1023px) {
  .scp-exam-toolbar {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  /* Search spans both columns — occupies row 1 alone */
  .scp-exam-toolbar-search-wrap {
    grid-column: 1 / -1;
  }

  /* Selects wrapper: un-dissolve → flex row with equal-width selects */
  .scp-exam-toolbar-selects {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: stretch;
    grid-column: 1;  /* col 1, row 2 */
  }

  .scp-exam-toolbar-select-wrap {
    flex: 1 1 0;
    min-width: 0;
  }

  /* Button: grid child in col 2, row 2 — auto-placed by grid */
  .scp-exam-toolbar-btn {
    grid-column: 2;
    width: auto;
    align-self: stretch;
  }
}


/* ── Mobile: ≤ 640px — single-column stack, selects in 2-col grid ─────────── */
@media (max-width: 640px) {
  /* Reset tablet's 2-col grid back to single column */
  .scp-exam-toolbar {
    grid-template-columns: 1fr;
  }

  .scp-exam-toolbar-search-wrap {
    grid-column: 1 / -1;
  }

  .scp-exam-toolbar-selects {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: start;
    grid-column: 1 / -1;
  }

  .scp-exam-toolbar-select-wrap {
    flex: unset;
    min-width: 0;
  }

  /* Reset tablet's grid-column: 2 and make button full-width */
  .scp-exam-toolbar-btn {
    grid-column: 1 / -1;
    width: 100%;
    align-self: auto;
  }

  .scp-exam-pagination-list {
    gap: 3px;
  }

  .scp-exam-pagination-link {
    min-width: 34px;
    min-height: 34px;
    font-size: 13px;
    padding: 5px 8px;
  }

  .scp-exam-pagination-prev .scp-exam-pagination-link,
  .scp-exam-pagination-next .scp-exam-pagination-link {
    padding: 5px 12px;
  }
}


/* ── Very small: ≤ 320px — fully single-column ───────────────────────────── */
@media (max-width: 320px) {
  .scp-exam-toolbar-selects {
    grid-template-columns: 1fr;
  }
}

