/*
Theme Name: Pro QR Generator Blog
Theme URI: https://proqrgen.com
Author: Pro QR Generator
Author URI: https://proqrgen.com
Description: Custom blog theme for Pro QR Generator — syncs dark mode and coin counter with the main app. Responsive grid: 2 cols mobile, 3 cols tablet, 4 cols desktop. 20 posts per page with pagination.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: Private
Text Domain: qr10s-blog
*/

/* ─── CSS Variables ─────────────────────────────────────────────────── */
:root {
  --qr-primary:       #6366f1;
  --qr-primary-dark:  #4f46e5;
  --qr-accent:        #f59e0b;
  --qr-radius:        12px;
  --qr-radius-sm:     8px;
  --qr-transition:    0.25s ease;

  /* Light mode */
  --bg:               #f5f5f5;
  --bg-card:          #ffffff;
  --bg-nav:           rgba(255,255,255,0.92);
  --text:             #0f172a;
  --text-muted:       #64748b;
  --border:           rgba(0,0,0,0.09);
  --shadow:           0 2px 12px rgba(0,0,0,0.07);
  --shadow-hover:     0 8px 28px rgba(0,0,0,0.13);
  --tag-bg:           rgba(99,102,241,0.09);
  --tag-text:         #6366f1;
  --nav-link:         #0f172a;
  --input-bg:         #fff;
  --input-border:     rgba(0,0,0,0.15);
  --pagination-bg:    #fff;
  --pagination-active:#6366f1;
}

html.dark {
  --bg:               #0f0f0f;
  --bg-card:          #1a1a1a;
  --bg-nav:           rgba(10,10,10,0.93);
  --text:             #f1f5f9;
  --text-muted:       #94a3b8;
  --border:           rgba(255,255,255,0.09);
  --shadow:           0 2px 12px rgba(0,0,0,0.4);
  --shadow-hover:     0 8px 28px rgba(0,0,0,0.55);
  --tag-bg:           rgba(99,102,241,0.18);
  --tag-text:         #a5b4fc;
  --nav-link:         #f1f5f9;
  --input-bg:         #1e1e1e;
  --input-border:     rgba(255,255,255,0.12);
  --pagination-bg:    #1e1e1e;
  --pagination-active:#6366f1;
}

/* ─── Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  transition: background-color var(--qr-transition), color var(--qr-transition);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ─── Navbar ────────────────────────────────────────────────────────── */
#qr10s-navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  background: var(--bg-nav);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 16px rgba(0,0,0,0.07);
  z-index: 9999;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 0;
  transition: background var(--qr-transition), border-color var(--qr-transition);
}
@media (min-width: 768px) { #qr10s-navbar { height: 72px; padding: 0 40px; } }
@media (min-width: 1024px) { #qr10s-navbar { height: 80px; padding: 0 56px; } }

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  text-decoration: none;
}
.nav-brand img {
  width: 44px; height: 44px;
  border-radius: 10px;
  object-fit: contain;
}
@media (min-width: 768px) { .nav-brand img { width: 52px; height: 52px; } }
.nav-brand-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--nav-link);
  display: none;
  letter-spacing: -0.3px;
}
@media (min-width: 480px) { .nav-brand-name { display: block; } }

.nav-links {
  display: none;
  align-items: center;
  gap: 28px;
  margin: 0 auto 0 40px;
}
@media (min-width: 768px) { .nav-links { display: flex; } }
.nav-links a {
  font-size: 15px;
  font-weight: 600;
  color: var(--nav-link);
  transition: color var(--qr-transition), opacity var(--qr-transition);
  opacity: 0.9;
}
.nav-links a:hover, .nav-links a.current { color: var(--qr-primary); opacity: 1; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* Coins badge — pill style (unified across light/dark modes) */
.nav-coins {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: rgba(120,120,120,0.14);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  padding: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
  text-decoration: none;
  letter-spacing: 0;
  border: 1.5px solid var(--border);
  position: relative;
}
.nav-coins:hover {
  transform: scale(1.07);
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  background: rgba(120,120,120,0.22);
}
html.dark .nav-coins {
  background: rgba(120,120,120,0.14);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
  border: 1.5px solid var(--border);
}
html.dark .nav-coins:hover { background: rgba(120,120,120,0.22); }
.nav-coins .coin-icon { display: none; }
.nav-coins .coin-count {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: inherit;
}

/* Dark mode toggle — unified across light/dark modes */
.nav-dark-toggle {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  background: rgba(120,120,120,0.14);
  transition: background var(--qr-transition), transform 0.15s, box-shadow 0.15s;
  font-size: 18px;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
  line-height: 1;
  cursor: pointer;
}
html.dark .nav-dark-toggle {
  background: rgba(120,120,120,0.14);
  color: var(--text);
  border: 1.5px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}
.nav-dark-toggle:hover {
  background: rgba(120,120,120,0.22);
  transform: scale(1.10);
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}
html.dark .nav-dark-toggle:hover { background: rgba(120,120,120,0.22); }

/* Mobile menu button */
.nav-hamburger {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 5px;
  border-radius: 8px;
  color: var(--nav-link);
  transition: background var(--qr-transition);
}
@media (min-width: 768px) { .nav-hamburger { display: none; } }
.nav-hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
#qr10s-mobile-nav {
  position: fixed;
  top: 64px; left: 0; right: 0;
  background: var(--bg-nav);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  z-index: 9998;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease, box-shadow 0.3s;
}
#qr10s-mobile-nav.open { max-height: 320px; box-shadow: 0 8px 24px rgba(0,0,0,0.18); }
@media (min-width: 768px) { #qr10s-mobile-nav { display: none !important; } }
.mobile-nav-inner { padding: 16px 24px 20px; display: flex; flex-direction: column; gap: 4px; }
.mobile-nav-inner a {
  padding: 11px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--nav-link);
  border-bottom: 1px solid var(--border);
}
.mobile-nav-inner a:last-child { border-bottom: none; }

