/* MCP integration guides (/docs/mcp). Built on the site tokens in styles.css; every class is prefixed
   "mcpd-" (no "btn-" / "-btn" substrings, which the global button rule in styles.css restyles). */

.mcpd { color: var(--ink); padding-bottom: clamp(3rem, 8vw, 6rem); }
.mcpd-wrap { max-width: 1040px; margin: 0 auto; padding: 0 var(--mobile-pad); }
.mcpd-narrow > * { max-width: 820px; }  /* reading width, left edge aligned with the hero */
.mcpd-hint { font-size: 0.92rem; color: var(--ink-soft); margin: 0.9rem 0 0; padding-left: 0.1rem; }

/* ---------- hero ---------- */
.mcpd-hero { padding: clamp(1.75rem, 5vw, 3.5rem) 0 clamp(1.25rem, 3vw, 2rem); }
.mcpd-hero .breadcrumbs { margin-bottom: 1.1rem; }
.mcpd-kicker {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--teal); background: hsl(183 45% 28% / .08); border: 1px solid hsl(183 45% 28% / .2);
  padding: 0.3rem 0.75rem; border-radius: var(--radius-full); margin-bottom: 1rem;
}
.mcpd-kicker::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.mcpd-title {
  font-family: var(--font-heading); font-weight: 500; font-style: italic;
  font-size: clamp(2.05rem, 5.2vw, 3.35rem); line-height: 1.06; letter-spacing: -0.015em;
  margin: 0 0 0.9rem; color: var(--ink);
}
.mcpd-lead { font-size: clamp(1rem, 1.6vw, 1.12rem); line-height: 1.65; color: var(--ink-soft); max-width: 64ch; margin: 0 0 1.25rem; }
.mcpd-facts { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 0 0 1.5rem; }
.mcpd-facts li {
  font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.02em; color: var(--ink-soft);
  background: var(--paper); border: 1px solid var(--border-subtle); padding: 0.35rem 0.7rem; border-radius: var(--radius-full);
}
.mcpd-facts li strong { color: var(--ink); font-weight: 500; }

.mcpd-actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0.75rem; }
.mcpd-actions .btn { min-height: 48px; }

