/* ================================================================
   COMPONENTS SECTION — Card Hover Effect Documentation
   ================================================================ */

.gl-comp-subtitle {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 52px 0 20px;
}

.gl-comp-subtitle:first-of-type {
  margin-top: 0;
}

/* ── Demo hint label ── */
.gl-comp-hint {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gl-comp-hint::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-green);
  animation: comp-pulse 1.8s ease-in-out infinite;
}

@keyframes comp-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* ── Live Demo Cards ── */
.gl-comp-demo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 4px;
}

.gl-comp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 28px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast),
              background var(--t-slow);
  cursor: default;
  position: relative;
  overflow: hidden;
}

.gl-comp-card:hover {
  transform: translateY(-2px);
}

.gl-comp-card--blue {
  background: linear-gradient(145deg, var(--surface) 50%, color-mix(in srgb, var(--c-blue) 7%, transparent) 100%);
  border-color: color-mix(in srgb, var(--c-blue) 18%, transparent);
}
.gl-comp-card--blue:hover {
  border-color: color-mix(in srgb, var(--c-blue) 50%, transparent);
  box-shadow: 0 8px 32px color-mix(in srgb, var(--c-blue) 12%, transparent);
}

.gl-comp-card--purple {
  background: linear-gradient(145deg, var(--surface) 50%, color-mix(in srgb, var(--c-purple) 7%, transparent) 100%);
  border-color: color-mix(in srgb, var(--c-purple) 18%, transparent);
}
.gl-comp-card--purple:hover {
  border-color: color-mix(in srgb, var(--c-purple) 50%, transparent);
  box-shadow: 0 8px 32px color-mix(in srgb, var(--c-purple) 12%, transparent);
}

.gl-comp-card--green {
  background: linear-gradient(145deg, var(--surface) 50%, color-mix(in srgb, var(--c-green) 7%, transparent) 100%);
  border-color: color-mix(in srgb, var(--c-green) 18%, transparent);
}
.gl-comp-card--green:hover {
  border-color: color-mix(in srgb, var(--c-green) 50%, transparent);
  box-shadow: 0 8px 32px color-mix(in srgb, var(--c-green) 12%, transparent);
}

.gl-comp-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.gl-comp-card__icon svg { width: 18px; height: 18px; }

.gl-comp-card__icon--blue   { background: color-mix(in srgb, var(--c-blue) 12%, transparent);   color: var(--c-blue); }
.gl-comp-card__icon--purple { background: color-mix(in srgb, var(--c-purple) 12%, transparent); color: var(--c-purple); }
.gl-comp-card__icon--green  { background: color-mix(in srgb, var(--c-green) 12%, transparent);  color: var(--c-green); }

.gl-comp-card__title {
  font-family: var(--f-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.gl-comp-card__text {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-2);
}

/* ── Anatomy ── */
.gl-comp-anatomy {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 52px;
  align-items: start;
}

.gl-comp-anatomy__card-wrap {
  position: relative;
}

/* Force the hover state so anatomy card always shows the "active" look */
.gl-comp-anatomy__demo.gl-comp-card--green {
  border-color: color-mix(in srgb, var(--c-green) 50%, transparent) !important;
  box-shadow: 0 8px 32px color-mix(in srgb, var(--c-green) 12%, transparent) !important;
  transform: translateY(-2px);
  overflow: visible;
}

/* Numbered callout badges */
.gl-comp-callout {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c-purple);
  color: var(--c-cream);
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--c-black) 35%, transparent);
  line-height: 1;
  pointer-events: none;
}

/* Anatomy legend */
.gl-comp-anatomy__legend {
  list-style: none;
  counter-reset: anatomy-item;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 4px;
}

.gl-comp-anatomy__legend li {
  counter-increment: anatomy-item;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-2);
}

.gl-comp-anatomy__legend li::before {
  content: counter(anatomy-item);
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c-purple);
  color: var(--c-cream);
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.gl-comp-anatomy__legend strong { color: var(--text); }

.gl-comp-anatomy__legend code {
  font-family: var(--f-mono);
  font-size: 11.5px;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: var(--r-xs);
  color: var(--accent-2);
}

/* ── Spec Table ── */
.gl-comp-spec-table-wrap,
.gl-comp-spec-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}

.gl-comp-spec-table,
.gl-comp-spec {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.gl-comp-spec-table thead tr,
.gl-comp-spec thead tr {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.gl-comp-spec-table th,
.gl-comp-spec th {
  font-family: var(--f-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  text-align: left;
  padding: 12px 20px;
}

.gl-comp-spec-table td,
.gl-comp-spec td {
  padding: 13px 20px;
  border-top: 1px solid var(--border-sub);
  color: var(--text-2);
  vertical-align: middle;
}

.gl-comp-spec-table td:first-child,
.gl-comp-spec td:first-child {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.gl-comp-spec-table td code,
.gl-comp-spec td code,
.gl-comp-spec-table th code,
.gl-comp-spec th code {
  font-family: var(--f-mono);
  font-size: 12px;
  background: var(--surface-2);
  padding: 2px 7px;
  border-radius: var(--r-xs);
  color: var(--accent-2);
}

.gl-comp-spec-table tbody tr:hover td,
.gl-comp-spec tbody tr:hover td {
  background: var(--surface);
}

.gl-comp-spec-table td[colspan],
.gl-comp-spec td[colspan] {
  color: var(--text-3);
  font-style: italic;
  font-size: 13px;
}

/* ── Color Variants ── */
.gl-comp-variants {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.gl-comp-variant {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--t-fast), background var(--t-slow);
}

.gl-comp-variant__swatch {
  width: 48px;
  height: 48px;
  border-radius: var(--r-sm);
  border: 2px solid transparent;
}

.gl-comp-variant--blue .gl-comp-variant__swatch {
  background: color-mix(in srgb, var(--c-blue) 18%, transparent);
  border-color: color-mix(in srgb, var(--c-blue) 50%, transparent);
}
.gl-comp-variant--purple .gl-comp-variant__swatch {
  background: color-mix(in srgb, var(--c-purple) 18%, transparent);
  border-color: color-mix(in srgb, var(--c-purple) 50%, transparent);
}
.gl-comp-variant--green .gl-comp-variant__swatch {
  background: color-mix(in srgb, var(--c-green) 18%, transparent);
  border-color: color-mix(in srgb, var(--c-green) 50%, transparent);
}

.gl-comp-variant__name {
  font-family: var(--f-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.gl-comp-variant__hex {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--text-3);
  display: block;
  margin-top: 1px;
}

.gl-comp-variant__use {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
}

/* ── Usage Rules ── */
.gl-comp-rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.gl-comp-rule {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--r-sm);
  font-size: 14px;
  line-height: 1.6;
}

.gl-comp-rule--ok {
  background: var(--rule-ok-bg);
  border: 1px solid var(--rule-ok-border);
  color: var(--rule-ok-text);
}

.gl-comp-rule--no {
  background: var(--rule-no-bg);
  border: 1px solid var(--rule-no-border);
  color: var(--rule-no-text);
}

.gl-comp-rule__icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.gl-comp-rule__icon svg {
  width: 16px;
  height: 16px;
}

.gl-comp-rule code {
  font-family: var(--f-mono);
  font-size: 12px;
  background: color-mix(in srgb, var(--c-cream) 7%, transparent);
  padding: 1px 5px;
  border-radius: var(--r-xs);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .gl-comp-anatomy {
    grid-template-columns: 1fr;
  }
  .gl-comp-anatomy__card-wrap {
    max-width: 300px;
  }
}
