/* subpage.css — layout and content styles for feature and use-case pages */

/* ─── NAV GROUPS (dropdowns) ─────────────────────────────────────────────── */

.nav-group {
  position: relative;
}

.nav-group-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 6px 16px;
  font-size: 13px;
  font-family: inherit;
  color: var(--slate);
  cursor: pointer;
  line-height: inherit;
  transition: color 0.15s;
}

.nav-group-btn:hover,
.nav-group:focus-within .nav-group-btn { color: var(--ink); }

.nav-group-btn.active { color: var(--deep); border-bottom-color: var(--nous); }

.nav-group-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  border: 1px solid var(--border);
  min-width: 220px;
  z-index: 200;
  padding: 8px 0 4px;
}

.nav-group:hover .nav-group-menu,
.nav-group:focus-within .nav-group-menu {
  display: block;
}

.nav-group-item {
  display: block;
  padding: 9px 16px;
  font-size: 13px;
  color: var(--slate);
  text-decoration: none;
  transition: color 0.1s, background 0.1s;
}

.nav-group-item:hover {
  color: var(--ink);
  background: var(--cloud);
}

/* ─── PAGE WRAPPER ───────────────────────────────────────────────────────── */

.subpage-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ─── SUBPAGE HERO ───────────────────────────────────────────────────────── */

.subpage-hero {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border);
}

.subpage-hero h1 {
  font-family: 'Inter', sans-serif;
  font-size: 44px;
  font-weight: 400;
  line-height: 1.1;
  color: var(--deep);
  margin-bottom: 1.25rem;
  max-width: 720px;
}

.subpage-hero .subpage-lead {
  font-size: 16px;
  line-height: 1.75;
  color: var(--slate);
  max-width: 640px;
  margin: 0;
}

/* ─── CONTENT SECTIONS ───────────────────────────────────────────────────── */

.subpage-article {
  max-width: 740px;
}

.content-section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

.content-section:last-of-type {
  border-bottom: none;
}

.content-section h2 {
  font-family: 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 400;
  color: var(--deep);
  margin-bottom: 2rem;
  line-height: 1.2;
}

.content-section p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--slate);
  margin-bottom: 1.25rem;
}

.content-section p:last-child { margin-bottom: 0; }

.content-section ul {
  margin: 0.75rem 0 1.5rem;
  padding: 0;
  list-style: none;
}

.content-section ul li {
  font-size: 14px;
  color: var(--slate);
  line-height: 1.65;
  margin-bottom: 0.875rem;
  padding-left: 1.5rem;
  position: relative;
}

.content-section ul li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--nous);
  font-size: 13px;
}

.content-section strong { font-weight: 500; color: var(--ink); }

.content-section code {
  font-family: 'DM Mono', 'Courier New', monospace;
  font-size: 12.5px;
  background: var(--cloud);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--ink);
}

/* ─── NUMBERED STEPS ─────────────────────────────────────────────────────── */

.step-block {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 1.25rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}

.step-block:first-child { padding-top: 0; }
.step-block:last-child { border-bottom: none; padding-bottom: 0; }

.step-num {
  font-family: 'Inter', sans-serif;
  font-size: 24px;
  color: var(--nous);
  line-height: 1;
  padding-top: 3px;
}

.step-body h3 {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.step-body p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--slate);
  margin-bottom: 0.875rem;
}

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

.step-body ul {
  margin: 0.75rem 0;
  padding: 0;
  list-style: none;
}

.step-body ul li {
  font-size: 14px;
  color: var(--slate);
  line-height: 1.65;
  margin-bottom: 0.6rem;
  padding-left: 1.5rem;
  position: relative;
}

.step-body ul li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--nous);
  font-size: 13px;
}

.step-body strong { font-weight: 500; color: var(--ink); }

.step-body code {
  font-family: 'DM Mono', 'Courier New', monospace;
  font-size: 12.5px;
  background: var(--cloud);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--ink);
}

/* ─── ARCHITECTURE BOX (MCP page) ────────────────────────────────────────── */

.arch-box {
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin: 1.25rem 0;
  background: var(--cloud);
}

.arch-box p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--slate);
  margin-bottom: 0.75rem;
}

.arch-box p:last-child { margin-bottom: 0; }

/* ─── FAQ ────────────────────────────────────────────────────────────────── */

.faq-section {
  max-width: 740px;
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

.faq-section h2 {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--deep);
  margin-bottom: 2rem;
}

.faq-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.faq-item:last-child { border-bottom: none; }

.faq-q {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.faq-a p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--slate);
  margin: 0;
}

/* ─── CTA BLOCK ──────────────────────────────────────────────────────────── */

.cta-block {
  border-top: 1px solid var(--border);
  padding: 4rem 0 5rem;
  text-align: center;
}

.cta-block .cta-sub {
  font-size: 15px;
  color: var(--slate);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.cta-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

/* ─── RELATED LINKS ──────────────────────────────────────────────────────── */

.related-section {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--slate);
  max-width: 740px;
}

.related-section a {
  color: var(--slate);
  text-decoration: underline;
}

.related-section a:hover { color: var(--ink); }

/* ─── HAMBURGER TOGGLE ───────────────────────────────────────────────────── */

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .subpage-hero h1 { font-size: 32px; }
  .content-section h2 { font-size: 20px; }
  .faq-section h2 { font-size: 18px; }

  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.25rem 1rem;
    gap: 0;
    z-index: 150;
  }

  .nav-links.open { display: flex; }

  .nav-group { position: static; }

  .nav-group-menu {
    position: static;
    border: none;
    min-width: 0;
    padding: 0 0 4px 12px;
    box-shadow: none;
    background: transparent;
  }

  .nav-group:hover .nav-group-menu,
  .nav-group:focus-within .nav-group-menu {
    display: none;
  }

  .nav-group-menu.mobile-open { display: block !important; }

  .nav-group-btn {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: none;
  }

  .nav-group-btn::after {
    content: '›';
    font-size: 16px;
    transition: transform 0.2s;
    display: inline-block;
    margin-left: 4px;
  }

  .nav-group-btn[aria-expanded="true"]::after {
    transform: rotate(90deg);
  }

  .nav-group-item { padding: 7px 0; font-size: 13px; }

  .nav-link { padding: 8px 0; border-bottom: none; display: block; }

  .nav-cta { margin-left: 0; margin-top: 0.75rem; display: block; text-align: center; padding: 10px 20px; }
}

@media (max-width: 480px) {
  .subpage-hero h1 { font-size: 26px; }
  .subpage-wrap { padding: 0 1.25rem; }
  .step-block { grid-template-columns: 28px 1fr; gap: 1rem; }
  .step-num { font-size: 20px; }
  .cta-buttons { flex-direction: column; align-items: stretch; }
  .cta-buttons .btn-p,
  .cta-buttons .btn-s { text-align: center; }
}
