/* ===================================================
   CATB.IN — Project Detail Page Styles v2
   Light-only · Liquid Glass · WCAG AA
   =================================================== */

/* ─── Page Layout ────────────────────────────────── */
.project-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 36px;
  align-items: start;
  padding-top: 80px;
}
.project-main   { min-width: 0; }
.project-sidebar { position: sticky; top: 80px; }

/* ─── Project Hero ───────────────────────────────── */
.project-hero {
  padding: 44px 0 36px;
  border-bottom: 2px solid var(--glass-border);
  margin-bottom: 36px;
}
.project-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 18px;
}
.project-hero h1 { margin-bottom: 14px; max-width: 720px; }
.project-hero .lead {
  font-size: 1.1rem;
  color: var(--text-500);
  max-width: 660px;
  line-height: 1.75;
  margin-bottom: 22px;
}
.project-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  padding: 18px 0;
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
  margin: 22px 0;
}
.stat-item { display: flex; flex-direction: column; gap: 2px; }
.stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-300);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.stat-value { font-size: 0.9375rem; font-weight: 700; color: var(--text-900); }

/* ─── Category Color Strip ───────────────────────── */
.category-strip {
  height: 4px;
  border-radius: 2px;
  margin-bottom: 28px;
  width: 56px;
}

/* ─── Section Headers ─────────────────────────────────────────
   Premium liquid glass badge icons with soft ambient glow.
   Each .section-icon is a frosted pill — emoji inside.
   The h2 gets a clean, modern look with no generic weight.
─────────────────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1.5px solid var(--bg-inset);
  position: relative;
}

/* Gradient underline accent */
.section-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 52px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 100%);
  opacity: 0.7;
}

/* ── Liquid glass icon badge ─── */
.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 1.25rem;
  line-height: 1;

  /* Liquid glass surface */
  background:
    linear-gradient(145deg,
      rgba(255,255,255,0.95) 0%,
      rgba(240,240,248,0.80) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);

  /* Specular bevel: top bright edge, bottom subtle shadow */
  border: 1px solid rgba(255,255,255,0.80);
  box-shadow:
    0 1px 0 rgba(255,255,255,1.0) inset,       /* top specular */
    0 -1px 0 rgba(0,0,0,0.04) inset,            /* bottom edge */
    0 3px 10px rgba(0,0,0,0.09),                /* drop shadow */
    0 0 0 1px rgba(0,0,0,0.06);                 /* outline */

  /* Hover: lift + glow */
  transition:
    transform 0.28s cubic-bezier(0.34,1.56,0.64,1),
    box-shadow 0.24s ease,
    background  0.20s ease;

  will-change: transform;
}

.section-header:hover .section-icon {
  transform: translateY(-2px) scale(1.05);
  box-shadow:
    0 1px 0 rgba(255,255,255,1.0) inset,
    0 -1px 0 rgba(0,0,0,0.06) inset,
    0 6px 20px rgba(0,102,204,0.15),
    0 2px 6px rgba(0,0,0,0.10),
    0 0 0 1px rgba(0,0,0,0.06);
  background:
    linear-gradient(145deg,
      rgba(255,255,255,1.0) 0%,
      rgba(235,240,255,0.90) 100%);
}

/* Subtle liquid motion on reveal — pairs with .rv in ui.js */
.section-header.in .section-icon {
  animation: iconPop 0.42s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes iconPop {
  0%  { transform: scale(0.70) rotate(-8deg); opacity: 0; }
  60% { transform: scale(1.08) rotate(2deg);  opacity: 1; }
  100%{ transform: scale(1.00) rotate(0deg);  opacity: 1; }
}

.section-header h2 {
  font-size: 1.38rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-900);
  margin: 0;
  line-height: 1.2;
}

.content-section { margin-bottom: 52px; }


/* ─── Components Table ───────────────────────────── */
.component-item {
  display: grid;
  grid-template-columns: auto 1fr 90px;
  gap: 14px;
  align-items: start;
  padding: 13px 0;
  border-bottom: 1px solid var(--glass-border);
}
.component-item:last-child { border-bottom: none; }
.component-num {
  width: 26px; height: 26px;
  background: var(--bg-inset);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-300);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.component-name    { font-weight: 600; color: var(--text-900); margin-bottom: 2px; font-size: 0.9375rem; }
.component-purpose { color: var(--text-500); font-size: 0.875rem; }
.component-qty     { font-size: 0.8rem; font-weight: 600; color: var(--text-500); text-align: right; }

/* ─── Step-by-Step ───────────────────────────────── */
.steps-list { counter-reset: steps; }

.step-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 18px;
  margin-bottom: 28px;
  align-items: start;
}
.step-num-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.step-num {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.975rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0,102,204,0.28);
}
.step-connector {
  width: 2px;
  flex: 1;
  background: linear-gradient(to bottom, rgba(0,102,204,0.28), transparent);
  min-height: 22px;
  margin-top: 4px;
}
.step-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-900);
  margin-bottom: 8px;
  line-height: 1.4;
}
.step-body { color: var(--text-500); line-height: 1.8; font-size: 0.9375rem; }
.step-body ul { margin-top: 8px; }
.step-body li { color: var(--text-500); }

