/* ============================================================
   RepackGames Child — theme.css
   1:1 visual clone of repack-games.com (video-wp), dark default.
   ============================================================ */

:root {
  --rg-bg:           #1a1a1a;
  --rg-bg-alt:       #232323;
  --rg-card:         #2a2a2a;
  --rg-card-hover:   #353535;
  --rg-border:       #3a3a3a;
  --rg-text:         #f0f0f0;
  --rg-text-muted:   #a0a0a0;
  --rg-primary:      #e85d04;
  --rg-primary-hov:  #ff7818;
  --rg-accent:       #22d3ee;
  --rg-success:      #22c55e;
  --rg-link:         #f0f0f0;
  --rg-link-hover:   #ff7818;

  --rg-font-body:    "Exo", "Helvetica Neue", Arial, sans-serif;
  --rg-font-head:    "Philosopher", Georgia, serif;
  --rg-font-mono:    "Droid Sans", Menlo, monospace;

  --rg-max-w:        1200px;
  --rg-header-h:     80px;
  --rg-radius:       8px;
  --rg-radius-sm:    4px;
  --rg-shadow:       0 4px 14px rgba(0,0,0,.4);
  --rg-shadow-card:  0 2px 8px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }

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

body.rg-theme {
  margin: 0;
  background: var(--rg-bg);
  color: var(--rg-text);
  font: 15px/1.55 var(--rg-font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--rg-link); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--rg-link-hover); }

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

h1, h2, h3, h4, h5, h6 { font-family: var(--rg-font-head); font-weight: 700; line-height: 1.2; margin: 0 0 .6em; color: var(--rg-text); }
h1 { font-size: 32px; }
h2 { font-size: 26px; }
h3 { font-size: 20px; }

p { margin: 0 0 1em; }

ul, ol { padding-left: 1.4em; }

/* ============================================================
   Header — modern two-tier layout
   Top tier (#0a0a0a): logo + search + dark toggle + CTA
   Bottom tier (#171717): horizontal category nav with subtle accent border
   ============================================================ */
.rg-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0a0a0a;
  border-bottom: 2px solid var(--rg-primary);
  box-shadow: 0 4px 18px rgba(0,0,0,.45);
}
.rg-header-top {
  max-width: var(--rg-max-w);
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.rg-header-inner {
  max-width: var(--rg-max-w);
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Logo */
.rg-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--rg-text);
  transition: filter .2s ease;
}
.rg-logo:hover { filter: brightness(1.15); }
.rg-logo svg { height: 52px; width: auto; display: block; }
.rg-wordmark {
  font: 700 22px/1 var(--rg-font-head);
  color: var(--rg-text);
  letter-spacing: -.5px;
}
.rg-wordmark .dot { color: var(--rg-primary); }

/* Spacer & actions */
.rg-header-spacer { flex: 1; }
.rg-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.rg-icon-btn,
.rg-icon-link,
.rg-search-toggle,
.rg-dark-toggle {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--rg-border);
  color: var(--rg-text);
  cursor: pointer;
  width: 38px; height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
  text-decoration: none;
  flex-shrink: 0;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.rg-icon-btn:hover,
.rg-icon-link:hover,
.rg-search-toggle:hover,
.rg-dark-toggle:hover {
  background: var(--rg-primary);
  border-color: var(--rg-primary);
  color: #fff;
  transform: translateY(-1px);
}
/* Make SVG icons visible regardless of cascade */
.rg-icon-btn svg,
.rg-icon-link svg,
.rg-search-toggle svg,
.rg-dark-toggle svg {
  width: 20px;
  height: 20px;
  color: inherit;
  fill: currentColor;
  stroke: currentColor;
  flex-shrink: 0;
  display: inline-block;
}
.rg-search-toggle svg,
.rg-dark-toggle svg { fill: none; }   /* stroke-only icons */
.rg-icon-link svg   { stroke: none; } /* solid icon (GitHub) */

