/*
Theme Name: Wtechni AI Lab
Theme URI: https://plugin.wtechni.com
Author: Wtechni
Author URI: https://plugin.wtechni.com
Description: A modern dark AI-themed WordPress blog theme with gradient accents, neural-glow design, card grid layouts and full Gutenberg support. Built for Wtechni Plugin Lab.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wtechni-ai
Tags: blog, dark, technology, two-columns, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready
*/

/* ============ Base & Variables ============ */
:root {
  --bg: #070b15;
  --bg-2: #0b1222;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-hover: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --text: #e8eefb;
  --muted: #93a3c0;
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --pink: #ec4899;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #22d3ee 100%);
  --grad-soft: linear-gradient(135deg, rgba(139, 92, 246, 0.16) 0%, rgba(34, 211, 238, 0.16) 100%);
  --radius: 18px;
  --maxw: 1180px;
  --contentw: 760px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 85% -100px, rgba(139, 92, 246, 0.12), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(34, 211, 238, 0.07), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--cyan); text-decoration: none; }
a:hover { color: #7ee0f5; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute;
}
.screen-reader-text:focus {
  clip: auto; clip-path: none; height: auto; width: auto;
  display: block; top: 8px; left: 8px; padding: 12px 18px; z-index: 100000;
  background: var(--bg-2); border-radius: 10px; font-weight: 600;
}

/* ============ Header ============ */
.site-header {
  position: sticky; top: 0; z-index: 900;
  background: rgba(7, 11, 21, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 68px; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand a { display: flex; align-items: center; gap: 12px; }
.custom-logo { max-height: 42px; width: auto; }
.brand-name {
  font-size: 1.22rem; font-weight: 800; letter-spacing: 0.2px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  white-space: nowrap;
}
.brand-glyph {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px;
  background: var(--grad); display: inline-flex; align-items: center; justify-content: center;
  color: #06121f; font-weight: 900; font-size: 1.05rem;
  box-shadow: 0 0 22px rgba(139, 92, 246, 0.45);
}
.brand-tag { display: block; font-size: 0.72rem; color: var(--muted); letter-spacing: 0.6px; text-transform: uppercase; -webkit-text-fill-color: var(--muted); }

.main-nav ul { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; align-items: center; flex-wrap: wrap; }
.main-nav a {
  color: var(--muted); font-weight: 600; font-size: 0.93rem;
  padding: 8px 14px; border-radius: 10px; transition: all 0.18s ease;
}
.main-nav a:hover { color: var(--text); background: var(--panel-hover); }
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a { color: var(--text); background: var(--grad-soft); box-shadow: inset 0 0 0 1px var(--line); }

.nav-toggle { display: none; }
.nav-burger { display: none; cursor: pointer; padding: 8px; border-radius: 10px; border: 1px solid var(--line); }
.nav-burger span { display: block; width: 20px; height: 2px; background: var(--text); margin: 4px 0; border-radius: 2px; }

@media (max-width: 900px) {
  .nav-burger { display: inline-block; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(9, 14, 27, 0.98); border-bottom: 1px solid var(--line);
    display: none; padding: 10px 22px 18px;
  }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .main-nav a { display: block; padding: 12px 14px; }
  .nav-toggle:checked ~ .main-nav { display: block; }
}

/* ============ Hero ============ */
.hero { position: relative; overflow: hidden; padding: 84px 0 64px; text-align: center; }
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.5;
  pointer-events: none; animation: floaty 9s ease-in-out infinite alternate;
}
.hero::before { width: 420px; height: 420px; background: rgba(139, 92, 246, 0.28); top: -160px; right: -80px; }
.hero::after { width: 360px; height: 360px; background: rgba(34, 211, 238, 0.18); bottom: -180px; left: -90px; animation-delay: 3s; }
.hero-grid-bg {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 75% 70% at 50% 35%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 35%, #000 30%, transparent 75%);
}
.hero-inner { position: relative; z-index: 2; max-width: 820px; margin: 0 auto; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--cyan); background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.25); padding: 7px 16px; border-radius: 999px;
}
.hero h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.4rem); line-height: 1.15; margin: 22px 0 14px; font-weight: 900;
  background: linear-gradient(120deg, #ffffff 30%, #b9a6ff 60%, #7ee7f7 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero .tagline { color: var(--muted); font-size: 1.12rem; max-width: 640px; margin: 0 auto 30px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.stat-chip {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 20px; font-size: 0.9rem; color: var(--muted);
}
.stat-chip b { color: var(--text); font-size: 1.05rem; margin-right: 6px; }

