/*
Theme Name: Affiox Ultra
Theme URI: https://affiox.com
Author: Affiox
Author URI: https://affiox.com
Description: Premium AI/Automation-first WordPress theme with futuristic glass + neon, worlds grid, multi-mode UI, and performance-first motion.
Version: 2.1.0
Requires at least: 6.2
Tested up to: 6.6
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: affiox-ultra
Tags: custom-background, custom-logo, custom-menu, featured-images, rtl-language-support, editor-style, block-styles, wide-blocks, accessibility-ready
*/

/* =========================================================
   0) Tokens / Base
   ========================================================= */
:root{
  --affiox-bg: #06070B;
  --affiox-bg2:#070914;
  --affiox-text:#EAF0FF;
  --affiox-muted: rgba(234,240,255,.72);
  --affiox-border: rgba(234,240,255,.12);

  --affiox-surface: rgba(255,255,255,.06);
  --affiox-surface2: rgba(255,255,255,.10);

  --affiox-cyan:#29F7FF;
  --affiox-magenta:#FF2D95;
  --affiox-violet:#7B61FF;
  --affiox-lime:#B8FF2C;

  --affiox-radius-xl: 26px;
  --affiox-radius-lg: 20px;
  --affiox-radius-md: 14px;
  --affiox-radius-sm: 12px;

  --affiox-shadow-glass: 0 12px 40px rgba(0,0,0,.35);
  --affiox-shadow-neon:
    0 0 0 1px rgba(41,247,255,.20),
    0 18px 60px rgba(123,97,255,.16),
    0 10px 26px rgba(255,45,149,.12);

  --affiox-max: 1200px;
  --affiox-wide: 1440px;

  --affiox-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  --affiox-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  color-scheme: dark;
}

html{ scroll-behavior:smooth; }
*,
*::before,
*::after{ box-sizing:border-box; }

