/* ==========================================================================
   TorGames Premium v3.0 — Genesis Child Theme (main stylesheet)
   Cyber-noir gaming UI · Mobile-first · A11y · Customizer-driven tokens
   ========================================================================== */

/* ---------- Design Tokens (defaults — overridden by Customizer) ---------- */
:root {
  --bg: #0a0e1a;
  --bg-2: #0f1424;
  --surface: #151b2e;
  --surface-2: #1c2340;
  --border: rgba(255,255,255,0.08);
  --border-2: rgba(255,255,255,0.16);
  --text: #e8ecf5;
  --text-dim: #b8c1d9;     /* WCAG-AA on --bg */
  --text-mute: #8089a8;
  --primary: #1ea7ff;
  --primary-2: #0d8de0;
  --accent: #00f0ff;
  --hero-title: #ff5a36;
  --green: #22c55e;
  --red: #ef4444;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow: 0 10px 40px rgba(0,0,0,0.45);
  --header-h: 72px;
  --container: 1280px;
  --t-fast: .18s ease;
  --t: .25s cubic-bezier(.4,0,.2,1);
  --font-h: 'Orbitron', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-b: 'Rajdhani', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* ---------- Reset / base ---------- */
*, *::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-b); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
h1,h2,h3,h4,h5,h6 { font-family: var(--font-h); color: #fff; line-height: 1.25; margin: 0 0 .5em; letter-spacing: .3px; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.9rem); }
h3 { font-size: clamp(1.05rem, 2vw, 1.25rem); }
p  { margin: 0 0 1em; color: var(--text-dim); }
::selection { background: var(--primary); color: #fff; }
.screen-reader-text { position: absolute !important; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }

/* Skip link */
.genesis-skip-link { position: absolute; left: -9999px; }
.genesis-skip-link:focus { left: 1rem; top: 1rem; z-index: 9999; background: var(--primary); color: #fff; padding: .5rem 1rem; border-radius: 8px; }

/* ---------- Layout ---------- */
.wrap, .site-inner > .content-sidebar-wrap, .content { max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.site-inner { padding: 0; }
.full-width-content .content { width: 100%; }
.content-sidebar-wrap { display: block; }
.sidebar-primary { display: none; }
.full-width-content .content { max-width: var(--container); margin: 0 auto; }

/* ---------- Breadcrumbs ---------- */
.tgv3-crumbs { max-width: var(--container); margin: 1rem auto 0; padding: 0 1.25rem; font-size: .85rem; color: var(--text-dim); }
.tgv3-crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.tgv3-crumbs li + li::before { content: '/'; margin-right: .35rem; opacity: .5; }
.tgv3-crumbs a { color: var(--text-dim); }
.tgv3-crumbs a:hover { color: var(--primary); }

/* ---------- Header ---------- */
.tg-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,14,26,0.85);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  display: flex; align-items: center;
}
.tgv3-compact-header { --header-h: 56px; }
.tg-header__inner { max-width: var(--container); margin: 0 auto; width: 100%; padding: 0 1.25rem; display: flex; align-items: center; gap: 1.5rem; }
.tg-logo { font-family: var(--font-h); font-weight: 900; font-size: 1.5rem; letter-spacing: 1px; color: #fff; white-space: nowrap; }
.tg-logo span { color: var(--primary); }
.tg-logo:hover { color: #fff; }
.tg-logo img { max-height: 44px; width: auto; }

.tg-nav { display: flex; align-items: center; gap: .25rem; flex: 1; }
.tg-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: .25rem; }
.tg-nav li { position: relative; }
.tg-nav a {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .55rem .9rem;
  color: var(--text); font-weight: 600; font-size: .92rem;
  border-radius: 8px; transition: all var(--t-fast);
  min-height: 40px; /* touch target */
}
.tg-nav a:hover, .tg-nav .current-menu-item > a, .tg-nav .current_page_item > a { color: #fff; background: rgba(30,167,255,0.15); }
.tg-nav .menu-item-has-children > a::after {
  content: ''; width: 6px; height: 6px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--t-fast);
}
.tg-nav .menu-item-has-children:hover > a::after { transform: rotate(225deg) translateY(-2px); }
.tg-nav .sub-menu {
  position: absolute; top: 100%; left: 0; min-width: 220px;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--radius); padding: .5rem;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: all var(--t); z-index: 200;
}
.tg-nav li:hover > .sub-menu, .tg-nav li:focus-within > .sub-menu, .tg-nav li.tg-open > .sub-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.tg-nav .sub-menu a { padding: .6rem .85rem; font-size: .9rem; border-radius: 8px; color: var(--text-dim); white-space: nowrap; }
.tg-nav .sub-menu a:hover { background: var(--surface-2); color: #fff; }

.tg-head-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.tg-icon-btn {
  width: 44px; height: 44px;            /* touch target ≥44px */
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text); cursor: pointer;
  transition: all var(--t-fast);
}
.tg-icon-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.tg-icon-btn svg { width: 18px; height: 18px; }
.tg-burger { display: none; }

/* Search overlay */
.tg-search-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(10,14,26,0.96);
  backdrop-filter: blur(8px);
  display: none; align-items: flex-start; justify-content: center;
  padding: 6rem 1.25rem 2rem;
}
.tg-search-overlay.is-open { display: flex; animation: tgFade .2s ease; }
.tg-search-overlay form { width: 100%; max-width: 640px; display: flex; gap: .5rem; }
.tg-search-overlay input {
  flex: 1; padding: 1rem 1.25rem; font-size: 1.05rem;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 12px; color: #fff;
}
.tg-search-overlay input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,167,255,.25); }
.tg-search-overlay button[type="submit"] { padding: 0 1.5rem; background: var(--primary); color: #fff; border: 0; border-radius: 12px; font-weight: 700; cursor: pointer; min-height: 44px; }
.tg-search-close { position: absolute; top: 1.25rem; right: 1.25rem; }

/* Mobile drawer */
.tg-drawer {
  position: fixed; top: 0; right: -100%; bottom: 0;
  width: min(85vw, 340px);
  background: var(--bg-2); border-left: 1px solid var(--border-2);
  z-index: 400; padding: 5rem 1.25rem 2rem;
  transition: right var(--t); overflow-y: auto;
}
.tg-drawer.is-open { right: 0; }
.tg-drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 350; opacity: 0; visibility: hidden; transition: all var(--t); }
.tg-drawer-backdrop.is-open { opacity: 1; visibility: visible; }
.tg-drawer ul { list-style: none; padding: 0; margin: 0; }
.tg-drawer > ul > li { border-bottom: 1px solid var(--border); }
.tg-drawer a { display: flex; align-items: center; justify-content: space-between; padding: 1rem .25rem; color: var(--text); font-weight: 600; font-size: 1rem; min-height: 48px; }
.tg-drawer .sub-menu { display: none; padding-left: 1rem; padding-bottom: .5rem; }
.tg-drawer .menu-item-has-children.tg-open > .sub-menu { display: block; }
.tg-drawer .menu-item-has-children > a::after { content: '+'; font-size: 1.3rem; color: var(--primary); }
.tg-drawer .menu-item-has-children.tg-open > a::after { content: '−'; }
.tg-drawer-close { position: absolute; top: 1rem; right: 1rem; }

