/*
Theme Name: IP4 Developer
Theme URI: https://ip4.market/blog
Author: SOLTIA
Description: Blog theme integrated with ip4.market IPv4 marketplace. Professional tech blog for IPv4 networking content.
Version: 1.0.0
Text Domain: ip4-developer
*/

/* ─── Variables ────────────────────────────────────────────── */
:root {
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --blue-900: #1e3a5f;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --green-500: #22c55e;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --container: 1280px;
  --content: 780px;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.08), 0 8px 10px -6px rgba(0,0,0,.04);
}

/* ─── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-sans); color: var(--gray-800); background: #fff; line-height: 1.6; font-size: 16px; }
a { color: inherit; text-decoration: none; transition: color .2s; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
::selection { background: var(--blue-600); color: #fff; }

/* ─── Navbar (matches ip4.market) ──────────────────────────── */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-100);
  height: 64px;
}
.nav-inner {
  max-width: var(--container); margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between; height: 100%;
}
.nav-logo { display: flex; align-items: center; gap: .5rem; text-decoration: none; }
.nav-logo-text { font-size: 1.35rem; font-weight: 700; color: var(--blue-600); }
.nav-logo-sub { font-size: .6rem; color: var(--gray-400); text-transform: uppercase; letter-spacing: 2px; font-weight: 600; }
.nav-links { display: flex; align-items: center; gap: .25rem; }
.nav-links a {
  padding: .5rem .75rem; font-size: .875rem; font-weight: 500;
  color: var(--gray-600); border-radius: 8px; transition: all .2s;
}
.nav-links a:hover { color: var(--gray-900); background: var(--gray-50); }
.nav-links a.active { color: var(--blue-600); }
.nav-actions { display: flex; align-items: center; gap: .75rem; }
.nav-signin { font-size: .875rem; font-weight: 500; color: var(--gray-600); padding: .5rem .75rem; border-radius: 8px; }
.nav-signin:hover { color: var(--gray-900); background: var(--gray-50); }
.nav-cta {
  font-size: .875rem; font-weight: 600; color: #fff; background: var(--blue-600);
  padding: .5rem 1.25rem; border-radius: 8px; transition: all .2s;
}
.nav-cta:hover { background: var(--blue-700); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.hamburger { display: none; background: none; border: 1px solid var(--gray-200); border-radius: 8px; padding: 6px 8px; cursor: pointer; }
.hamburger span { display: block; width: 20px; height: 2px; background: var(--gray-600); margin: 4px 0; border-radius: 2px; transition: .3s; }

@media (max-width: 768px) {
  .nav-links, .nav-actions { display: none; }
  .hamburger { display: block; }
}

/* ─── Mobile Menu ──────────────────────────────────────────── */
.mobile-menu {
  position: fixed; top: 0; right: -320px; width: 300px; height: 100vh;
  background: #fff; z-index: 10001; transition: right .35s ease;
  box-shadow: var(--shadow-xl); padding: 1.5rem;
}
.mobile-menu.is-open { right: 0; }
.mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 10000; }
.mobile-overlay.is-visible { display: block; }
.mobile-menu-close { background: none; border: none; font-size: 1.5rem; color: var(--gray-400); cursor: pointer; float: right; }
.mobile-menu nav { margin-top: 2rem; }
.mobile-menu nav a { display: block; padding: .75rem 0; font-size: 1rem; font-weight: 500; color: var(--gray-700); border-bottom: 1px solid var(--gray-100); }
.mobile-menu nav a:hover { color: var(--blue-600); }
.mobile-menu .mobile-cta { display: block; margin-top: 1.5rem; text-align: center; background: var(--blue-600); color: #fff; padding: .75rem; border-radius: 8px; font-weight: 600; }

/* ─── Page Layout ──────────────────────────────────────────── */
.site-main { margin-top: 64px; min-height: calc(100vh - 64px - 300px); }

/* ─── Blog Hero (Index) ────────────────────────────────────── */
.blog-hero {
  background: linear-gradient(135deg, var(--gray-900) 0%, var(--blue-900) 100%);
  color: #fff; padding: 5rem 2rem 4rem; text-align: center;
}
.blog-hero h1 { font-size: 3rem; font-weight: 800; letter-spacing: -1px; margin-bottom: .75rem; }
.blog-hero p { font-size: 1.15rem; color: rgba(255,255,255,.7); max-width: 600px; margin: 0 auto 2rem; }
.blog-hero .hero-tags { display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap; }
.blog-hero .hero-tag {
  font-size: .75rem; font-weight: 600; padding: .35rem .85rem;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15);
  border-radius: 20px; color: rgba(255,255,255,.8);
}