body{
  margin:0;
  background: var(--affiox-bg);
  color: var(--affiox-text);
  font-family: var(--affiox-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img{ max-width:100%; height:auto; }
a{ color: var(--affiox-cyan); text-decoration:none; }
a:hover{ color: var(--affiox-magenta); }

.affiox-container{
  width: min(100% - 2rem, var(--affiox-max));
  margin-inline:auto;
}
.affiox-wide{
  width: min(100% - 2rem, var(--affiox-wide));
  margin-inline:auto;
}

:focus-visible{
  outline: 2px solid rgba(41,247,255,.65);
  outline-offset: 2px;
  border-radius: 10px;
}

/* =========================================================
   1) Modes: Dark / Light / Ultra + Reader
   ========================================================= */
html[data-affiox-mode="light"]{ color-scheme: light; }
html[data-affiox-mode="light"] body{
  background:#F7FAFF;
  color:#0C1020;
}
html[data-affiox-mode="light"] a{ color:#125CFF; }
html[data-affiox-mode="light"] a:hover{ color:#0C1020; }

html[data-affiox-mode="light"]{
  --affiox-text:#0C1020;
  --affiox-muted: rgba(12,16,32,.70);
  --affiox-border: rgba(12,16,32,.12);
  --affiox-surface: rgba(12,16,32,.04);
  --affiox-surface2: rgba(12,16,32,.06);
  --affiox-shadow-glass: 0 14px 46px rgba(12,16,32,.10);
}

html[data-affiox-mode="ultra"] body{ background:#02030A; }

html[data-affiox-reader="1"] .reveal{
  opacity:1 !important;
  transform:none !important;
  transition:none !important;
}
html[data-affiox-reader="1"] .affiox-hero-bg{ filter:none !important; }
html[data-affiox-reader="1"] .affiox-glow{ display:none !important; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  * { transition:none !important; animation:none !important; scroll-behavior:auto !important; }
}

/* =========================================================
   2) Header: Premium Horizontal + Apple-style Nav (FIXED)
   ========================================================= */
.affiox-header{
  position: sticky;
  top:0;
  z-index: 999;
  background: rgba(6,7,11,.72);
  border-bottom: 1px solid rgba(234,240,255,.10);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

html[data-affiox-mode="light"] .affiox-header{
  background: rgba(247,250,255,.92);
  border-bottom-color: rgba(12,16,32,.10);
}

.affiox-header-inner{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}

/* Brand */
.affiox-brand-link{
  display:flex;
  align-items:center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: -.02em;
  color: var(--affiox-text);
  white-space: nowrap;
}
.affiox-brand-text{ font-weight: 900; }
.affiox-logo{
  width: 34px; height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(41,247,255,.85), rgba(123,97,255,.75), rgba(255,45,149,.70));
  box-shadow: var(--affiox-shadow-neon);
}

/* IMPORTANT: remove bullets ONLY inside nav menus */
.affiox-nav,
.affiox-nav ul,
.affiox-nav li{
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Apple-style nav list from wp_nav_menu */
.affiox-nav-list{
  display:flex;
  align-items:center;
  gap: 18px;
  list-style:none;
  margin:0;
  padding:0;
  white-space: nowrap;
}
.affiox-nav-list > li{ margin:0; padding:0; }
.affiox-nav-list > li > a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color: var(--affiox-text);
  opacity:.78;
  font-weight: 850;
  padding: 10px 10px;
  border-radius: 12px;
  transition: transform .2s ease, opacity .2s ease, background .2s ease;
}
.affiox-nav-list > li > a:hover{
  opacity:1;
  background: rgba(255,255,255,.06);
  transform: translateY(-1px);
}
html[data-affiox-mode="light"] .affiox-nav-list > li > a:hover{
  background: rgba(12,16,32,.06);
}

/* Actions */
.affiox-actions{
  display:flex;
  align-items:center;
  gap: 10px;
}

/* Icon buttons */
.affiox-iconbtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--affiox-border);
  background: var(--affiox-surface);
  color: var(--affiox-text);
  cursor:pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
  box-shadow: 0 14px 40px rgba(0,0,0,.16);
}
.affiox-iconbtn:hover{
  transform: translateY(-1px);
  border-color: rgba(41,247,255,.22);
  background: rgba(255,255,255,.08);
}
html[data-affiox-mode="light"] .affiox-iconbtn:hover{
  background: rgba(12,16,32,.06);
}

/* Mode dropdown */
.affiox-modewrap{ position: relative; }
.affiox-modemenu{
  position:absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  border-radius: 18px;
  border: 1px solid var(--affiox-border);
  background: rgba(10,12,20,.92);
  box-shadow: 0 40px 120px rgba(0,0,0,.45);
  backdrop-filter: blur(16px);
  padding: 10px;
  display:none;
}
html[data-affiox-mode="light"] .affiox-modemenu{
  background: rgba(255,255,255,.95);
  box-shadow: 0 18px 70px rgba(12,16,32,.18);
}
.affiox-modemenu.is-open{ display:block; }

.affiox-modemenu .row{
  display:flex;
  flex-direction: column;
  gap: 8px;
}
.affiox-modemenu button{
  width:100%;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--affiox-border);
  background: var(--affiox-surface);
  color: var(--affiox-text);
  cursor:pointer;
  font-weight: 900;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.affiox-modemenu button:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.08);
  border-color: rgba(41,247,255,.22);
}
html[data-affiox-mode="light"] .affiox-modemenu button:hover{
  background: rgba(12,16,32,.06);
}
.affiox-modemenu button.is-active{
  background: linear-gradient(135deg, rgba(41,247,255,.22), rgba(123,97,255,.18));
  color: #000;
  border-color: rgba(0,0,0,.12);
}
html[data-affiox-mode="light"] .affiox-modemenu button.is-active{
  background: linear-gradient(135deg, rgba(18,92,255,.16), rgba(123,97,255,.14));
  color:#000;
}

/* Drawer (mobile) */
.affiox-burger{ display:none; }

.affiox-drawer{ display:none; }
@media (max-width: 980px){
  .affiox-nav{ display:none; }
  .affiox-burger{ display:inline-flex; }

  .affiox-drawer{
    display:block;
    position: fixed;
    inset: 0;
    pointer-events:none;
    z-index: 2000;
  }
  .affiox-drawer-backdrop{
    position:absolute; inset:0;
    background: rgba(0,0,0,.55);
    opacity:0;
    transition: opacity .25s ease;
  }
  .affiox-drawer-panel{
    position:absolute;
    top: 0; right: 0;
    height: 100%;
    width: min(420px, 92vw);
    background: rgba(10,12,20,.86);
    border-left: 1px solid rgba(234,240,255,.10);
    backdrop-filter: blur(18px);
    transform: translateX(102%);
    transition: transform .28s cubic-bezier(.2,.8,.2,1);
    padding: 18px;
  }
  html[data-affiox-mode="light"] .affiox-drawer-panel{
    background: rgba(255,255,255,.92);
    border-left-color: rgba(12,16,32,.10);
  }
  .affiox-drawer-panel .title{
    display:flex;
    align-items:center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    font-weight: 950;
  }

  /* drawer menu reset bullets */
  .affiox-drawer-menu,
  .affiox-drawer-menu li{
    list-style:none !important;
    margin:0 !important;
    padding:0 !important;
  }
  .affiox-drawer-menu a{
    display:block;
    padding: 14px 12px;
    border-radius: 14px;
    color: var(--affiox-text);
    opacity:.92;
    font-weight: 900;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--affiox-border);
    margin-bottom: 10px;
  }
  html[data-affiox-mode="light"] .affiox-drawer-menu a{
    background: rgba(12,16,32,.05);
  }

  body.affiox-drawer-open .affiox-drawer{ pointer-events:auto; }
  body.affiox-drawer-open .affiox-drawer-backdrop{ opacity:1; }
  body.affiox-drawer-open .affiox-drawer-panel{ transform: translateX(0%); }
}

