/* ============================================
   Web Extension Lab — Design System
   webextlab.joifup.com
   ============================================

   Color palette: warm white + orange
   Audience: developers (DevOps, SRE, indie hackers)
   Pages: blog, privacy policies, hub index

   Accessibility:
   - #c2410c on #ffffff = 6.2:1 (AAA)
   - #fb923c on #1c1917 = 7.6:1 (AAA)
   ============================================ */

/* --- Design Tokens --- */

:root {
  /* Background */
  --color-bg: #faf9f7;
  --color-surface: #ffffff;

  /* Text */
  --color-text: #1c1917;
  --color-text-secondary: #78716c;

  /* Orange accent */
  --color-accent: #c2410c;
  --color-accent-hover: #9a3412;
  --color-accent-light: #fff7ed;
  --color-accent-surface: #ffedd5;

  /* Structural */
  --color-border: #e7e5e4;
  --color-code-bg: #f5f5f4;

  /* Layout */
  --max-width: 720px;
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1c1917;
    --color-surface: #292524;
    --color-text: #fafaf9;
    --color-text-secondary: #a8a29e;
    --color-accent: #fb923c;
    --color-accent-hover: #fdba74;
    --color-accent-light: #431407;
    --color-accent-surface: #7c2d12;
    --color-border: #44403c;
    --color-code-bg: #44403c;
  }
}

/* --- Reset & Base --- */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  padding: 0 1rem 2rem;
}

/* Top accent bar */
body::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #ea580c, #f59e0b);
  margin: 0 -1rem 2rem;
}

/* --- Layout --- */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  background: var(--color-surface);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  padding: 2.5rem 2rem;
}

.container--narrow {
  max-width: 480px;
  margin-top: 3rem;
  text-align: center;
}

@media (max-width: 640px) {
  .container {
    padding: 1.5rem 1.25rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}

/* --- Typography --- */

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.375rem;
  border-bottom: 2px solid var(--color-accent);
  display: inline-block;
}

/* Force h2 underline to full width */
h2::after {
  content: "";
  display: block;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 0.75rem;
}

strong {
  font-weight: 600;
}

/* --- Links --- */

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

a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* --- Lists --- */

ul, ol {
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.375rem;
}

/* --- Code --- */

code {
  background: var(--color-code-bg);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.875em;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
}

/* --- Table --- */

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.75rem;
  font-size: 0.925rem;
}

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

th {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
}

/* --- Components --- */

/* Language switcher */
.lang-switcher {
  text-align: right;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.lang-switcher a {
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--color-border);
}

.lang-switcher a:hover {
  background: var(--color-accent-light);
  text-decoration: none;
}

/* Meta text (dates, last-updated) */
.published-date,
.last-updated {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

/* Intro / lead paragraph */
.intro {
  color: var(--color-text-secondary);
  font-size: 1.05rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

/* Highlight box (callouts) */
.highlight-box {
  background: var(--color-accent-light);
  border-left: 3px solid var(--color-accent);
  padding: 0.75rem 1rem;
  border-radius: 0 6px 6px 0;
  margin-bottom: 0.75rem;
}

/* CTA box */
.cta-box {
  background: var(--color-accent-light);
  border-left: 3px solid var(--color-accent);
  padding: 1rem 1.25rem;
  border-radius: 0 6px 6px 0;
  margin: 2rem 0;
}

.cta-box a {
  font-weight: 600;
}

/* Screenshots */
.screenshot {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  margin: 1rem 0;
}

.screenshot-caption {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}

/* Footer */
.footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  text-align: center;
}

/* --- Hub / Index page --- */

.hub-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

.hub-section {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.links {
  list-style: none;
  padding-left: 0;
}

.links li {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.sep {
  color: var(--color-text-secondary);
  margin: 0 0.25rem;
}

/* --- Responsive --- */

@media (max-width: 640px) {
  h1 {
    font-size: 1.5rem;
  }

  body::before {
    margin: 0 -1rem 1.5rem;
  }
}
