/* XGameHub front-end styles — aligned with the main site design DNA. */

:root {
  --xh-bg: #0e0f0f;
  --xh-header: #000000;
  --xh-surface: #141414;
  --xh-surface-2: #1c1c22;
  --xh-surface-3: #1f1f26;
  --xh-text: #ffffff;
  --xh-text-muted: #898992;
  --xh-text-dim: rgba(255, 255, 255, 0.5);
  --xh-border: rgba(255, 255, 255, 0.08);
  --xh-border-strong: rgba(255, 255, 255, 0.15);
  --xh-brand: #ff2e6c;
  --xh-brand-2: #f022c4;
  --xh-cta: linear-gradient(90deg, #ff2e6c 0%, #f022c4 100%);
  --xh-radius: 0.625rem;
  --xh-radius-card: 16px;
  --xh-radius-cta: 22px;
  --xh-header-h: 70px;
  --xh-content: 720px;
  --xh-wide: 1120px;
  --xh-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", system-ui, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.xgamehub-theme {
  margin: 0;
  background: var(--xh-bg);
  color: var(--xh-text);
  font-family: var(--xh-font);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

body.nav-open {
  overflow: hidden;
}

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

a {
  color: var(--xh-brand);
  text-decoration: none;
}

a:hover {
  color: #ff5a8a;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--xh-text);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.6em;
}

p {
  margin: 0 0 1em;
}

.screen-reader-text,
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100000;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  padding: 8px 14px;
  background: var(--xh-brand);
  color: #fff;
  border-radius: 8px;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--xh-header);
  border-bottom: 1px solid var(--xh-border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--xh-header-h);
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-logo,
.site-logo__img {
  cursor: pointer;
}

.site-logo {
  display: flex;
  align-items: center;
}

.site-logo__img {
  display: block;
  height: 24px;
  width: auto;
  max-width: 159px;
}

.site-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__list a {
  color: rgba(255, 255, 255, 0.75);
  font-size: 15px;
  white-space: nowrap;
}

.site-nav__list a:hover,
.site-nav__list .current-menu-item > a,
.site-nav__list .current_page_item > a {
  color: #fff;
}

.site-nav__list .sub-menu {
  display: none;
  position: absolute;
  min-width: 180px;
  margin: 8px 0 0;
  padding: 8px 0;
  list-style: none;
  background: var(--xh-surface-2);
  border: 1px solid var(--xh-border-strong);
  border-radius: var(--xh-radius);
}

.site-nav__list > li {
  position: relative;
}

.site-nav__list > li:hover > .sub-menu,
.site-nav__list > li:focus-within > .sub-menu {
  display: block;
}

.site-nav__list .sub-menu a {
  display: block;
  padding: 8px 16px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-toggle__bar {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: var(--xh-radius-cta);
  background: var(--xh-cta);
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-cta:hover {
  box-shadow: 0 8px 24px rgba(255, 46, 108, 0.35);
  transform: scale(1.02);
}

.btn-cta--mobile {
  display: none;
}

/* Main layout */

.site-main {
  min-height: calc(100vh - var(--xh-header-h) - 280px);
  padding: 40px 24px 80px;
}

.container {
  width: 100%;
  max-width: var(--xh-wide);
  margin: 0 auto;
}

.container--narrow {
  max-width: var(--xh-content);
}

.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: clamp(1.75rem, 3vw, 2rem);
  margin-bottom: 8px;
}

.page-header p,
.archive-description {
  color: var(--xh-text-muted);
  margin: 0;
}

/* Post card grid */

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--xh-surface);
  border-radius: var(--xh-radius-card);
  overflow: hidden;
  border: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.post-card:hover {
  border-color: var(--xh-border-strong);
}

.post-card__media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--xh-surface-3);
}

.post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.post-card:hover .post-card__media img {
  transform: scale(1.06);
}

.post-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px 20px;
  flex: 1;
}

.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--xh-text-muted);
  font-size: 12px;
}

.post-card__meta a {
  color: var(--xh-text-muted);
}

.post-card__meta a:hover {
  color: var(--xh-brand);
}

.post-card__title {
  font-size: 1.125rem;
  margin: 0;
}

.post-card__title a {
  color: var(--xh-text);
}

.post-card__title a:hover {
  color: var(--xh-brand);
}