/* ─── Layout ────────────────────────────────────────────────────────── */
#qr10s-wrapper {
  min-height: 100vh;
  padding-top: 64px;
}
@media (min-width: 768px) { #qr10s-wrapper { padding-top: 72px; } }
@media (min-width: 1024px) { #qr10s-wrapper { padding-top: 80px; } }

.qr10s-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 640px)  { .qr10s-container { padding: 0 24px; } }
@media (min-width: 1024px) { .qr10s-container { padding: 0 40px; } }
@media (min-width: 1280px) { .qr10s-container { padding: 0 56px; } }

/* No sidebar / full-width — eliminates the Astra side gap */
#primary, .site-content, .content-area, .entry-content { max-width: 100%; }

/* ─── Header / hero strip ───────────────────────────────────────────── */
.qr10s-blog-header {
  padding: 40px 0 8px;
  text-align: left;
  background: transparent !important;
}
.qr10s-blog-header h1 {
  font-size: clamp(22px, 3.5vw, 32px);
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text) !important;
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  -webkit-text-fill-color: var(--text) !important;
}
.qr10s-blog-header p {
  font-size: clamp(13px, 1.6vw, 15px);
  color: var(--text-muted);
  margin-top: 6px;
  max-width: 540px;
}

/* ─── Controls bar (search + category) ─────────────────────────────── */
.qr10s-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.qr10s-search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}
.qr10s-search-wrap svg {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
.qr10s-search-wrap input {
  width: 100%;
  padding: 9px 12px 9px 38px;
  border-radius: var(--qr-radius-sm);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color var(--qr-transition), box-shadow var(--qr-transition);
}
.qr10s-search-wrap input:focus { border-color: var(--qr-primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
.qr10s-search-wrap input::placeholder { color: var(--text-muted); }

.qr10s-cat-select {
  padding: 9px 14px;
  border-radius: var(--qr-radius-sm);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  min-width: 180px;
  transition: border-color var(--qr-transition);
}
.qr10s-cat-select:focus { border-color: var(--qr-primary); }

/* ─── Posts Grid ────────────────────────────────────────────────────── */
.qr10s-posts-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 768px)  { .qr10s-posts-grid { grid-template-columns: repeat(3, 1fr); gap: 22px; } }
@media (min-width: 1200px) { .qr10s-posts-grid { grid-template-columns: repeat(4, 1fr); gap: 24px; } }

/* ─── Post Card ─────────────────────────────────────────────────────── */
.qr10s-card {
  background: var(--bg-card);
  border-radius: var(--qr-radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--qr-transition), box-shadow var(--qr-transition), border-color var(--qr-transition);
  text-decoration: none;
  color: var(--text);
}
.qr10s-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(99,102,241,0.25);
}

.qr10s-card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  flex-shrink: 0;
}
html.dark .qr10s-card-thumb { background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%); }
.qr10s-card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.qr10s-card:hover .qr10s-card-thumb img { transform: scale(1.05); }

.qr10s-card-body { padding: 14px 16px 18px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 768px) { .qr10s-card-body { padding: 16px 18px 20px; } }

.qr10s-card-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.qr10s-card-cat {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--tag-text);
  background: var(--tag-bg);
  padding: 2px 8px;
  border-radius: 20px;
}

.qr10s-card-title {
  font-size: clamp(13px, 1.8vw, 15px);
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  flex: 1;
}

.qr10s-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.qr10s-card-meta a { color: var(--qr-primary); font-weight: 600; }
.qr10s-card-meta a:hover { text-decoration: underline; }