/* Primary nav (lower bar) */
.rg-nav-bar {
  background: #131318;
  border-top: 1px solid var(--rg-border);
}
.rg-primary-nav {
  max-width: var(--rg-max-w);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
}
.rg-menu {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
  width: 100%;
}
.rg-menu li {
  position: relative;
}
.rg-menu li a {
  display: inline-block;
  padding: 12px 14px;
  font: 600 12px/1 var(--rg-font-body);
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--rg-text-muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s, background .15s;
}
.rg-menu li a:hover,
.rg-menu li.current-cat a,
.rg-menu li.current-menu-item a {
  color: var(--rg-primary);
  border-bottom-color: var(--rg-primary);
  background: rgba(232,93,4,0.06);
}
.rg-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  display: none;
  background: var(--rg-bg-alt);
  border: 1px solid var(--rg-border);
  border-radius: var(--rg-radius-sm);
  min-width: 200px;
  list-style: none;
  padding: 6px 0;
  margin: 0;
  flex-direction: column;
  gap: 0;
  box-shadow: var(--rg-shadow);
  z-index: 200;
}
.rg-menu li:hover > .sub-menu,
.rg-menu li:focus-within > .sub-menu { display: flex; }
.rg-menu .sub-menu li a { padding: 10px 16px; border-bottom: 0; }

/* Mobile toggle (shown ≤768px) */
.rg-mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--rg-border);
  width: 38px; height: 38px;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
@media (max-width: 768px) {
  .rg-mobile-toggle { display: inline-flex !important; }
  .rg-nav-bar { display: none; }  /* hide horizontal nav on mobile; toggle opens slide-down */
}
@media (max-width: 420px) {
  .rg-icon-btn, .rg-icon-link, .rg-search-toggle, .rg-dark-toggle, .rg-mobile-toggle {
    width: 34px !important;
    height: 34px !important;
  }
  .rg-icon-btn svg, .rg-icon-link svg, .rg-search-toggle svg, .rg-dark-toggle svg {
    width: 17px !important;
    height: 17px !important;
  }
  .rg-header-actions { gap: 4px !important; }
}
.rg-mobile-toggle span {
  display: block;
  width: 18px; height: 2px;
  background: var(--rg-text);
  border-radius: 1px;
}

/* Search bar (slide-down) */
.rg-search-bar {
  display: none;
  background: #0a0a0a;
  border-top: 1px solid var(--rg-border);
  padding: 12px 16px;
}
.rg-search-bar.is-open { display: flex; gap: 8px; max-width: var(--rg-max-w); margin: 0 auto; }
.rg-search-bar input {
  flex: 1; padding: 11px 16px; border: 1px solid var(--rg-border);
  background: var(--rg-bg-alt); color: var(--rg-text); border-radius: var(--rg-radius-sm);
  font: 14px var(--rg-font-body);
}
.rg-search-bar input:focus {
  outline: 0; border-color: var(--rg-primary);
  box-shadow: 0 0 0 3px rgba(232,93,4,.18);
}
.rg-search-bar button {
  padding: 11px 22px; background: var(--rg-primary); color: #fff; border: 0;
  border-radius: var(--rg-radius-sm); font: 600 13px var(--rg-font-body); cursor: pointer;
  text-transform: uppercase; letter-spacing: .5px;
}
.rg-search-bar button:hover { background: var(--rg-primary-hov); }

/* ----------- Main container ----------- */
.rg-main {
  max-width: var(--rg-max-w);
  margin: 0 auto;
  padding: 24px 16px;
}