/* server URL with copy */
.mcpd-url {
  display: inline-flex; align-items: center; gap: 0.25rem; min-height: 48px; max-width: 100%;
  background: var(--bg-input); border: 1px solid var(--border-color); border-radius: var(--radius-md);
  padding: 0.3rem 0.35rem 0.3rem 0.9rem; box-shadow: var(--shadow-sm);
}
.mcpd-url-label { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.mcpd .mcpd-url code { font-family: var(--font-mono); font-size: 0.92rem; color: var(--ink); overflow-wrap: anywhere; padding: 0 0.35rem; background: none; }

/* copy buttons (progressive enhancement: hidden until JS marks the page ready) */
.mcpd-copy {
  display: none; align-items: center; gap: 0.35rem; flex-shrink: 0;
  font-family: var(--font-body); font-size: 0.82rem; font-weight: 700; color: var(--teal);
  background: hsl(183 45% 28% / .08); border: 1px solid hsl(183 45% 28% / .22); border-radius: var(--radius-sm);
  padding: 0 0.8rem; min-height: 38px; min-width: 64px; justify-content: center; cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.mcpd-js .mcpd-copy { display: inline-flex; }
.mcpd-copy:hover { background: var(--teal); color: var(--paper); }
.mcpd-copy[data-copied="true"] { background: var(--accent-emerald); border-color: var(--accent-emerald); color: #fff; }

/* ---------- platform switcher ---------- */
.mcpd-tabs {
  position: relative; display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.9rem 0; margin: 0.25rem 0 0;
  border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle);
}
.mcpd-tabs a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 1rem; border-radius: var(--radius-full);
  font-weight: 700; font-size: 0.9rem; color: var(--ink-soft); text-decoration: none; border: 1px solid transparent;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.mcpd-tabs a:hover { background: var(--paper); border-color: var(--border-subtle); color: var(--ink); }
.mcpd-tabs a[aria-current="page"] { background: var(--teal); color: var(--paper); }

/* ---------- sections ---------- */
.mcpd-section { padding-top: clamp(2.25rem, 5vw, 3.25rem); }
.mcpd-eyebrow { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal); margin: 0 0 0.4rem; }
.mcpd-h2 { font-family: var(--font-heading); font-weight: 500; font-size: clamp(1.55rem, 3vw, 2.05rem); line-height: 1.15; margin: 0 0 0.6rem; color: var(--ink); }
.mcpd-sub { color: var(--ink-soft); line-height: 1.6; margin: 0 0 1.25rem; max-width: 68ch; }
.mcpd-section p, .mcpd-section li { line-height: 1.6; }
/* links inside prose only (a generic ".mcpd a" rule would out-rank the tab and pager colours) */
.mcpd-sub a, .mcpd-card p a, .mcpd-meta a, .mcpd-manual a, .mcpd-notes a, .mcpd-qa p a, .mcpd-step a { color: var(--teal); text-underline-offset: 3px; }
.mcpd .breadcrumbs .breadcrumb-current { color: var(--ink); font-weight: 600; }
.mcpd code { font-family: var(--font-mono); font-size: 0.88em; }
.mcpd :not(pre) > code { background: hsl(183 45% 28% / .07); padding: 0.1em 0.35em; border-radius: var(--radius-xs); overflow-wrap: anywhere; }

/* cards and grids */
.mcpd-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.mcpd-grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.mcpd-extras { margin-top: 1rem; }
.mcpd-card {
  display: flex; flex-direction: column; gap: 0.5rem; padding: 1.25rem 1.3rem; min-height: 100%;
  background: var(--paper); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  color: inherit; text-decoration: none; box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}
a.mcpd-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: hsl(183 45% 28% / .35); }
.mcpd-card h3 { font-size: 1.08rem; font-weight: 800; margin: 0; color: var(--ink); }
.mcpd-card p { margin: 0; color: var(--ink-soft); font-size: 0.94rem; }
.mcpd-card-cta { margin-top: auto; padding-top: 0.5rem; font-weight: 700; font-size: 0.9rem; color: var(--teal); }
.mcpd-mark {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-family: var(--font-heading); font-style: italic; font-size: 1.35rem; color: var(--paper); background: var(--teal);
}
/* platform icons: official app icons on a neutral tile so every brand reads on the sand background */
.mcpd-logo {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
  background: #fff; border: 1px solid var(--border-subtle); box-shadow: var(--shadow-sm);
}
.mcpd-logo img { width: 28px; height: 28px; object-fit: contain; display: block; }
.mcpd-logo-lg { width: 56px; height: 56px; border-radius: 16px; }
.mcpd-logo-lg img { width: 34px; height: 34px; }
.mcpd-logo-tile { background: none; border: 0; box-shadow: var(--shadow-sm); overflow: hidden; }
.mcpd-logo-tile img, .mcpd-logo-lg.mcpd-logo-tile img { width: 100%; height: 100%; }
.mcpd-pair { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
.mcpd-plus { font: 400 1.4rem/1 var(--font-body); color: var(--text-muted); }
.mcpd-tab-icon { width: 18px; height: 18px; object-fit: contain; margin-right: 0.45rem; border-radius: 4px; }
.mcpd-tabs a[aria-current="page"] .mcpd-tab-icon { background: #fff; padding: 1px; }
.mcpd-ext { margin-left: 0.1rem; }

.mcpd-num {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  font-family: var(--font-mono); font-size: 0.9rem; color: var(--teal); background: hsl(183 45% 28% / .1); border: 1px solid hsl(183 45% 28% / .25);
}

/* ---------- steps ---------- */
.mcpd-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; counter-reset: none; }
.mcpd-step {
  display: flex; gap: 0.95rem; align-items: flex-start; padding: 1rem 1.15rem; scroll-margin-top: 96px;
  background: var(--paper); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
}
.mcpd-step p { margin: 0.2rem 0 0; color: var(--ink); }
.mcpd-step:target { border-color: var(--teal); box-shadow: var(--shadow-glow); }
.mcpd-manual { font-size: 0.92rem; color: var(--ink-soft); margin: 0.9rem 0 0; }

/* ---------- code / snippet blocks ---------- */
.mcpd-code { border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-input); overflow: hidden; box-shadow: var(--shadow-sm); }
.mcpd-code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.5rem 0.5rem 0.5rem 1rem; background: var(--muted); border-bottom: 1px solid var(--border-color);
}
.mcpd-code-head span { font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.04em; color: var(--ink-soft); }
.mcpd-code pre {
  margin: 0; padding: 1rem 1.1rem; font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.65;
  white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); background: transparent;
}

