/*
Theme Name: TechNova
Theme URI: https://designworld.info
Author: DesignWorld
Description: Theme công nghệ cao cấp – dark mode, neon gradient, glassmorphism, bố cục tạp chí công nghệ lớn.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: technova
*/

:root {
  --bg: #05060d;
  --bg-2: #0a0c18;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8eaf6;
  --muted: #8b90ad;
  --cyan: #22d3ee;
  --violet: #8b5cf6;
  --pink: #ec4899;
  --grad: linear-gradient(135deg, #22d3ee 0%, #8b5cf6 50%, #ec4899 100%);
  --radius: 18px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
  --font: 'Inter', system-ui, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --container: 1280px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(800px 500px at 10% -10%, rgba(139, 92, 246, .18), transparent 60%),
    radial-gradient(700px 500px at 100% 0%, rgba(34, 211, 238, .14), transparent 60%),
    radial-gradient(600px 400px at 50% 110%, rgba(236, 72, 153, .10), transparent 60%);
  pointer-events: none; z-index: -2;
}
body::after {
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
  pointer-events: none; z-index: -1;
}
a { color: inherit; text-decoration: none; transition: color .25s var(--ease); }
a:hover { color: var(--cyan); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 .6em; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.screen-reader-text { position: absolute !important; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }

/* ---------- Progress bar ---------- */
#tn-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--grad); z-index: 1001; box-shadow: 0 0 12px var(--cyan); }

/* ---------- Topbar ---------- */
.tn-topbar { border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.tn-topbar .container { display: flex; align-items: center; gap: 20px; height: 40px; }
.tn-ticker-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); white-space: nowrap; }
.tn-ticker-label .dot { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 0 rgba(239,68,68,.7); animation: tnPulse 1.6s infinite; }
@keyframes tnPulse { 70% { box-shadow: 0 0 0 10px rgba(239,68,68,0); } 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); } }
.tn-ticker { flex: 1; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.tn-ticker-track { display: inline-flex; gap: 48px; white-space: nowrap; animation: tnMarquee 40s linear infinite; }
.tn-ticker:hover .tn-ticker-track { animation-play-state: paused; }
@keyframes tnMarquee { to { transform: translateX(-50%); } }
.tn-date { white-space: nowrap; }

/* ---------- Header ---------- */
.tn-header { position: sticky; top: 0; z-index: 1000; transition: all .35s var(--ease); }
.tn-header.scrolled { background: rgba(5, 6, 13, .75); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); border-bottom: 1px solid var(--border); }
.tn-header .container { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 24px; }
.tn-logo { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 700; font-size: 22px; }
.tn-logo-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--grad); display: grid; place-items: center; color: #fff; font-size: 18px; box-shadow: 0 8px 30px -6px rgba(139,92,246,.7); position: relative; }
.tn-logo-mark::after { content: ""; position: absolute; inset: 2px; border-radius: 10px; background: var(--bg); }
.tn-logo-mark span { position: relative; z-index: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }
.tn-logo img { max-height: 44px; width: auto; }
.tn-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.tn-nav li { position: relative; }
.tn-nav a { display: block; padding: 10px 16px; border-radius: 10px; font-weight: 500; font-size: 15px; color: var(--muted); }
.tn-nav a:hover, .tn-nav .current-menu-item > a { color: var(--text); background: var(--surface-2); }
.tn-nav .sub-menu { position: absolute; top: 110%; left: 0; min-width: 220px; flex-direction: column; padding: 8px; background: rgba(12,14,28,.95); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(8px); transition: all .25s var(--ease); }
.tn-nav li:hover > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.tn-actions { display: flex; align-items: center; gap: 10px; }
.tn-icon-btn { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; transition: all .25s var(--ease); }
.tn-icon-btn:hover { border-color: var(--cyan); box-shadow: 0 0 20px -4px var(--cyan); }
.tn-btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 12px; font-weight: 600; font-size: 15px; border: 0; cursor: pointer; background: var(--grad); background-size: 200% 200%; color: #fff; transition: all .4s var(--ease); box-shadow: 0 10px 30px -10px rgba(139,92,246,.8); }
.tn-btn:hover { color: #fff; background-position: 100% 0; transform: translateY(-2px); box-shadow: 0 16px 40px -10px rgba(236,72,153,.8); }
.tn-btn-ghost { background: var(--surface); border: 1px solid var(--border); box-shadow: none; }
.tn-btn-ghost:hover { background: var(--surface-2); border-color: var(--violet); box-shadow: none; }
.tn-burger { display: none; }

/* ---------- Search overlay ---------- */
.tn-search { position: fixed; inset: 0; z-index: 2000; background: rgba(5,6,13,.9); backdrop-filter: blur(20px); display: grid; place-items: center; opacity: 0; visibility: hidden; transition: all .3s var(--ease); }
.tn-search.open { opacity: 1; visibility: visible; }
.tn-search form { width: min(720px, 90vw); position: relative; }
.tn-search input[type=search] { width: 100%; padding: 26px 28px; font-size: 26px; font-family: var(--font-display); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; color: var(--text); outline: none; }
.tn-search input[type=search]:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(139,92,246,.2); }
.tn-search-close { position: absolute; top: 30px; right: 30px; }
.tn-search p { color: var(--muted); text-align: center; margin-top: 16px; }

