/*
Theme Name: PixelXtreme
Theme URI: https://www.ecwxt.com
Author: PixelXtreme
Description: A modern, gallery-first wallpaper theme with hero showcase, responsive masonry grid, category chips and a download-focused single view.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: pixelxtreme
*/

:root {
  --bg: #0b0c10;
  --bg-soft: #111319;
  --surface: #151821;
  --surface-2: #1b1f2a;
  --line: rgba(255, 255, 255, .08);
  --text: #eef1f7;
  --muted: #98a1b3;
  --accent: #6ea8fe;
  --accent-2: #c084fc;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --container: 1360px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(110, 168, 254, .16), transparent 60%),
    radial-gradient(700px 420px at 92% 0%, rgba(192, 132, 252, .12), transparent 65%);
  z-index: 0;
}

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

a { color: inherit; text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 { line-height: 1.22; margin: 0 0 .55em; font-weight: 700; letter-spacing: -.02em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--accent); color: #08101f; padding: 10px 16px; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(11, 12, 16, .72);
  border-bottom: 1px solid var(--line);
}

.site-header.is-scrolled { background: rgba(9, 10, 14, .9); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }

/* ---------- Portal bar (sibling sites) ---------- */
.portal-bar { border-bottom: 1px solid var(--line); background: rgba(9, 10, 14, .55); }
.portal-inner { display: flex; align-items: center; gap: 14px; min-height: 36px; }
.portal-label {
  font-size: .64rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: #7f8ba0; white-space: nowrap;
}
.portal-nav { margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.portal-nav::-webkit-scrollbar { display: none; }
.portal-list { list-style: none; display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; }
.portal-list a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; color: #aeb8c9;
  border: 1px solid transparent; white-space: nowrap;
}
.portal-list a::after {
  content: "↗"; font-size: .72rem; color: #6f7c92;
  transition: color .18s ease, transform .18s ease;
}
.portal-list a:hover {
  color: #fff; background: rgba(110, 168, 254, .12); border-color: rgba(110, 168, 254, .35);
}
.portal-list a:hover::after { color: var(--accent); transform: translate(1px, -1px); }

.header-inner {
  display: flex; align-items: center; gap: 26px;
  min-height: 68px;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.03em; font-size: 1.25rem; }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  color: #0a0d14; font-size: 15px; font-weight: 900;
  box-shadow: 0 6px 18px rgba(110, 168, 254, .35);
}
.brand small { display: block; font-size: .62rem; letter-spacing: .18em; color: var(--muted); font-weight: 600; text-transform: uppercase; }

.main-nav { margin-left: auto; }
.main-nav ul { list-style: none; display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; }
.main-nav a {
  display: inline-block; padding: 8px 12px; border-radius: 10px;
  font-size: .93rem; color: var(--muted); font-weight: 500;
}
.main-nav a:hover { color: var(--text); background: var(--surface-2); }
.main-nav .current-menu-item > a, .main-nav .current_page_item > a { color: var(--text); background: var(--surface-2); }

.header-search { flex: 0 0 auto; }
.header-search form { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 4px 4px 14px; }
.header-search input[type="search"] {
  border: 0; background: transparent; color: var(--text); outline: none;
  font-size: .9rem; width: 170px; padding: 6px 0;
}
.header-search input::placeholder { color: #6f7789; }
.header-search button {
  border: 0; cursor: pointer; border-radius: 999px; padding: 7px 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0a0d14; font-weight: 700; font-size: .82rem;
}

/* ---------- Hero ---------- */
.hero { margin: 26px 0 10px; }
.hero-card {
  position: relative; overflow: hidden; border-radius: 24px;
  min-height: clamp(320px, 50vh, 540px);
  display: flex; align-items: flex-end;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.hero-card img.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8, 9, 13, .1) 0%, rgba(8, 9, 13, .55) 55%, rgba(8, 9, 13, .92) 100%);
}
.hero-body { position: relative; z-index: 2; padding: clamp(22px, 4vw, 44px); max-width: 760px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: #cfe0ff; background: rgba(110, 168, 254, .14);
  border: 1px solid rgba(110, 168, 254, .32);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 14px;
}
.hero-body h1 { font-size: clamp(1.65rem, 4vw, 3rem); margin-bottom: 10px; }
.hero-body h1 a:hover { color: inherit; }
.hero-body p { color: #c8cfdd; margin: 0 0 18px; font-size: clamp(.95rem, 1.4vw, 1.05rem); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 12px; font-weight: 700; font-size: .92rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #0a0d14;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(110, 168, 254, .3); color: #0a0d14; }
.btn.ghost { background: rgba(255, 255, 255, .06); color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: rgba(255, 255, 255, .12); box-shadow: none; }

/* ---------- Sections ---------- */
.section { margin: 44px 0; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); margin: 0; }
.section-head .count { color: var(--muted); font-size: .86rem; }
.section-head .more { margin-left: auto; font-size: .88rem; color: var(--muted); }
.section-head .more:hover { color: var(--accent); }