/* =========================================================
   3) Home v2: World Grid (2×2) — Signature Layout
   ========================================================= */
.affiox-home{
  position: relative;
  overflow: hidden;
}

/* Ambient background */
.affiox-hero{
  position: relative;
  min-height: 92vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 110px 0 70px;
}
.affiox-hero-bg{
  position:absolute;
  inset:0;
  background:
    radial-gradient(1100px 560px at 12% 12%, rgba(41,247,255,.16), transparent 60%),
    radial-gradient(1000px 560px at 88% 18%, rgba(123,97,255,.16), transparent 62%),
    radial-gradient(1000px 560px at 60% 86%, rgba(255,45,149,.10), transparent 64%),
    linear-gradient(180deg, #05060a, #080A15 55%, #05060a);
  filter: saturate(1.15);
  transform: translateZ(0);
}
html[data-affiox-mode="light"] .affiox-hero-bg{
  background:
    radial-gradient(1100px 560px at 12% 12%, rgba(18,92,255,.10), transparent 60%),
    radial-gradient(1000px 560px at 88% 18%, rgba(123,97,255,.10), transparent 62%),
    radial-gradient(1000px 560px at 60% 86%, rgba(255,45,149,.08), transparent 64%),
    linear-gradient(180deg, #F7FAFF, #FFFFFF 55%, #F7FAFF);
  filter: none;
}

.affiox-hero-inner{
  position: relative;
  z-index: 2;
  border-radius: var(--affiox-radius-xl);
  border: 1px solid var(--affiox-border);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  box-shadow: 0 55px 150px rgba(0,0,0,.45);
  padding: 56px 46px;
  overflow:hidden;
}

html[data-affiox-mode="light"] .affiox-hero-inner{
  background: rgba(255,255,255,.82);
  box-shadow: 0 26px 90px rgba(12,16,32,.18);
}

.affiox-glow{
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(520px 240px at 18% 10%, rgba(41,247,255,.18), transparent 60%),
    radial-gradient(520px 240px at 82% 16%, rgba(123,97,255,.16), transparent 60%),
    radial-gradient(520px 240px at 50% 90%, rgba(255,45,149,.10), transparent 60%);
  opacity:.85;
  pointer-events:none;
}

.affiox-hero-head{
  position:relative;
  z-index:2;
  text-align:center;
  margin-bottom: 28px;
}
.affiox-kicker{
  display:inline-flex;
  align-items:center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(41,247,255,.22);
  background: rgba(41,247,255,.08);
  font-weight: 950;
  letter-spacing: -.01em;
}
html[data-affiox-mode="light"] .affiox-kicker{
  border-color: rgba(18,92,255,.20);
  background: rgba(18,92,255,.06);
}

.affiox-hero-head h1{
  margin: 14px 0 10px;
  font-size: clamp(34px, 5vw, 66px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.affiox-hero-head p{
  margin: 0 auto 0;
  max-width: 780px;
  color: var(--affiox-muted);
  font-size: 18px;
  line-height: 1.65;
}

/* World Grid */
.affiox-worldgrid{
  position:relative;
  z-index:2;
  display:grid;
  gap: 14px;
  margin-top: 26px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 820px){
  .affiox-hero-inner{ padding: 42px 18px; }
  .affiox-worldgrid{ grid-template-columns: 1fr; }
}

.affiox-worldcard{
  position:relative;
  border-radius: 22px;
  border: 1px solid var(--affiox-border);
  background:
    radial-gradient(520px 240px at 18% 0%, rgba(255,255,255,.10), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
  overflow:hidden;
  padding: 18px 18px 18px;
  min-height: 190px;
  box-shadow: var(--affiox-shadow-glass);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease, border-color .35s ease;
}

html[data-affiox-mode="light"] .affiox-worldcard{
  background:
    radial-gradient(520px 240px at 18% 0%, rgba(18,92,255,.08), transparent 60%),
    rgba(255,255,255,.86);
}

.affiox-worldcard:hover{
  transform: translateY(-10px);
  box-shadow: 0 60px 140px rgba(0,0,0,.50);
  border-color: rgba(41,247,255,.22);
}
html[data-affiox-mode="light"] .affiox-worldcard:hover{
  box-shadow: 0 30px 110px rgba(12,16,32,.18);
  border-color: rgba(18,92,255,.18);
}

/* =========================================================
   5) Footer
   ========================================================= */
.affiox-footer{
  border-top: 1px solid var(--affiox-border);
  background: rgba(6,7,11,.88);
  padding: 48px 0;
}
html[data-affiox-mode="light"] .affiox-footer{ background: rgba(247,250,255,.92); }

/* =========================================================
   6) Animations: Scroll Reveal
   ========================================================= */
.reveal{
  opacity: 0;
  transform: translateY(26px) scale(.985);
  transition:
    opacity .9s ease,
    transform .9s cubic-bezier(.2,.8,.2,1);
  will-change: opacity, transform;
}
.reveal.is-visible{
  opacity:1;
  transform: translateY(0) scale(1);
}

/* =========================================================
   FIX: Global lists looking broken in content area
   (Do NOT kill bullets globally – only normalize spacing)
   ========================================================= */
main#content ul, main#content ol{
  margin: 0 0 16px 18px;
}
main#content li{
  margin: 6px 0;
}
/* =====================================================
   ULTRA PREMIUM INFO / FOOTER SECTION (FIX)
   ===================================================== */

.affiox-footer{
  background: linear-gradient(
    180deg,
    rgba(10,12,20,.85),
    rgba(6,7,11,.95)
  );
  padding: 80px 0 50px;
}

html[data-affiox-mode="light"] .affiox-footer{
  background: linear-gradient(
    180deg,
    #f1f4f9,
    #ffffff
  );
}

/* Footer grid */
.affiox-footer-grid{
  display:grid;
  gap: 26px;
}

@media (min-width: 900px){
  .affiox-footer-grid{
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
  }
}

/* Brand block */
.affiox-footer-brand h3{
  font-size: 22px;
  margin: 0 0 10px;
}
.affiox-footer-brand p{
  color: var(--affiox-muted);
  max-width: 420px;
  line-height: 1.7;
}

/* Footer cards */
.affiox-footer-card{
  border-radius: 18px;
  padding: 18px 18px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--affiox-border);
  transition: transform .25s ease, box-shadow .25s ease;
}

.affiox-footer-card:hover{
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

html[data-affiox-mode="light"] .affiox-footer-card{
  background: #ffffff;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
}

/* Footer titles */
.affiox-footer-card h4{
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .02em;
  opacity: .9;
}

/* Footer links — NO BULLETS */
.affiox-footer-card ul{
  list-style: none;
  margin: 0;
  padding: 0;
}
.affiox-footer-card li{
  margin-bottom: 10px;
}
.affiox-footer-card a{
  display:inline-block;
  color: var(--affiox-text);
  opacity:.75;
  font-weight: 700;
  transition: opacity .2s ease, transform .2s ease;
}
.affiox-footer-card a:hover{
  opacity:1;
  transform: translateX(4px);
}

/* Copyright */
.affiox-footer-bottom{
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--affiox-border);
  text-align: center;
  font-size: 13px;
  color: var(--affiox-muted);
}
/* =========================================================
   CATEGORY / WORLD PAGES — PROFESSIONAL LAYOUT FIX
   Applies to: /world-ai, /world-automation, categories, archives
   ========================================================= */

/* Main content container */
body.category main,
body.archive main,
body.single main,
.affiox-world-page,
.affiox-category-page {
  width: min(100% - 3rem, 1100px);
  margin-inline: auto;
  padding: 72px 0 110px;
}

/* Headings spacing */
body.category h1,
body.archive h1,
body.single h1 {
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

/* Section titles */
body.category h2,
body.archive h2 {
  margin-top: 56px;
  margin-bottom: 10px;
}

/* Post blocks spacing */
body.category article,
body.archive article {
  margin-bottom: 42px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--affiox-border);
}

/* REMOVE ugly WordPress blue */
body.category a,
body.archive a,
body.single a {
  color: var(--affiox-text);
  text-decoration: none;
  font-weight: 800;
}

/* Hover accent (premium) */
body.category a:hover,
body.archive a:hover,
body.single a:hover {
  color: var(--affiox-cyan);
}

/* Meta / excerpt text */
body.category p,
body.archive p {
  color: var(--affiox-muted);
  max-width: 880px;
  line-height: 1.7;
}

/* Read arrow */
body.category a:has(span),
body.archive a:has(span) {
  font-family: var(--affiox-mono);
  font-size: 13px;
}

/* =========================================================
   LIGHT MODE — SOFT BACKGROUND & BETTER CONTRAST
   ========================================================= */

html[data-affiox-mode="light"] body {
  background: #f2f4f8; /* soft gray-blue (eye friendly) */
  color: #0d1020;
}

html[data-affiox-mode="light"] body.category a,
html[data-affiox-mode="light"] body.archive a {
  color: #0d1020;
}

html[data-affiox-mode="light"] body.category a:hover,
html[data-affiox-mode="light"] body.archive a:hover {
  color: #5b6cff; /* soft premium blue */
}

/* Divider softening */
html[data-affiox-mode="light"] body.category article,
html[data-affiox-mode="light"] body.archive article {
  border-bottom-color: rgba(0,0,0,.08);
}
/* =========================================================
   🚨 FINAL HARD FIX — CATEGORY / WORLD ALIGNMENT
   Works on ALL:
   - world-ai / world-automation / world-crypto / world-media
   - categories
   - archives
   - blog
   ========================================================= */

/* Force WordPress main container to center */
body.archive #primary,
body.category #primary,
body.blog #primary,
body.single #primary,
body.page #primary {
  width: 100%;
}

/* Actual content wrapper */
body.archive #primary > *,
body.category #primary > *,
body.blog #primary > *,
body.single #primary > *,
body.page #primary > * {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* Vertical breathing space */
body.archive #primary,
body.category #primary {
  padding-top: 72px;
  padding-bottom: 120px;
}

