/* Shared styles for preview site documentation pages */

/* ── Base ── */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #f8f9ff;
  color: #1a202c;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Header ── */
.header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: white;
  border-bottom: 1px solid #e2e0f0;
  position: sticky;
  top: 0;
  z-index: 200;
}

.header .home-link {
  text-decoration: none;
  color: #3525cd;
  font-weight: 600;
}

/* ── Page layout ── */
.page {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: #f0eef9;
  padding: 1.5rem 0;
  overflow-y: auto;
  border-right: 1px solid #e2e0f0;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: calc(100vh - 57px);
}

.sidebar .home-link-sidebar {
  display: block;
  padding: 0.4rem 1.5rem 0.6rem;
  margin-bottom: 0.75rem;
  color: #3525cd;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  border-left: 3px solid transparent;
  border-bottom: 1px solid #e2e0f0;
}

.sidebar .home-link-sidebar.current {
  border-left-color: #3525cd;
  background: #e8e6f8;
}

.sidebar .group {
  margin-bottom: 1.5rem;
}

.sidebar .group-label {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: #6b63a1;
  font-weight: 600;
  padding: 0 1.5rem;
  margin-bottom: 0.5rem;
}

.sidebar a {
  display: block;
  padding: 0.4rem 1.5rem;
  color: #4a5568;
  text-decoration: none;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
}

.sidebar a:hover {
  background: #e8e6f8;
}

.sidebar a.current {
  color: #3525cd;
  font-weight: 600;
  border-left-color: #3525cd;
  background: #e8e6f8;
}

.sidebar a.action-link {
  margin-top: 0.5rem;
  padding-top: 0.6rem;
  border-top: 1px solid #e2e0f0;
}

/* ── Content area ── */
.content {
  flex: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 3rem;
  overflow-y: auto;
}

.content-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.content-header h1 {
  color: #1a202c;
  font-size: 1.8rem;
  margin: 0;
}

/* ── Copy as Markdown button ── */
.copy-md-btn {
  background: #e8e6f8;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  color: #3525cd;
  cursor: pointer;
  font-size: 0.85rem;
}

.copy-md-btn:hover {
  background: #d5d2ed;
}

/* ── Footer ── */
.footer {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: white;
  border-top: 1px solid #e2e0f0;
  font-size: 0.85rem;
  color: #a0aec0;
}

.footer a {
  color: #3525cd;
  text-decoration: none;
}

/* ── Content typography ── */
.content h2 {
  color: #1a202c;
  font-size: 1.4rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #e2e0f0;
}

.content h3 {
  color: #1a202c;
  font-size: 1.15rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.content p {
  color: #4a5568;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.content ul,
.content ol {
  color: #4a5568;
  line-height: 1.7;
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.content li {
  margin-bottom: 0.3rem;
}

.content a {
  color: #3525cd;
  text-decoration: none;
}

.content a:hover {
  text-decoration: underline;
}

.content code {
  background: #e8e6f8;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

.content pre {
  background: #1e1e2e;
  color: #e0def4;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.content pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  color: inherit;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.content th {
  background: #f0eef9;
  padding: 0.6rem 1rem;
  text-align: left;
  font-size: 0.85rem;
  color: #1a202c;
  border-bottom: 2px solid #e2e0f0;
}

.content td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #e2e0f0;
  font-size: 0.9rem;
  color: #4a5568;
}

/* ── Example callouts ── */
.example-box {
  background: #f0eef9;
  border-left: 3px solid #3525cd;
  border-radius: 0 6px 6px 0;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.example-box strong {
  color: #3525cd;
}

.example-box a {
  color: #3525cd;
}

/* ── Hints ── */
.hint {
  font-size: 0.85rem;
  color: #6b63a1;
  margin-top: -1rem;
  margin-bottom: 1.5rem;
}

/* ── Inline diagrams ── */
.diagram {
  margin: 1.5rem 0;
  text-align: center;
  overflow-x: auto;
}

.diagram svg {
  max-width: 100%;
  height: auto;
}

/* ── Prompt blocks ── */
.prompt-block {
  position: relative;
  margin-bottom: 1.5rem;
}

.prompt-block pre {
  padding-right: 4rem;
}

.prompt-block pre code {
  white-space: pre-wrap;
}

.prompt-block .copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e0def4;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
}

.prompt-block .copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ── Home page ── */
.content.home {
  max-width: 1040px;
}

.home-hero {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin: 0.5rem 0 1.75rem;
}

.home-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b63a1;
  margin-bottom: 0.6rem;
}

.home-hero h1 {
  font-size: 2.3rem;
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 0;
  color: #1a202c;
  text-wrap: balance;
}

.content .home-hero p {
  font-size: 1.05rem;
  max-width: 56ch;
  margin: 0.85rem 0 0;
}

.home-hero .copy-md-btn {
  flex-shrink: 0;
}

.home-panel {
  background: white;
  border: 1px solid #e2e0f0;
  border-radius: 16px;
  padding: 1.25rem 1.5rem 1rem;
  box-shadow: 0 18px 40px -32px rgba(53, 37, 205, 0.45);
}

.home-panel-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b63a1;
}

.home-panel-hint {
  font-size: 0.8rem;
  color: #a0aec0;
  text-align: right;
}

.home-diagram {
  margin: 0.75rem 0 0.25rem;
}

.home-diagram svg {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  width: 100%;
}

.home-diagram .col-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  fill: #a0aec0;
}