/* ---------- Category chips ---------- */
.chips { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 8px 15px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--muted); font-size: .86rem; font-weight: 600; white-space: nowrap;
}
.chip:hover, .chip.active { color: var(--text); border-color: rgba(110, 168, 254, .5); background: rgba(110, 168, 254, .12); }

/* ---------- Grid / cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
  align-items: start;
}
.grid.tight { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }

.card {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(0, 0, 0, .42); border-color: rgba(110, 168, 254, .35); color: inherit; }
.card-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #0f1117; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease, opacity .3s ease; }
.card:hover .card-media img { transform: scale(1.04); }
.card-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(6, 7, 10, .82) 100%);
  opacity: .85; transition: opacity .2s ease;
}
.card-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 14px 13px; z-index: 2; }
.card-title {
  font-size: .95rem; font-weight: 650; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .5);
}
.card-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: .72rem; color: #cbd4e4; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .16);
  font-size: .68rem; font-weight: 700; letter-spacing: .02em; backdrop-filter: blur(6px);
}

/* ---------- Single ---------- */
.post-wrap { max-width: 1180px; margin: 0 auto; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .82rem; color: var(--muted); margin: 22px 0 16px; }
.breadcrumbs a:hover { color: var(--accent); }

.post-header { margin-bottom: 22px; }
.post-header h1 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); margin-bottom: 12px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--muted); font-size: .86rem; }

.stage {
  position: relative; border-radius: 20px; overflow: hidden;
  background: #0f1117; border: 1px solid var(--line); box-shadow: var(--shadow);
}
.stage img { width: 100%; max-height: 74vh; object-fit: contain; background: #0a0b0f; }
.stage-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 16px 18px; border-top: 1px solid var(--line); background: var(--surface); }
.stage-actions .spacer { flex: 1; }
.stage-actions .hint { font-size: .8rem; color: var(--muted); }

.post-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; margin-top: 28px; align-items: start; }
.content-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(18px, 2.4vw, 30px); }
.content-card p { color: #cfd6e4; }
.content-card h3 { font-size: 1.05rem; margin-top: 1.4em; }
.content-card ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.content-card li { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: .88rem; color: var(--muted); }
.content-card li strong { color: var(--text); font-weight: 650; }
.content-card img { border-radius: 14px; margin: 10px 0; }

.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin-bottom: 18px; }
.side-card h3 { font-size: .95rem; margin-bottom: 12px; letter-spacing: .02em; }
.spec-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: .87rem; }
.spec-list li { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.spec-list li span:last-child { color: var(--text); font-weight: 600; text-align: right; }
.side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.side-list a { display: flex; justify-content: space-between; gap: 10px; font-size: .87rem; color: var(--muted); }
.side-list a:hover { color: var(--accent); }

/* ---------- Archives ---------- */
.archive-head { margin: 28px 0 24px; }
.archive-head h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 6px; }
.archive-head p { color: var(--muted); margin: 0; font-size: .92rem; }

/* ---------- Pagination ---------- */
.pagination { margin: 34px 0 10px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pagination .page-numbers {
  display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 12px;
  border-radius: 11px; background: var(--surface); border: 1px solid var(--line);
  color: var(--muted); font-size: .87rem; font-weight: 600;
}
.pagination .page-numbers:hover { color: var(--text); border-color: rgba(110, 168, 254, .45); }
.pagination .current { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #0a0d14; border-color: transparent; }
.pagination .dots { background: transparent; border-color: transparent; }

/* ---------- Empty / 404 ---------- */
.empty { text-align: center; padding: 80px 20px; color: var(--muted); }
.empty h1, .empty h2 { color: var(--text); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 60px; border-top: 1px solid var(--line); background: rgba(12, 13, 18, .7); }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 34px; padding: 44px 0 26px; }
.footer-inner p { color: var(--muted); font-size: .88rem; margin: 10px 0 0; max-width: 340px; }
.footer-col h4 { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: #bcc7db; margin-bottom: 12px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .88rem; }
.footer-col a { color: var(--muted); }
.footer-col a:hover { color: var(--accent); }
.copyright { border-top: 1px solid var(--line); padding: 16px 0 22px; font-size: .8rem; color: #7c8598; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Motion ---------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .post-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .header-inner { flex-wrap: wrap; gap: 12px; padding: 10px 0; }
  .main-nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .main-nav ul { gap: 2px; }
  .header-search { margin-left: auto; }
  .header-search input[type="search"] { width: 130px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
  .card-title { font-size: .85rem; }
}

@media (max-width: 560px) {
  .container { padding: 0 16px; }
  .brand small { display: none; }
  .header-search input[type="search"] { width: 96px; }
  .hero-card { border-radius: 18px; min-height: 300px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-body { padding: 10px; }
  .card-meta { display: none; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .content-card ul { grid-template-columns: 1fr 1fr; }
}