/* ----------- Cards / Grid ----------- */
.rg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.rg-card {
  background: var(--rg-card);
  border-radius: var(--rg-radius);
  overflow: hidden;
  box-shadow: var(--rg-shadow-card);
  transition: transform .15s ease, background .15s ease;
}
.rg-card:hover { transform: translateY(-2px); background: var(--rg-card-hover); }
.rg-card-link { display: block; color: inherit; }
.rg-card-thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #000; }
.rg-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.rg-card:hover .rg-card-thumb img { transform: scale(1.04); }
.rg-card-cat {
  position: absolute; top: 8px; left: 8px;
  background: rgba(232,93,4,.92); color: #fff;
  font: 600 11px/1 var(--rg-font-body); text-transform: uppercase;
  padding: 4px 8px; border-radius: var(--rg-radius-sm);
}
.rg-card-title {
  font: 600 15px/1.3 var(--rg-font-body);
  margin: 0;
  padding: 12px;
  color: var(--rg-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ----------- Section heads ----------- */
.rg-section { margin: 36px 0; }
.rg-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--rg-primary);
}
.rg-section-head h2 { margin: 0; font-size: 24px; }
.rg-more { color: var(--rg-accent); font: 500 13px var(--rg-font-body); }
.rg-more:hover { color: var(--rg-primary); }

/* ----------- Pagination ----------- */
.rg-pagination {
  margin: 32px 0;
  text-align: center;
}
.rg-pagination .page-numbers {
  display: inline-block;
  padding: 8px 14px;
  margin: 0 4px;
  background: var(--rg-card);
  color: var(--rg-text);
  border-radius: var(--rg-radius-sm);
  font: 500 14px var(--rg-font-body);
}
.rg-pagination .page-numbers.current { background: var(--rg-primary); color: #fff; }
.rg-pagination .page-numbers:hover { background: var(--rg-primary-hov); color: #fff; }

/* ----------- Footer ----------- */
.rg-site-footer {
  background: #0a0a0a;
  border-top: 1px solid var(--rg-border);
  margin-top: 48px;
}
.rg-footer-inner {
  max-width: var(--rg-max-w);
  margin: 0 auto;
  padding: 32px 16px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 32px;
}
.rg-footer-col h4 { font-family: var(--rg-font-head); color: var(--rg-primary); font-size: 17px; margin: 0 0 12px; }
.rg-footer-col ul { list-style: none; padding: 0; margin: 0; }
.rg-footer-col li { margin: 6px 0; font-size: 13px; }
.rg-footer-col a { color: var(--rg-text-muted); }
.rg-footer-col a:hover { color: var(--rg-primary); }
.rg-footer-bottom {
  border-top: 1px solid var(--rg-border);
  padding: 14px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--rg-text-muted);
}

/* ----------- Archive ----------- */
.rg-archive-head {
  border-bottom: 2px solid var(--rg-primary);
  padding-bottom: 14px;
  margin-bottom: 24px;
}
.rg-archive-head h1 { font-size: 28px; margin: 0; }
.rg-archive-desc { margin-top: 10px; color: var(--rg-text-muted); font-size: 14px; }

.rg-no-results {
  background: var(--rg-card);
  padding: 30px;
  border-radius: var(--rg-radius);
  text-align: center;
  color: var(--rg-text-muted);
}

/* ----------- Page ----------- */
.rg-page { max-width: 800px; margin: 0 auto; }
.rg-page h1 { font-size: 30px; border-bottom: 2px solid var(--rg-primary); padding-bottom: 12px; margin-bottom: 20px; }

/* ----------- Responsive ----------- */
@media (max-width: 960px) {
  .rg-footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .rg-mobile-toggle { display: block; }
  .rg-menu {
    display: none;
    position: absolute; top: var(--rg-header-h); left: 0; right: 0;
    background: #0f0f0f;
    flex-direction: column;
    padding: 12px 16px;
    border-bottom: 1px solid var(--rg-border);
    gap: 0;
  }
  .rg-menu.is-open { display: flex; }
  .rg-menu li a { padding: 10px 0; display: block; }
  .rg-footer-inner { grid-template-columns: 1fr; gap: 24px; }
  h1 { font-size: 26px; }
  h2 { font-size: 22px; }
}