/* ---------- Hero ---------- */
.tn-hero { position: relative; padding: 80px 0 60px; overflow: hidden; }
#tn-hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: .6; }
.tn-hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 60px; align-items: center; }
.tn-badge { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.tn-badge b { background: var(--grad); color: #fff; padding: 3px 10px; border-radius: 999px; font-size: 12px; }
.tn-hero h1 { font-size: clamp(40px, 6vw, 76px); font-weight: 700; letter-spacing: -0.04em; }
.tn-hero-lead { font-size: 19px; color: var(--muted); max-width: 560px; margin-bottom: 32px; }
.tn-hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.tn-stats { display: flex; gap: 40px; margin-top: 48px; }
.tn-stat strong { display: block; font-family: var(--font-display); font-size: 32px; }
.tn-stat span { color: var(--muted); font-size: 14px; }
.tn-hero-feature { position: relative; border-radius: 24px; overflow: hidden; aspect-ratio: 4/5; border: 1px solid var(--border); box-shadow: var(--shadow); transform: perspective(1200px) rotateY(-6deg) rotateX(3deg); transition: transform .6s var(--ease); }
.tn-hero-feature:hover { transform: perspective(1200px) rotateY(0) rotateX(0); }
.tn-hero-feature::before { content: ""; position: absolute; inset: -2px; border-radius: 26px; padding: 2px; background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; z-index: 2; pointer-events: none; }
.tn-hero-feature img { width: 100%; height: 100%; object-fit: cover; }
.tn-hero-feature .tn-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(5,6,13,.95)); display: flex; flex-direction: column; justify-content: flex-end; padding: 32px; }
.tn-hero-feature h2 { font-size: 28px; margin-bottom: 10px; }

/* ---------- Thumbnails fallback ---------- */
.tn-thumb { position: relative; overflow: hidden; background: linear-gradient(135deg, #111633, #1c1240); }
.tn-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.tn-thumb-fallback { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 48px; font-weight: 700; color: rgba(255,255,255,.12); background: radial-gradient(circle at 30% 30%, rgba(34,211,238,.35), transparent 50%), radial-gradient(circle at 70% 70%, rgba(236,72,153,.35), transparent 50%), #0e1124; }

/* ---------- Category chip / meta ---------- */
.tn-cat { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; background: rgba(34,211,238,.12); color: var(--cyan); border: 1px solid rgba(34,211,238,.25); margin-bottom: 12px; }
.tn-cat:hover { background: var(--cyan); color: #05060d; }
.tn-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); }
.tn-meta img { width: 28px; height: 28px; border-radius: 50%; }
.tn-meta .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); opacity: .5; }

/* ---------- Sections ---------- */
.tn-section { padding: 60px 0; }
.tn-section-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 32px; gap: 20px; }
.tn-section-head h2 { font-size: 34px; margin: 0; }
.tn-eyebrow { font-size: 13px; text-transform: uppercase; letter-spacing: .2em; color: var(--cyan); font-weight: 600; margin-bottom: 8px; display: block; }