/* ─── Applications Grid ──────────────────────────── */
.applications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.application-item {
  background: var(--bg-subtle);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: 13px 15px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-700);
  display: flex;
  align-items: center;
  gap: 9px;
  transition: border-color var(--fast), box-shadow var(--fast);
}
.application-item:hover { border-color: rgba(0,0,0,0.13); box-shadow: var(--shadow-xs); }
.app-icon { font-size: 1.2rem; flex-shrink: 0; }

/* ─── Related Projects ───────────────────────────── */
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 14px;
}
.related-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 1.15rem;
  text-decoration: none;
  display: block;
  box-shadow: var(--shadow-xs);
  transition:
    transform  var(--base) var(--spring),
    box-shadow var(--base) var(--ease),
    border-color var(--fast);
}
.related-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(0,0,0,0.13);
  text-decoration: none;
}
.related-cat {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 7px;
  display: block;
}
.related-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-900);
  line-height: 1.4;
  margin-bottom: 7px;
}
.related-desc {
  font-size: 0.8125rem;
  color: var(--text-500);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Sidebar ────────────────────────────────────── */
.sidebar-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 1.4rem;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.sidebar-card h4 {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-300);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

/* TOC */
.toc-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.toc-list a {
  font-size: 0.875rem;
  color: var(--text-500);
  padding: 6px 10px;
  border-radius: var(--r-sm);
  display: block;
  border-left: 2px solid transparent;
  text-decoration: none;
  transition: all var(--fast);
}
.toc-list a:hover  { color: var(--accent); background: var(--accent-light); }
.toc-list a.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-light); }

/* Spec items */
.spec-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 9px 0;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.875rem;
  gap: 10px;
}
.spec-item:last-child { border-bottom: none; }
.spec-key { color: var(--text-300); font-weight: 500; flex-shrink: 0; }
.spec-val { color: var(--text-900); font-weight: 600; text-align: right; }

/* ─── Responsive ─────────────────────────────────────────────
   Project detail page — mobile first
   Google PageSpeed: no horizontal overflow, tap targets ≥48px
────────────────────────────────────────────────────────────── */

/* Tablet ≤1024px: single column, sidebar below */
@media (max-width: 1024px) {
  .project-layout {
    grid-template-columns: 1fr;
    padding-top: 72px;
  }
  .project-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Small tablet / large phone ≤768px */
@media (max-width: 768px) {
  .project-layout { padding-top: 68px; gap: 20px; }
  .project-hero { padding: 28px 0 24px; }
  .project-hero h1 { font-size: clamp(1.4rem, 5.5vw, 1.9rem); }
  .project-stats-row { gap: 18px; padding: 14px 0; }
  .project-sidebar {
    grid-template-columns: 1fr; /* stack on phone */
  }
  /* TOC: horizontal scroll pill row on mobile */
  .toc-list {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .toc-list::-webkit-scrollbar { display: none; }
  .toc-list a {
    white-space: nowrap;
    padding: 7px 14px;
    border-radius: 999px;
    border-left: none;
    border: 1px solid var(--glass-border);
    background: var(--bg-card);
    font-size: 0.8rem;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }
  .toc-list a.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
  }
  /* Breadcrumb truncate */
  .breadcrumb {
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  /* Tags wrap */
  .tags-row { gap: 6px; }
  /* Section icons smaller */
  .section-icon { width: 34px; height: 34px; font-size: 1.05rem; border-radius: 10px; }
  /* Table: scroll horizontally */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 420px; }
}

/* Mobile ≤600px */
@media (max-width: 600px) {
  .related-grid { grid-template-columns: 1fr; }
  .project-stats-row { gap: 14px; }
  .component-item { grid-template-columns: auto 1fr; }
  .component-qty { display: none; }

  /* Steps: tighter layout */
  .step-item { grid-template-columns: 40px 1fr; gap: 14px; }
  .step-num  { width: 40px; height: 40px; font-size: 0.875rem; }

  /* Code block: full-width scroll */
  .code-block pre {
    font-size: 0.78rem;
    padding: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* FAQ: larger tap target */
  .faq-item summary,
  .faq-question {
    padding: 14px 0;
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  /* Applications grid: 1 col */
  .applications-grid { grid-template-columns: 1fr; }

  /* Playground card */
  .playground-zone { padding: 20px 16px; }
}

/* Tiny phones ≤380px */
@media (max-width: 380px) {
  .project-hero h1 { font-size: 1.35rem; }
  .step-item { gap: 10px; }
  .step-num  { width: 34px; height: 34px; font-size: 0.8rem; }
  .badge { font-size: 0.7rem; padding: 3px 8px; }
}

