/*
Theme Name: Gitx
Theme URI: https://gitx.net/
Author: Gitx
Author URI: https://gitx.net/
Description: A fast, clean, source-driven WordPress news theme for Business and Tech & Science. Version 10 restores real source favicons with robust fallback while keeping dark circular icon backgrounds.
Version: 10.0.0
Requires at least: 6.3
Tested up to: 6.6
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gitx
Tags: blog, news, custom-logo, featured-images, grid-layout
*/

:root {
  --gx-bg: #080909;
  --gx-surface: #101111;
  --gx-panel: #151515;
  --gx-panel-2: #1b1b1b;
  --gx-border: rgba(255,255,255,.11);
  --gx-border-strong: rgba(255,255,255,.2);
  --gx-text: #f3eee7;
  --gx-text-soft: #c9c1b8;
  --gx-muted: #948d86;
  --gx-accent: #a7de7a;
  --gx-accent-2: #9ccfff;
  --gx-radius-xl: 22px;
  --gx-radius-lg: 18px;
  --gx-radius-md: 14px;
  --gx-max: 1120px;
  --gx-article: 930px;
  --gx-serif: Georgia, Cambria, "Times New Roman", Times, serif;
  --gx-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { margin: 0; padding: 0; overflow-x: hidden; background: var(--gx-bg); }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: radial-gradient(circle at 50% -10%, rgba(255,255,255,.045), transparent 36rem), var(--gx-bg);
  color: var(--gx-text);
  font-family: var(--gx-sans);
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--gx-text); }
img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.screen-reader-text, .skip-link {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed !important;
  z-index: 9999;
  width: auto; height: auto;
  clip: auto;
  top: 12px; left: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--gx-text);
  color: #111;
}

/* Header */
.gx-site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(8,9,9,.88);
  border-bottom: 1px solid rgba(255,255,255,.075);
}
.admin-bar .gx-site-header { top: 32px; }
.gx-header-inner {
  width: min(100% - 36px, var(--gx-max));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.gx-brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; font-weight: 900; }
.gx-brand-mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.16);
  color: var(--gx-text);
  font-size: .82rem;
}
.gx-brand-text { font-family: var(--gx-serif); font-size: 1.05rem; letter-spacing: -.04em; }
.custom-logo { max-height: 40px; width: auto; }
.gx-nav { display: flex; align-items: center; gap: 22px; color: var(--gx-text-soft); font-size: .82rem; }
.gx-nav a { color: var(--gx-text-soft); }
.gx-nav a:hover { color: var(--gx-text); }
.gx-menu-list { display: flex; align-items: center; gap: 22px; padding: 0; margin: 0; list-style: none; }
.gx-mobile-toggle { display: none; border: 1px solid var(--gx-border); color: var(--gx-text); background: var(--gx-panel); width: 38px; height: 34px; border-radius: 12px; }

/* Layout */
.gx-main-wrap {
  width: min(100% - 36px, var(--gx-max));
  margin: 0 auto;
  padding: 42px 0 76px;
}
.gx-home-shell,
.gx-home-shell-single {
  display: block;
  width: 100%;
}
.gx-home-main { min-width: 0; display: grid; gap: 52px; }
.gx-section { min-width: 0; }
.gx-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 20px;
}
.gx-section-head-clean { align-items: end; }
.gx-overline {
  margin: 0 0 7px;
  color: var(--gx-accent);
  font-size: .7rem;
  line-height: 1.2;
  letter-spacing: .13em;
  text-transform: uppercase;
  font-weight: 900;
}
.gx-board-title, .gx-section-title, .gx-page-title {
  margin: 0;
  color: var(--gx-text);
  font-family: var(--gx-serif);
  letter-spacing: -.05em;
  line-height: 1;
}
.gx-board-title { font-size: clamp(2.1rem, 4vw, 3.4rem); }
.gx-section-title { font-size: clamp(1.65rem, 2.5vw, 2.35rem); }
.gx-section-note {
  margin: 0;
  width: min(420px, 48%);
  color: var(--gx-muted);
  font-size: .82rem;
  line-height: 1.5;
}
.gx-section-link {
  flex: 0 0 auto;
  border: 1px solid var(--gx-border);
  color: var(--gx-text-soft);
  background: rgba(255,255,255,.035);
  padding: 8px 13px;
  border-radius: 999px;
  font-size: .76rem;
}
.gx-section-link:hover { background: rgba(255,255,255,.075); border-color: var(--gx-border-strong); }