/* ─── Featured Post ────────────────────────────────────────── */
.featured-section { max-width: var(--container); margin: -2rem auto 3rem; padding: 0 2rem; position: relative; z-index: 1; }
.featured-card {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 0;
  background: #fff; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-xl); border: 1px solid var(--gray-100);
}
.featured-image { overflow: hidden; }
.featured-image img { width: 100%; height: 100%; object-fit: cover; min-height: 360px; transition: transform .5s; }
.featured-card:hover .featured-image img { transform: scale(1.03); }
.featured-content { padding: 2.5rem; display: flex; flex-direction: column; justify-content: center; }
.featured-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: var(--blue-600); background: var(--blue-50); padding: 4px 12px;
  border-radius: 6px; margin-bottom: 1rem; width: fit-content;
}
.featured-badge::before { content: ''; width: 6px; height: 6px; background: var(--blue-600); border-radius: 50%; }
.featured-content h2 { font-size: 1.75rem; font-weight: 700; line-height: 1.3; margin-bottom: 1rem; color: var(--gray-900); }
.featured-content h2 a { color: inherit; }
.featured-content h2 a:hover { color: var(--blue-600); }
.featured-excerpt { color: var(--gray-500); font-size: .95rem; line-height: 1.7; margin-bottom: 1.5rem; }
.featured-meta { display: flex; align-items: center; gap: 1rem; font-size: .8rem; color: var(--gray-400); }
.featured-read-more {
  display: inline-flex; align-items: center; gap: .5rem;
  color: var(--blue-600); font-weight: 600; font-size: .9rem; margin-top: 1rem;
}
.featured-read-more:hover { gap: .75rem; }

@media (max-width: 768px) {
  .featured-card { grid-template-columns: 1fr; }
  .featured-image img { min-height: 220px; }
  .featured-content { padding: 1.5rem; }
  .blog-hero h1 { font-size: 2rem; }
  .blog-hero { padding: 3rem 1.5rem 3rem; }
}

/* ─── Post Grid ────────────────────────────────────────────── */
.posts-section { max-width: var(--container); margin: 0 auto 4rem; padding: 0 2rem; }
.posts-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.posts-header h2 { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); }
.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.post-card {
  background: #fff; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--gray-100); transition: all .3s;
}
.post-card:hover { border-color: var(--blue-200); box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.post-card-image { overflow: hidden; position: relative; }
.post-card-image img { width: 100%; height: 200px; object-fit: cover; transition: transform .5s; }
.post-card:hover .post-card-image img { transform: scale(1.05); }
.post-card-cat {
  position: absolute; top: 12px; left: 12px;
  font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  background: rgba(255,255,255,.95); color: var(--blue-600); padding: 3px 10px;
  border-radius: 6px; backdrop-filter: blur(4px);
}
.post-card-body { padding: 1.25rem; }
.post-card-body h3 { font-size: 1.1rem; font-weight: 700; line-height: 1.4; margin-bottom: .5rem; color: var(--gray-900); }
.post-card-body h3 a { color: inherit; }
.post-card-body h3 a:hover { color: var(--blue-600); }
.post-card-excerpt { color: var(--gray-500); font-size: .85rem; line-height: 1.6; margin-bottom: 1rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card-meta { font-size: .75rem; color: var(--gray-400); display: flex; align-items: center; gap: .75rem; }
.post-card-meta .dot { width: 3px; height: 3px; background: var(--gray-300); border-radius: 50%; }

@media (max-width: 960px) { .posts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .posts-grid { grid-template-columns: 1fr; } }

/* ─── CTA Banner ───────────────────────────────────────────── */
.cta-banner {
  max-width: var(--container); margin: 0 auto 4rem; padding: 0 2rem;
}
.cta-inner {
  background: linear-gradient(135deg, var(--blue-600) 0%, var(--blue-800) 100%);
  border-radius: var(--radius); padding: 3rem; text-align: center; color: #fff;
  position: relative; overflow: hidden;
}
.cta-inner::before {
  content: ''; position: absolute; top: -50%; right: -20%; width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,.08) 0%, transparent 70%); border-radius: 50%;
}
.cta-inner h2 { font-size: 1.75rem; font-weight: 700; margin-bottom: .75rem; position: relative; }
.cta-inner p { font-size: 1rem; color: rgba(255,255,255,.8); margin-bottom: 1.5rem; position: relative; }
.cta-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: #fff; color: var(--blue-700); font-weight: 700; font-size: .9rem;
  padding: .75rem 2rem; border-radius: 8px; position: relative;
  transition: all .2s;
}
.cta-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.2); color: var(--blue-700); }

