/*
Theme Name: Tutorial Theme
Description: Dark-mode tutorial site for WooCommerce guides & plugin recommendations
Version: 1.0
*/

/* ── Tokens ──────────────────────────────────────────────────── */
:root {
  --bg:          #0d1117;
  --surface:     #161b22;
  --surface-2:   #21262d;
  --border:      #30363d;
  --text:        #e6edf3;
  --muted:       #8b949e;
  --accent:      #a78bfa;
  --accent-dim:  #7c3aed;
  --accent-bg:   rgba(167,139,250,.12);
  --green:       #3fb950;
  --radius:      10px;
  --radius-lg:   16px;
  --shadow:      0 1px 4px rgba(0,0,0,.5);
  --shadow-card: 0 2px 8px rgba(0,0,0,.4);
  --max-w:       1200px;
  --content-w:   760px;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: #c4b5fd; }
p { margin-bottom: 1em; }
h1,h2,h3,h4,h5 { line-height: 1.25; font-weight: 700; color: var(--text); }

/* ── Container ───────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ──────────────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.site-logo {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}
.site-logo span { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a { font-size: 14px; font-weight: 500; color: var(--muted); }
.site-nav a:hover { color: var(--text); }
.site-nav .nav-cta {
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid rgba(167,139,250,.3);
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 13px;
}
.site-nav .nav-cta:hover { background: rgba(167,139,250,.2); color: var(--accent); }

/* ── Hero ─────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, #13111c 0%, #0d1117 60%);
  border-bottom: 1px solid var(--border);
  padding: 80px 24px 72px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -80px; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 300px;
  background: radial-gradient(ellipse, rgba(124,58,237,.18) 0%, transparent 70%);
  pointer-events: none;
}
.hero-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid rgba(167,139,250,.25);
  border-radius: 20px;
  padding: 4px 14px;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -.03em;
  max-width: 680px;
  margin: 0 auto 18px;
  background: linear-gradient(135deg, #e6edf3 30%, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  font-size: 17px;
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto 32px;
  line-height: 1.7;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  border: none;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent-dim);
  color: #fff;
}
.btn-primary:hover { background: #6d28d9; color: #fff; }
.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface); color: var(--text); }

/* ── Section shared ──────────────────────────────────────────── */
.section { padding: 64px 0; }
.section-header { margin-bottom: 36px; }
.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 8px;
}
.section-title {
  font-size: 1.75rem;
  letter-spacing: -.02em;
}
.section-sub {
  color: var(--muted);
  font-size: 15px;
  margin-top: 6px;
}

/* ── Tutorial Cards Grid ─────────────────────────────────────── */
.tutorials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.tutorial-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.tutorial-card:hover {
  border-color: rgba(167,139,250,.4);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.card-thumb {
  display: block;
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 16/9;
}
.card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.tutorial-card:hover .card-thumb img { transform: scale(1.03); }
.card-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--surface-2) 0%, #1e1433 100%);
}
.card-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.card-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-bg);
  border-radius: 4px;
  padding: 2px 8px;
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
  color: var(--text);
}
.card-title a { color: inherit; }
.card-title a:hover { color: var(--accent); }
.card-excerpt {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.card-date { font-size: 12px; color: var(--muted); }
.card-read-more {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}
.card-read-more:hover { color: #c4b5fd; }

/* ── All posts link ──────────────────────────────────────────── */
.section-footer { text-align: center; margin-top: 36px; }

/* ── Archive page (index.php) ────────────────────────────────── */
.archive-hero {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}
.archive-hero h1 { font-size: 2rem; letter-spacing: -.02em; }
.archive-hero p { color: var(--muted); margin-top: 6px; }

/* ── Single post ──────────────────────────────────────────────── */
.single-main { padding: 48px 0 80px; }
.single-inner { max-width: var(--content-w); margin: 0 auto; }

.post-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
}
.post-back:hover { color: var(--text); }

.post-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.post-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid rgba(167,139,250,.2);
  border-radius: 4px;
  padding: 3px 10px;
}

.post-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: -.025em;
  line-height: 1.2;
  margin-bottom: 16px;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.post-meta span { display: flex; align-items: center; gap: 5px; }

.post-thumbnail {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 36px;
  border: 1px solid var(--border);
}
.post-thumbnail img { width: 100%; height: auto; }

/* ── Prose (post content) ────────────────────────────────────── */
.post-content {
  color: var(--text);
  font-size: 16px;
  line-height: 1.8;
}
.post-content h2 {
  font-size: 1.5rem;
  margin: 2.2em 0 .7em;
  padding-bottom: .4em;
  border-bottom: 1px solid var(--border);
}
.post-content h3 { font-size: 1.2rem; margin: 1.8em 0 .5em; }
.post-content h4 { font-size: 1rem; margin: 1.5em 0 .4em; color: var(--muted); }
.post-content p { margin-bottom: 1.2em; }
.post-content ul, .post-content ol {
  margin: 0 0 1.2em 1.4em;
}
.post-content li { margin-bottom: .4em; }
.post-content blockquote {
  border-left: 3px solid var(--accent-dim);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 20px;
  margin: 1.5em 0;
  color: var(--muted);
  font-style: italic;
}
.post-content code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: .875em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  color: #f78166;
}
.post-content pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  overflow-x: auto;
  margin: 1.5em 0;
  font-size: 14px;
}
.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: #e6edf3;
  font-size: inherit;
}
.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(167,139,250,.4);
  text-underline-offset: 2px;
}
.post-content a:hover { text-decoration-color: var(--accent); }
.post-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 1.5em 0;
}
.post-content th {
  background: var(--surface-2);
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.post-content td {
  padding: 9px 14px;
  border: 1px solid var(--border);
  vertical-align: top;
}
.post-content tr:nth-child(even) td { background: var(--surface); }
.post-content img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 1.2em 0;
}
.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  font-size: 13px;
  color: var(--muted);
}
.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }

/* ── Pagination ───────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 52px;
}
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface);
}
.pagination .page-numbers.current { background: var(--accent-dim); border-color: var(--accent-dim); color: #fff; }
.pagination .page-numbers:hover:not(.current) { border-color: var(--accent); color: var(--accent); }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .tutorials-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
  .tutorials-grid { grid-template-columns: 1fr; }
  .hero { padding: 56px 20px 48px; }
  .site-nav .nav-text { display: none; }
  .site-footer .container { flex-direction: column; text-align: center; }
  .post-meta { flex-wrap: wrap; gap: 10px; }
}