/* ---------- Bento ---------- */
.tn-bento { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 240px; gap: 20px; }
.tn-bento .tn-card:nth-child(1) { grid-column: span 2; grid-row: span 2; }
.tn-bento .tn-card:nth-child(4) { grid-column: span 2; }
.tn-bento .tn-card { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.tn-bento .tn-thumb { position: absolute; inset: 0; }
.tn-bento .tn-card-body { position: absolute; inset: auto 0 0 0; padding: 24px; background: linear-gradient(180deg, transparent, rgba(5,6,13,.95) 60%); }
.tn-bento .tn-card h3 { font-size: 19px; margin: 0; }
.tn-bento .tn-card:nth-child(1) h3 { font-size: 30px; }

/* ---------- Cards ---------- */
.tn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.tn-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform .45s var(--ease), border-color .45s, box-shadow .45s; position: relative; }
.tn-card:hover { transform: translateY(-6px); border-color: rgba(139,92,246,.45); box-shadow: 0 30px 60px -30px rgba(139,92,246,.6); }
.tn-card:hover .tn-thumb img { transform: scale(1.07); }
.tn-card .tn-thumb { aspect-ratio: 16/10; }
.tn-card-body { padding: 24px; }
.tn-card h3 { font-size: 21px; margin-bottom: 10px; }
.tn-card p { color: var(--muted); font-size: 15px; margin: 0 0 18px; }
.tn-card .tn-spot { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(139,92,246,.12), transparent 40%); opacity: 0; transition: opacity .3s; }
.tn-card:hover .tn-spot { opacity: 1; }

/* ---------- Layout main + sidebar ---------- */
.tn-layout { display: grid; grid-template-columns: 1fr 340px; gap: 48px; }
.tn-list .tn-card { display: grid; grid-template-columns: 280px 1fr; margin-bottom: 24px; }
.tn-list .tn-card .tn-thumb { aspect-ratio: auto; height: 100%; min-height: 200px; }
.tn-sidebar .widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.tn-sidebar .widget-title { font-size: 18px; display: flex; align-items: center; gap: 10px; }
.tn-sidebar .widget-title::before { content: ""; width: 4px; height: 18px; border-radius: 4px; background: var(--grad); }
.tn-sidebar ul { list-style: none; padding: 0; margin: 0; }
.tn-sidebar li { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.tn-sidebar li:last-child { border: 0; }
.tn-trending li { display: flex; gap: 14px; align-items: flex-start; }
.tn-trending .num { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1; min-width: 34px; }
.tn-trending a { font-weight: 600; font-size: 15px; line-height: 1.4; }

/* ---------- Newsletter ---------- */
.tn-newsletter { position: relative; border-radius: 28px; padding: 64px; overflow: hidden; border: 1px solid var(--border); background: linear-gradient(135deg, rgba(34,211,238,.12), rgba(139,92,246,.15) 50%, rgba(236,72,153,.12)); text-align: center; }
.tn-newsletter h2 { font-size: clamp(28px, 4vw, 44px); }
.tn-newsletter p { color: var(--muted); max-width: 560px; margin: 0 auto 28px; }
.tn-newsletter form { display: flex; gap: 12px; max-width: 520px; margin: 0 auto; }
.tn-input, .tn-newsletter input, .comment-form input, .comment-form textarea, .search-form input[type=search] { flex: 1; width: 100%; padding: 14px 18px; border-radius: 12px; background: rgba(0,0,0,.35); border: 1px solid var(--border); color: var(--text); font: inherit; outline: none; transition: border-color .25s, box-shadow .25s; }
.tn-input:focus, .tn-newsletter input:focus, .comment-form input:focus, .comment-form textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(139,92,246,.18); }