@keyframes floaty { from { transform: translateY(-12px); } to { transform: translateY(14px); } }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--grad); color: #071120 !important;
  font-weight: 800; font-size: 0.95rem; padding: 13px 26px; border-radius: 12px;
  border: 0; cursor: pointer; transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 8px 26px rgba(139, 92, 246, 0.35);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(34, 211, 238, 0.35); }
.btn-ghost {
  background: var(--panel); color: var(--text) !important; border: 1px solid var(--line);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--panel-hover); box-shadow: none; }

/* ============ Section Titles ============ */
.section-head { display: flex; align-items: center; gap: 14px; margin: 0 0 26px; }
.section-head h2 { font-size: 1.5rem; margin: 0; font-weight: 800; }
.section-bar { width: 5px; height: 26px; border-radius: 4px; background: var(--grad); flex: 0 0 5px; }

/* ============ Cards Grid ============ */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 24px; padding-bottom: 10px; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.card:hover { transform: translateY(-5px); border-color: rgba(139, 92, 246, 0.5); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(139, 92, 246, 0.18); }

.card-thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-2); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.card:hover .card-thumb img { transform: scale(1.06); }
.thumb-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: var(--grad-soft); font-size: 3rem; font-weight: 900;
  background-image: var(--grad-soft), radial-gradient(300px 160px at 80% 10%, rgba(139,92,246,0.25), transparent);
}
.card-cat {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase;
  color: #071120; background: var(--grad); padding: 5px 12px; border-radius: 999px;
}
.card-body { padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-title { margin: 0; font-size: 1.14rem; line-height: 1.4; font-weight: 750; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--cyan); }
.card-excerpt { color: var(--muted); font-size: 0.93rem; margin: 0; }
.card-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.82rem; margin-top: auto; padding-top: 6px; }
.card-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--violet); }
.card-link { font-size: 0.88rem; font-weight: 700; color: var(--cyan); }

/* ============ Archive / Search header ============ */
.archive-head { padding: 54px 0 8px; }
.archive-head h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 8px 0 10px; font-weight: 850; }
.archive-head .desc { color: var(--muted); margin: 0 0 18px; }
.archive-kicker { font-size: 0.8rem; letter-spacing: 1.4px; text-transform: uppercase; color: var(--cyan); font-weight: 800; }

/* ============ Single Post ============ */
.single-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 34px; padding: 46px 0 30px; }
@media (max-width: 1024px) { .single-wrap { grid-template-columns: 1fr; } }

.entry-header { margin-bottom: 24px; }
.entry-cat {
  display: inline-block; font-size: 0.75rem; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase; color: #071120; background: var(--grad);
  padding: 5px 14px; border-radius: 999px; margin-bottom: 14px;
}
.entry-title { font-size: clamp(1.75rem, 4.4vw, 2.6rem); line-height: 1.2; margin: 0 0 16px; font-weight: 850; }
.entry-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 0.9rem; }
.entry-meta .avatar { border-radius: 50%; vertical-align: middle; margin-right: 6px; }
.entry-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--violet); }

.entry-image { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); margin: 0 0 30px; }
.entry-image img { display: block; width: 100%; }

