/*
Theme Name: Realytix Blog
Theme URI: https://realytix.io
Author: Realytix
Author URI: https://realytix.io
Description: Dark, modern blog theme matching the Realytix.io brand identity.
Version: 1.1.0
License: GNU General Public License v2 or later
Text Domain: realytix-blog
*/

/* ========== RESET & BASE ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary:    #0a0e1a;
  --bg-secondary:  #0f1628;
  --bg-card:       #111827;
  --bg-card-hover: #1a2235;
  --border:        rgba(0,229,255,0.12);
  --border-hover:  rgba(0,229,255,0.3);
  --blue:          #0072ff;
  --cyan:          #00e5ff;
  --green:         #00ff88;
  --purple:        #a855f7;
  --text-primary:  #ffffff;
  --text-secondary:#9ca3af;
  --text-muted:    #6b7280;
  --radius:        12px;
  --radius-sm:     8px;
  --font:          'Inter', system-ui, -apple-system, sans-serif;
  --max-width:     1100px;
  --nav-height:    68px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; transition: color 0.2s; }
a:hover { color: #fff; }

img { max-width: 100%; height: auto; display: block; }

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

.gradient-text {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(0,229,255,0.1);
  color: var(--cyan);
  border: 1px solid rgba(0,229,255,0.2);
}

/* ========== HEADER / NAV ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(10,14,26,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.site-logo-img {
  height: 34px !important;
  width: auto !important;
  max-width: 180px;
  display: block !important;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.main-nav a:hover,
.main-nav a.current-menu-item {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
}

.nav-cta {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 20px;
  transition: opacity 0.2s !important;
  white-space: nowrap;
}

.nav-cta:hover { opacity: 0.85; color: #fff !important; background: linear-gradient(135deg, var(--blue), var(--cyan)) !important; }

/* ========== HERO / PAGE TITLE ========== */
.archive-hero, .page-hero {
  padding: 72px 0 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.archive-hero::before {
  content: '';
  position: absolute;
  top: -60px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 500px;
  background: radial-gradient(ellipse at 50% 40%, rgba(0,114,255,0.18) 0%, rgba(0,229,255,0.06) 40%, transparent 70%);
  pointer-events: none;
}

.archive-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(0,229,255,0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

.archive-hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.archive-hero p {
  color: var(--text-secondary);
  font-size: 17px;
  max-width: 520px;
  margin: 0 auto;
}

/* ========== POSTS GRID ========== */
.posts-wrap {
  padding: 0 0 80px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,114,255,0.10), 0 0 0 1px rgba(0,229,255,0.08);
}

.post-card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: linear-gradient(135deg, #0f1628, #1a2235);
}

.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.post-card:hover .post-card-thumb img { transform: scale(1.04); }

.post-card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0,114,255,0.1), rgba(0,229,255,0.05));
  font-size: 40px;
  opacity: 0.4;
}

.post-card-body {
  padding: 20px 22px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.post-card-cat {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan);
}

.post-card-date {
  font-size: 12px;
  color: var(--text-muted);
}

.post-card-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  transition: color 0.2s;
}

.post-card:hover .post-card-title { color: var(--cyan); }

.post-card-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.read-more {
  font-size: 13px;
  font-weight: 600;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: gap 0.2s;
}

.read-more:hover { color: var(--cyan); gap: 8px; }

.read-time {
  font-size: 12px;
  color: var(--text-muted);
}