/* ─── Single Article ───────────────────────────────────────── */
.article-hero {
  background: linear-gradient(135deg, var(--gray-900) 0%, var(--blue-900) 100%);
  color: #fff; padding: 4rem 2rem 3rem; text-align: center;
}
.article-hero .breadcrumbs { font-size: .8rem; color: rgba(255,255,255,.5); margin-bottom: 1.5rem; }
.article-hero .breadcrumbs a { color: rgba(255,255,255,.6); }
.article-hero .breadcrumbs a:hover { color: #fff; }
.article-hero .article-cat {
  display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; background: var(--blue-600); color: #fff; padding: 4px 14px;
  border-radius: 6px; margin-bottom: 1rem;
}
.article-hero h1 { font-size: 2.5rem; font-weight: 800; line-height: 1.2; max-width: 800px; margin: 0 auto 1.25rem; letter-spacing: -1px; }
.article-hero .article-meta { font-size: .85rem; color: rgba(255,255,255,.6); display: flex; justify-content: center; gap: 1.5rem; }

.article-container { max-width: var(--content); margin: -2rem auto 0; padding: 0 2rem; position: relative; z-index: 1; }
.article-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid var(--gray-100); overflow: hidden; }
.article-featured-img img { width: 100%; height: auto; border-radius: var(--radius) var(--radius) 0 0; }
.article-body { padding: 2.5rem; }

/* Article content typography */
.article-content { font-family: var(--font-sans); font-size: 1.05rem; line-height: 1.85; color: var(--gray-700); }
.article-content p { margin-bottom: 1.5rem; }
.article-content h2 { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); margin: 2.5rem 0 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--gray-100); }
.article-content h3 { font-size: 1.2rem; font-weight: 600; color: var(--gray-800); margin: 2rem 0 .75rem; }
.article-content h4 { font-size: 1.05rem; font-weight: 600; color: var(--gray-700); margin: 1.5rem 0 .5rem; }
.article-content a { color: var(--blue-600); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.article-content a:hover { color: var(--blue-700); }
.article-content ul, .article-content ol { margin: 1rem 0 1.5rem; padding-left: 1.5rem; }
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li { margin-bottom: .5rem; color: var(--gray-600); }
.article-content blockquote {
  border-left: 3px solid var(--blue-600); margin: 1.5rem 0; padding: 1rem 1.5rem;
  background: var(--blue-50); border-radius: 0 8px 8px 0; font-style: italic; color: var(--gray-600);
}
.article-content pre, .article-content code {
  font-family: var(--font-mono); font-size: .9rem;
  background: var(--gray-50); border-radius: 6px;
}
.article-content code { padding: 2px 6px; border: 1px solid var(--gray-200); }
.article-content pre { padding: 1.25rem; overflow-x: auto; border: 1px solid var(--gray-200); margin: 1.5rem 0; }
.article-content pre code { border: none; padding: 0; background: transparent; }
.article-content img { border-radius: 8px; margin: 1.5rem 0; }
.article-content strong { color: var(--gray-900); font-weight: 600; }
.article-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .9rem; }
.article-content th { background: var(--gray-50); font-weight: 600; color: var(--gray-700); text-align: left; padding: .75rem 1rem; border: 1px solid var(--gray-200); }
.article-content td { padding: .75rem 1rem; border: 1px solid var(--gray-200); color: var(--gray-600); }

/* Article tags */
.article-tags { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--gray-100); }
.article-tags span { font-weight: 600; color: var(--gray-700); margin-right: .5rem; }
.tag { display: inline-block; font-size: .75rem; font-weight: 500; color: var(--blue-600); background: var(--blue-50); padding: 4px 10px; border-radius: 6px; margin: 3px; }
.tag:hover { background: var(--blue-100); }

/* Article share */
.article-share { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--gray-100); display: flex; align-items: center; gap: 1rem; }
.article-share span { font-weight: 600; color: var(--gray-700); font-size: .85rem; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px; background: var(--gray-50);
  color: var(--gray-500); font-size: .85rem; transition: all .2s;
}
.share-btn:hover { background: var(--blue-50); color: var(--blue-600); }

/* Author box */
.author-box {
  display: flex; gap: 1.25rem; align-items: center;
  margin-top: 2.5rem; padding: 1.5rem; background: var(--gray-50);
  border-radius: var(--radius); border: 1px solid var(--gray-100);
}
.author-avatar {
  width: 56px; height: 56px; border-radius: 50%; background: var(--blue-600);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.25rem; flex-shrink: 0;
}
.author-info h4 { font-size: .95rem; font-weight: 700; color: var(--gray-900); }
.author-info p { font-size: .85rem; color: var(--gray-500); margin-top: .25rem; }

/* Inline CTA in articles */
.inline-cta {
  margin: 2.5rem 0; padding: 1.5rem 2rem;
  background: linear-gradient(135deg, var(--blue-50), var(--blue-100));
  border: 1px solid var(--blue-200); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}