/* Headings spacing */
body.archive h1,
body.category h1 {
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

/* Post blocks */
body.archive article,
body.category article {
  margin-bottom: 44px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--affiox-border);
}

/* =========================================================
   🎨 KILL UGLY BLUE — PREMIUM TEXT COLORS
   ========================================================= */

body.archive a,
body.category a {
  color: var(--affiox-text);
  font-weight: 800;
  text-decoration: none;
}

body.archive a:hover,
body.category a:hover {
  color: var(--affiox-cyan);
}

/* Read → link */
body.archive a[href*="read"],
body.category a[href*="read"] {
  font-family: var(--affiox-mono);
  font-size: 13px;
  opacity: 0.9;
}

/* =========================================================
   🌤️ LIGHT MODE — SOFT & PREMIUM
   ========================================================= */

html[data-affiox-mode="light"] body {
  background: #f3f5f9;
}

html[data-affiox-mode="light"] body.archive a,
html[data-affiox-mode="light"] body.category a {
  color: #0d1020;
}

html[data-affiox-mode="light"] body.archive a:hover,
html[data-affiox-mode="light"] body.category a:hover {
  color: #5b6cff;
}

html[data-affiox-mode="light"] body.archive article,
html[data-affiox-mode="light"] body.category article {
  border-bottom-color: rgba(0,0,0,.08);
}
/* ===== CATEGORY PAGE FIX ===== */

.affiox-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.affiox-card-title {
  color: var(--affiox-text);
}

.affiox-card-excerpt {
  color: var(--affiox-text-muted);
}

.affiox-card-link {
  text-decoration: none;
  color: inherit;
}

html[data-affiox-mode="light"] body {
  background: linear-gradient(
    180deg,
    #f4f6fb,
    #f7f9fe 60%,
    #ffffff
  );
}
