/* GrammarXP Blog – Shared Stylesheet */
/* TODO: Update --site-url once domain is live */

:root {
  --primary:       #58cc02;
  --primary-dark:  #46a302;
  --accent:        #ce82ff;
  --accent-dark:   #a855f7;
  --text:          #1a1a2e;
  --text-muted:    #6b7280;
  --bg:            #f9fafb;
  --surface:       #ffffff;
  --border:        #e5e7eb;
  --danger:        #ef4444;
  --warning-bg:    #fffbeb;
  --warning-border:#f59e0b;
  --info-bg:       #eff6ff;
  --info-border:   #3b82f6;
  --success-bg:    #f0fdf4;
  --success-border:#58cc02;
  --radius:        12px;
  --shadow:        0 2px 12px rgba(0,0,0,0.08);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
}

/* ── Navigation ── */
.site-nav {
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.site-nav__logo {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.site-nav__logo span { color: var(--text); }

.site-nav__cta {
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 0.875rem;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 3px 0 var(--primary-dark);
  transition: box-shadow 0.1s, transform 0.1s;
  white-space: nowrap;
}

.site-nav__cta:hover {
  box-shadow: 0 5px 0 var(--primary-dark);
  transform: translateY(-1px);
}

/* ── Layout ── */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Article Header ── */
.post-header {
  padding: 3rem 0 2rem;
}

.post-header__breadcrumb {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.post-header__breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.post-header__breadcrumb a:hover { color: var(--primary); }

.post-header__tag {
  display: inline-block;
  background: var(--success-bg);
  color: var(--primary-dark);
  border: 1.5px solid var(--success-border);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.post-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.post-header__meta {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.post-header__meta strong { color: var(--text); }

/* ── Quick Answer Box (Featured Snippet Bait) ── */
.quick-answer {
  background: var(--success-bg);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}

.quick-answer__label {
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.quick-answer p {
  font-weight: 700;
  font-size: 1.0625rem;
}

/* ── Prose ── */
.prose { padding: 1rem 0 3rem; }

.prose h2 {
  font-size: 1.5rem;
  font-weight: 900;
  margin: 2.5rem 0 1rem;
  color: var(--text);
  scroll-margin-top: 80px;
}

.prose h3 {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 1.75rem 0 0.75rem;
}

.prose p { margin-bottom: 1rem; }

.prose ul, .prose ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

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

.prose strong { font-weight: 800; color: var(--text); }

.prose em { color: var(--accent-dark); font-style: normal; font-weight: 700; }

/* ── Info Boxes ── */
.box {
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
  margin: 1.5rem 0;
  border-left: 4px solid;
}

.box--info  { background: var(--info-bg);    border-color: var(--info-border); }
.box--warn  { background: var(--warning-bg); border-color: var(--warning-border); }
.box--green { background: var(--success-bg); border-color: var(--primary); }

.box__title {
  font-weight: 900;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.box--info  .box__title { color: var(--info-border); }
.box--warn  .box__title { color: var(--warning-border); }
.box--green .box__title { color: var(--primary-dark); }

/* ── Example Table ── */
.example-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.example-table thead tr { background: var(--primary); color: #fff; }
.example-table thead th { padding: 0.75rem 1rem; font-weight: 800; text-align: left; }
.example-table tbody tr:nth-child(even) { background: var(--bg); }
.example-table tbody tr:nth-child(odd)  { background: var(--surface); }
.example-table td { padding: 0.65rem 1rem; border-bottom: 1px solid var(--border); }
.example-table td:first-child { font-style: italic; font-weight: 700; }

/* ── Signal Words Grid ── */
.signal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

.signal-card {
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  border: 2px solid;
}

.signal-card--pp { background: var(--success-bg); border-color: var(--primary); }
.signal-card--sp { background: var(--info-bg);    border-color: var(--info-border); }

.signal-card__title {
  font-weight: 900;
  font-size: 0.875rem;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.signal-card--pp .signal-card__title { color: var(--primary-dark); }
.signal-card--sp .signal-card__title { color: var(--info-border); }

.signal-card ul { padding-left: 1.1rem; }
.signal-card li { font-weight: 700; font-size: 0.9375rem; margin-bottom: 0.25rem; }

/* ── CTA Block ── */
.cta-block {
  background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%);
  border: 2px solid var(--primary);
  border-radius: 16px;
  padding: 2rem 1.75rem;
  text-align: center;
  margin: 3rem 0;
}

.cta-block__emoji { font-size: 3rem; display: block; margin-bottom: 0.75rem; }
.cta-block h2 { font-size: 1.5rem; font-weight: 900; margin-bottom: 0.75rem; }
.cta-block p  { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.9375rem; }

.cta-block__btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
  font-size: 1.0625rem;
  padding: 0.85rem 2rem;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--primary-dark);
  transition: box-shadow 0.1s, transform 0.1s;
}

.cta-block__btn:hover {
  box-shadow: 0 6px 0 var(--primary-dark);
  transform: translateY(-2px);
}

/* ── FAQ ── */
.faq { margin: 2rem 0 3rem; }

.faq h2 {
  font-size: 1.4rem;
  font-weight: 900;
  margin-bottom: 1.25rem;
}

.faq-item {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-item summary {
  font-weight: 800;
  padding: 1rem 1.25rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
}

.faq-item summary::after {
  content: '+';
  font-size: 1.25rem;
  color: var(--primary);
  font-weight: 900;
  transition: transform 0.2s;
}

.faq-item[open] summary::after { transform: rotate(45deg); }

.faq-item__body {
  padding: 0 1.25rem 1rem;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--surface);
  line-height: 1.7;
}

/* ── Blog Index Cards ── */
.blog-grid {
  display: grid;
  gap: 1.25rem;
  padding: 2rem 0 4rem;
}

.blog-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  box-shadow: var(--shadow);
}

.blog-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(88,204,2,0.15);
  transform: translateY(-2px);
}

.blog-card__tag {
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.blog-card h2 {
  font-size: 1.1875rem;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.blog-card p  { font-size: 0.9rem; color: var(--text-muted); line-height: 1.55; }

.blog-card__meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* ── Footer ── */
.site-footer {
  background: var(--surface);
  border-top: 2px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.site-footer a { color: var(--primary-dark); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 540px) {
  .signal-grid { grid-template-columns: 1fr; }
  .post-header h1 { font-size: 1.6rem; }
  .cta-block { padding: 1.5rem 1.1rem; }
}

/* ── Dark Mode ── */
/* Uses the exact same gamified-dark palette as the main GrammarXP app */
@media (prefers-color-scheme: dark) {
  :root {
    /* Mirror: src/style.css :root (Gamified Theme) */
    --text:          #ffffff;
    --text-muted:    #a8b8d8;
    --bg:            #1a2744;
    --surface:       #243668;
    --border:        #3a5299;
    --shadow:        0 4px 16px rgba(0,0,0,0.35);

    /* Info box backgrounds – adapted to blue-dark palette */
    --warning-bg:    #2a1f00;
    --warning-border:#ff9600;
    --info-bg:       #0e1f44;
    --info-border:   #4fc3f7;
    --success-bg:    #0d2110;
    --success-border:#46a302;

    /* Primary stays identical */
    --primary:       #58cc02;
    --primary-dark:  #46a302;
    --accent-dark:   #ce82ff;
  }

  body { background: var(--bg); color: var(--text); }

  /* Nav – matches app NavBar surface */
  .site-nav {
    background: #1e3059;
    border-bottom-color: var(--border);
  }

  /* Tables */
  .example-table thead tr { background: #1a4505; }
  .example-table tbody tr:nth-child(even) { background: #1e3059; }
  .example-table tbody tr:nth-child(odd)  { background: var(--surface); }
  .example-table td { border-bottom-color: var(--border); }

  /* Signal cards */
  .signal-card--pp { background: #0d2110; border-color: var(--primary); }
  .signal-card--sp { background: #0e1f44; border-color: var(--info-border); }

  /* CTA block */
  .cta-block {
    background: linear-gradient(135deg, #0d2110 0%, #0e1f44 100%);
    border-color: var(--primary);
  }
  .cta-block p { color: var(--text-muted); }

  /* FAQ items */
  .faq-item { border-color: var(--border); }
  .faq-item summary { background: var(--surface); color: var(--text); }
  .faq-item__body  { background: var(--surface); color: var(--text); }

  /* Blog index cards */
  .blog-card {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
  }
  .blog-card:hover { border-color: var(--primary); }
  .blog-card p     { color: var(--text-muted); }

  /* Footer – matches app footer / nav */
  .site-footer {
    background: #1e3059;
    border-top-color: var(--border);
    color: var(--text-muted);
  }

  /* Quick-answer box */
  .quick-answer {
    background: var(--success-bg);
    border-color: var(--primary);
  }
  .quick-answer p { color: var(--text); }

  /* Post header tag pill */
  .post-header__tag {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--primary);
  }

  /* Inline <em> accent colour */
  .prose em { color: var(--accent-dark); }
}