.qr10s-card-excerpt {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* ─── Pagination ────────────────────────────────────────────────────── */
.qr10s-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 40px 0 24px;
  flex-wrap: wrap;
}
.qr10s-pagination a,
.qr10s-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px; height: 40px;
  padding: 0 12px;
  border-radius: var(--qr-radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--pagination-bg);
  color: var(--text);
  transition: background var(--qr-transition), color var(--qr-transition), border-color var(--qr-transition), transform 0.1s;
  text-decoration: none;
}
.qr10s-pagination a:hover {
  background: var(--qr-primary);
  color: #fff;
  border-color: var(--qr-primary);
  transform: scale(1.06);
}
.qr10s-pagination span.current {
  background: var(--qr-primary);
  color: #fff;
  border-color: var(--qr-primary);
}
.qr10s-pagination .prev-btn,
.qr10s-pagination .next-btn {
  gap: 4px;
  padding: 0 16px;
  font-size: 13px;
}

/* ─── Widgets area ──────────────────────────────────────────────────── */
#qr10s-widgets {
  margin: 32px 0 0;
  padding: 24px 0;
  border-top: 1px solid var(--border);
}
#qr10s-widgets .qr10s-widget-area {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px)  { #qr10s-widgets .qr10s-widget-area { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { #qr10s-widgets .qr10s-widget-area { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { #qr10s-widgets .qr10s-widget-area { grid-template-columns: repeat(4, 1fr); } }

.widget {
  background: var(--bg-card);
  border-radius: var(--qr-radius);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow);
}
.widget-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--qr-primary);
  display: inline-block;
}
.widget ul { list-style: none; }
.widget ul li { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { color: var(--text-muted); transition: color var(--qr-transition); }
.widget ul li a:hover { color: var(--qr-primary); }

/* ─── Footer ────────────────────────────────────────────────────────── */
#qr10s-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 48px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
#qr10s-footer a { color: var(--qr-primary); }
#qr10s-footer a:hover { text-decoration: underline; }
.footer-links { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-bottom: 12px; }
.footer-links a { font-weight: 600; }

/* ─── Single post ───────────────────────────────────────────────────── */
.qr10s-single-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 36px 0 60px;
}
.single-post-title {
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 16px;
  letter-spacing: -0.3px;
}
.single-post-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.single-post-meta a { color: var(--qr-primary); font-weight: 600; }
.single-post-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--qr-radius);
  margin-bottom: 28px;
}
.entry-content { font-size: 16px; line-height: 1.75; color: var(--text); }
.entry-content h2, .entry-content h3 { font-weight: 700; margin: 28px 0 12px; }
.entry-content p { margin-bottom: 18px; }
.entry-content a { color: var(--qr-primary); text-decoration: underline; }
.entry-content ul, .entry-content ol { margin: 0 0 18px 24px; }
.entry-content li { margin-bottom: 6px; }
.entry-content img { border-radius: var(--qr-radius-sm); margin: 20px 0; }
.entry-content code {
  background: var(--tag-bg); color: var(--qr-primary);
  padding: 2px 6px; border-radius: 4px; font-size: 0.9em;
}
.entry-content pre {
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 16px; border-radius: var(--qr-radius-sm);
  overflow-x: auto; margin-bottom: 18px;
}

/* ─── No-results ────────────────────────────────────────────────────── */
.qr10s-no-results {
  text-align: center; padding: 80px 20px;
  color: var(--text-muted);
  grid-column: 1 / -1;
}
.qr10s-no-results svg { margin: 0 auto 16px; opacity: 0.35; }
.qr10s-no-results h3 { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 6px; }

/* ─── Related tools (final de cada artículo) ────────────────────────── */
/* Usa las mismas variables que el resto del tema, así que sigue al modo
   oscuro sin necesitar reglas aparte. */
.qr10s-related-tools {
  margin-top: 48px;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--qr-radius);
}
.qr10s-related-tools h2 {
  font-size: 22px; font-weight: 800;
  color: var(--text); margin-bottom: 6px;
}
.qr10s-related-tools-intro {
  font-size: 14px; color: var(--text-muted); margin-bottom: 20px;
}
.qr10s-related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.qr10s-related-tool {
  display: flex; flex-direction: column; gap: 3px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--qr-radius-sm);
  text-decoration: none;
  transition: border-color var(--qr-transition), transform var(--qr-transition);
}
.qr10s-related-tool:hover {
  border-color: var(--qr-primary);
  transform: translateY(-2px);
}
.qr10s-related-tool-name { font-size: 15px; font-weight: 700; color: var(--qr-primary); }
.qr10s-related-tool-desc { font-size: 13px; color: var(--text-muted); line-height: 1.4; }

/* ─── Utility ───────────────────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