/* ---------- Hero Slider ---------- */
.tg-hero { position: relative; margin: 1.5rem auto 2.5rem; max-width: var(--container); padding: 0 1.25rem; content-visibility: auto; contain-intrinsic-size: 480px; }
.tg-hero__swiper { border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.tg-hero__slide {
  position: relative; min-height: 480px;
  display: flex; align-items: center;
  background-size: cover; background-position: right center;
  overflow: hidden;
}
.tg-hero__slide::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg) 0%, rgba(10,14,26,0.85) 40%, rgba(10,14,26,0.2) 75%, transparent 100%); }
.tg-hero__slide::after  { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, var(--bg) 100%); }
.tg-hero__content { position: relative; z-index: 2; padding: 3rem; max-width: 600px; width: 100%; }
.tg-hero__title {
  font-size: var(--hero-title-size, clamp(2.2rem, 5vw, 4rem)); font-weight: 900;
  color: var(--hero-title);
  letter-spacing: 2px; margin-bottom: 1.25rem; text-transform: uppercase;
  text-shadow: 0 4px 20px rgba(0,0,0,0.7); line-height: .95;
}
.tg-hero__title a { color: inherit; text-decoration: none; }
.tg-hero__title a:hover { color: var(--primary); }
.tg-hero__badges { display: flex; gap: .5rem; margin-bottom: 1.25rem; flex-wrap: wrap; align-items: center; }
.tg-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .75rem; font-size: .78rem; font-weight: 700; border-radius: 6px; background: var(--surface-2); color: #fff; border: 1px solid var(--border-2); text-transform: uppercase; letter-spacing: .5px; }
.tg-badge--version { background: var(--green); color: #06210f; border-color: transparent; }
.tg-hero__meta { color: #cbd2e8; font-size: .88rem; }
.tg-hero__desc { font-size: 1rem; color: #cbd2e8; margin-bottom: 1.75rem; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.tg-hero__actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.tg-btn { display: inline-flex; align-items: center; gap: .5rem; padding: .9rem 1.5rem; font-family: var(--font-b); font-weight: 700; font-size: .95rem; border-radius: 10px; border: 1px solid transparent; cursor: pointer; transition: all var(--t); min-height: 44px; }
.tg-btn--primary { background: var(--primary); color: #fff; box-shadow: 0 6px 20px rgba(30,167,255,.4); }
.tg-btn--primary:hover { background: var(--primary-2); color: #fff; transform: translateY(-2px); box-shadow: 0 10px 28px rgba(30,167,255,.55); }
.tg-btn--ghost { background: transparent; color: #fff; border-color: var(--border-2); }
.tg-btn--ghost:hover { background: var(--surface-2); color: #fff; }
.tg-btn svg { width: 16px; height: 16px; }

/* Swiper navigation */
.tg-hero .swiper-button-prev, .tg-hero .swiper-button-next {
  width: 48px; height: 48px;
  background: rgba(15,20,36,0.85);
  border: 1px solid var(--border-2);
  border-radius: 50%; color: #fff !important;
  backdrop-filter: blur(10px); transition: all var(--t-fast);
}
.tg-hero .swiper-button-prev:hover, .tg-hero .swiper-button-next:hover { background: var(--primary); border-color: var(--primary); }
.tg-hero .swiper-button-prev::after, .tg-hero .swiper-button-next::after { font-size: 18px; font-weight: 900; }
.tg-hero .swiper-pagination { bottom: 70px !important; }
.tg-hero .swiper-pagination-bullet { width: 12px; height: 12px; background: rgba(255,255,255,.5); opacity: 1; transition: all var(--t-fast); margin: 0 6px !important; }
.tg-hero .swiper-pagination-bullet-active { width: 36px; border-radius: 6px; background: var(--primary); }

.tg-hero__progress { position: absolute; bottom: 24px; left: 24px; right: 24px; height: 3px; background: rgba(255,255,255,.18); border-radius: 3px; overflow: hidden; z-index: 5; }
.tg-hero__progress-bar { height: 100%; width: 0; background: var(--primary); border-radius: 3px; transition: width .15s linear; }

/* ---------- Social CTA Strip ---------- */
.tg-social-strip { max-width: var(--container); margin: 0 auto 3rem; padding: 0 1.25rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.tg-social-card { display: flex; align-items: center; justify-content: center; gap: .75rem; padding: 1rem 1.5rem; border-radius: 14px; font-weight: 700; color: #fff; transition: all var(--t); box-shadow: 0 6px 20px rgba(0,0,0,.3); min-height: 64px; }
.tg-social-card:hover { transform: translateY(-3px); color: #fff; }
.tg-social-card span { font-size: .78rem; opacity: .9; display: block; line-height: 1; margin-bottom: 2px; font-weight: 500; }
.tg-social-card strong { font-size: 1.05rem; display: block; line-height: 1.1; }
.tg-social-card--discord { background: linear-gradient(135deg, #5865f2, #4752c4); }
.tg-social-card--reddit  { background: linear-gradient(135deg, #ff4500, #cc3700); }
.tg-social-card--donate  { background: linear-gradient(135deg, #16a34a, #15803d); }
.tg-social-card svg { width: 24px; height: 24px; }

/* ---------- Section header ---------- */
.tg-section { max-width: var(--container); margin: 0 auto 3rem; padding: 0 1.25rem; content-visibility: auto; contain-intrinsic-size: 600px; }
.tg-section__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }
.tg-section__title { font-size: clamp(1.3rem, 2.5vw, 1.75rem); font-weight: 900; margin: 0; position: relative; padding-left: .75rem; }
.tg-section__title::before { content: ''; position: absolute; left: 0; top: 12%; bottom: 12%; width: 4px; background: var(--primary); border-radius: 4px; }
.tg-section__more { color: var(--primary); font-weight: 700; font-size: .9rem; display: inline-flex; align-items: center; gap: .35rem; background: transparent; border: 0; cursor: pointer; padding: .5rem .75rem; min-height: 40px; }
.tg-section__more:hover { color: var(--accent); gap: .6rem; }

/* Tabs */
.tg-tabs { display: flex; gap: .5rem; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: .25rem 0 .75rem; scrollbar-width: none; }
.tg-tabs::-webkit-scrollbar { display: none; }
.tg-tab { padding: .6rem 1.1rem; font-size: .88rem; font-weight: 600; background: var(--surface); color: var(--text-dim); border: 1px solid var(--border); border-radius: 999px; white-space: nowrap; cursor: pointer; transition: all var(--t-fast); min-height: 40px; }
.tg-tab:hover { color: #fff; border-color: var(--border-2); }
.tg-tab.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Game cards ---------- */
.tg-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tg-card { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface); aspect-ratio: 3/4; transition: transform var(--t), box-shadow var(--t); display: block; }
.tg-card:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(0,0,0,.5), 0 0 0 2px var(--primary); }
.tg-card__img-wrap { position: absolute; inset: 0; }
.tg-card__img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.4,0,.2,1); }
.tg-card:hover .tg-card__img { transform: scale(1.08); }
.tg-card__no-img { width:100%;height:100%;display:flex;align-items:center;justify-content:center; background: linear-gradient(135deg, var(--surface-2), var(--bg)); color: var(--text-dim); font-weight: 600; padding: 1rem; text-align: center; }
.tg-card__base { position: absolute; bottom: 0; left: 0; right: 0; padding: 2.5rem 1rem 1rem; background: linear-gradient(to top, rgba(0,0,0,.95) 0%, rgba(0,0,0,.7) 60%, transparent 100%); z-index: 2; }
.tg-card__title { font-family: var(--font-b); font-size: 1rem; font-weight: 700; color: #fff; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 2px 8px rgba(0,0,0,.85); }
.tg-card__hover { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,14,26,0.75), rgba(10,14,26,0.96)); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1rem; opacity: 0; transition: opacity var(--t); z-index: 3; }
.tg-card:hover .tg-card__hover { opacity: 1; }
.tg-card__cat { display: inline-block; padding: .3rem .7rem; background: var(--primary); color: #fff; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; border-radius: 4px; margin-bottom: .75rem; }
.tg-card__name { font-family: var(--font-h); font-size: 1.05rem; font-weight: 700; color: #fff; margin: 0 0 1rem; }
.tg-card__dl { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; background: var(--primary); border-radius: 50%; color: #fff; box-shadow: 0 8px 24px rgba(30,167,255,.55); transition: transform var(--t-fast); }
.tg-card__dl:hover { transform: scale(1.1); color: #fff; }
.tg-card__dl svg { width: 22px; height: 22px; }
@media (hover: none) { .tg-card__hover { opacity: 0; } .tg-card__base { padding-top: 4rem; } }

/* ---------- Categories ---------- */
.tg-cats { display: flex; gap: .75rem; flex-wrap: wrap; }
.tg-cat-pill { padding: .65rem 1.15rem; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; color: var(--text); font-size: .88rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; transition: all var(--t-fast); min-height: 40px; display: inline-flex; align-items: center; }
.tg-cat-pill:hover { background: var(--primary); border-color: var(--primary); color: #fff; transform: translateY(-2px); }

/* ---------- Single post / page ---------- */
.entry, .single-post .entry, .page .entry, .single-game .entry {
  background: var(--surface); padding: 2rem; border-radius: var(--radius);
  border: 1px solid var(--border); margin: 2rem auto; max-width: 900px;
}
.entry-title { font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: 1rem; }
.entry-content { font-size: 1.05rem; line-height: 1.75; color: var(--text); }
.entry-content p, .entry-content li { color: var(--text); }
.entry-content h2, .entry-content h3 { margin-top: 2rem; }
.entry-content a { color: var(--primary); border-bottom: 1px dashed currentColor; }
.entry-content a:hover { color: var(--accent); }
.entry-content img { border-radius: var(--radius-sm); margin: 1rem 0; }
.entry-content blockquote { margin: 1.5rem 0; padding: 1rem 1.5rem; border-left: 4px solid var(--primary); background: var(--surface-2); border-radius: var(--radius-sm); }

.tg-download-box { margin: 2rem 0; padding: 1.5rem; background: linear-gradient(135deg, var(--surface-2), var(--surface)); border: 1px solid var(--border-2); border-radius: var(--radius); }
.tg-download-box__meta { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; font-size: .92rem; color: var(--text-dim); }
.tg-download-box__meta strong { color: #fff; }
.tg-download-box__actions { display: flex; gap: .75rem; flex-wrap: wrap; }

.tg-sysreq { margin: 1.5rem 0; padding: 1.25rem 1.5rem; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); }
.tg-sysreq h3 { margin: 0 0 .75rem; }
.tg-sysreq ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .5rem; }
.tg-sysreq li { color: var(--text-dim); }
.tg-sysreq strong { color: #fff; }

.tg-screens { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.tg-screen { position: relative; aspect-ratio: 16/9; border-radius: var(--radius-sm); overflow: hidden; cursor: zoom-in; background: var(--surface-2); }
.tg-screen img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.4,0,.2,1); }
.tg-screen:hover img { transform: scale(1.15); }

/* Auto-style WP gallery as screenshots */
.entry-content .wp-block-gallery .wp-block-image, .entry-content .gallery .gallery-item { overflow: hidden; border-radius: var(--radius-sm); }
.entry-content .wp-block-gallery .wp-block-image img, .entry-content .gallery img { transition: transform .5s ease; border-radius: var(--radius-sm); }
.entry-content .wp-block-gallery .wp-block-image:hover img, .entry-content .gallery .gallery-item:hover img { transform: scale(1.08); }

/* ---------- Archive head ---------- */
.tg-archive-head { max-width: var(--container); margin: 2rem auto 1.5rem; padding: 0 1.25rem; }
.tg-archive-head h1 { margin-bottom: .25rem; }
.tg-archive-head p { color: var(--text-dim); margin: 0; }

/* ---------- Pagination ---------- */
.archive-pagination, .pagination { margin: 2rem auto; display: flex; justify-content: center; gap: .5rem; list-style: none; padding: 0; flex-wrap: wrap; }
.archive-pagination li a, .archive-pagination li.active a, .archive-pagination li span { display: inline-block; padding: .65rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-weight: 700; transition: all var(--t-fast); min-height: 44px; }
.archive-pagination li a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.archive-pagination li.active a { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Footer ---------- */
.tg-footer { background: var(--bg-2); border-top: 1px solid var(--border); padding: 3rem 1.25rem 6rem; margin-top: 4rem; --cols: 4; }
.tg-footer__inner { max-width: var(--container); margin: 0 auto; display: grid; grid-template-columns: 2fr repeat(calc(var(--cols) - 1), 1fr); gap: 2rem; }
.tg-footer h4 { font-size: .95rem; text-transform: uppercase; letter-spacing: 1px; color: var(--primary); margin-bottom: 1rem; }
.tg-footer ul { list-style: none; padding: 0; margin: 0; }
.tg-footer li { margin-bottom: .5rem; }
.tg-footer a { color: var(--text-dim); font-size: .92rem; }
.tg-footer a:hover { color: #fff; }
.tg-footer__about { color: var(--text-dim); font-size: .92rem; }
.tg-footer__bottom { max-width: var(--container); margin: 2rem auto 0; padding-top: 1.5rem; border-top: 1px solid var(--border); text-align: center; color: var(--text-mute); font-size: .88rem; }

/* ---------- Mobile bottom nav ---------- */
.tg-bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(10,14,26,0.95); backdrop-filter: blur(12px); border-top: 1px solid var(--border-2); display: none; justify-content: space-around; padding: .35rem .25rem; padding-bottom: calc(.35rem + env(safe-area-inset-bottom)); z-index: 90; }
.tg-bottom-nav a, .tg-bottom-nav .tg-bn-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .5rem .25rem; font-size: .7rem; color: var(--text-dim); font-weight: 600; flex: 1; text-align: center; transition: color var(--t-fast); min-height: 48px; background: transparent; border: 0; cursor: pointer; font-family: inherit; }
.tg-bottom-nav a:hover, .tg-bottom-nav a.is-active, .tg-bottom-nav .tg-bn-btn:hover { color: var(--primary); }
.tg-bottom-nav svg { width: 22px; height: 22px; }

/* ---------- Ad slots ---------- */
.tgv3-ad { max-width: var(--container); margin: 1.25rem auto; padding: 0 1.25rem; text-align: center; }
.tgv3-ad img, .tgv3-ad ins { max-width: 100%; height: auto; }
.tgv3-ad--in_content { margin: 1.5rem 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .tg-footer__inner { grid-template-columns: 1fr 1fr; }
  .tg-hero__content { padding: 2rem; }
}
@media (max-width: 768px) {
  :root { --header-h: 64px; }
  .tg-nav { display: none; }
  .tg-burger { display: inline-flex; }
  .tg-bottom-nav { display: flex; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

  .tg-hero { margin: 1rem auto 2rem; padding: 0 .75rem; contain-intrinsic-size: 420px; }
  .tg-hero__slide { min-height: 420px; background-position: 75% center; }
  .tg-hero__slide::before { background: linear-gradient(180deg, rgba(10,14,26,.5) 0%, rgba(10,14,26,.95) 70%, var(--bg) 100%); }
  .tg-hero__content { padding: 1.5rem; max-width: 100%; }
  .tg-hero__title { font-size: clamp(1.8rem, 8vw, 2.5rem); }
  .tg-hero__desc { -webkit-line-clamp: 3; font-size: .95rem; color: #d6dcef; }
  .tg-hero .swiper-button-prev, .tg-hero .swiper-button-next { display: none; }
  .tg-hero .swiper-pagination { bottom: 50px !important; }
  .tg-hero__progress { left: 16px; right: 16px; bottom: 16px; }

  .tg-social-strip { grid-template-columns: 1fr; gap: .5rem; }
  .tg-social-card { padding: .9rem 1rem; }

  .tg-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .tg-card__title { font-size: .9rem; }
  .tg-card__base { padding: 2rem .75rem .75rem; }

  .entry, .page .entry { padding: 1.25rem; margin: 1rem auto; border-radius: var(--radius-sm); }
  .tg-screens { grid-template-columns: repeat(2, 1fr); gap: .5rem; }

  .tg-footer__inner { grid-template-columns: 1fr; gap: 1.5rem; text-align: center; }
}
@media (max-width: 480px) {
  .tg-grid { gap: .5rem; }
  .tg-logo { font-size: 1.2rem; }
}

/* ---------- Animations ---------- */
@keyframes tgFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes tgSlideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.tg-anim-in { animation: tgSlideUp .6s ease both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ============================================================
   COMMENTS — fully customizable via Customizer (CSS vars)
   ============================================================ */
.tg-comments-wrap {
  margin: 3rem 0 2rem;
  padding: 1.75rem;
  background: var(--cmt-bg, #10182b);
  border: 1px solid var(--cmt-field-brd, #23304d);
  border-radius: calc(var(--cmt-radius, 12px) + 4px);
}
.tg-comments-heading {
  font-family: var(--font-h);
  font-size: 1.25rem;
  color: var(--text);
  margin: 0 0 1.25rem;
  letter-spacing: .5px;
  display: flex; align-items: center; gap: .5rem;
}
.tg-comments-heading span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2rem; height: 1.75rem; padding: 0 .55rem;
  background: var(--cmt-accent, var(--primary));
  color: #fff; border-radius: 999px; font-size: .85rem;
}
.tg-comment-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.tg-comment-list .children { list-style: none; padding-left: 1.25rem; margin-top: .75rem; border-left: 2px solid var(--cmt-field-brd); }
.tg-comment { margin: 0 0 1rem; }
.tg-comment__inner {
  background: var(--cmt-field-bg);
  border: 1px solid var(--cmt-field-brd);
  border-radius: var(--cmt-radius, 12px);
  padding: 1rem 1.1rem;
}
.tg-comment__head { display: flex; gap: .75rem; align-items: center; margin-bottom: .5rem; }
.tg-comment__avatar img { border-radius: 50%; display: block; }
.tg-comment__author { color: var(--cmt-text); font-size: .95rem; }
.tg-comment__author a { color: inherit; text-decoration: none; }
.tg-comment__time { color: var(--text-dim); font-size: .8rem; }
.tg-comment__body { color: var(--cmt-text); line-height: 1.6; font-size: var(--cmt-field-size, 16px); }
.tg-comment__body p { margin: 0 0 .5rem; }
.tg-comment__pending { color: #ffb86b; font-style: italic; font-size: .85rem; margin: 0 0 .5rem; }
.tg-comment__actions { margin-top: .65rem; display: flex; gap: .75rem; font-size: .85rem; }
.tg-comment__actions a { color: var(--cmt-accent); text-decoration: none; font-weight: 600; }
.tg-comment__actions a:hover { text-decoration: underline; }

/* ---- Form ---- */
.tg-comment-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.tg-comment-form .tg-comment-field--message,
.tg-comment-form .tg-comment-actions { grid-column: 1 / -1; }
.tg-comment-field { margin: 0; }
.tg-comment-field label {
  display: block;
  margin-bottom: .4rem;
  color: var(--cmt-label);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .3px;
}
.tg-comment-field .tg-req { color: #ff5a5a; }
.tg-comment-form input[type="text"],
.tg-comment-form input[type="email"],
.tg-comment-form input[type="url"],
.tg-comment-form textarea {
  width: 100%;
  background: var(--cmt-field-bg);
  border: 1px solid var(--cmt-field-brd);
  color: var(--cmt-text);
  font-size: var(--cmt-field-size);
  font-family: var(--font-b);
  padding: .85rem 1rem;
  border-radius: var(--cmt-radius);
  transition: border-color .2s, box-shadow .2s, background .2s;
  -webkit-appearance: none; appearance: none;
}
.tg-comment-form input::placeholder,
.tg-comment-form textarea::placeholder { color: color-mix(in srgb, var(--cmt-text) 40%, transparent); }
.tg-comment-form input:focus,
.tg-comment-form textarea:focus {
  outline: none;
  border-color: var(--cmt-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cmt-accent) 25%, transparent);
}
.tg-comment-form textarea {
  min-height: var(--cmt-textarea-h, 140px);
  resize: vertical;
  line-height: 1.5;
}
.tg-comment-actions { display: flex; align-items: center; gap: 1rem; }
.tg-comment-actions .tg-btn { min-width: 160px; justify-content: center; }
.tg-comments-pagination { margin-top: 1.25rem; }
.tg-comments-closed { color: var(--text-dim); font-style: italic; }

/* Mobile: stack name & email */
@media (max-width: 600px) {
  .tg-comments-wrap { padding: 1.1rem; }
  .tg-comment-form { grid-template-columns: 1fr; }
  .tg-comment-actions .tg-btn { width: 100%; }
}

/* ---------- v3.5: Hero high-res <picture> background + per-category rows ---------- */
.tg-hero__bg {
  position: absolute; inset: 0; z-index: 0;
  display: block; width: 100%; height: 100%;
  pointer-events: none;
}
.tg-hero__bg img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: right center;
  display: block;
  transform: scale(1.02);
  transition: transform 8s ease-out;
}
.swiper-slide-active .tg-hero__bg img { transform: scale(1.08); }
.tg-hero__overlay {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(90deg, var(--bg) 0%, rgba(10,14,26,.88) 38%, rgba(10,14,26,.25) 75%, transparent 100%),
    linear-gradient(180deg, transparent 55%, var(--bg) 100%);
}
@media (max-width: 768px) {
  .tg-hero__bg img { object-position: 70% center; }
  .tg-hero__overlay {
    background: linear-gradient(180deg, rgba(10,14,26,.45) 0%, rgba(10,14,26,.95) 65%, var(--bg) 100%);
  }
}

/* Per-category rows: subtle separator + tighter heading */
.tg-section--catrow { margin-top: 1.25rem; }
.tg-section--catrow .tg-section__title {
  position: relative; padding-left: .9rem;
}
.tg-section--catrow .tg-section__title::before {
  content: ''; position: absolute; left: 0; top: 50%;
  width: 4px; height: 70%; transform: translateY(-50%);
  background: var(--primary); border-radius: 2px;
}