/* ============ Entry Content (Gutenberg) ============ */
.entry-content { font-size: 1.02rem; }
.entry-content p { line-height: 1.85; color: #d7e0f2; }
.entry-content > p:first-of-type { font-size: 1.09rem; color: var(--text); }
.entry-content h2 {
  font-size: 1.5rem; font-weight: 800; margin: 42px 0 16px; line-height: 1.3; position: relative; padding-left: 18px;
}
.entry-content h2::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 4px;
  border-radius: 4px; background: var(--grad);
}
.entry-content h3 { font-size: 1.2rem; font-weight: 750; margin: 30px 0 12px; color: var(--text); }
.entry-content a { color: var(--cyan); text-decoration: underline; text-decoration-color: rgba(34, 211, 238, 0.4); text-underline-offset: 3px; }
.entry-content a:hover { text-decoration-color: var(--cyan); }
.entry-content ul, .entry-content ol { padding-left: 24px; color: #d7e0f2; }
.entry-content li { margin: 8px 0; line-height: 1.75; }
.entry-content li::marker { color: var(--violet); font-weight: 700; }
.entry-content strong { color: var(--text); }
.entry-content code {
  background: rgba(139, 92, 246, 0.12); border: 1px solid rgba(139, 92, 246, 0.25);
  padding: 2px 7px; border-radius: 7px; font-size: 0.88em; color: #c4b5fd;
}
.entry-content pre {
  background: #0a0f1e; border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 20px; overflow: auto; font-size: 0.9rem; line-height: 1.6;
}
.entry-content pre code { background: none; border: 0; padding: 0; color: #9fe8f5; }
.entry-content blockquote {
  margin: 28px 0; padding: 18px 24px; border-left: 4px solid transparent;
  border-image: linear-gradient(180deg, #8b5cf6, #22d3ee) 1;
  background: var(--panel); border-radius: 0 14px 14px 0; color: var(--muted); font-style: italic;
}
.entry-content blockquote p { margin: 0; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 0.94rem; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 11px 14px; text-align: left; }
.entry-content th { background: var(--grad-soft); font-weight: 700; }
.entry-content .wp-block-image img { border-radius: 14px; }
.entry-content .alignwide { max-width: 1020px; margin-left: calc((100% - 1020px) / 2); margin-right: calc((100% - 1020px) / 2); }
.entry-content .wp-block-separator { border: 0; height: 1px; background: var(--line); margin: 36px 0; }
.entry-content .has-medium-font-size, .entry-content .has-large-font-size { line-height: 1.5; }

/* ============ Tags / Author / Post-nav ============ */
.post-tags { display: flex; flex-wrap: wrap; gap: 9px; margin: 34px 0 0; }
.post-tags a {
  font-size: 0.82rem; font-weight: 650; color: var(--muted);
  background: var(--panel); border: 1px solid var(--line);
  padding: 6px 14px; border-radius: 999px; transition: all 0.16s ease;
}
.post-tags a:hover { color: var(--text); border-color: rgba(139, 92, 246, 0.55); }

.author-box {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin: 36px 0 0;
}
.author-box img { border-radius: 50%; border: 2px solid rgba(139, 92, 246, 0.5); }
.author-box h3 { margin: 0 0 6px; font-size: 1.02rem; }
.author-box p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 36px 0 0; }
.post-nav a {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; display: block; transition: border-color 0.18s ease;
}
.post-nav a:hover { border-color: rgba(34, 211, 238, 0.5); }
.post-nav .label { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 6px; }
.post-nav .title { color: var(--text); font-weight: 700; font-size: 0.95rem; line-height: 1.45; }
.post-nav .next { text-align: right; }
@media (max-width: 640px) { .post-nav { grid-template-columns: 1fr; } }

/* ============ Pagination ============ */
.pagination { margin: 40px 0 10px; }
.nav-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.page-numbers {
  min-width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 14px; border-radius: 12px; background: var(--panel);
  border: 1px solid var(--line); color: var(--muted); font-weight: 700; font-size: 0.92rem;
}
.page-numbers.current { background: var(--grad); color: #071120; border-color: transparent; }
.page-numbers:hover:not(.current) { color: var(--text); border-color: rgba(139, 92, 246, 0.5); }

/* ============ Sidebar ============ */
.widget-area { display: flex; flex-direction: column; gap: 22px; }
.widget {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px;
}
.widget-title { font-size: 1rem; font-weight: 800; margin: 0 0 16px; display: flex; align-items: center; gap: 10px; }
.widget-title::before { content: ""; width: 4px; height: 16px; border-radius: 3px; background: var(--grad); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 9px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.07); font-size: 0.93rem; }
.widget li:last-child { border-bottom: 0; }
.widget li a { color: #c9d5ea; }
.widget li a:hover { color: var(--cyan); }
.widget .post-date { display: block; font-size: 0.78rem; color: var(--muted); }
.widget_search input[type="search"] {
  width: 100%; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 16px; color: var(--text); font-size: 0.95rem; outline: none;
}
.widget_search input[type="search"]:focus { border-color: rgba(139, 92, 246, 0.6); }
.widget_tag_cloud .tagcloud a, .wp-block-tag-cloud a {
  display: inline-block; font-size: 0.8rem !important; color: var(--muted);
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 13px; margin: 0 5px 7px 0;
}
.widget_tag_cloud .tagcloud a:hover { color: var(--text); border-color: rgba(139, 92, 246, 0.55); }

/* ============ Comments ============ */
.comments-area { margin-top: 44px; }
.comments-area > h2, .comments-title { font-size: 1.3rem; font-weight: 800; }
.comment-list { list-style: none; padding: 0; margin: 0 0 30px; }
.comment-list .comment { border: 1px solid var(--line); background: var(--panel); border-radius: 16px; padding: 18px 20px; margin: 14px 0; }
.comment-list .children { list-style: none; margin: 14px 0 0; padding-left: 22px; }
.comment-meta { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; color: var(--muted); margin-bottom: 10px; }
.comment-author .fn { color: var(--text); font-weight: 700; font-style: normal; }
.comment-author img { border-radius: 50%; }
.comment-content p { margin: 6px 0; color: #d7e0f2; font-size: 0.95rem; }
.reply a { font-size: 0.83rem; font-weight: 700; }
.comment-form label { display: block; font-size: 0.88rem; font-weight: 650; margin-bottom: 6px; color: var(--muted); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width: 100%; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 15px; color: var(--text); font-size: 0.95rem; outline: none; margin-bottom: 14px;
}
.comment-form input:focus, .comment-form textarea:focus { border-color: rgba(139, 92, 246, 0.6); }
.comment-form .submit { background: var(--grad); color: #071120; border: 0; font-weight: 800; padding: 13px 28px; border-radius: 12px; cursor: pointer; }
.comment-notes, .logged-in-as { color: var(--muted); font-size: 0.88rem; }

/* ============ Footer ============ */
.site-footer { margin-top: 70px; border-top: 1px solid var(--line); position: relative; }
.site-footer::before {
  content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, #8b5cf6 30%, #22d3ee 70%, transparent);
}
.footer-widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 30px; padding: 44px 0 30px; }
.footer-widgets .widget { background: none; border: 0; padding: 0; }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 20px 0 26px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.87rem;
}
.footer-bottom .heart { color: var(--pink); }
.footer-nav ul { list-style: none; display: flex; gap: 18px; margin: 0; padding: 0; flex-wrap: wrap; }
.footer-nav a { color: var(--muted); font-size: 0.87rem; }
.footer-nav a:hover { color: var(--cyan); }

/* ============ 404 / No results ============ */
.error-404 { text-align: center; padding: 90px 0 60px; }
.error-404 .code {
  font-size: clamp(4.5rem, 16vw, 9rem); font-weight: 900; line-height: 1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.error-404 h1 { font-size: 1.5rem; margin: 10px 0 12px; }
.error-404 p { color: var(--muted); max-width: 460px; margin: 0 auto 26px; }
.no-results { text-align: center; padding: 60px 0; color: var(--muted); }

/* ============ Motion & misc ============ */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
::selection { background: rgba(139, 92, 246, 0.45); color: #fff; }