/* ---------- Single ---------- */
.tn-single-hero { padding: 60px 0 40px; text-align: center; }
.tn-single-hero h1 { font-size: clamp(34px, 5vw, 60px); max-width: 960px; margin: 0 auto 24px; }
.tn-single-hero .tn-meta { justify-content: center; }
.tn-single-cover { border-radius: 24px; overflow: hidden; border: 1px solid var(--border); margin-bottom: 48px; box-shadow: var(--shadow); }
.tn-content { font-size: 18px; max-width: 760px; }
.tn-content p { margin: 0 0 1.4em; color: #c9cce0; }
.tn-content h2 { font-size: 32px; margin-top: 1.8em; }
.tn-content h3 { font-size: 24px; margin-top: 1.6em; }
.tn-content a { color: var(--cyan); border-bottom: 1px solid rgba(34,211,238,.4); }
.tn-content blockquote { margin: 2em 0; padding: 24px 28px; border-left: 4px solid var(--violet); background: var(--surface); border-radius: 0 16px 16px 0; font-size: 21px; font-style: italic; }
.tn-content pre, .tn-content code { font-family: 'JetBrains Mono', monospace; background: #0b0e1e; border: 1px solid var(--border); border-radius: 10px; }
.tn-content code { padding: 2px 6px; font-size: .88em; color: var(--pink); }
.tn-content pre { padding: 20px; overflow: auto; }
.tn-content pre code { border: 0; padding: 0; color: #c9cce0; }
.tn-content img { border-radius: 16px; }
.tn-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 40px 0; }
.tn-tags a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.tn-tags a:hover { border-color: var(--cyan); color: var(--cyan); }
.tn-author-box { display: flex; gap: 20px; padding: 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); margin: 40px 0; }
.tn-author-box img { border-radius: 50%; }
.tn-share { display: flex; gap: 10px; }

/* ---------- Pagination ---------- */
.tn-pagination { display: flex; gap: 8px; justify-content: center; margin: 48px 0; }
.tn-pagination .page-numbers { min-width: 44px; height: 44px; padding: 0 14px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.tn-pagination .current { background: var(--grad); border-color: transparent; color: #fff; }

/* ---------- Comments ---------- */
.comment-list { list-style: none; padding: 0; }
.comment-list .comment-body { padding: 20px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 16px; }
.comment-list .avatar { border-radius: 50%; float: left; margin-right: 14px; }
.comment-form p { margin-bottom: 16px; }
.comment-form .submit { width: auto; background: var(--grad); border: 0; color: #fff; font-weight: 600; cursor: pointer; padding: 14px 28px; }

/* ---------- Footer ---------- */
.tn-footer { margin-top: 80px; border-top: 1px solid var(--border); background: linear-gradient(180deg, transparent, rgba(139,92,246,.06)); }
.tn-footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 48px; padding: 70px 0 50px; }
.tn-footer h4 { font-size: 15px; text-transform: uppercase; letter-spacing: .12em; color: var(--text); }
.tn-footer ul { list-style: none; padding: 0; margin: 0; }
.tn-footer li { margin-bottom: 10px; }
.tn-footer li a, .tn-footer p { color: var(--muted); font-size: 15px; }
.tn-social { display: flex; gap: 10px; margin-top: 20px; }
.tn-footer-bottom { border-top: 1px solid var(--border); padding: 24px 0; font-size: 14px; color: var(--muted); }
.tn-footer-bottom .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
#tn-top { position: fixed; right: 24px; bottom: 24px; opacity: 0; visibility: hidden; transform: translateY(20px); transition: all .3s var(--ease); z-index: 900; }
#tn-top.show { opacity: 1; visibility: visible; transform: none; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 404 ---------- */
.tn-404 { text-align: center; padding: 120px 0; }
.tn-404 h1 { font-size: clamp(100px, 20vw, 220px); margin: 0; line-height: 1; }

/* ---------- WP core ---------- */
.alignwide { max-width: 1100px; } .alignfull { width: 100vw; margin-left: calc(50% - 50vw); }
.aligncenter { margin-left: auto; margin-right: auto; }
.wp-caption-text, figcaption { color: var(--muted); font-size: 14px; text-align: center; }
.sticky .tn-card { border-color: var(--violet); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .tn-bento { grid-template-columns: repeat(2, 1fr); }
  .tn-bento .tn-card:nth-child(4) { grid-column: span 1; }
  .tn-layout { grid-template-columns: 1fr; }
  .tn-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .tn-hero-grid { grid-template-columns: 1fr; }
  .tn-hero-feature { transform: none; aspect-ratio: 16/10; }
  .tn-grid { grid-template-columns: repeat(2, 1fr); }
  .tn-burger { display: grid; }
  .tn-nav { position: fixed; top: 76px; left: 0; right: 0; background: rgba(5,6,13,.97); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); padding: 16px 24px; transform: translateY(-120%); transition: transform .4s var(--ease); }
  .tn-nav.open { transform: none; }
  .tn-nav ul { flex-direction: column; }
  .tn-nav .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; background: none; border: 0; box-shadow: none; padding-left: 16px; }
  .tn-actions .tn-btn { display: none; }
}
@media (max-width: 640px) {
  .tn-grid, .tn-bento { grid-template-columns: 1fr; }
  .tn-bento .tn-card:nth-child(1) { grid-column: span 1; }
  .tn-list .tn-card { grid-template-columns: 1fr; }
  .tn-newsletter { padding: 40px 24px; }
  .tn-newsletter form { flex-direction: column; }
  .tn-footer-grid { grid-template-columns: 1fr; }
  .tn-stats { gap: 24px; }
  .tn-date { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } .reveal { opacity: 1; transform: none; } }