/* Cards */
.gx-latest-feed { display: grid; gap: 22px; min-width: 0; }
.gx-news-grid, .gx-grid-2, .gx-grid-3, .gx-news-grid-four, .gx-related-grid {
  display: grid;
  gap: 24px;
  min-width: 0;
}
.gx-news-grid-four,
.gx-grid-3,
.gx-archive-grid,
.gx-related-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gx-card {
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--gx-border);
  border-radius: var(--gx-radius-lg);
  background: var(--gx-panel);
  box-shadow: 0 16px 48px rgba(0,0,0,.18);
}
.gx-card:hover { background: var(--gx-panel-2); border-color: var(--gx-border-strong); }
.gx-card-media { display: block; min-width: 0; overflow: hidden; background: #0d0d0d; aspect-ratio: 16 / 10; }
.gx-card-media img { width: 100%; height: 100%; object-fit: cover; }
.gx-card-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 13px; }
.gx-card-title {
  margin: 0;
  color: var(--gx-text);
  font-family: var(--gx-serif);
  font-size: .98rem;
  line-height: 1.12;
  letter-spacing: -.035em;
}
.gx-card-title a {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.gx-card-excerpt {
  margin: 0;
  color: var(--gx-muted);
  font-size: .72rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.gx-card-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--gx-muted);
  font-size: .66rem;
  min-height: 22px;
}
.gx-card-wide {
  display: grid;
  grid-template-columns: minmax(0, 52%) minmax(0, 1fr);
  min-height: 320px;
}
.gx-card-wide .gx-card-media { aspect-ratio: auto; height: 100%; min-height: 320px; }
.gx-card-wide .gx-card-body { justify-content: center; padding: 28px; }
.gx-card-wide .gx-card-title { font-size: clamp(1.65rem, 3vw, 2.85rem); line-height: .98; }
.gx-card-wide .gx-card-title a { -webkit-line-clamp: 3; }
.gx-card-wide .gx-card-excerpt { max-width: 96%; font-size: .84rem; -webkit-line-clamp: 3; }
.gx-card-related .gx-card-excerpt { display: none; }

/* Source icons */
.gx-sources-mini { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.gx-source-icons { display: inline-flex; align-items: center; flex: 0 0 auto; }
.gx-source-icon,
.gx-drawer-source-icon {
  width: 21px; height: 21px;
  flex: 0 0 21px;
  display: grid; place-items: center;
  overflow: hidden;
  border-radius: 999px;
  background: #0b0b0b;
  border: 1px solid rgba(255,255,255,.15);
  box-shadow: 0 0 0 1px rgba(0,0,0,.75), 0 4px 10px rgba(0,0,0,.24);
  color: transparent !important;
  font-size: 0 !important;
}
.gx-source-icon { margin-left: -6px; }
.gx-source-icon:first-child { margin-left: 0; }
.gx-source-icon img,
.gx-drawer-source-icon img { width: 72%; height: 72%; object-fit: contain; border-radius: 50%; }
.gx-source-icon.is-generic::before,
.gx-drawer-source-icon.is-generic::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.55);
}
.gx-source-count { white-space: nowrap; }

