/*
Theme Name: Gamerex Theme
Theme URI: https://gamerexofficial.com/
Author: Gamerex
Description: Custom dark red/black esports theme for Gamerex — home hero video with two buttons, full Games & Software catalogs with genre tabs, per-listing system requirements, and a Request a Game form. Edit page heading/subheading/hero video/buttons from each Page's "Gamerex Page Settings" box in WP Admin. Every WordPress page includes built-in custom heading, subheading, image, hero video, buttons, meta title, and meta description controls.
Version: 1.0
Requires PHP: 7.4
Text Domain: gamerex-theme
*/

/* ==========================================================================
   DESIGN TOKENS — edit these to re-theme the whole site from one place.
   ========================================================================== */
:root {
  --grex-bg: #0a0a0c;
  --grex-panel: #131317;
  --grex-panel-2: #1b1b20;
  --grex-border: #2a2a31;
  --grex-red: #e8283f;
  --grex-red-dim: #8c1526;
  --grex-gold: #f2b33d;
  --grex-text: #f3f2ef;
  --grex-muted: #94949e;
  --grex-font-display: "Rajdhani", "Arial Narrow", sans-serif;
  --grex-font-body: "Inter", -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  background: var(--grex-bg);
  color: var(--grex-text);
  font-family: var(--grex-font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--grex-font-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.01em; }

/* ---------------------------------------------------------------------- */
/* HEADER / NAV                                                            */
/* ---------------------------------------------------------------------- */
.grex-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  width: 100%;
  background: rgba(10,10,12,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--grex-border);
}
.grex-header-inner {
  min-height: 78px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 42px;
}
.grex-logo {
  grid-column: 1;
  font-family: var(--grex-font-display);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.grex-logo span { color: var(--grex-red); }
.grex-nav {
  grid-column: 2;
  display: flex;
  align-items: stretch;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.grex-header-inner::after {
  content: "";
  grid-column: 3;
}
.grex-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 78px;
  padding: 0 19px;
  font-family: var(--grex-font-display);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  color: var(--grex-muted);
  white-space: nowrap;
  transition: color .18s ease, background .18s ease;
}
.grex-nav a::after {
  content: "";
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 0;
  height: 3px;
  background: var(--grex-red);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .18s ease;
}
.grex-nav a:hover,
.grex-nav a.is-active {
  color: var(--grex-text);
  background: rgba(232,40,63,0.06);
}
.grex-nav a:hover::after,
.grex-nav a.is-active::after { transform: scaleX(1); }

/* ---------------------------------------------------------------------- */
/* HERO (Home only)                                                        */
/* ---------------------------------------------------------------------- */
.grex-hero { position: relative; min-height: 100vh; display: flex; align-items: flex-end; overflow: hidden; clip-path: polygon(0 0, 100% 0, 100% 92%, 0 100%); }
.grex-hero-media { position: absolute; inset: 0; z-index: 0; }
.grex-hero-media video { width: 100%; height: 100%; object-fit: cover; }
.grex-hero-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,10,12,0.98) 0%, rgba(10,10,12,0.55) 45%, rgba(10,10,12,0.35) 100%),
    linear-gradient(120deg, rgba(232,40,63,0.25), transparent 55%);
}
.grex-hero-content { position: relative; z-index: 1; width: 100%; padding: 0 32px 72px; max-width: 1240px; margin: 0 auto; }
.grex-eyebrow { display: inline-flex; align-items: center; gap: 10px; font-family: var(--grex-font-display); font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--grex-gold); margin-bottom: 18px; }
.grex-eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--grex-gold); }
.grex-hero h1 { font-size: clamp(40px, 6.5vw, 84px); line-height: 0.98; max-width: 900px; margin-bottom: 22px; }
.grex-lede { max-width: 560px; font-size: 17px; color: var(--grex-muted); margin: 0 0 34px; }
.grex-hero-ctas { display: flex; gap: 16px; flex-wrap: wrap; }