.home-diagram .flow {
  fill: none;
  stroke: #a39de0;
  stroke-width: 1.6;
}

.home-diagram .node rect {
  transition: filter 160ms ease;
}

.home-diagram .node:hover rect {
  filter: drop-shadow(0 6px 10px rgba(53, 37, 205, 0.25));
}

.content h2.home-section-title {
  border-bottom: none;
  font-size: 1.25rem;
  margin: 2.25rem 0 1rem;
  padding: 0;
}

.area-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.area-card {
  position: relative;
  background: white;
  border: 1px solid #e2e0f0;
  border-radius: 14px;
  padding: 1.25rem 1.25rem 1.1rem;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.area-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 16px 32px -24px var(--accent);
}

.area-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-bg);
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.area-icon svg {
  width: 22px;
  height: 22px;
}

.content .area-card h3 {
  margin: 0 0 0.3rem;
  font-size: 1.1rem;
}

.content .area-card h3 a {
  color: #1a202c;
}

/* Whole card is clickable via the title link */
.content .area-card h3 a::after {
  content: '';
  position: absolute;
  inset: 0;
}

.content .area-card h3 a:hover {
  text-decoration: none;
}

.content .area-card p {
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0 0 0.9rem;
}

.area-links {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.content .area-links a {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

.content .area-links a:hover {
  text-decoration: none;
  filter: brightness(0.95);
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.content a.task-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  background: #f0eef9;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  color: #1a202c;
  transition: border-color 160ms ease, background 160ms ease;
}

.content a.task-card:hover {
  text-decoration: none;
  background: white;
  border-color: #3525cd;
}

.task-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 9px;
  background: #3525cd;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.task-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  font-size: 0.95rem;
}

.task-text span {
  font-size: 0.82rem;
  color: #6b63a1;
}

.task-arrow {
  color: #3525cd;
  font-weight: 700;
  transition: transform 160ms ease;
}

.content a.task-card:hover .task-arrow {
  transform: translateX(4px);
}

/* ── Hamburger toggle (hidden on desktop) ── */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  margin-left: auto;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #3525cd;
  margin: 4px 0;
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.menu-toggle.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .header {
    padding: 0.75rem 1rem;
  }

  .menu-toggle {
    display: block;
  }

  .page {
    flex-direction: column;
    position: relative;
  }

  .sidebar {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    border-right: none;
    border-bottom: 1px solid #e2e0f0;
    padding: 1rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }

  .sidebar.open {
    display: block;
  }

  .content {
    padding: 1.5rem 1rem;
  }

  .content-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .content-header h1 {
    font-size: 1.4rem;
  }

  .content table {
    display: block;
    overflow-x: auto;
  }

  .home-hero {
    flex-direction: column;
  }

  .home-hero h1 {
    font-size: 1.7rem;
  }

  .home-panel {
    padding: 1rem;
  }

  .area-grid,
  .task-grid {
    grid-template-columns: 1fr;
  }

  .diagram {
    margin: 1rem -0.5rem;
  }
}

/* ── Mobile notice banner ── */
.mobile-notice {
  display: none;
  background: #3525cd;
  color: white;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  text-align: center;
  position: relative;
}

.mobile-notice button {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0.7;
  padding: 0.25rem;
}

.mobile-notice button:hover {
  opacity: 1;
}

@media (max-width: 768px) {
  .mobile-notice {
    display: block;
  }
}