/* Archive / infinite load */
.gx-archive-shell { width: min(100%, var(--gx-max)); margin: 0 auto; }
.gx-archive-header { margin-bottom: 28px; }
.gx-archive-grid {
  align-items: stretch;
  grid-auto-flow: row;
  row-gap: 30px;
  column-gap: 24px;
}
.gx-archive-grid .gx-card { height: 100%; }
.gx-archive-grid + .gx-load-more-wrap { margin-top: 38px; }
.gx-page-title { font-size: clamp(2rem, 4vw, 3.2rem); }
.gx-page-description { max-width: 720px; color: var(--gx-text-soft); margin-top: 10px; font-size: .95rem; }
.gx-empty-state { border: 1px solid var(--gx-border); border-radius: var(--gx-radius-lg); background: var(--gx-panel); color: var(--gx-muted); padding: 18px; }
.gx-more-section { padding-top: 6px; }
.gx-load-grid { margin-top: 0; }
.gx-more-section .gx-load-grid { row-gap: 30px; column-gap: 24px; }
.gx-load-more-wrap { display: grid; place-items: center; gap: 10px; margin-top: 28px; min-height: 54px; }
.gx-load-more {
  border: 1px solid var(--gx-border);
  border-radius: 999px;
  background: rgba(255,255,255,.045);
  color: var(--gx-text-soft);
  padding: 11px 18px;
  font-size: .82rem;
  font-weight: 700;
}
.gx-load-more:hover { background: rgba(255,255,255,.08); color: var(--gx-text); border-color: var(--gx-border-strong); }
.gx-load-more.is-loading { opacity: .72; pointer-events: none; }
.gx-load-status { color: var(--gx-muted); font-size: .78rem; min-height: 1.2em; }
.gx-pagination { display: none; }