.grex-btn {
  font-family: var(--grex-font-display); font-weight: 700; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 15px 30px; border-radius: 2px; display: inline-flex; align-items: center; gap: 10px;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease; border: 1px solid transparent; cursor: pointer;
}
.grex-btn-primary { background: var(--grex-red); color: #0a0a0c; }
.grex-btn-primary:hover { transform: translateY(-2px); background: #ff3f57; color: #0a0a0c; }
.grex-btn-outline { border-color: var(--grex-border); color: var(--grex-text); background: transparent; }
.grex-btn-outline:hover { border-color: var(--grex-red); color: var(--grex-red); }
.grex-btn-download { background: #22c55e; color: #06210f; }
.grex-btn-download:hover { transform: translateY(-2px); background: #34e075; color: #06210f; }

/* ---------------------------------------------------------------------- */
/* SECTIONS                                                                 */
/* ---------------------------------------------------------------------- */
.grex-section { padding: 90px 32px 20px; max-width: 1240px; margin: 0 auto; }
.grex-section-top { padding-top: 130px; padding-bottom: 90px; }
.grex-section-head { margin-bottom: 40px; }
.grex-eyebrow-inline { font-family: var(--grex-font-display); font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--grex-red); margin-bottom: 10px; }
.grex-section-head h2 { font-size: clamp(28px, 3.4vw, 44px); margin-bottom: 10px; }
.grex-page-lede { color: var(--grex-muted); max-width: 560px; }

/* ---------------------------------------------------------------------- */
/* TABS                                                                     */
/* ---------------------------------------------------------------------- */
.grex-tabs-bar { position: sticky; top: 78px; z-index: 40; background: rgba(10,10,12,0.95); backdrop-filter: blur(8px); border-top: 1px solid var(--grex-border); border-bottom: 1px solid var(--grex-border); padding: 18px 0; margin-bottom: 30px; }
@media (max-width: 860px) { .grex-tabs-bar { top: 70px; } }
.grex-tabs { display: flex; gap: 10px; overflow-x: auto; max-width: 1240px; margin: 0 auto; scrollbar-width: none; }
.grex-tabs::-webkit-scrollbar { display: none; }
.grex-tab { font-family: var(--grex-font-display); font-weight: 600; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; padding: 10px 20px; border: 1px solid var(--grex-border); border-radius: 2px; color: var(--grex-muted); background: var(--grex-panel); transition: all 0.15s ease; }
.grex-tab:hover { color: var(--grex-text); border-color: var(--grex-muted); }
.grex-tab.active { background: var(--grex-red); border-color: var(--grex-red); color: #0a0a0c; }
.grex-count { opacity: 0.65; font-weight: 500; margin-left: 4px; }

/* ---------------------------------------------------------------------- */
/* GRID + CARDS                                                            */
/* ---------------------------------------------------------------------- */
.grex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.grex-card { position: relative; background: var(--grex-panel); border: 1px solid var(--grex-border); border-radius: 3px; overflow: hidden; display: flex; flex-direction: column; transition: border-color 0.2s ease, transform 0.2s ease; }
.grex-card.grex-hidden { display: none; }
.grex-card:hover { border-color: var(--grex-red-dim); transform: translateY(-3px); }
.grex-cover { position: relative; aspect-ratio: 16/10; background: linear-gradient(135deg, var(--grex-panel-2), var(--grex-bg)); display: flex; align-items: flex-end; padding: 16px; overflow: hidden; }
.grex-cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.grex-rank { position: absolute; top: -14px; left: -6px; font-family: var(--grex-font-display); font-weight: 700; font-size: 76px; color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,0.14); line-height: 1; }
.grex-genre-tag { position: relative; z-index: 1; font-family: var(--grex-font-display); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; background: var(--grex-red); color: #0a0a0c; padding: 4px 10px; border-radius: 2px; }
.grex-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.grex-title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.grex-title { font-size: 19px; }
.grex-rating { color: var(--grex-gold); font-family: var(--grex-font-display); font-weight: 700; font-size: 14px; white-space: nowrap; }
.grex-rating-lg { font-size: 24px; margin: 10px 0 20px; }
.grex-sub { font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--grex-muted); margin-bottom: 10px; }
.grex-desc { font-size: 14px; color: var(--grex-muted); flex: 1; margin: 0 0 16px; }
.grex-link { font-family: var(--grex-font-display); font-size: 13px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.grex-link:hover { color: var(--grex-red); }
.grex-empty-state { text-align: center; padding: 60px 0; color: var(--grex-muted); font-family: var(--grex-font-display); text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------------------------------------------------------------------- */
/* SINGLE LISTING PAGE                                                      */
/* ---------------------------------------------------------------------- */
.grex-single-banner { position: relative; border-radius: 3px; margin-bottom: 34px; background-size: cover; background-position: center; background-repeat: no-repeat; overflow: hidden; }
.grex-single-banner.has-bg {
  width: 100vw; max-width: 100vw; position: relative; left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw;
  border-radius: 0; border: none; border-top: 1px solid var(--grex-border); border-bottom: 1px solid var(--grex-border);
  padding: 64px 32px; margin-bottom: 40px;
  aspect-ratio: 16 / 9; min-height: 420px; max-height: 90vh; display: flex; align-items: flex-end;
  overflow: hidden;
}
.grex-single-banner.has-bg::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,10,12,0.35), rgba(10,10,12,0.94)); }
.grex-banner-inner { position: relative; z-index: 1; width: 100%; max-width: 1240px; margin: 0 auto; }
.grex-single-banner.has-bg .grex-single-head { margin-bottom: 0; }
.grex-single-head { display: flex; gap: 32px; flex-wrap: wrap; margin-bottom: 34px; align-items: flex-start; }
.grex-single-cover { flex: 0 0 280px; width: 280px; aspect-ratio: 3 / 4; border-radius: 3px; overflow: hidden; border: 1px solid var(--grex-border); background: var(--grex-panel); }
.grex-single-cover img { width: 100%; height: 100%; object-fit: cover; }
.grex-single-info { flex: 1; min-width: 260px; }
.grex-single-head h1 { font-size: clamp(28px, 4vw, 48px); margin-bottom: 6px; }
.grex-single-desc { color: var(--grex-muted); max-width: 720px; margin-bottom: 40px; }

.grex-meta-row { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--grex-muted); font-size: 16px; margin: 14px 0; }
.grex-meta-row span:not(:last-child)::after { content: "•"; margin-left: 18px; color: var(--grex-border); }

.grex-genre-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.grex-tag-pill { font-size: 12px; font-weight: 600; padding: 6px 14px; border-radius: 20px; background: var(--grex-panel-2); border: 1px solid var(--grex-border); color: var(--grex-text); }

.grex-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.grex-two-col.single { grid-template-columns: 1fr; }
.grex-info-card { background: var(--grex-panel); border: 1px solid var(--grex-border); border-radius: 6px; padding: 26px; }
.grex-info-card h3 { font-size: 20px; margin-bottom: 4px; }
.grex-card-sub { color: var(--grex-muted); font-size: 13px; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--grex-border); }