/* ---------- prompts ---------- */
.mcpd-prompts { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.mcpd-prompt {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 0.75rem 0.75rem 1.1rem;
  background: var(--paper); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
}
.mcpd-prompt small { display: block; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.mcpd-prompt q { font-weight: 600; color: var(--ink); quotes: "\201C" "\201D"; }

/* ---------- notes ---------- */
.mcpd-notes { list-style: none; padding: 1rem 1.15rem; margin: 0; display: grid; gap: 0.55rem;
  background: hsl(46 91% 66% / .16); border: 1px solid hsl(46 91% 50% / .35); border-radius: var(--radius-md); }
.mcpd-notes li { padding-left: 1.4rem; position: relative; color: var(--ink); font-size: 0.95rem; }
.mcpd-notes li::before { content: "i"; position: absolute; left: 0; top: 0.15em; width: 1rem; height: 1rem; border-radius: 50%;
  display: grid; place-items: center; font: italic 700 0.7rem/1 var(--font-heading); color: var(--paper); background: var(--ink-soft); }

/* ---------- accordions (FAQ, troubleshooting) ---------- */
.mcpd-qa { display: grid; gap: 0.6rem; }
.mcpd-qa details { background: var(--paper); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.mcpd-qa summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.95rem 1.15rem; min-height: 48px; font-weight: 700; color: var(--ink);
}
.mcpd-qa summary::-webkit-details-marker { display: none; }
.mcpd-qa summary::after { content: "+"; font: 400 1.35rem/1 var(--font-body); color: var(--teal); transition: transform var(--transition-fast); }
.mcpd-qa details[open] summary::after { transform: rotate(45deg); }
.mcpd-qa details > p { margin: 0; padding: 0 1.15rem 1.05rem; color: var(--ink-soft); }

/* ---------- tools ---------- */
.mcpd-tool code { font-size: 0.86rem; color: var(--teal); background: none !important; padding: 0 !important; }

/* ---------- prev / next + footer meta ---------- */
.mcpd-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: clamp(2.25rem, 5vw, 3.25rem); }
.mcpd-pager a { display: flex; flex-direction: column; gap: 0.2rem; padding: 1rem 1.15rem; border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); background: var(--paper); text-decoration: none; color: var(--ink); }
.mcpd-pager a:hover { border-color: hsl(183 45% 28% / .35); }
.mcpd-pager small { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.mcpd-pager .mcpd-next { text-align: right; grid-column: 2; }
.mcpd-meta { margin-top: 2rem; font-size: 0.85rem; color: var(--text-muted); }

.mcpd-cta {
  margin-top: clamp(2.5rem, 6vw, 3.5rem); padding: clamp(1.5rem, 4vw, 2.25rem); border-radius: var(--radius-xl);
  background: var(--night); color: var(--paper); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
}
.mcpd-cta h2 { font-family: var(--font-heading); font-style: italic; font-weight: 500; font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0; color: var(--paper); }
.mcpd-cta p { margin: 0.35rem 0 0; color: hsl(40 38% 97% / .75); }

/* focus visibility */
.mcpd a:focus-visible, .mcpd button:focus-visible, .mcpd summary:focus-visible { outline: 3px solid var(--teal-light); outline-offset: 2px; }

/* ---------- mobile ---------- */
@media (max-width: 640px) {
  .mcpd-actions { flex-direction: column; }
  .mcpd-actions .btn, .mcpd-url { width: 100%; }
  .mcpd-url { justify-content: space-between; }
  .mcpd-url-label { display: none; }
  /* one swipeable row instead of wrapping (scrolls inside itself, never the page) */
  .mcpd-tabs { gap: 0.35rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    margin-left: calc(-1 * var(--mobile-pad)); margin-right: calc(-1 * var(--mobile-pad));
    padding-left: var(--mobile-pad); padding-right: var(--mobile-pad); }
  .mcpd-tabs::-webkit-scrollbar { display: none; }
  .mcpd-tabs a { flex: 0 0 auto; padding: 0 0.85rem; font-size: 0.88rem; }
  .mcpd-step { padding: 0.9rem; gap: 0.75rem; }
  .mcpd-prompt { flex-direction: column; align-items: stretch; }
  .mcpd-prompt .mcpd-copy { align-self: flex-end; }
  .mcpd-pager { grid-template-columns: 1fr; }
  .mcpd-pager .mcpd-next { grid-column: 1; }
  .mcpd-cta .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .mcpd-card, .mcpd-copy, .mcpd-tabs a { transition: none; }
  a.mcpd-card:hover { transform: none; }
}
