/*
Theme Name: CodeNexy Gaming Tech
Theme URI: https://codenexy.com/
Author: CodeNexy
Author URI: https://codenexy.com/
Description: A fast, responsive Gaming + Tech magazine theme built for CodeNexy. Includes featured stories, category sections, reviews, guides, ad-ready widget areas, dark mode styling, and SEO-friendly article layouts.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: codenexy
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: blog, news, gaming, technology, dark, two-columns, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

:root {
  --cx-bg: #090b10;
  --cx-surface: #10141d;
  --cx-surface-2: #151b27;
  --cx-border: #232b3a;
  --cx-text: #f6f7fb;
  --cx-muted: #9ea8ba;
  --cx-accent: #6d5dfc;
  --cx-accent-2: #19c3ff;
  --cx-success: #3ddc97;
  --cx-danger: #ff5d6c;
  --cx-radius: 18px;
  --cx-shadow: 0 18px 60px rgba(0,0,0,.28);
  --cx-container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cx-bg);
  color: var(--cx-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--cx-accent-2); }
img { max-width: 100%; height: auto; display: block; }
button, input, textarea, select { font: inherit; }
::selection { background: var(--cx-accent); color: #fff; }

.cx-container { width: min(calc(100% - 32px), var(--cx-container)); margin-inline: auto; }
.cx-site { min-height: 100vh; overflow: hidden; }
.cx-skip-link { position: absolute; left: -9999px; top: 0; z-index: 9999; }
.cx-skip-link:focus { left: 16px; top: 16px; background: #fff; color: #111; padding: 10px 14px; border-radius: 8px; }

/* Header */
.cx-topbar { border-bottom: 1px solid var(--cx-border); background: #07090d; color: var(--cx-muted); font-size: 13px; }
.cx-topbar-inner { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.cx-topbar a { color: #d9deea; }
.cx-topbar a:hover { color: var(--cx-accent-2); }
.cx-header { position: sticky; top: 0; z-index: 100; background: rgba(9,11,16,.92); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(35,43,58,.86); }
.cx-header-inner { min-height: 76px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; }
.cx-brand { display: flex; align-items: center; gap: 12px; min-width: 190px; }
.cx-brand-mark { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg,var(--cx-accent),var(--cx-accent-2)); display: grid; place-items: center; font-weight: 900; box-shadow: 0 8px 26px rgba(109,93,252,.34); }
.cx-brand-text { font-weight: 900; letter-spacing: .8px; font-size: 21px; }
.cx-brand-text span { color: var(--cx-accent-2); }
.custom-logo { max-height: 44px; width: auto; }
.cx-nav { justify-self: center; }
.cx-nav ul { list-style: none; display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; }
.cx-nav a { display: block; padding: 10px 12px; color: #dfe4ef; font-size: 14px; font-weight: 700; border-radius: 10px; }
.cx-nav a:hover, .cx-nav .current-menu-item > a { background: var(--cx-surface-2); color: #fff; }
.cx-header-actions { display: flex; align-items: center; gap: 10px; }
.cx-icon-btn { width: 42px; height: 42px; border: 1px solid var(--cx-border); color: #fff; background: var(--cx-surface); border-radius: 12px; display: grid; place-items: center; cursor: pointer; }
.cx-icon-btn:hover { border-color: var(--cx-accent); }
.cx-menu-toggle { display: none; }
.cx-search-panel { display: none; padding: 18px 0; border-top: 1px solid var(--cx-border); }
.cx-search-panel.is-open { display: block; }
.cx-search-form { display: flex; gap: 10px; }
.cx-search-form input[type="search"] { flex: 1; min-width: 0; background: var(--cx-surface); color: #fff; border: 1px solid var(--cx-border); border-radius: 12px; padding: 13px 15px; outline: none; }
.cx-search-form input[type="search"]:focus { border-color: var(--cx-accent); box-shadow: 0 0 0 3px rgba(109,93,252,.12); }
.cx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; background: linear-gradient(135deg,var(--cx-accent),#5548df); color: #fff; font-weight: 800; border: 0; border-radius: 12px; cursor: pointer; box-shadow: 0 12px 32px rgba(109,93,252,.2); }
.cx-btn:hover { color: #fff; transform: translateY(-1px); }

/* Generic */
.cx-main { padding: 34px 0 64px; }
.cx-section { padding: 34px 0; }
.cx-section-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.cx-eyebrow { color: var(--cx-accent-2); text-transform: uppercase; letter-spacing: 1.8px; font-size: 12px; font-weight: 900; }
.cx-section-title { margin: 3px 0 0; font-size: clamp(24px,3vw,34px); line-height: 1.15; }
.cx-section-link { color: var(--cx-muted); font-weight: 800; font-size: 14px; }
.cx-section-link:hover { color: var(--cx-accent-2); }
.cx-grid { display: grid; gap: 20px; }
.cx-grid-2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.cx-grid-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
.cx-grid-4 { grid-template-columns: repeat(4,minmax(0,1fr)); }
.cx-card { background: var(--cx-surface); border: 1px solid var(--cx-border); border-radius: var(--cx-radius); overflow: hidden; transition: transform .2s ease,border-color .2s ease,box-shadow .2s ease; }
.cx-card:hover { transform: translateY(-4px); border-color: #35405a; box-shadow: var(--cx-shadow); }
.cx-card-media { position: relative; aspect-ratio: 16/9; overflow: hidden; background: linear-gradient(135deg,#141a26,#0e1118); }
.cx-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.cx-card:hover .cx-card-media img { transform: scale(1.035); }
.cx-card-body { padding: 18px; }
.cx-card-title { margin: 8px 0 10px; font-size: 19px; line-height: 1.28; }
.cx-card-title a:hover { color: #fff; }
.cx-card-excerpt { color: var(--cx-muted); margin: 0 0 12px; font-size: 14px; line-height: 1.62; }
.cx-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--cx-muted); font-size: 12px; font-weight: 650; }
.cx-badge { display: inline-flex; align-items: center; padding: 5px 9px; background: rgba(109,93,252,.15); border: 1px solid rgba(109,93,252,.34); color: #cfcaff; border-radius: 999px; font-size: 11px; line-height: 1; font-weight: 900; text-transform: uppercase; letter-spacing: .55px; }
.cx-badge.tech { background: rgba(25,195,255,.12); border-color: rgba(25,195,255,.3); color: #8ce4ff; }
.cx-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: #637089; font-weight: 900; letter-spacing: 1px; }

/* Hero */
.cx-hero { padding: 26px 0 18px; }
.cx-hero-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(320px,.85fr); gap: 20px; }
.cx-featured { min-height: 480px; position: relative; border-radius: 24px; overflow: hidden; border: 1px solid var(--cx-border); background: #121723; }
.cx-featured img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.cx-featured::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg,rgba(5,7,11,.05) 20%,rgba(5,7,11,.92) 100%); }
.cx-featured-content { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 34px; }
.cx-featured-title { margin: 12px 0 12px; max-width: 850px; font-size: clamp(30px,4vw,52px); line-height: 1.03; letter-spacing: -.9px; }
.cx-featured-excerpt { margin: 0 0 16px; color: #d7dbe5; max-width: 700px; font-size: 15px; }
.cx-side-stack { display: grid; gap: 20px; }
.cx-mini-feature { position: relative; min-height: 230px; border-radius: 20px; overflow: hidden; border: 1px solid var(--cx-border); background: #121723; }
.cx-mini-feature img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cx-mini-feature::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg,rgba(6,8,12,.12),rgba(6,8,12,.92)); }
.cx-mini-feature-content { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 21px; }
.cx-mini-feature h3 { margin: 9px 0 8px; font-size: 21px; line-height: 1.18; }

/* Trend strip */
.cx-trendbar { margin-top: 22px; background: var(--cx-surface); border: 1px solid var(--cx-border); border-radius: 16px; padding: 12px 14px; display: flex; align-items: center; gap: 15px; overflow: hidden; }
.cx-trendbar-label { flex: 0 0 auto; color: #fff; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .9px; padding: 7px 10px; background: linear-gradient(135deg,var(--cx-accent),#5143d8); border-radius: 8px; }
.cx-trendbar-items { display: flex; gap: 24px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.cx-trendbar-items::-webkit-scrollbar { display: none; }
.cx-trendbar a { flex: 0 0 auto; color: #d6dbe7; font-size: 13px; font-weight: 750; }

/* Content + sidebar */
.cx-layout { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 34px; align-items: start; }
.cx-sidebar { display: grid; gap: 22px; position: sticky; top: 100px; }
.cx-widget { background: var(--cx-surface); border: 1px solid var(--cx-border); border-radius: 18px; padding: 20px; }
.cx-widget-title { margin: 0 0 16px; font-size: 17px; }
.cx-widget ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cx-widget li { color: #c8cfdd; font-size: 14px; }
.cx-widget input, .cx-widget select { width: 100%; background: #0c1017; color: #fff; border: 1px solid var(--cx-border); border-radius: 10px; padding: 10px 12px; }
.cx-ad { min-height: 120px; display: grid; place-items: center; text-align: center; border: 1px dashed #3a455d; color: #6f7b91; border-radius: 14px; background: rgba(255,255,255,.015); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }

/* Article */
.cx-article { background: var(--cx-surface); border: 1px solid var(--cx-border); border-radius: 22px; overflow: hidden; }
.cx-article-header { padding: 34px 34px 24px; }
.cx-article-title { margin: 10px 0 15px; font-size: clamp(34px,5vw,58px); line-height: 1.05; letter-spacing: -1.2px; }
.cx-article-hero { aspect-ratio: 16/8.6; background: #111621; }
.cx-article-hero img { width: 100%; height: 100%; object-fit: cover; }
.cx-article-body { padding: 34px; color: #dde2ec; font-size: 17px; }
.cx-article-body > *:first-child { margin-top: 0; }
.cx-article-body h2, .cx-article-body h3 { color: #fff; line-height: 1.22; scroll-margin-top: 110px; }
.cx-article-body h2 { margin-top: 38px; font-size: 30px; }
.cx-article-body h3 { margin-top: 28px; font-size: 23px; }
.cx-article-body p { margin: 0 0 20px; }
.cx-article-body a { color: #8ce4ff; text-decoration: underline; text-underline-offset: 3px; }
.cx-article-body blockquote { margin: 28px 0; padding: 20px 22px; border-left: 4px solid var(--cx-accent); background: #0d1119; border-radius: 0 12px 12px 0; color: #eef1f6; }
.cx-article-body table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 15px; }
.cx-article-body th,.cx-article-body td { border: 1px solid var(--cx-border); padding: 12px; text-align: left; }
.cx-article-body th { background: #121926; color: #fff; }
.cx-article-body pre { overflow: auto; background: #080a0f; border: 1px solid var(--cx-border); border-radius: 12px; padding: 16px; }
.cx-article-body code { background: #0d1119; border-radius: 5px; padding: 2px 6px; }
.cx-toc { margin: 0 0 28px; padding: 20px; background: #0c1017; border: 1px solid var(--cx-border); border-radius: 16px; }
.cx-toc h2 { margin: 0 0 10px!important; font-size: 18px!important; }
.cx-toc ol { margin: 0; padding-left: 20px; }
.cx-toc li { margin: 6px 0; }
.cx-toc a { text-decoration: none; color: #cfd7e7; }
.cx-post-tags { padding: 0 34px 30px; display: flex; flex-wrap: wrap; gap: 8px; }
.cx-post-tags a { border: 1px solid var(--cx-border); background: #0c1017; color: #c7cfde; padding: 7px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.cx-author-box { margin-top: 24px; padding: 22px; display: grid; grid-template-columns: auto 1fr; gap: 16px; background: var(--cx-surface); border: 1px solid var(--cx-border); border-radius: 18px; }
.cx-author-box img { border-radius: 50%; }
.cx-author-box h3 { margin: 0 0 4px; }
.cx-author-box p { margin: 0; color: var(--cx-muted); font-size: 14px; }
.cx-post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.cx-post-nav a { display: block; padding: 17px; background: var(--cx-surface); border: 1px solid var(--cx-border); border-radius: 14px; }
.cx-post-nav span { display: block; color: var(--cx-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 4px; }

/* Archive/Page */
.cx-page-header { margin-bottom: 26px; padding: 28px; background: linear-gradient(135deg,#101521,#0d1119); border: 1px solid var(--cx-border); border-radius: 20px; }
.cx-page-header h1 { margin: 0 0 8px; font-size: clamp(32px,4vw,48px); line-height: 1.1; }
.cx-page-header p { margin: 0; color: var(--cx-muted); }
.cx-pagination { margin-top: 30px; display: flex; justify-content: center; }
.cx-pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.cx-pagination a,.cx-pagination span { min-width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--cx-border); background: var(--cx-surface); border-radius: 10px; font-weight: 800; }
.cx-pagination .current { background: var(--cx-accent); border-color: var(--cx-accent); }

/* Comments */
.comments-area { margin-top: 24px; padding: 24px; background: var(--cx-surface); border: 1px solid var(--cx-border); border-radius: 18px; }
.comment-list { padding-left: 20px; }
.comment-body { padding: 18px 0; border-bottom: 1px solid var(--cx-border); }
.comment-form input:not([type="submit"]), .comment-form textarea { width: 100%; background: #0c1017; color: #fff; border: 1px solid var(--cx-border); border-radius: 10px; padding: 11px 13px; }
.form-submit .submit { border: 0; background: var(--cx-accent); color: #fff; font-weight: 800; border-radius: 10px; padding: 11px 16px; cursor: pointer; }

/* Footer */
.cx-footer { margin-top: 40px; border-top: 1px solid var(--cx-border); background: #07090d; }
.cx-footer-top { padding: 50px 0 34px; display: grid; grid-template-columns: 1.25fr repeat(3,1fr); gap: 30px; }
.cx-footer-brand p { color: var(--cx-muted); max-width: 420px; font-size: 14px; }
.cx-footer h3 { font-size: 15px; margin: 0 0 15px; }
.cx-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.cx-footer li,.cx-footer a { color: #aeb8c9; font-size: 14px; }
.cx-footer-bottom { border-top: 1px solid var(--cx-border); min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #758095; font-size: 13px; }

@media (max-width: 1020px) {
  .cx-nav { display: none; position: absolute; left: 16px; right: 16px; top: 76px; padding: 14px; background: #0d1119; border: 1px solid var(--cx-border); border-radius: 14px; box-shadow: var(--cx-shadow); }
  .cx-nav.is-open { display: block; }
  .cx-nav ul { flex-direction: column; align-items: stretch; }
  .cx-menu-toggle { display: grid; }
  .cx-header-inner { grid-template-columns: 1fr auto; }
  .cx-header-actions { justify-self: end; }
  .cx-hero-grid { grid-template-columns: 1fr; }
  .cx-side-stack { grid-template-columns: 1fr 1fr; }
  .cx-layout { grid-template-columns: 1fr; }
  .cx-sidebar { position: static; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .cx-footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .cx-topbar { display: none; }
  .cx-header-inner { min-height: 68px; }
  .cx-nav { top: 68px; }
  .cx-brand { min-width: 0; }
  .cx-brand-text { font-size: 18px; }
  .cx-hero { padding-top: 18px; }
  .cx-featured { min-height: 420px; }
  .cx-featured-content { padding: 24px; }
  .cx-featured-title { font-size: 34px; }
  .cx-featured-excerpt { display: none; }
  .cx-side-stack { grid-template-columns: 1fr; }
  .cx-mini-feature { min-height: 210px; }
  .cx-grid-4,.cx-grid-3,.cx-grid-2 { grid-template-columns: 1fr; }
  .cx-sidebar { grid-template-columns: 1fr; }
  .cx-article-header,.cx-article-body { padding: 24px 20px; }
  .cx-article-title { font-size: 37px; }
  .cx-article-body { font-size: 16px; }
  .cx-post-tags { padding-inline: 20px; }
  .cx-post-nav { grid-template-columns: 1fr; }
  .cx-footer-top { grid-template-columns: 1fr; }
  .cx-footer-bottom { align-items: flex-start; flex-direction: column; padding: 18px 0; }
  .cx-section-header { align-items: flex-start; }
}