.grex-steps { list-style: none; display: flex; flex-direction: column; gap: 18px; }
.grex-steps li { display: flex; align-items: flex-start; gap: 14px; font-size: 14px; }
.grex-step-num { flex: 0 0 26px; height: 26px; border-radius: 50%; border: 1px solid var(--grex-red); color: var(--grex-red); display: flex; align-items: center; justify-content: center; font-family: var(--grex-font-display); font-weight: 700; font-size: 13px; }

.grex-req-table { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grex-req-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--grex-red); margin-bottom: 12px; }
.grex-req-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.grex-req-col li { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--grex-border); padding-bottom: 8px; }
.grex-req-col li strong { color: var(--grex-muted); font-weight: 500; }
.grex-req-col li span { color: var(--grex-text); font-weight: 600; text-align: right; }

.grex-notes-card { background: var(--grex-panel); border: 1px solid var(--grex-gold); border-radius: 6px; padding: 26px; margin-bottom: 34px; }
.grex-notes-card h3 { font-size: 18px; color: var(--grex-gold); margin-bottom: 4px; }
.grex-notes-card ul { list-style: disc; padding-left: 20px; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--grex-muted); }

.grex-download-banner { display: flex; justify-content: center; padding: 50px 0; }
.grex-btn-pill { display: inline-flex; align-items: center; gap: 14px; background: #22c55e; color: #06210f; padding: 16px 32px; border-radius: 50px; box-shadow: 0 0 40px rgba(34,197,94,0.45); transition: transform 0.15s ease; }
.grex-btn-pill:hover { transform: translateY(-2px); }
.grex-pill-icon { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.25); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.grex-pill-text { display: flex; flex-direction: column; line-height: 1.25; }
.grex-pill-text strong { font-family: var(--grex-font-display); font-size: 17px; text-transform: uppercase; letter-spacing: 0.03em; }
.grex-pill-text small { font-size: 12px; opacity: 0.85; }

@media (max-width: 760px) {
  .grex-two-col, .grex-req-table { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------- */
/* REQUEST FORM                                                            */
/* ---------------------------------------------------------------------- */
.grex-form { display: flex; flex-direction: column; gap: 18px; max-width: 560px; }
.grex-form label { display: flex; flex-direction: column; gap: 8px; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--grex-muted); font-family: var(--grex-font-display); font-weight: 600; }
.grex-form input, .grex-form textarea { font-family: var(--grex-font-body); font-size: 15px; background: var(--grex-panel); border: 1px solid var(--grex-border); color: var(--grex-text); padding: 12px 14px; border-radius: 2px; }
.grex-form input:focus, .grex-form textarea:focus { outline: none; border-color: var(--grex-red); }
.grex-form button { align-self: flex-start; margin-top: 4px; }
.grex-form-notice { background: var(--grex-panel); border: 1px solid var(--grex-red-dim); padding: 14px 18px; border-radius: 2px; margin-bottom: 20px; font-size: 14px; }

/* ---------------------------------------------------------------------- */
/* FOOTER                                                                   */
/* ---------------------------------------------------------------------- */
.grex-footer { margin-top: 60px; border-top: 1px solid var(--grex-border); padding: 60px 32px 30px; max-width: 1240px; margin-left: auto; margin-right: auto; }
.grex-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.grex-footer-grid h4 { font-family: var(--grex-font-display); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--grex-muted); margin-bottom: 16px; }
.grex-footer-grid ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.grex-footer-grid ul a:hover { color: var(--grex-red); }
.grex-footer-about p { color: var(--grex-muted); font-size: 14px; max-width: 320px; margin-top: 10px; }
.grex-footer-bottom { border-top: 1px solid var(--grex-border); padding-top: 24px; font-size: 13px; color: var(--grex-muted); }

@media (max-width: 700px) {
  .grex-req-table { grid-template-columns: 1fr; }
  .grex-single-head { flex-direction: column; }
  .grex-single-cover { width: 100%; max-width: 240px; }
  .grex-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .grex-hero-content, .grex-section, .grex-footer { padding-left: 18px; padding-right: 18px; }
  .grex-footer-grid { grid-template-columns: 1fr; }
}


/* ---------------------------------------------------------------------- */
/* CUSTOM PAGE CONTENT                                                     */
/* ---------------------------------------------------------------------- */
.grex-custom-page .grex-section-head { margin-bottom: 28px; }
.grex-custom-page .grex-section-head h1 { font-size: clamp(38px, 5vw, 68px); line-height: 1; margin-bottom: 14px; }
.grex-page-hero-image { width: 100%; max-height: 420px; overflow: hidden; margin-bottom: 28px; border: 1px solid var(--grex-border); background: var(--grex-panel); }
.grex-page-hero-image img { width: 100%; height: auto; max-height: 420px; object-fit: cover; }
.grex-page-lede { max-width: 760px; color: var(--grex-muted); font-size: 17px; }
@media (max-width: 860px) {
  .grex-header-inner { min-height: 70px; padding: 0 18px; gap: 18px; overflow-x: auto; }
  .grex-logo { font-size: 22px; }
  .grex-nav { overflow-x: auto; scrollbar-width: none; }
  .grex-nav::-webkit-scrollbar { display: none; }
  .grex-nav a { min-height: 70px; padding: 0 13px; font-size: 13px; }
  .grex-nav a::after { left: 9px; right: 9px; }
}

/* ---------------------------------------------------------------------- */
/* NAV — mobile override                                                   */
/* ---------------------------------------------------------------------- */
@media (max-width: 860px) {
  .grex-header-inner { grid-template-columns: auto 1fr; }
  .grex-header-inner::after { display: none; }
}

/* ==========================================================================
   HERO IMAGE SLIDER — Games & Software catalog pages
   ========================================================================== */

.grex-hero-slider {
    position: relative;
    width: 100%;
    max-height: 460px;
    overflow: hidden;
    margin-bottom: 28px;
    border: 1px solid var(--grex-border);
    background: var(--grex-panel);
    border-radius: 4px;
}

.grex-slider-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.grex-slide {
    display: none;
    width: 100%;
}

.grex-slide.active {
    display: block;
}

.grex-slide img {
    width: 100%;
    height: auto;
    max-height: 460px;
    object-fit: cover;
    display: block;
}

/* Single image — no arrows/dots needed, behaves like old hero image */
.grex-slider-single {
    max-height: 420px;
}
.grex-slider-single .grex-slide img {
    max-height: 420px;
}

/* Arrows */
.grex-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    font-size: 36px;
    line-height: 1;
    width: 48px;
    height: 48px;
    cursor: pointer;
    z-index: 10;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

.grex-slider-arrow:hover {
    background: rgba(180, 20, 20, 0.85);
}

.grex-slider-prev { left: 12px; }
.grex-slider-next { right: 12px; }

/* Dot indicators */
.grex-slider-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.grex-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
}

.grex-dot.active,
.grex-dot:hover {
    background: #fff;
    transform: scale(1.25);
}

/* Fade animation between slides */
.grex-slide {
    animation: none;
}

.grex-slide.active {
    animation: grexSlideIn 0.4s ease;
}

@keyframes grexSlideIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Mobile */
@media (max-width: 600px) {
    .grex-hero-slider { max-height: 240px; }
    .grex-slider-single { max-height: 220px; }
    .grex-slide img,
    .grex-slider-single .grex-slide img { max-height: 240px; }
    .grex-slider-arrow { width: 36px; height: 36px; font-size: 26px; }
    .grex-slider-prev { left: 6px; }
    .grex-slider-next { right: 6px; }
}

/* Slide link wrapper — fills the entire slide so full image is clickable */
.grex-slide-link {
    display: block;
    width: 100%;
    line-height: 0;
    cursor: pointer;
}

.grex-slide-link img {
    transition: opacity 0.2s;
}

.grex-slide-link:hover img {
    opacity: 0.88;
}