.post-card__excerpt {
  color: var(--xh-text-muted);
  font-size: 14px;
  margin: 0;
  flex: 1;
}

.post-card__placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1218 0%, #2a1524 50%, #141414 100%);
}

/* Article / page content */

.entry-hero {
  margin-bottom: 28px;
}

.entry-hero__media {
  aspect-ratio: 16 / 9;
  border-radius: var(--xh-radius-card);
  overflow: hidden;
  margin-bottom: 24px;
  background: var(--xh-surface);
}

.entry-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.entry-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin-bottom: 12px;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--xh-text-muted);
  font-size: 14px;
}

.entry-meta a {
  color: var(--xh-text-muted);
}

.entry-meta a:hover {
  color: var(--xh-brand);
}

.entry-content {
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.7;
  font-size: 1.0625rem;
}

.entry-content > *:first-child {
  margin-top: 0;
}

.entry-content a {
  color: var(--xh-brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin-top: 1.6em;
}

.entry-content img,
.entry-content .wp-block-image img,
.entry-content .wp-block-gallery img {
  border-radius: 12px;
}

.entry-content blockquote,
.entry-content .wp-block-quote {
  margin: 1.5em 0;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--xh-brand);
  color: rgba(255, 255, 255, 0.8);
}

.entry-content pre,
.entry-content code,
.entry-content kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.entry-content pre,
.entry-content .wp-block-code {
  background: var(--xh-surface);
  border: 1px solid var(--xh-border);
  border-radius: var(--xh-radius);
  padding: 16px;
  overflow-x: auto;
  color: #e5e5e5;
}

.entry-content :not(pre) > code {
  background: var(--xh-surface-2);
  padding: 0.15em 0.4em;
  border-radius: 6px;
  font-size: 0.9em;
}

.entry-content ul,
.entry-content ol {
  padding-left: 1.25em;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
}

.entry-content th,
.entry-content td {
  border: 1px solid var(--xh-border-strong);
  padding: 10px 12px;
  text-align: left;
}

.entry-content hr,
.entry-content .wp-block-separator {
  border: 0;
  border-top: 1px solid var(--xh-border);
  margin: 2em 0;
}

.entry-footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--xh-border);
}

.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.entry-tags a {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--xh-surface-2);
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  border: 1px solid var(--xh-border);
}

.entry-tags a:hover {
  color: #fff;
  border-color: var(--xh-brand);
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 32px;
}

.post-nav a {
  display: block;
  padding: 16px 18px;
  background: var(--xh-surface);
  border-radius: var(--xh-radius);
  color: var(--xh-text);
}

.post-nav span {
  display: block;
  color: var(--xh-text-muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.post-nav a:hover {
  color: var(--xh-brand);
}

.post-nav__next {
  text-align: right;
}

/* Pagination */

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--xh-surface);
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background: var(--xh-cta);
  color: #fff;
}

/* Search form */

.search-form {
  display: flex;
  gap: 8px;
  max-width: 480px;
}

.search-form label {
  flex: 1;
}

.search-form .search-field {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--xh-border-strong);
  border-radius: var(--xh-radius-cta);
  background: var(--xh-surface);
  color: var(--xh-text);
  font: inherit;
}

.search-form .search-field:focus {
  outline: 2px solid var(--xh-brand);
  outline-offset: 1px;
}

.search-form .search-submit {
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--xh-radius-cta);
  background: var(--xh-cta);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.search-form .search-submit:hover {
  box-shadow: 0 8px 24px rgba(255, 46, 108, 0.35);
}

/* Empty / 404 */

.empty-state {
  text-align: center;
  padding: 72px 16px;
}

.empty-state h1,
.empty-state h2 {
  font-size: 2rem;
}

.empty-state p {
  color: var(--xh-text-muted);
  margin-bottom: 24px;
}

.empty-state__actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.page-header .search-form {
  margin-top: 16px;
}

.no-comments {
  color: var(--xh-text-muted);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: var(--xh-radius-cta);
  border: 1px solid var(--xh-border-strong);
  background: rgba(255, 255, 255, 0.06);
  color: #fff !important;
  font-weight: 600;
}

.btn-ghost:hover {
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Comments */

.comments-area {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--xh-border);
}

.comments-title {
  font-size: 1.25rem;
  margin-bottom: 24px;
}

.comment-list {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
}

