/* MBTI Cognitive Functions Page Styles */

.tl-mbti-cognitive-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

.tl-mbti-page-header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.tl-mbti-page-header h1 {
  font-size: clamp(2rem, 5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.tl-mbti-page-sub {
  display: block;
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
  font-weight: 400;
  color: var(--color-primary);
  margin-top: 0.25rem;
}

.tl-mbti-page-lead {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--color-muted);
  max-width: 700px;
  margin: 0 auto;
}

.tl-mbti-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-muted);
  margin-bottom: 1.5rem;
  justify-content: center;
}

.tl-mbti-breadcrumb a {
  color: var(--color-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.tl-mbti-breadcrumb a:hover {
  color: var(--color-primary);
}

.tl-mbti-breadcrumb span[aria-hidden="true"] {
  color: var(--color-border);
}

.tl-mbti-section {
  margin-bottom: 3rem;
}

.tl-mbti-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-primary);
  display: inline-block;
}

.tl-mbti-table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
  border-radius: 12px;
  border: 1px solid var(--color-border);
}

.tl-mbti-function-table,
.tl-mbti-stack-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.tl-mbti-function-table th,
.tl-mbti-function-table td,
.tl-mbti-stack-table th,
.tl-mbti-stack-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.tl-mbti-function-table th,
.tl-mbti-stack-table th {
  background: var(--color-surface);
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}

.tl-mbti-function-table tr:last-child td,
.tl-mbti-stack-table tr:last-child td {
  border-bottom: none;
}

.tl-mbti-function-table tr:hover td,
.tl-mbti-stack-table tr:hover td {
  background: var(--color-surface-hover);
}

.tl-mbti-func-code {
  font-family: monospace;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-primary);
}

.tl-mbti-func-name {
  font-weight: 500;
  color: var(--color-text);
}

.tl-mbti-stack-type {
  font-weight: 600;
}

.tl-mbti-stack-type a {
  color: var(--color-primary);
  text-decoration: none;
}

.tl-mbti-stack-type a:hover {
  text-decoration: underline;
}

.tl-mbti-stack-func {
  display: inline-block;
  font-family: monospace;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.tl-mbti-stack-func.dominant {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.tl-mbti-stack-func.auxiliary {
  background: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
}

.tl-mbti-stack-func.tertiary {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.tl-mbti-stack-func.inferior {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

/* Function Detail Cards */
.tl-mbti-func-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.tl-mbti-func-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.tl-mbti-func-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.tl-mbti-func-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
  color: white;
}

.tl-mbti-func-card-header .tl-mbti-func-code {
  display: inline-block;
  font-family: monospace;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.625rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.tl-mbti-func-card-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.tl-mbti-func-meta {
  font-size: 0.8125rem;
  opacity: 0.9;
}

.tl-mbti-func-card-body {
  padding: 1.5rem;
}

.tl-mbti-func-card-body > p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.tl-mbti-func-examples h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.tl-mbti-func-examples ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tl-mbti-func-examples li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--color-muted);
}

.tl-mbti-func-examples li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 0.375rem;
  height: 0.375rem;
  background: var(--color-primary);
  border-radius: 50%;
}

.tl-mbti-nav-back {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  justify-content: center;
}

.tl-mbti-nav-back a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s;
}

.tl-mbti-nav-back a:hover {
  opacity: 0.7;
  text-decoration: underline;
}

/* Mobile */
@media (max-width: 640px) {
  .tl-mbti-cognitive-page {
    padding: 0 1rem 2rem;
  }

  .tl-mbti-func-card-grid {
    grid-template-columns: 1fr;
  }

  .tl-mbti-table-wrap {
    margin: 0.5rem -1rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}