/* ========== FEATURED POST ========== */
.featured-post {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 32px;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.featured-post:hover {
  border-color: rgba(0,229,255,0.4);
  box-shadow: 0 0 0 1px rgba(0,229,255,0.12), 0 20px 60px rgba(0,114,255,0.12);
}

.featured-post .post-card-thumb {
  aspect-ratio: unset;
  min-height: 260px;
}

.featured-post .post-card-body {
  padding: 32px;
  justify-content: center;
}

.featured-post .post-card-title { font-size: 22px; }

/* ========== SINGLE POST ========== */
.single-wrap { padding: 0 0 80px; }

.single-hero {
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.single-hero .container { max-width: 760px; }

.single-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.single-meta .post-cat {
  background: rgba(0,229,255,0.1);
  color: var(--cyan);
  border: 1px solid rgba(0,229,255,0.2);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.single-meta .post-date,
.single-meta .post-author,
.single-meta .post-read-time {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.single-title {
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 20px;
}

.single-thumbnail {
  width: 100%;
  max-width: 760px;
  margin: 0 auto 48px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.single-thumbnail img { width: 100%; height: auto; }

/* ========== POST CONTENT ========== */
.entry-content {
  max-width: 760px;
  margin: 0 auto;
}

.entry-content h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 40px 0 16px;
  color: var(--text-primary);
}

.entry-content h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 32px 0 12px;
  color: var(--text-primary);
}

.entry-content h4 {
  font-size: 17px;
  font-weight: 600;
  margin: 24px 0 10px;
  color: var(--text-secondary);
}

.entry-content p { margin-bottom: 20px; color: #d1d5db; font-size: 16px; line-height: 1.75; }

.entry-content ul, .entry-content ol {
  margin: 0 0 20px 24px;
  color: #d1d5db;
}

.entry-content li { margin-bottom: 8px; line-height: 1.7; }

.entry-content a { color: var(--cyan); border-bottom: 1px solid rgba(0,229,255,0.3); }
.entry-content a:hover { border-bottom-color: var(--cyan); }

.entry-content blockquote {
  margin: 32px 0;
  padding: 20px 24px;
  border-left: 3px solid var(--cyan);
  background: rgba(0,229,255,0.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
  font-size: 17px;
}

.entry-content blockquote p { margin: 0; color: inherit; }

.entry-content code {
  background: rgba(0,229,255,0.08);
  border: 1px solid rgba(0,229,255,0.15);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 14px;
  font-family: 'Fira Code', monospace;
  color: var(--cyan);
}

.entry-content pre {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  overflow-x: auto;
  margin: 24px 0;
}

.entry-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 14px;
  color: #e5e7eb;
}

.entry-content img {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin: 24px 0;
}

.entry-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}

.entry-content th {
  background: rgba(0,229,255,0.08);
  color: var(--cyan);
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.entry-content td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: #d1d5db;
}

.entry-content tr:hover td { background: rgba(255,255,255,0.02); }

/* ========== POST TAGS ========== */
.post-tags {
  margin: 48px 0 32px;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-tags a {
  background: rgba(168,85,247,0.1);
  color: var(--purple);
  border: 1px solid rgba(168,85,247,0.2);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
}

.post-tags a:hover {
  background: rgba(168,85,247,0.2);
  color: #c084fc;
}

/* ========== RELATED POSTS ========== */
.related-posts {
  max-width: 760px;
  margin: 0 auto 64px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}

.related-posts h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* ========== CTA BOX ========== */
.cta-box {
  background: linear-gradient(135deg, rgba(0,114,255,0.15), rgba(0,229,255,0.08));
  border: 1px solid rgba(0,229,255,0.25);
  border-radius: var(--radius);
  padding: 48px 40px;
  text-align: center;
  margin: 64px auto;
  max-width: 660px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 80px rgba(0,114,255,0.08);
}

.cta-box::before {
  content: '';
  position: absolute;
  top: -40px; left: 50%; transform: translateX(-50%);
  width: 400px; height: 200px;
  background: radial-gradient(ellipse at center, rgba(0,229,255,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.cta-box h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.cta-box p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 28px;
  border-radius: 24px;
  transition: opacity 0.2s, transform 0.2s;
}

.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); color: #fff; }

/* ========== PAGINATION ========== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 40px 0 60px;
  flex-wrap: wrap;
}

.pagination .page-numbers {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all 0.2s;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border-color: transparent;
  color: #fff;
}

.pagination .prev, .pagination .next { width: auto; padding: 0 16px; }

/* ========== SIDEBAR ========== */
.content-sidebar-wrap {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  padding-bottom: 80px;
}

.sidebar { padding-top: 8px; }

.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 24px;
}

.widget-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.widget ul { list-style: none; }

.widget ul li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 14px;
}

.widget ul li:last-child { border-bottom: none; }

.widget ul li a { color: var(--text-secondary); transition: color 0.2s; }
.widget ul li a:hover { color: var(--text-primary); }

.search-form {
  display: flex;
  gap: 8px;
}

.search-form input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s;
}

.search-form input:focus { border-color: var(--cyan); }

.search-form button {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.2s;
}

.search-form button:hover { opacity: 0.85; }

/* ========== FOOTER ========== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
}

.footer-logo-img {
  height: 26px !important;
  width: auto !important;
  max-width: 140px;
  display: block;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.footer-logo-img:hover { opacity: 1; }

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--text-primary); }

.footer-copy {
  font-size: 13px;
  color: var(--text-muted);
}

/* ========== NO POSTS / 404 ========== */
.no-results {
  text-align: center;
  padding: 80px 24px;
}

.no-results h2 { font-size: 24px; font-weight: 700; margin-bottom: 12px; }
.no-results p { color: var(--text-secondary); margin-bottom: 24px; }

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .content-sidebar-wrap { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .featured-post { grid-template-columns: 1fr; }
  .featured-post .post-card-thumb { min-height: 200px; }
}

@media (max-width: 640px) {
  :root { --nav-height: 60px; }
  .main-nav { display: none; }
  .posts-grid { grid-template-columns: 1fr; }
  .cta-box { padding: 28px 20px; }
}