.comment-list .children {
  list-style: none;
  margin: 16px 0 0 24px;
  padding: 0;
}

.comment-body {
  background: var(--xh-surface);
  border-radius: var(--xh-radius);
  padding: 16px 18px;
  margin-bottom: 12px;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--xh-text-muted);
  font-size: 13px;
}

.comment-author img,
.comment-meta .avatar {
  border-radius: 50%;
}

.comment-author {
  color: var(--xh-text);
  font-weight: 600;
}

.comment-content {
  color: rgba(255, 255, 255, 0.85);
}

.comment-reply-link {
  font-size: 13px;
}

.comment-respond {
  background: var(--xh-surface);
  border-radius: var(--xh-radius-card);
  padding: 24px;
}

.comment-reply-title {
  font-size: 1.125rem;
}

.comment-form label {
  display: block;
  margin-bottom: 6px;
  color: var(--xh-text-muted);
  font-size: 13px;
}

.comment-form p {
  margin-bottom: 14px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--xh-border-strong);
  border-radius: 10px;
  background: var(--xh-bg);
  color: var(--xh-text);
  font: inherit;
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: 2px solid var(--xh-brand);
  outline-offset: 1px;
}

.comment-form .submit,
.comment-form input[type="submit"] {
  border: 0;
  padding: 10px 22px;
  border-radius: var(--xh-radius-cta);
  background: var(--xh-cta);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.comment-form .submit:hover,
.comment-form input[type="submit"]:hover {
  box-shadow: 0 8px 24px rgba(255, 46, 108, 0.35);
}

/* Footer */

.site-footer {
  padding: 64px 24px 0;
  background: var(--xh-bg);
}

.site-footer__brand {
  text-align: center;
  margin-bottom: 40px;
}

.site-footer__logo img {
  height: 20px;
  width: auto;
}

.site-footer__tagline {
  color: #fff;
  font-size: 24px;
  font-weight: 600;
  margin: 24px 0;
}

.social-list {
  display: flex;
  justify-content: center;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.social-list a,
.site-footer__follow a {
  display: inline-flex;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.social-list a:hover,
.site-footer__follow a:hover {
  opacity: 1;
}

.social-list img,
.site-footer__follow img {
  width: 24px;
  height: 24px;
  display: block;
}

.footer-nav {
  margin-bottom: 32px;
}

.footer-nav__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-nav__list a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
}

.footer-nav__list a:hover {
  color: #fff;
  text-decoration: underline;
}

.site-footer__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 8px 20px;
  border-top: 1px solid var(--xh-border);
}

.site-footer__bar-logo {
  height: 20px;
  width: auto;
}

.site-footer__copy {
  margin: 0;
  color: var(--xh-text-dim);
  font-size: 14px;
  text-align: center;
}

.site-footer__follow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

/* Gutenberg alignment helpers */

.alignwide {
  max-width: var(--xh-wide);
}

.alignfull {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
}

.wp-block-button__link {
  border-radius: var(--xh-radius-cta) !important;
}

.has-brand-background-color {
  background-color: var(--xh-brand);
}

.has-brand-color {
  color: var(--xh-brand);
}

/* Responsive */

@media (max-width: 960px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .site-header__inner {
    padding: 0 16px;
    min-height: 56px;
  }

  .nav-toggle {
    display: flex;
    order: 3;
  }

  .btn-cta--desktop {
    display: none;
  }

  .btn-cta--mobile {
    display: inline-flex;
    width: 100%;
    margin-top: 16px;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #000;
    border-bottom: 1px solid var(--xh-border);
    padding: 12px 16px 24px;
    justify-content: flex-start;
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav__list {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .site-nav__list > li {
    width: 100%;
    border-bottom: 1px solid var(--xh-border);
  }

  .site-nav__list a {
    display: block;
    padding: 12px 0;
    font-size: 16px;
  }

  .site-nav__list .sub-menu {
    position: static;
    display: block;
    background: transparent;
    border: 0;
    padding: 0 0 8px 12px;
  }

  .site-main {
    padding: 24px 16px 64px;
  }

  .post-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav__next {
    text-align: left;
  }

  .site-footer__tagline {
    font-size: 18px;
  }

  .site-footer__bar {
    flex-direction: column;
    text-align: center;
    padding-bottom: 24px;
  }

  .comment-list .children {
    margin-left: 12px;
  }
}
