/* Live Platform Manual — shared styles (plain HTML / S3 static) */

:root {
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #1e293b;
  --color-muted: #64748b;
  --color-border: #e2e8f0;
  --color-brand: #2563eb;
  --color-brand-dark: #1d4ed8;
  --sidebar-width: 240px;
  --content-max: 760px;
  --font-sans: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
}

a {
  color: var(--color-brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout */

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar__brand {
  padding: 0 1.25rem 1rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0.75rem;
}

.sidebar__brand span {
  display: block;
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-top: 0.15rem;
}

.sidebar nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar nav li {
  margin: 0;
}

.sidebar nav a {
  display: block;
  padding: 0.4rem 1.25rem;
  color: var(--color-text);
  font-size: 0.9rem;
  text-decoration: none;
}

.sidebar nav a:hover {
  background: var(--color-bg);
  text-decoration: none;
}

.sidebar nav a.is-active {
  color: var(--color-brand);
  font-weight: 600;
  border-right: 3px solid var(--color-brand);
  background: #eff6ff;
}

.sidebar nav .nav-section {
  padding: 0.75rem 1.25rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  padding: 0.75rem 2rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  font-size: 0.85rem;
  color: var(--color-muted);
}

.topbar a {
  color: var(--color-muted);
}

.topbar a:hover {
  color: var(--color-brand);
}

.content {
  flex: 1;
  padding: 2rem;
  max-width: calc(var(--content-max) + 4rem);
}

.footer {
  padding: 1rem 2rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.8rem;
  color: var(--color-muted);
  background: var(--color-surface);
}

/* Typography */

.content h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  line-height: 1.3;
}

.content h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.25rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--color-border);
}

.content h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.05rem;
}

.content p {
  margin: 0 0 1rem;
}

.content ul,
.content ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

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

/* Components */

.lead {
  font-size: 1.05rem;
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}

.note {
  padding: 1rem 1.15rem;
  margin: 1.25rem 0;
  border-radius: 6px;
  border-left: 4px solid var(--color-brand);
  background: #eff6ff;
  font-size: 0.9rem;
}

.note--warn {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.card {
  display: block;
  padding: 1.15rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.card:hover {
  border-color: var(--color-brand);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
  text-decoration: none;
}

.card__title {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.card__desc {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.9rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
}

th,
td {
  padding: 0.6rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  background: var(--color-bg);
  font-weight: 600;
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: #f1f5f9;
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem 1.15rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.step-list {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.step-list li {
  counter-increment: step;
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 1rem;
}

.step-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.6rem;
  height: 1.6rem;
  background: var(--color-brand);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 50%;
  text-align: center;
  line-height: 1.6rem;
}

/* Home only */

.hero {
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: 0.35rem;
}

@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .content {
    padding: 1.25rem;
  }
}
