/* PostCopilot — Shared Design System */

/* ============================================
   CSS Variables
   ============================================ */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --text: #000000;
  --text-secondary: #737373;
  --text-muted: #a3a3a3;
  --primary: #000000;
  --primary-hover: #262626;
  --secondary: #404040;
  --accent: #171717;
  --success: #22c55e;
  --warning: #f59e0b;
  --border: #e5e5e5;
  --shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-lg: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --radius: 12px;
  --radius-lg: 16px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overflow-y: auto;
}

a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
a:hover { text-decoration: underline; }

/* ============================================
   Layout
   ============================================ */
.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px;
}

/* ============================================
   Navigation — full-width sticky bar
   ============================================ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  font-size: 14px;
}

.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
}

.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  transition: var(--transition);
}

.site-nav a:hover {
  color: var(--primary);
  text-decoration: none;
}

.site-nav .brand {
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  font-size: 17px;
  flex-shrink: 0;
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-nav-links a.active {
  color: #000;
  font-weight: 600;
}

.site-nav-links a.nav-cta {
  font-weight: 600;
  color: #000;
  background: var(--surface-2);
  padding: 6px 14px;
  border-radius: 8px;
}

/* Hamburger — hidden on desktop */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  transition: var(--transition);
}
.nav-toggle:hover {
  background: var(--surface-2);
}

/* ============================================
   Header (page hero)
   ============================================ */
header {
  text-align: center;
  margin-bottom: 40px;
}

header h1 {
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

header .lead {
  margin: 0 auto;
  max-width: 540px;
  font-size: 18px;
  font-weight: 400;
  color: var(--text-secondary);
}

/* ============================================
   Hero / Card Sections
   ============================================ */
.hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
}

/* ============================================
   Buttons
   ============================================ */
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border: 0;
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}

.cta:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  color: #fff;
}

.cta:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.cta-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.cta-secondary:hover {
  background: var(--border);
  text-decoration: none;
}

/* ============================================
   Form Elements
   ============================================ */
.input-group { margin-bottom: 16px; }

.input-group label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--text);
}

.input-group input,
.input-group textarea,
.input-group select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: var(--transition);
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

/* ============================================
   Tools Grid (internal linking)
   ============================================ */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.tools-grid a {
  display: block;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: var(--transition);
}

.tools-grid a:hover {
  border-color: var(--text-muted);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

.tools-grid h3 {
  margin: 0 0 4px;
  font-size: 15px;
  color: var(--text);
}

.tools-grid p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ============================================
   FAQ Accordion
   ============================================ */
details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--surface);
}

details summary {
  padding: 16px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

details summary::-webkit-details-marker { display: none; }
details summary::marker { display: none; content: ''; }

details summary::after {
  content: '+';
  font-size: 18px;
  font-weight: 400;
  color: var(--text-muted);
  transition: var(--transition);
}

details[open] summary::after {
  content: '\2212';
}

details > div,
details > p {
  padding: 0 16px 16px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

/* ============================================
   Footer
   ============================================ */
footer {
  text-align: center;
  padding: 32px 0;
  color: var(--text-muted);
  font-size: 14px;
}

footer a {
  color: var(--text-secondary);
  font-weight: 400;
}

footer a:hover {
  color: var(--primary);
}

.social-share {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 16px 0;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  transition: var(--transition);
}

.social-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
  text-decoration: none;
  color: #fff;
}

.social-btn--x       { background: #000; }
.social-btn--fb      { background: #1877f2; font-size: 16px; }
.social-btn--linkedin { background: #0a66c2; }
.social-btn--reddit  { background: #ff4500; }
.social-btn--threads { background: #000; }

/* ============================================
   Responsive — Nav collapse (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
  .nav-toggle { display: block; }

  .nav-inner { flex-wrap: wrap; height: auto; padding: 12px 0; }

  .site-nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
  }

  .site-nav-links.open { display: flex; }

  .site-nav-links a {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 15px;
  }

  .site-nav-links a:hover,
  .site-nav-links a.active {
    background: var(--surface-2);
  }

  .site-nav-links a.nav-cta {
    background: var(--surface-2);
    padding: 10px 12px;
  }
}

/* ============================================
   Responsive — Mobile (max-width: 640px)
   ============================================ */
@media (max-width: 640px) {
  .wrap { padding: 20px 16px; }

  header { margin-bottom: 32px; }
  header h1 { font-size: 24px; }

  .hero { padding: 24px 20px; }

  .cta { padding: 14px 20px; font-size: 15px; }

  .tools-grid { grid-template-columns: 1fr; }

  /* Prevent iOS zoom on input focus */
  input, textarea, select { font-size: 16px !important; }
}

/* Safe area (notched devices) */
@supports (padding: env(safe-area-inset-bottom)) {
  .wrap {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }
}