/* Article */
.gx-article-shell { width: min(100%, var(--gx-article)); margin: 0 auto; padding-bottom: 82px; }
.gx-article-hero { padding: 10px 0 0; }
.gx-eyebrow { margin-bottom: 10px; color: var(--gx-accent); font-size: .7rem; line-height: 1.2; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }
.gx-article-title {
  margin: 0 0 13px;
  color: var(--gx-text);
  font-family: var(--gx-serif);
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1;
  letter-spacing: -.058em;
  text-wrap: balance;
}
.gx-article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--gx-muted); font-size: .76rem; margin-bottom: 18px; }
.gx-article-lead {
  margin: 0 0 28px;
  color: var(--gx-text);
  font-family: var(--gx-serif);
  font-size: 1rem;
  line-height: 1.74;
}
.gx-article-lead p { margin: 0 0 1em; }
.gx-source-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 100%;
  overflow: visible;
  margin: 0 0 34px;
}
.gx-source-pill, .gx-source-all {
  min-width: 0;
  border: 1px solid var(--gx-border);
  border-radius: 14px;
  background: var(--gx-panel);
  color: var(--gx-text-soft);
  padding: 10px;
  display: grid;
  grid-template-columns: 24px minmax(0,1fr);
  gap: 9px;
  align-items: center;
  text-align: left;
}
.gx-source-pill:hover, .gx-source-all:hover { background: var(--gx-panel-2); border-color: var(--gx-border-strong); }
.gx-source-pill-domain { display: block; color: var(--gx-muted); font-size: .66rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gx-source-pill-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: var(--gx-text-soft); font-size: .7rem; line-height: 1.24; }
.gx-source-all { grid-template-columns: minmax(0,1fr); place-items: center; text-align: center; }
.gx-source-all strong { color: var(--gx-text-soft); font-size: .72rem; }
.gx-source-all .gx-source-icons { justify-content: center; }
.gx-featured-image { margin: 0 0 34px; overflow: hidden; border: 1px solid var(--gx-border); border-radius: 20px; background: #111; }
.gx-featured-image img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gx-article-content {
  width: 100%;
  color: var(--gx-text);
  font-family: var(--gx-serif);
  font-size: 1rem;
  line-height: 1.74;
}
.gx-article-content > *:first-child { margin-top: 0; }
.gx-article-content p { margin: 0 0 1.1em; }
.gx-article-content h2, .gx-article-content h3, .gx-article-content h4 {
  margin: 1.65em 0 .6em;
  color: var(--gx-text);
  font-family: var(--gx-serif);
  letter-spacing: -.04em;
  line-height: 1.08;
}
.gx-article-content h2 { font-size: clamp(1.45rem, 2.2vw, 2rem); }
.gx-article-content h3 { font-size: clamp(1.18rem, 1.8vw, 1.55rem); }
.gx-article-content a, .gx-article-lead a { color: var(--gx-accent-2); text-decoration: underline; text-decoration-thickness: .07em; text-underline-offset: .18em; }
.gx-article-content .citation-link, .gx-article-lead .citation-link {
  display: inline-flex;
  vertical-align: baseline;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  font-family: var(--gx-sans);
  font-size: .66em;
  line-height: 1;
  text-decoration: none;
  color: var(--gx-text-soft);
  background: rgba(255,255,255,.065);
  border: 1px solid var(--gx-border);
  border-radius: 999px;
  padding: .32em .58em;
  margin-inline: .12em;
}
.gx-article-content .citation-link:hover, .gx-article-lead .citation-link:hover { background: rgba(255,255,255,.11); color: var(--gx-text); }
.gx-article-content blockquote { margin: 1.4em 0; padding: .2em 0 .2em 1em; border-left: 3px solid var(--gx-border-strong); color: var(--gx-text-soft); }
.gx-article-content table { width: 100%; border-collapse: collapse; font-family: var(--gx-sans); font-size: .9rem; display: block; overflow-x: auto; }
.gx-article-content th, .gx-article-content td { border: 1px solid var(--gx-border); padding: 10px; }
.gx-article-content pre { overflow-x: auto; background: #0c0c0c; border: 1px solid var(--gx-border); border-radius: 14px; padding: 14px; }
.gx-related { margin-top: 48px; }
.gx-related .gx-section-head { margin-bottom: 16px; }
.gx-related .gx-section-title { font-size: 1.5rem; }

/* Sources drawer */
.gx-source-backdrop { position: fixed; inset: 0; z-index: 190; background: rgba(0,0,0,.46); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.gx-source-backdrop.is-open { opacity: 1; pointer-events: auto; }
.gx-source-drawer {
  position: fixed;
  z-index: 200;
  inset: 0 0 0 auto;
  width: min(430px, calc(100vw - 22px));
  display: flex;
  flex-direction: column;
  background: rgba(15,15,15,.98);
  border-left: 1px solid var(--gx-border-strong);
  box-shadow: -30px 0 80px rgba(0,0,0,.42);
  transform: translateX(105%);
  transition: transform .24s ease;
}
.gx-source-drawer.is-open { transform: translateX(0); }
.gx-source-drawer-head { display: flex; justify-content: space-between; align-items: start; gap: 14px; padding: 20px; border-bottom: 1px solid var(--gx-border); }
.gx-source-drawer-title { margin: 0; color: var(--gx-text); font-size: 1rem; line-height: 1.25; }
.gx-source-drawer-count { margin-top: 6px; color: var(--gx-muted); font-size: .78rem; }
.gx-drawer-close { flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid var(--gx-border); border-radius: 999px; color: var(--gx-text-soft); background: rgba(255,255,255,.055); }
.gx-drawer-close:hover { color: var(--gx-text); background: rgba(255,255,255,.09); }
.gx-source-drawer-body { overflow: auto; padding: 12px; display: grid; gap: 10px; }
.gx-drawer-source { display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 11px; padding: 12px; border: 1px solid var(--gx-border); border-radius: 16px; background: rgba(255,255,255,.035); }
.gx-drawer-source:hover { background: rgba(255,255,255,.065); }
.gx-drawer-source-icon { width: 30px; height: 30px; flex-basis: 30px; }
.gx-drawer-source-domain { display: block; color: var(--gx-muted); font-size: .7rem; margin-bottom: 3px; }
.gx-drawer-source-title { display: block; color: var(--gx-text); font-size: .86rem; line-height: 1.3; }
.gx-drawer-source-snippet { color: var(--gx-text-soft); font-size: .76rem; line-height: 1.45; margin: 7px 0 0; }

.gx-footer { border-top: 1px solid rgba(255,255,255,.07); color: var(--gx-muted); font-size: .78rem; }
.gx-footer-inner { width: min(100% - 36px, var(--gx-max)); margin: 0 auto; padding: 30px 0; display: flex; justify-content: space-between; gap: 18px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media (max-width: 1040px) {
  .gx-news-grid-four, .gx-grid-3, .gx-archive-grid, .gx-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gx-card-wide { grid-template-columns: 1fr; min-height: 0; }
  .gx-card-wide .gx-card-media { min-height: 0; aspect-ratio: 16 / 9; }
  .gx-source-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gx-section-note { width: auto; max-width: 420px; }
}
@media (max-width: 720px) {
  .admin-bar .gx-site-header { top: 46px; }
  .gx-header-inner { min-height: 58px; width: min(100% - 24px, var(--gx-max)); }
  .gx-mobile-toggle { display: grid; place-items: center; }
  .gx-nav { display: none; position: absolute; left: 12px; right: 12px; top: 62px; padding: 12px; border: 1px solid var(--gx-border); border-radius: 16px; background: rgba(18,18,18,.98); }
  .gx-nav.is-open { display: grid; gap: 10px; }
  .gx-menu-list { display: grid; gap: 10px; }
  .gx-main-wrap { width: min(100% - 24px, var(--gx-max)); padding-top: 28px; }
  .gx-section-head, .gx-section-head-clean { display: grid; align-items: start; }
  .gx-section-note { width: 100%; max-width: none; }
  .gx-home-main { gap: 42px; }
  .gx-source-strip { grid-template-columns: 1fr; }
  .gx-footer-inner { width: min(100% - 24px, var(--gx-max)); display: grid; }
}
@media (max-width: 560px) {
  .gx-board-title { font-size: 2.2rem; }
  .gx-news-grid-four, .gx-grid-3, .gx-archive-grid, .gx-related-grid { grid-template-columns: 1fr; }
  .gx-card-news, .gx-card-related { display: grid; grid-template-columns: 116px minmax(0, 1fr); }
  .gx-card-news .gx-card-media, .gx-card-related .gx-card-media { aspect-ratio: auto; height: 100%; min-height: 112px; }
  .gx-card-news .gx-card-excerpt, .gx-card-related .gx-card-excerpt { display: none; }
  .gx-card-wide .gx-card-body { padding: 18px; }
  .gx-card-wide .gx-card-title { font-size: 1.55rem; }
  .gx-article-title { font-size: 2.15rem; }
  .gx-featured-image { border-radius: 16px; }
}

.gx-search-form {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  max-width: 520px;
}
.gx-search-form input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--gx-border);
  border-radius: 999px;
  background: var(--gx-panel);
  color: var(--gx-text);
  padding: 11px 14px;
  outline: none;
}
.gx-search-form input:focus { border-color: var(--gx-border-strong); }
.gx-search-form button {
  border: 1px solid var(--gx-border);
  border-radius: 999px;
  background: rgba(255,255,255,.055);
  color: var(--gx-text-soft);
  padding: 11px 15px;
  font-weight: 700;
}
.gx-search-form button:hover { color: var(--gx-text); background: rgba(255,255,255,.09); }
@media (max-width: 520px) {
  .gx-search-form { display: grid; }
}


/* Gitx v9 PageSpeed and accessibility refinements */
.gx-site-header { background: rgba(8,9,9,.96); }
.gx-card-title { font-size: .94rem; }
.gx-card-wide .gx-card-title { font-size: clamp(1.55rem, 2.65vw, 2.45rem); }
.gx-card-excerpt { font-size: .7rem; }
.gx-source-strip { overflow: hidden; align-items: stretch; }
.gx-source-pill, .gx-source-all { contain: content; }
.gx-source-strip * { min-width: 0; }
.gx-article-shell { width: min(100%, 920px); }
.gx-article-content, .gx-article-lead { overflow-wrap: anywhere; }
.gx-featured-image img { content-visibility: auto; }
@media (max-width: 720px) {
  .gx-news-grid, .gx-grid-2, .gx-grid-3, .gx-news-grid-four, .gx-related-grid { gap: 18px; }
  .gx-card { box-shadow: 0 10px 28px rgba(0,0,0,.16); }
  .gx-article-lead { margin-bottom: 24px; }
}