.inline-cta-text h4 { font-size: 1rem; font-weight: 700; color: var(--gray-900); margin-bottom: .25rem; }
.inline-cta-text p { font-size: .85rem; color: var(--gray-500); }
.inline-cta-btn {
  flex-shrink: 0; background: var(--blue-600); color: #fff; font-weight: 600;
  font-size: .85rem; padding: .6rem 1.25rem; border-radius: 8px; white-space: nowrap;
}
.inline-cta-btn:hover { background: var(--blue-700); color: #fff; }

@media (max-width: 768px) {
  .article-hero h1 { font-size: 1.75rem; }
  .article-hero { padding: 3rem 1.5rem 2.5rem; }
  .article-body { padding: 1.5rem; }
  .inline-cta { flex-direction: column; text-align: center; }
}

/* ─── Related Posts ────────────────────────────────────────── */
.related-section { max-width: var(--content); margin: 3rem auto; padding: 0 2rem; }
.related-section h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--gray-900); }
.related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.related-card {
  display: flex; gap: 1rem; padding: 1rem; background: #fff;
  border: 1px solid var(--gray-100); border-radius: var(--radius); transition: all .2s;
}
.related-card:hover { border-color: var(--blue-200); box-shadow: var(--shadow-sm); }
.related-card img { width: 100px; height: 80px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.related-card h4 { font-size: .9rem; font-weight: 600; color: var(--gray-800); line-height: 1.4; }
.related-card h4 a { color: inherit; }
.related-card h4 a:hover { color: var(--blue-600); }
.related-card .related-meta { font-size: .75rem; color: var(--gray-400); margin-top: .35rem; }

@media (max-width: 640px) { .related-grid { grid-template-columns: 1fr; } }

/* ─── Category Page ────────────────────────────────────────── */
.cat-hero {
  background: var(--gray-50); border-bottom: 1px solid var(--gray-100);
  padding: 3rem 2rem; text-align: center;
}
.cat-hero h1 { font-size: 2rem; font-weight: 800; color: var(--gray-900); margin-bottom: .5rem; }
.cat-hero p { font-size: 1rem; color: var(--gray-500); }

/* ─── Pagination ───────────────────────────────────────────── */
.pagination { max-width: var(--container); margin: 0 auto 4rem; padding: 0 2rem; text-align: center; }
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 .5rem; margin: 0 3px;
  font-size: .875rem; font-weight: 500; color: var(--gray-600);
  background: #fff; border: 1px solid var(--gray-200); border-radius: 8px; transition: all .2s;
}
.pagination .page-numbers:hover { border-color: var(--blue-300); color: var(--blue-600); }
.pagination .page-numbers.current { background: var(--blue-600); color: #fff; border-color: var(--blue-600); }

/* ─── Footer (matches ip4.market) ──────────────────────────── */
.site-footer { background: var(--gray-900); color: var(--gray-300); padding: 4rem 0 0; }
.footer-inner { max-width: var(--container); margin: 0 auto; padding: 0 2rem; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2.5rem; margin-bottom: 3rem; }
.footer-col h4 { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #fff; margin-bottom: 1.25rem; }
.footer-col a { display: block; font-size: .875rem; color: var(--gray-400); padding: .3rem 0; transition: color .2s; }
.footer-col a:hover { color: #fff; }
.footer-col .coming-soon { font-size: .65rem; color: var(--gray-500); background: var(--gray-800); padding: 1px 6px; border-radius: 4px; margin-left: .5rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08); padding: 1.5rem 0;
  display: flex; justify-content: space-between; align-items: center;
  font-size: .8rem; color: var(--gray-500);
}
.footer-bottom a { color: var(--gray-500); }
.footer-bottom a:hover { color: var(--gray-300); }

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
  .footer-bottom { flex-direction: column; gap: .75rem; text-align: center; }
}

/* ─── Sidebar / Newsletter ─────────────────────────────────── */
.newsletter-box {
  background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 2rem; margin-bottom: 2rem;
}
.newsletter-box h4 { font-size: 1rem; font-weight: 700; color: var(--gray-900); margin-bottom: .5rem; }
.newsletter-box p { font-size: .85rem; color: var(--gray-500); margin-bottom: 1rem; }
.newsletter-form { display: flex; gap: .5rem; }
.newsletter-form input {
  flex: 1; padding: .6rem .75rem; border: 1px solid var(--gray-200);
  border-radius: 8px; font-size: .85rem; background: #fff;
}
.newsletter-form input:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.newsletter-form button {
  background: var(--blue-600); color: #fff; border: none; padding: .6rem 1.25rem;
  border-radius: 8px; font-weight: 600; font-size: .85rem; cursor: pointer;
}
.newsletter-form button:hover { background: var(--blue-700); }

/* ─── Utilities ────────────────────────────────────────────── */
.text-blue { color: var(--blue-600); }
.bg-blue-subtle { background: var(--blue-50); }
.mt-0 { margin-top: 0; }
