/* ===================================================================
   zekt-terminology.css
   Spec: 102-zekt-terminology-page
   Knowledge / Reference page theme — cool blue accent.
   =================================================================== */

/* ── Accent override — Zekt green ───────────────────────────────── */
:root {
  --accent:     #00ff88;
  --accent-rgb: 0, 255, 136;
}

/* ── Fix flip-card.flipped: remove scale transform from service-page ─ */
.flip-card.flipped {
  transform: none;
}

.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

/* ── Card grid ───────────────────────────────────────────────────── */
.terminology-cards-section {
  margin-bottom: 72px;
}

.terminology-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  position: relative; /* needed so placeholder dimensions are respected */
}

/* Card min-height (front face) */
.terminology-card {
  height: 220px;
}

/* Placeholder preserves grid slot while card is expanded */
.terminology-card-placeholder {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.06);
}

/* ── Back body: scroll for tall content ─────────────────────────── */
.flip-card-back .back-body {
  max-height: 65vh;
  overflow-y: auto;
}

/* ── Expanding overlay state — smooth 3D flip + simultaneous size expansion ─ */
.flip-card.expanding {
  position: fixed;
  z-index: 100;
  /* Transition position AND size; rotation is handled by .flip-card-inner */
  transition: top 0.55s cubic-bezier(0.4, 0, 0.2, 1),
              left 0.55s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.55s cubic-bezier(0.4, 0, 0.2, 1),
              height 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Match rotation transition duration to size transition */
.flip-card.expanding .flip-card-inner {
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Back body scrolls within the fixed card height */
.flip-card.expanding .flip-card-back .back-body {
  max-height: none;
  overflow-y: auto;
}

/* ── flip-hint: orange to stand out ─────────────────────────────── */
.flip-hint {
  color: rgba(255, 153, 0, 0.65);
}

.flip-card:hover .flip-hint {
  color: #ff9900;
}

/* ── Footer tagline ──────────────────────────────────────────────── */
.footer-tagline {
  color: #ff9900;
  font-weight: 400;
}

/* ── Backdrop ────────────────────────────────────────────────────── */
.terminology-card-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 99;
  animation: backdropIn 0.2s ease forwards;
}

@keyframes backdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Tab bar ─────────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 36px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
  -webkit-overflow-scrolling: touch;
}

.tab-bar::-webkit-scrollbar {
  height: 4px;
}

.tab-bar::-webkit-scrollbar-track {
  background: transparent;
}

.tab-bar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid #2a2a2a;
  background: #111;
  color: #888;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  font-family: inherit;
}

.tab-btn:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
  color: #ccc;
}

.tab-btn.tab-active {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
}

.tab-btn .material-icons {
  font-size: 15px;
}

/* ── Tab placeholder ─────────────────────────────────────────────── */
.tab-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: #555;
  font-size: 0.9rem;
  font-style: italic;
}

/* ── Back-body rich content ──────────────────────────────────────── */
.back-body p {
  margin-bottom: 0.75em;
}

.back-body p:last-child {
  margin-bottom: 0;
}

.back-body ol {
  padding-left: 1.4rem;
  margin-top: 6px;
}

.back-body ol li {
  margin-bottom: 6px;
}

.back-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 0.8rem;
}

.back-body th {
  text-align: left;
  color: var(--accent);
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.2);
  padding: 5px 8px;
  font-weight: 600;
}

.back-body td {
  padding: 5px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #aaa;
  vertical-align: top;
}

.back-body tr:last-child td {
  border-bottom: none;
}

.back-body code {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 1px 5px;
  color: #ccc;
}

.back-body pre {
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  margin: 10px 0;
  font-size: 0.75rem;
  line-height: 1.55;
}

.back-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: #bbb;
}

.back-body blockquote {
  border-left: 3px solid rgba(var(--accent-rgb), 0.4);
  margin: 8px 0;
  padding: 6px 12px;
  color: #999;
  font-size: 0.82rem;
  font-style: italic;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .terminology-grid {
    grid-template-columns: 1fr;
  }

  .tab-bar {
    gap: 6px;
  }

  .tab-btn {
    padding: 7px 12px;
    font-size: 0.78rem;
  }
}
