/**
 * 888 GCC - Main Stylesheet
 *
 * EXPLANATION:
 * ============
 * This file contains all CSS for the theme. We use CSS Custom Properties
 * (variables) for colors so they can be changed via the Customizer and
 * easily switched for light/dark mode.
 *
 * Organization:
 * 1. CSS Variables (colors, spacing)
 * 2. Reset & Base Styles
 * 3. Layout (container, grid)
 * 4. Header
 * 5. Mobile Menu
 * 6. Footer
 * 7. Components (buttons, cards)
 * 8. Utility Classes
 * 9. Responsive Breakpoints
 *
 * @package Casino888
 * @since 1.0.0
 */

/*--------------------------------------------------------------
# 1. CSS Variables
--------------------------------------------------------------*/

/**
 * EXPLANATION:
 * CSS Custom Properties (variables) let us define values once
 * and reuse them throughout. They start with -- and are accessed
 * with var(--name).
 *
 * Benefits:
 * - Change a color in one place, updates everywhere
 * - JavaScript can modify them for live theme switching
 * - Customizer can inject overrides via inline styles
 */
:root {
    /* Colors - Dark Mode (Default) — dark surfaces + lime-green CTAs */
    --c888-primary: #7BF037;          /* primary CTA / play button */
    --c888-primary-hover: #7FF800;    /* brighter green on hover */
    --c888-secondary: #171717;        /* page background (near-black) */
    --c888-surface: #232323;          /* cards, header, footer */
    --c888-surface-2: #2B2B2B;        /* raised surface / hover rows */
    --c888-text: #FFFFFF;
    --c888-text-secondary: #C1C1C1;
    --c888-border: #2E2E2E;
    --c888-accent-gold: #FCE403;      /* jackpot / promo highlights */
    --c888-on-primary: #0A0A0A;       /* text/icon on the green CTA */

    /* Typography — open fallbacks; client can add licensed brand fonts */
    --c888-font-family: 'Roboto', 'Antonio', -apple-system, BlinkMacSystemFont, 'Segoe UI', Verdana, sans-serif;
    --c888-font-size-base: 16px;
    --c888-font-size-sm: 14px;
    --c888-font-size-xs: 12px;
    --c888-font-size-lg: 18px;
    --c888-font-size-xl: 20px;
    --c888-font-size-2xl: 24px;
    --c888-font-size-3xl: 30px;

    /* Spacing */
    --c888-spacing-xs: 4px;
    --c888-spacing-sm: 8px;
    --c888-spacing-md: 16px;
    --c888-spacing-lg: 24px;
    --c888-spacing-xl: 32px;
    --c888-spacing-2xl: 48px;
    --c888-spacing-3xl: 64px;

    /* Layout */
    --c888-container-max: 1440px;
    --c888-container-padding: 20px;
    --c888-header-height: 70px;
    --c888-header-height-mobile: 60px;

    /* Transitions */
    --c888-transition-fast: 150ms ease;
    --c888-transition-normal: 250ms ease;
    --c888-transition-slow: 350ms ease;

    /* Shadows */
    --c888-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --c888-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --c888-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);

    /* Border Radius */
    --c888-radius-sm: 4px;
    --c888-radius-md: 8px;
    --c888-radius-lg: 12px;
    --c888-radius-full: 9999px;
}

/**
 * Light Mode Colors
 *
 * EXPLANATION:
 * When body has .light-mode class, these variables override the defaults.
 * The class is toggled by JavaScript when user clicks the theme toggle.
 */
body.light-mode {
    --c888-secondary: #FFFFFF;
    --c888-surface: #F5F5F5;
    --c888-text: #1F1B2E;
    --c888-text-secondary: #666666;
    --c888-border: #E0E0E0;
}

/*--------------------------------------------------------------
# 2. Reset & Base Styles
--------------------------------------------------------------*/

/**
 * EXPLANATION:
 * CSS Reset removes browser default styling for consistency.
 * We use a minimal reset that keeps useful defaults.
 */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: var(--c888-font-size-base);
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scrollbar-gutter: stable;
    /* Prevent any horizontal overflow / sideways "wobble" site-wide.
       Use `clip` (not `hidden`) so the body does NOT become a scroll
       container — that keeps position: sticky (sticky header) working. */
    overflow-x: clip;
}

body {
    font-family: var(--c888-font-family);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--c888-text);
    background-color: var(--c888-secondary);
    transition: background-color var(--c888-transition-normal),
                color var(--c888-transition-normal);
    overflow-x: clip;
    max-width: 100%;
}

/* Links */
a {
    color: inherit;
    text-decoration: none;
    transition: color var(--c888-transition-fast);
}

a:hover {
    color: var(--c888-primary);
}

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

/* Lists */
ul, ol {
    list-style: none;
}

/* Buttons */
button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    background: none;
    border: none;
    color: inherit;
}

/* Focus styles for accessibility */
:focus-visible {
    outline: 2px solid var(--c888-primary);
    outline-offset: 2px;
}

/*--------------------------------------------------------------
# 3. Layout
--------------------------------------------------------------*/

.c888-container {
    max-width: var(--c888-container-max);
    margin: 0 auto;
    padding: 0 var(--c888-container-padding);
}

.c888-main {
    min-height: calc(100vh - var(--c888-header-height));
}

/* Interior page main wrapper — archive.php, taxonomy-game_category.php,
   single.php, single-game.php */
.c888-main--interior {
    padding-top: var(--c888-spacing-xl);
}

.c888-content {
    padding: var(--c888-spacing-2xl) 0;
}

/*--------------------------------------------------------------
# 4. Header
--------------------------------------------------------------*/

.c888-header {
    background-color: var(--c888-secondary);
    border-bottom: 1px solid var(--c888-border);
    height: var(--c888-header-height);
    z-index: 100;
    transition: background-color var(--c888-transition-normal);
}

/**
 * Sticky Header
 *
 * EXPLANATION:
 * position: sticky keeps the header fixed at the top when scrolling,
 * but only when enabled via Customizer (.c888-header--sticky class).
 */
.c888-header--sticky {
    position: sticky;
    top: 0;
}

.c888-header__container {
    max-width: var(--c888-container-max);
    margin: 0 auto;
    padding: 0 var(--c888-container-padding);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--c888-spacing-lg);
}

/* Mobile Menu Toggle - Hidden on desktop */
.c888-header__menu-toggle {
    display: none;
}

/* Logo */
.c888-header__logo {
    flex-shrink: 0;
}

.c888-header__logo img,
.c888-header__logo .custom-logo {
    height: 40px;
    width: auto;
}

/* Dark/light mode logo switching — CSS only, no flash */
.c888-logo__light                 { display: none; }
body.light-mode .c888-logo__dark  { display: none; }
body.light-mode .c888-logo__light { display: inline-block; }

.c888-header__logo .site-title {
    font-size: var(--c888-font-size-xl);
    font-weight: 700;
    color: var(--c888-text);
}

/* Desktop Navigation */
.c888-header__nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.c888-nav-menu {
    display: flex;
    gap: var(--c888-spacing-xl);
}

.c888-nav-menu li {
    position: relative;
}

.c888-nav-menu a {
    display: block;
    padding: var(--c888-spacing-sm) 0;
    font-size: var(--c888-font-size-base);
    font-weight: 500;
    color: var(--c888-text);
    position: relative;
}

/**
 * Active/Hover Underline Effect
 *
 * EXPLANATION:
 * We use a ::after pseudo-element to create the purple underline.
 * It starts at 0 width and expands on hover/active state.
 */
.c888-nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--c888-primary);
    transition: width var(--c888-transition-normal);
}

.c888-nav-menu a:hover::after,
.c888-nav-menu .current-menu-item a::after,
.c888-nav-menu .current_page_item a::after {
    width: 100%;
}

/* ── Desktop submenu dropdown ── */
.c888-nav-menu .menu-item-has-children {
    position: relative;
}

.c888-nav-menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--c888-surface);
    border: 1px solid var(--c888-border);
    border-radius: 8px;
    padding: 10px 0 6px;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
    list-style: none;
    margin: 0;
}

.c888-nav-menu .menu-item-has-children:hover > .sub-menu,
.c888-nav-menu .menu-item-has-children.is-open > .sub-menu {
    display: block;
}

.c888-nav-menu .sub-menu li {
    position: relative; /* needed so 3rd-tier .sub-menu can flyout from this li */
}

.c888-nav-menu .sub-menu a {
    padding: 9px 18px;
    font-size: .9rem;
    white-space: nowrap;
}

.c888-nav-menu .sub-menu a::after {
    display: none; /* no underline inside dropdown */
}

.c888-nav-menu .sub-menu a:hover {
    color: var(--c888-primary);
}

/* 3rd-tier dropdown — flies out to the right of the 2nd-tier item.
   Hover on a level-2 .menu-item-has-children reveals its nested .sub-menu. */
.c888-nav-menu .sub-menu .sub-menu {
    top: 0;
    left: 100%;
    margin-left: 1px;
}

[dir="rtl"] .c888-nav-menu .sub-menu .sub-menu {
    left: auto;
    right: 100%;
    margin-left: 0;
    margin-right: 1px;
}

/* Caret on a nested parent points right (▸) instead of down (▾). */
.c888-nav-menu .sub-menu .menu-item-has-children > a::after {
    content: ' ▸';
    float: right;
    margin-left: 8px;
}

[dir="rtl"] .c888-nav-menu .sub-menu .menu-item-has-children > a::after {
    content: ' ◂';
    float: left;
    margin-left: 0;
    margin-right: 8px;
}

/* Caret on parent item — appended after link text */
.c888-nav-menu .menu-item-has-children > a::after {
    content: ' ▾';
    font-size: .7em;
    letter-spacing: 0;
    vertical-align: middle;
    opacity: .6;
    width: auto;    /* override the underline trick */
    height: auto;
    background: none;
    position: static;
    bottom: auto;
    left: auto;
    transition: none;
}
.c888-nav-menu .menu-item-has-children:hover > a::after,
.c888-nav-menu .menu-item-has-children.is-open > a::after {
    opacity: 1;
}

/* Header Actions (Theme toggle + Buttons) */
.c888-header__actions {
    display: flex;
    align-items: center;
    gap: var(--c888-spacing-md);
}

.c888-header__buttons {
    display: flex;
    gap: var(--c888-spacing-sm);
}

/*--------------------------------------------------------------
# Theme Toggle Button
--------------------------------------------------------------*/

.c888-theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: var(--c888-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c888-text-secondary);
    transition: color var(--c888-transition-fast),
                background-color var(--c888-transition-fast);
}

.c888-theme-toggle:hover {
    color: var(--c888-text);
    background-color: var(--c888-surface);
}

.c888-theme-toggle svg {
    width: 20px;
    height: 20px;
}

/* Show sun in dark mode, moon in light mode */
.c888-theme-toggle__sun {
    display: block;
}

.c888-theme-toggle__moon {
    display: none;
}

body.light-mode .c888-theme-toggle__sun {
    display: none;
}

body.light-mode .c888-theme-toggle__moon {
    display: block;
}

/*--------------------------------------------------------------
# Buttons
--------------------------------------------------------------*/

.c888-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--c888-spacing-xs);
    padding: var(--c888-spacing-sm) var(--c888-spacing-lg);
    font-size: var(--c888-font-size-sm);
    font-weight: 600;
    border-radius: var(--c888-radius-md);
    transition: all var(--c888-transition-fast);
    white-space: nowrap;
}

.c888-btn__icon {
    width: 16px;
    height: 16px;
}

/* Outline Button (Login) */
.c888-btn--outline {
    background: transparent;
    border: 1px solid var(--c888-text-secondary);
    color: var(--c888-text);
}

.c888-btn--outline:hover {
    border-color: var(--c888-text);
    color: var(--c888-text);
}

/* Primary Button (Register) */
.c888-btn--primary {
    background: var(--c888-primary);
    border: 1px solid var(--c888-primary);
    color: #FFFFFF;
}

.c888-btn--primary:hover {
    background: var(--c888-primary-hover);
    border-color: var(--c888-primary-hover);
    color: #FFFFFF;
}

/*--------------------------------------------------------------
# 5. Mobile Menu
--------------------------------------------------------------*/

/**
 * The menu panel sits directly below the header and slides downward.
 * z-index 99 keeps it behind the header (z-index 100) so the header
 * is always visible and acts as the natural "close" affordance via
 * the hamburger→X animation.
 */
.c888-mobile-menu {
    position: fixed;
    top: var(--c888-header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--c888-secondary);
    z-index: 99;
    display: flex;
    flex-direction: column;
    transform: translateY(-100%);
    pointer-events: none;
    transition: transform var(--c888-transition-slow),
                opacity var(--c888-transition-slow);
    opacity: 0;
    overflow-y: auto;
}

.c888-mobile-menu.is-open {
    transform: translateY(0);
    pointer-events: auto;
    opacity: 1;
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

.c888-mobile-menu__nav {
    flex: 1;
    padding: var(--c888-spacing-2xl) var(--c888-container-padding);
}

.c888-mobile-nav-menu {
    display: flex;
    flex-direction: column;
    gap: var(--c888-spacing-lg);
}

.c888-mobile-nav-menu a {
    display: block;
    font-size: var(--c888-font-size-2xl);
    font-weight: 600;
    color: var(--c888-text);
    padding: var(--c888-spacing-sm) 0;
    position: relative;
}

.c888-mobile-nav-menu .current-menu-item a,
.c888-mobile-nav-menu .current_page_item a {
    color: var(--c888-primary);
}

.c888-mobile-nav-menu .current-menu-item a::after,
.c888-mobile-nav-menu .current_page_item a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--c888-primary);
}

/* Mobile submenu */
.c888-mobile-nav-menu .menu-item-has-children {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.c888-mobile-nav-menu .menu-item-has-children > a {
    flex: 1;
}

.c888-mobile-submenu-toggle {
    background: none;
    border: none;
    color: var(--c888-text);
    font-size: 1.4rem;
    line-height: 1;
    padding: 0 8px;
    cursor: pointer;
    opacity: .6;
    transition: opacity .2s, transform .2s;
}
.c888-mobile-submenu-toggle[aria-expanded="true"] {
    transform: rotate(180deg);
    opacity: 1;
}

.c888-mobile-nav-menu .sub-menu {
    display: none;
    width: 100%;
    flex-basis: 100%;
    list-style: none;
    margin: 4px 0 0;
    padding: 0 0 0 16px;
    border-left: 2px solid var(--c888-primary);
}
.c888-mobile-nav-menu .sub-menu.is-open {
    display: block;
}
.c888-mobile-nav-menu .sub-menu a {
    font-size: 1rem;
    font-weight: 400;
    padding: 6px 0;
}
.c888-mobile-nav-menu .sub-menu a::after {
    display: none;
}

.c888-mobile-menu__footer {
    padding: var(--c888-spacing-lg) var(--c888-container-padding);
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--c888-border);
}

/*--------------------------------------------------------------
# Hamburger Icon & Animation
--------------------------------------------------------------*/

.c888-hamburger {
    width: 24px;
    height: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.c888-hamburger__line {
    width: 100%;
    height: 2px;
    background-color: var(--c888-text);
    border-radius: 1px;
    transition: transform var(--c888-transition-normal),
                opacity var(--c888-transition-normal),
                background-color var(--c888-transition-fast);
    transform-origin: center;
}

/* Animate to X when menu is open */
.c888-header__menu-toggle.is-open .c888-hamburger__line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.c888-header__menu-toggle.is-open .c888-hamburger__line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.c888-header__menu-toggle.is-open .c888-hamburger__line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/*--------------------------------------------------------------
# 6. Footer
--------------------------------------------------------------*/

.c888-footer {
    background-color: var(--c888-surface);
    padding: var(--c888-spacing-3xl) var(--c888-container-padding);
    transition: background-color var(--c888-transition-normal);
}

/* Footer Logo — only add bottom gap when a sibling follows it */
.c888-footer__logo {
    text-align: center;
}

.c888-footer__logo:not(:last-child) {
    margin-bottom: var(--c888-spacing-2xl);
}

.c888-footer__logo img,
.c888-footer__logo .custom-logo {
    height: 60px;
    width: auto;
    margin: 0 auto;
}

/* Footer Content — flexbox so any number of menu columns works naturally */
.c888-footer__content {
    max-width: var(--c888-container-max);
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    gap: var(--c888-spacing-2xl);
}

/* Only add the divider when payments or legal follow */
.c888-footer__content:not(:last-child) {
    padding-bottom: var(--c888-spacing-2xl);
    border-bottom: 1px solid var(--c888-border);
}

/* App Download Section */
.c888-app-download {
    max-width: 280px;
}

.c888-app-download__title {
    font-size: var(--c888-font-size-sm);
    font-weight: 600;
    color: var(--c888-text-secondary);
    letter-spacing: 0.5px;
    margin-bottom: var(--c888-spacing-md);
}

.c888-app-download__content {
    display: flex;
    align-items: stretch;
    gap: var(--c888-spacing-md);
    background: var(--c888-secondary);
    border-radius: var(--c888-radius-lg);
    padding: var(--c888-spacing-md);
}

.c888-app-download__qr {
    display: flex;
    align-items: stretch;
}

.c888-app-download__qr img {
    width: auto;
    height: 100%;
    max-width: 100px;
    object-fit: contain;
    border-radius: var(--c888-radius-sm);
    background: white;
    padding: 4px;
}

.c888-app-download__buttons {
    display: flex;
    flex-direction: column;
    gap: var(--c888-spacing-sm);
}

/* Store Buttons */
.c888-store-btn {
    display: flex;
    align-items: center;
    gap: var(--c888-spacing-sm);
    background: var(--c888-border);
    padding: var(--c888-spacing-sm) var(--c888-spacing-md);
    border-radius: var(--c888-radius-md);
    transition: background-color var(--c888-transition-fast);
}

.c888-store-btn:hover {
    background: var(--c888-surface);
    color: var(--c888-text);
}

.c888-store-btn__icon {
    width: 20px;
    height: 20px;
}

.c888-store-btn__text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.c888-store-btn__text small {
    font-size: 10px;
    color: var(--c888-text-secondary);
}

.c888-store-btn__text strong {
    font-size: var(--c888-font-size-sm);
}

/* Footer Menus — flex container so columns distribute evenly */
.c888-footer__menus {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: var(--c888-spacing-xl);
    justify-content: center;
}

.c888-footer-menu {
    flex: 0 1 auto;
    min-width: 130px;
    max-width: 220px;
}

.c888-footer-menu__title {
    font-size: var(--c888-font-size-base);
    font-weight: 600;
    color: var(--c888-text);
    margin-bottom: var(--c888-spacing-md);
    display: block;
    cursor: default;
}

.c888-footer-menu__title .c888-footer-menu__arrow {
    display: none;
}

.c888-footer-menu__list {
    display: flex;
    flex-direction: column;
    gap: var(--c888-spacing-sm);
}

.c888-footer-menu__list a {
    font-size: var(--c888-font-size-sm);
    color: var(--c888-text-secondary);
}

.c888-footer-menu__list a:hover {
    color: var(--c888-text);
}

/* Social Icons — standalone full-width centred row */
.c888-footer__social-row {
    display: flex;
    align-items: center;
    align-self: center;
    flex-shrink: 0;
    padding: 0;
}

.c888-footer__social-row:not(:last-child) {
    border-bottom: none;
}

.c888-social-icons {
    display: flex;
    flex-direction: column;
    gap: var(--c888-spacing-sm);
    background-color: var(--c888-secondary);
    padding: var(--c888-spacing-lg) var(--c888-spacing-sm);
    border-radius: var(--c888-radius-full);
}

.c888-social-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--c888-radius-full);
    background-color: var(--c888-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    transition: background-color var(--c888-transition-fast),
                transform var(--c888-transition-fast);
}

.c888-social-icon:hover {
    background-color: var(--c888-primary-hover);
    color: #FFFFFF;
    transform: scale(1.1);
}

.c888-social-icon svg {
    width: 18px;
    height: 18px;
}

/* Payment Icons */
.c888-footer__payments {
    max-width: var(--c888-container-max);
    margin: 0 auto;
    padding: var(--c888-spacing-2xl) 0;
}

.c888-footer__payments:not(:last-child) {
    border-bottom: 1px solid var(--c888-border);
}

.c888-payment-icons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--c888-spacing-md);
}

.c888-payment-icon {
    background: white;
    border-radius: var(--c888-radius-lg);
    padding: var(--c888-spacing-sm) var(--c888-spacing-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.c888-payment-icon img {
    height: 30px;
    width: auto;
}

/* Legal Section — sizing + flex handled in one place (see "Language Switcher" section below) */

.c888-footer__copyright {
    margin-bottom: var(--c888-spacing-md);
}

.c888-legal-disclaimer {
    line-height: 1.5;
}

/*--------------------------------------------------------------
# 7. Post Cards (Index Page)
--------------------------------------------------------------*/

.c888-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--c888-spacing-xl);
}

.c888-post-card {
    background: var(--c888-surface);
    border-radius: var(--c888-radius-lg);
    overflow: hidden;
    transition: transform var(--c888-transition-fast),
                box-shadow var(--c888-transition-fast);
}

.c888-post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--c888-shadow-lg);
}

.c888-post-card__image {
    aspect-ratio: 2 / 1;
    overflow: hidden;
}

.c888-post-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.c888-post-card__content {
    padding: var(--c888-spacing-md);
}

.c888-post-card__category {
    display: inline-block;
    font-size: var(--c888-font-size-xs);
    font-weight: 600;
    color: var(--c888-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--c888-spacing-xs);
}

.c888-post-card__title {
    font-size: var(--c888-font-size-base);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: var(--c888-spacing-xs);
}

.c888-post-card__title a:hover {
    color: var(--c888-primary);
}

.c888-post-card__excerpt {
    font-size: var(--c888-font-size-sm);
    color: var(--c888-text-secondary);
    margin-bottom: var(--c888-spacing-sm);
}

.c888-post-card__date {
    font-size: var(--c888-font-size-xs);
    color: var(--c888-text-secondary);
}

/* ---------------------------------------------------------------
   Featured post card (tri-card rows: featured + related posts)
--------------------------------------------------------------- */

.c888-post-card--featured {
    background: #130f1e;
    position: relative;
}

.c888-post-card--featured .c888-post-card__link {
    display: block;
    position: relative;
    text-decoration: none;
    color: inherit;
}

.c888-post-card--featured .c888-post-card__image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 2 / 1;
}

.c888-post-card--featured .c888-post-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--c888-transition-fast);
}

.c888-post-card--featured:hover .c888-post-card__image img {
    transform: scale(1.04);
}

.c888-post-card--featured .c888-post-card__image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 80%,
        rgba(10, 7, 20, 0.95) 100%
    );
    pointer-events: none;
}

.c888-post-card--featured .c888-post-card__image-placeholder {
    width: 100%;
    aspect-ratio: 2 / 1;
    background: #1a1530;
}

.c888-post-card--featured .c888-post-card__category {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: var(--c888-primary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 3px 8px;
    border-radius: 3px;
    margin-bottom: 0;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
}

.c888-post-card--featured .c888-post-card__category:hover {
    background: var(--c888-primary-hover);
    transform: scale(1.06);
}

.c888-post-card--featured .c888-post-card__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 12px 12px;
    z-index: 2;
    pointer-events: none;
}

.c888-post-card--featured .c888-post-card__title {
    font-size: var(--c888-font-size-sm);
    font-weight: 700;
    line-height: 1.35;
    color: #fff;
    margin: 0;
}

/* No Posts Message */
.c888-no-posts {
    text-align: center;
    padding: var(--c888-spacing-3xl) 0;
}

.c888-no-posts h1 {
    font-size: var(--c888-font-size-2xl);
    margin-bottom: var(--c888-spacing-md);
}

/* Pagination */
.navigation.pagination {
    margin-top: var(--c888-spacing-2xl);
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: var(--c888-spacing-sm);
}

.page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--c888-spacing-md);
    background: var(--c888-surface);
    border-radius: var(--c888-radius-md);
    font-weight: 500;
}

.page-numbers.current,
.page-numbers:hover {
    background: var(--c888-primary);
    color: #FFFFFF;
}

/*--------------------------------------------------------------
# 8. Responsive Styles
--------------------------------------------------------------*/

/* Tablet and below */
@media (max-width: 1024px) {
    .c888-footer__content {
        flex-wrap: wrap;
        gap: var(--c888-spacing-xl);
    }

    .c888-footer__menus {
        flex-wrap: wrap;
    }

}

/* Mobile (768px and below) */
@media (max-width: 768px) {
    :root {
        --c888-header-height: var(--c888-header-height-mobile);
    }

    /* Header Mobile */
    .c888-header__menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
    }

    .c888-header__nav {
        display: none;
    }

    .c888-header__theme-toggle {
        display: none;
    }

    .c888-header__buttons .c888-btn__icon {
        display: none;
    }

    /* Footer Mobile */
    .c888-footer__content {
        flex-direction: column;
        gap: 0;
    }

    .c888-app-download {
        max-width: 100%;
        padding-bottom: var(--c888-spacing-xl);
        border-bottom: 1px solid var(--c888-border);
    }

    .c888-app-download__content {
        justify-content: flex-start;
        align-items: center;
    }

    .c888-app-download__qr {
        display: none;
    }

    .c888-app-download__buttons {
        flex-direction: row;
    }

    /* Footer Menus — stack vertically, become accordions */
    .c888-footer__menus {
        flex-direction: column;
        gap: 0;
        width: 100%;
        max-width: 100%;
    }

    .c888-footer-menu {
        width: 100%;
        max-width: 100%;
        border-bottom: 1px solid var(--c888-border);
    }

    .c888-footer-menu__title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: var(--c888-spacing-md) 0;
        margin-bottom: 0;
        cursor: pointer;
    }

    .c888-footer-menu__title .c888-footer-menu__arrow {
        display: block;
        width: 20px;
        height: 20px;
        transition: transform var(--c888-transition-fast);
    }

    .c888-footer-menu.is-open .c888-footer-menu__arrow {
        transform: rotate(180deg);
    }

    .c888-footer-menu__links {
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--c888-transition-normal);
    }

    .c888-footer-menu.is-open .c888-footer-menu__links {
        max-height: 500px;
    }

    .c888-footer-menu__list {
        padding-bottom: var(--c888-spacing-md);
    }

    /* Social row — centred below menus on mobile */
    .c888-footer__social-row {
        justify-content: center;
        padding: var(--c888-spacing-xl) 0;
        border-top: 1px solid var(--c888-border);
        width: 100%;
    }

    .c888-social-icons {
        flex-direction: row;
        padding: var(--c888-spacing-sm) var(--c888-spacing-lg);
    }

    /* Payment Icons */
    .c888-payment-icons {
        justify-content: center;
    }

    /* Posts Grid */
    .c888-posts-grid {
        grid-template-columns: 1fr;
    }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
    .c888-header__buttons .c888-btn {
        padding: var(--c888-spacing-sm) var(--c888-spacing-md);
        font-size: var(--c888-font-size-xs);
    }

    .c888-mobile-menu__buttons .c888-btn {
        padding: var(--c888-spacing-sm) var(--c888-spacing-md);
        font-size: var(--c888-font-size-xs);
    }
}

/*--------------------------------------------------------------
# 9. Page Sections — shared base used by all templates
--------------------------------------------------------------*/

/* Base section wrapper — used on homepage full-width sections AND
   interior page featured/related sections */
.c888-section {
    padding: var(--c888-spacing-3xl) 0;
}

/* Section heading — shared by posts-grid, featured-article, archive-featured, related-posts */
.c888-section__heading {
    font-size: var(--c888-font-size-2xl);
    font-weight: 700;
    margin-bottom: var(--c888-spacing-xl);
    color: var(--c888-text);
}

/* ---------------------------------------------------------------
   Homepage Sections (front-page.php, archive-game.php, page-game.php)
   Sections below are full-width with inner .c888-container
--------------------------------------------------------------- */

/* ---------------------------------------------------------------
   Hero Section
--------------------------------------------------------------- */

.c888-hero {
    position: relative;
    /* Constrain to the regular container width instead of full-bleed */
    width: calc(100% - 2 * var(--c888-container-padding));
    max-width: calc(var(--c888-container-max) - 2 * var(--c888-container-padding));
    margin-inline: auto;
    background-color: var(--c888-surface);
    background-size: cover;
    background-position: center;
    /* Match the big featured card in the category-posts (6) grid.
       min-height is border-box, so the inherited .c888-section vertical
       padding (3xl) sits inside it — the banner stays 300px tall while
       keeping the same vertical rhythm as the sections around it. */
    min-height: 300px;
    display: flex;
    align-items: center;
    border-radius: var(--c888-radius-lg);
    overflow: hidden;
    /* The banner background fills the box edge-to-edge, so it needs its own
       outward spacing below it — otherwise the next section (e.g. the archive
       posts list, whose top padding is stripped) butts right against it. */
    margin-bottom: var(--c888-spacing-3xl);
}

.c888-hero__overlay {
    position: absolute;
    inset: 0;
}

.c888-hero__inner {
    position: relative;
    z-index: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--c888-spacing-lg);
    padding-top: var(--c888-spacing-lg);
    padding-bottom: var(--c888-spacing-lg);
}

.c888-hero__title {
    font-size: var(--c888-font-size-3xl);
    font-weight: 800;
    line-height: 1.2;
    color: #fff;
    max-width: 700px;
}

.c888-hero__subtitle {
    font-size: var(--c888-font-size-lg);
    color: rgba(255, 255, 255, 0.85);
    max-width: 560px;
}

/* Whole-hero clickable link — replaces the visible CTA button.
   Covers the entire banner and sits above the centered text. */
.c888-hero__link {
    position: absolute;
    inset: 0;
    z-index: 2;
    cursor: pointer;
    background: transparent;
    transition: background-color 0.2s ease;
}

.c888-hero__link:hover {
    background: rgba(255, 255, 255, 0.08);
}

.c888-hero__link:focus-visible {
    outline: 2px solid var(--c888-primary);
    outline-offset: -4px;
}

/* ---------------------------------------------------------------
   Posts Grid Section
--------------------------------------------------------------- */

.c888-section--posts-grid {
    background-color: var(--c888-secondary);
}

/* ---------------------------------------------------------------
   CTA Banner Section
--------------------------------------------------------------- */

.c888-cta-banner {
    padding: var(--c888-spacing-2xl) 0;
}

.c888-cta-banner__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--c888-spacing-xl);
    flex-wrap: wrap;
}

.c888-cta-banner__text {
    flex: 1;
    min-width: 240px;
}

.c888-cta-banner__heading {
    font-size: var(--c888-font-size-2xl);
    font-weight: 700;
    color: #fff;
    margin-bottom: var(--c888-spacing-xs);
}

.c888-cta-banner__subheading {
    font-size: var(--c888-font-size-base);
    color: rgba(255, 255, 255, 0.85);
}

.c888-cta-banner__btn {
    background: #fff;
    color: #1F1B2E;
    font-weight: 700;
    border-color: #fff;
    padding: var(--c888-spacing-md) var(--c888-spacing-2xl);
    white-space: nowrap;
    flex-shrink: 0;
}

.c888-cta-banner__btn:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.9);
    color: #1F1B2E;
}

/* ---------------------------------------------------------------
   Featured Article Section
--------------------------------------------------------------- */

.c888-featured-article {
    background-color: var(--c888-surface);
}

.c888-featured-article__card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--c888-spacing-2xl);
    align-items: center;
}

.c888-featured-article__image img {
    width: 100%;
    height: 360px;
    object-fit: cover;
    border-radius: var(--c888-radius-lg);
}

.c888-featured-article__content {
    display: flex;
    flex-direction: column;
    gap: var(--c888-spacing-md);
}

.c888-featured-article__title {
    font-size: var(--c888-font-size-2xl);
    font-weight: 700;
    line-height: 1.3;
}

.c888-featured-article__title a:hover {
    color: var(--c888-primary);
}

.c888-featured-article__excerpt {
    font-size: var(--c888-font-size-base);
    color: var(--c888-text-secondary);
    line-height: 1.7;
}

.c888-featured-article__read-more {
    align-self: flex-start;
}

/* ---------------------------------------------------------------
   Responsive — homepage sections
--------------------------------------------------------------- */

@media (max-width: 768px) {
    .c888-section {
        padding: var(--c888-spacing-xl) 0;
    }

    .c888-section__heading {
        margin-bottom: var(--c888-spacing-lg);
    }

    .c888-hero {
        min-height: 0;
    }

    .c888-hero__inner {
        padding-top: var(--c888-spacing-xl);
        padding-bottom: var(--c888-spacing-xl);
        gap: var(--c888-spacing-md);
    }

    .c888-hero__title {
        font-size: var(--c888-font-size-2xl);
    }

    .c888-hero__subtitle {
        font-size: var(--c888-font-size-base);
    }

    .c888-cta-banner__inner {
        flex-direction: column;
        text-align: center;
    }

    .c888-cta-banner__btn {
        width: 100%;
        justify-content: center;
    }

    .c888-featured-article__card {
        grid-template-columns: 1fr;
    }

    .c888-featured-article__image img {
        height: 240px;
    }
}

/* ---------------------------------------------------------------
   Category Posts section (5 posts: 1 big + 2 stacked smalls / 3 smalls)
--------------------------------------------------------------- */

.c888-section.c888-category-posts {
    padding: var(--c888-spacing-xl) 0;
}

/* 3-column grid — big spans 2 cols, right-col 1 col, bottom 3 auto-fill */
.c888-category-posts__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--c888-spacing-md);
}

/* Big card: span 2 cols, stretch full row height */
.c888-category-posts__grid > .c888-post-card--featured:first-child,
.c888-category-posts__grid > .c888-post-card--placeholder:first-child {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
}

.c888-category-posts__grid > .c888-post-card--featured:first-child .c888-post-card__link {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.c888-category-posts__grid > .c888-post-card--featured:first-child .c888-post-card__image {
    flex: 1;
    aspect-ratio: unset;
}

.c888-category-posts__grid > .c888-post-card--featured:first-child .c888-post-card__image img,
.c888-category-posts__grid > .c888-post-card--featured:first-child .c888-post-card__image-placeholder {
    height: 100%;
    min-height: 300px;
}

/* Right column: 2 stacked equal smalls */
.c888-category-posts__right-col {
    display: flex;
    flex-direction: column;
    gap: var(--c888-spacing-md);
}

.c888-category-posts__right-col .c888-post-card--featured,
.c888-category-posts__right-col .c888-post-card--placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.c888-category-posts__right-col .c888-post-card--featured .c888-post-card__link {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.c888-category-posts__right-col .c888-post-card--featured .c888-post-card__image {
    flex: 1;
    aspect-ratio: unset;
}

.c888-category-posts__right-col .c888-post-card--featured .c888-post-card__image img,
.c888-category-posts__right-col .c888-post-card--featured .c888-post-card__image-placeholder {
    height: 100%;
    min-height: 130px;
}

/* Row 2: 3 equal smalls auto-placed (each spans 1 col) */
.c888-category-posts__grid > .c888-post-card--featured:nth-child(n+3) .c888-post-card__image img,
.c888-category-posts__grid > .c888-post-card--featured:nth-child(n+3) .c888-post-card__image-placeholder {
    height: 100%;
}

/* Responsive — slider on mobile */
@media (max-width: 768px) {
    .c888-section.c888-category-posts {
        padding: var(--c888-spacing-lg) 0;
    }

    /* Before JS initialises: hide overflow */
    .c888-category-posts__grid {
        display: block;
        overflow: hidden;
    }

    /* Stacked fallback (before/without the JS slider): even vertical gaps
       between every direct card — big card, right-col, and the bottom 3.
       The :not() keeps this off once the slider replaces the children with
       its track + dots. */
    .c888-category-posts__grid:not(.c888-cp-slider-active) > * + * {
        margin-top: var(--c888-spacing-md);
    }

    /* Slider track: horizontal flex strip */
    .c888-cp-slider__track {
        display: flex;
        transition: transform 0.4s ease;
    }

    /* Each slide fills the full container width */
    .c888-cp-slider__slide {
        flex: 0 0 100%;
        width: 100%;
        padding: 0;
        box-sizing: border-box;
    }

    /* Card image inside slider — let 2/1 aspect-ratio from base rule apply */
    .c888-cp-slider__slide .c888-post-card__image img {
        height: 100%;
    }

    /* Dot indicators */
    .c888-cp-slider__dots {
        display: flex;
        justify-content: center;
        gap: 6px;
        padding: 10px 0 4px;
    }

    .c888-cp-slider__dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: transparent;
        box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7);
        padding: 0;
        cursor: pointer;
        outline: none;
        transition: background 0.2s, box-shadow 0.2s;
    }

    .c888-cp-slider__dot.is-active {
        background: var(--c888-primary);
        box-shadow: inset 0 0 0 2px var(--c888-primary);
    }
}

/* --------------------------------------------------------------
   Category Posts — Desktop Carousel (.c888-cp-carousel)
   Shows 3 cards at once, prev/next arrows, dot indicators.
   -------------------------------------------------------------- */

.c888-cp-carousel {
    position: relative;
    overflow: hidden;
}

.c888-cp-carousel__track {
    display: flex;
    transition: transform 0.4s ease;
}

/* Disable the lift-on-hover inside the carousel — overflow:hidden would clip it */
.c888-cp-carousel .c888-post-card:hover {
    transform: none;
}

/* Each slide wrapper takes exactly 1/3 of the container and provides the gap */
.c888-cp-carousel__slide {
    flex: 0 0 calc(100% / 3);
    width: calc(100% / 3);
    padding: 0 8px;
    box-sizing: border-box;
}

/* Card inside the slide fills the padded area with visible rounded corners */
.c888-cp-carousel__slide .c888-post-card--featured {
    border-radius: 10px;
    overflow: hidden;
    height: 100%;
}

/* Card image inside carousel — let 2/1 aspect-ratio from base rule apply */
.c888-cp-carousel__track .c888-post-card__image img {
    height: 100%;
}

/* Prev / Next buttons */
.c888-cp-carousel__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(19, 15, 30, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.c888-cp-carousel__btn:hover {
    background: var(--c888-primary);
    border-color: var(--c888-primary);
    transform: translateY(-50%) scale(1.08);
}

.c888-cp-carousel__btn svg {
    display: block;
    flex-shrink: 0;
}

.c888-cp-carousel__prev { left: 10px; }
.c888-cp-carousel__next { right: 10px; }

/* Dot indicators */
.c888-cp-carousel__dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 12px 0 4px;
}

.c888-cp-carousel__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--c888-border);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
}

.c888-cp-carousel__dot.is-active {
    background: var(--c888-primary);
}

/* On mobile: hide prev/next, let mobile slider handle it */
@media (max-width: 768px) {
    .c888-cp-carousel__btn { display: none; }

    .c888-cp-carousel__slide {
        flex: 0 0 100%;
        width: 100%;
        padding: 0;
    }
}

/* ==============================================================
   INTERIOR PAGE LAYOUT
   Shared by archive (archive.php, taxonomy-game_category.php)
   and single (single.php, single-game.php) templates.
   ============================================================== */

/* ---------------------------------------------------------------
   Page header — same padding for both archive title and post title
--------------------------------------------------------------- */

.c888-archive__header {
    padding: var(--c888-spacing-md) 0 var(--c888-spacing-sm);
}

.c888-single__header {
    padding: var(--c888-spacing-xs) 0 var(--c888-spacing-lg);
}

/* ---------------------------------------------------------------
   Page titles
--------------------------------------------------------------- */

.c888-archive__title,
.c888-single__title {
    font-weight: 700;
    color: var(--c888-text);
}

.c888-single__title {
    font-size: var(--c888-font-size-3xl);
}

/* Archive-specific title — compact */
.c888-archive__title {
    font-size: var(--c888-font-size-xl);
    margin: 0 0 4px;
    line-height: 1.2;
}

/* Single-specific title margin + line-height */
.c888-single__title {
    line-height: 1.25;
    margin: var(--c888-spacing-sm) 0 var(--c888-spacing-md);
}

/* Archive category description */
.c888-archive__description {
    font-size: var(--c888-font-size-base);
    color: var(--c888-text-secondary);
    line-height: 1.7;
    max-width: 680px;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ---------------------------------------------------------------
   Two-column layout — shared by archive and single
--------------------------------------------------------------- */

.c888-archive-layout,
.c888-single-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--c888-spacing-2xl);
    align-items: start;
    padding-bottom: var(--c888-spacing-3xl);
}

/* Grid items default to min-width:auto which lets wide children (tables,
   long-word text, iframes) push the track past the viewport. Pin to 0 so
   the column respects the layout's width. */
.c888-single__content,
.c888-single__sidebar {
    min-width: 0;
}

.c888-archive-layout--with-sidebar,
.c888-single-layout--with-sidebar {
    grid-template-columns: 1fr 300px;
}

/* ---------------------------------------------------------------
   Archive featured section (tri-card row above the posts list)
--------------------------------------------------------------- */

.c888-archive__featured {
    padding: var(--c888-spacing-3xl) 0;
    border-bottom: 1px solid var(--c888-border);
    margin-bottom: var(--c888-spacing-xl);
}

/* ---------------------------------------------------------------
   Posts list layout variant
--------------------------------------------------------------- */

/* Strip the generic .c888-section top padding so the list aligns
   with the top of the sidebar in the 2-column archive layout. */
.c888-archive__posts-list {
    padding-top: 0;
}

.c888-posts-list {
    display: flex;
    flex-direction: column;
    gap: var(--c888-spacing-lg);
}

.c888-posts-list .c888-post-card--list {
    display: flex;
    align-items: stretch;
    background: var(--c888-surface);
    border-radius: var(--c888-radius-lg);
    overflow: hidden;
}

.c888-posts-list .c888-post-card--list .c888-post-card__image {
    flex: 0 0 480px;
    aspect-ratio: 2 / 1;
}

.c888-posts-list .c888-post-card--list .c888-post-card__image a {
    display: block;
    width: 100%;
    height: 100%;
}

.c888-posts-list .c888-post-card--list .c888-post-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.c888-posts-list .c888-post-card--list .c888-post-card__content {
    flex: 1;
    min-width: 0;
    padding: var(--c888-spacing-sm) var(--c888-spacing-md);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    overflow: hidden;
}

.c888-posts-list .c888-post-card--list .c888-post-card__title {
    font-size: var(--c888-font-size-base);
    line-height: 1.3;
    margin: 0;
}

.c888-posts-list .c888-post-card--list .c888-post-card__excerpt {
    font-size: var(--c888-font-size-xs);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.c888-posts-list .c888-post-card--list .c888-post-card__date {
    font-size: var(--c888-font-size-xs);
}

.c888-posts-list .c888-post-card--list .c888-post-card__category {
    font-size: 10px;
    margin: 0;
}

/* ---------------------------------------------------------------
   Pagination
--------------------------------------------------------------- */

.c888-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: var(--c888-spacing-sm);
    justify-content: center;
    padding: var(--c888-spacing-xl) 0;
}

.c888-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--c888-spacing-sm);
    border: 1px solid var(--c888-border);
    border-radius: var(--c888-radius-sm);
    color: var(--c888-text);
    text-decoration: none;
    font-size: var(--c888-font-size-sm);
    transition: background var(--c888-transition-fast), border-color var(--c888-transition-fast);
}

.c888-pagination .page-numbers:hover,
.c888-pagination .page-numbers.current {
    background: var(--c888-primary);
    border-color: var(--c888-primary);
    color: #fff;
}

/* ==============================================================
   SINGLE POST TEMPLATE
   Layout + header rules are in INTERIOR PAGE LAYOUT above.
   ============================================================== */

/* ---------------------------------------------------------------
   Post meta
--------------------------------------------------------------- */

.c888-single__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--c888-spacing-sm);
    font-size: var(--c888-font-size-sm);
    color: var(--c888-text-secondary);
}

.c888-single__meta-sep {
    opacity: 0.4;
}

/* ---------------------------------------------------------------
   Article body
--------------------------------------------------------------- */

.c888-single__featured-image {
    margin-bottom: var(--c888-spacing-xl);
    border-radius: var(--c888-radius-lg);
    overflow: hidden;
}

.c888-single__featured-image img {
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: cover;
    display: block;
}

.c888-single__body {
    font-size: var(--c888-font-size-base);
    line-height: 1.8;
    color: var(--c888-text);
}

.c888-single__body h2,
.c888-single__body h3,
.c888-single__body h4 {
    font-weight: 700;
    line-height: 1.3;
    margin: var(--c888-spacing-xl) 0 var(--c888-spacing-md);
    color: var(--c888-text);
}

.c888-single__body h2 { font-size: var(--c888-font-size-2xl); }
.c888-single__body h3 { font-size: var(--c888-font-size-xl); }
.c888-single__body h4 { font-size: var(--c888-font-size-lg); }

.c888-single__body p {
    margin-bottom: var(--c888-spacing-lg);
}

.c888-single__body ul,
.c888-single__body ol {
    margin: 0 0 var(--c888-spacing-lg) var(--c888-spacing-xl);
}

.c888-single__body ul {
    list-style: disc;
}

.c888-single__body ol {
    list-style: decimal;
}

.c888-single__body li {
    margin-bottom: var(--c888-spacing-xs);
}

/* Nested lists inside content list items */
.c888-single__body li ul,
.c888-single__body li ol {
    margin: var(--c888-spacing-xs) 0 var(--c888-spacing-sm) var(--c888-spacing-lg);
}

.c888-single__body li ul {
    list-style: circle;
}

.c888-single__body li li ul {
    list-style: square;
}

.c888-single__body li ol {
    list-style: lower-alpha;
}

.c888-single__body a {
    color: var(--c888-primary);
    text-decoration: underline;
}

.c888-single__body a:hover {
    color: var(--c888-primary-hover);
}

.c888-single__body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--c888-radius-md);
    margin: var(--c888-spacing-md) 0;
}

/* Captioned images: WordPress wraps these in <figure class="wp-caption">
   with an inline width (e.g. style="width: 1536px"). Cap it so the figure
   never overflows the content column. The inline style only sets `width`,
   so this max-width caps the rendered size without !important. */
.c888-single__body figure,
.c888-single__body .wp-caption {
    max-width: 100%;
    height: auto;
    margin: var(--c888-spacing-md) 0;
}

.c888-single__body figure img,
.c888-single__body .wp-caption img {
    margin: 0;
}

.c888-single__body figcaption,
.c888-single__body .wp-caption-text {
    font-size: var(--c888-font-size-sm);
    color: var(--c888-text-secondary);
    text-align: center;
    margin-top: var(--c888-spacing-xs);
}

/* AI image credit — small left-aligned notice under every editorial image
   ("Visual creado con IA"). Inserted after each content image by the
   the_content filter and under featured images by the single templates. */
.c888-ai-credit {
    display: block;
    text-align: left;
    font-size: var(--c888-font-size-sm);
    line-height: 1.4;
    font-style: italic;
    color: var(--c888-text-secondary);
    margin: var(--c888-spacing-xs) 0 var(--c888-spacing-md);
}

/* Tuck the credit right under its image (kill the image's bottom margin when a
   credit immediately follows). Progressive enhancement — older browsers without
   :has() simply keep the default, slightly larger gap. */
.c888-single__body img:has(+ .c888-ai-credit),
.c888-single__body a:has(+ .c888-ai-credit),
.wc2026-single-match__content img:has(+ .c888-ai-credit),
.wc2026-single-match__content a:has(+ .c888-ai-credit),
.wc2026-single-team__content img:has(+ .c888-ai-credit),
.wc2026-single-team__content a:has(+ .c888-ai-credit) {
    margin-bottom: 0;
}

.c888-single__featured-image {
    position: relative;
}

.c888-single__featured-image .c888-ai-credit {
    margin-top: var(--c888-spacing-xs);
}

.c888-single__body blockquote {
    border-left: 4px solid var(--c888-primary);
    padding-left: var(--c888-spacing-lg);
    margin: var(--c888-spacing-xl) 0;
    color: var(--c888-text-secondary);
    font-style: italic;
}

.c888-single__body .table-scroll,
.c888-single__body table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: var(--c888-spacing-lg) 0;
}

.c888-single__body table {
    border-collapse: collapse;
}

.c888-single__body table th,
.c888-single__body table td {
    padding: var(--c888-spacing-sm) var(--c888-spacing-md);
    border: 1px solid var(--c888-border);
    text-align: left;
    vertical-align: top;
}

.c888-single__body table th {
    background: var(--c888-surface);
    font-weight: 700;
}

.c888-single__body iframe,
.c888-single__body video,
.c888-single__body embed,
.c888-single__body object {
    max-width: 100%;
}

.c888-single__body pre {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---------------------------------------------------------------
   Related posts section
--------------------------------------------------------------- */

.c888-single__related {
    padding: var(--c888-spacing-3xl) 0;
    border-top: 1px solid var(--c888-border);
}

/* ==============================================================
   BREADCRUMBS — all breadcrumb rules in one place
   ============================================================== */

/* Outer wrapper — controls spacing above/below breadcrumb trail */
.c888-breadcrumbs-wrap {
    padding: 0 0 var(--c888-spacing-xs);
    font-size: var(--c888-font-size-sm);
}

/* When breadcrumbs are inside the wrapper, let the wrapper own the spacing */
.c888-breadcrumbs-wrap .c888-breadcrumbs {
    padding: 0;
}

/* Standalone breadcrumbs (not inside wrapper) */
.c888-breadcrumbs {
    padding: var(--c888-spacing-sm) 0;
}

.c888-breadcrumbs__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: var(--c888-font-size-sm);
    color: var(--c888-text-secondary);
}

.c888-breadcrumbs__item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.c888-breadcrumbs__link {
    color: var(--c888-text-secondary);
    text-decoration: none;
    transition: color var(--c888-transition-fast);
}

.c888-breadcrumbs__link:hover {
    color: var(--c888-primary);
    text-decoration: underline;
}

.c888-breadcrumbs__link--accent {
    color: var(--c888-primary);
    font-weight: 600;
}

.c888-breadcrumbs__link--accent:hover {
    color: var(--c888-accent-hover, var(--c888-primary-hover, #9F67FF));
}

.c888-breadcrumbs__item--current span {
    color: var(--c888-primary);
    font-weight: 600;
}

.c888-breadcrumbs__sep {
    color: var(--c888-text-secondary);
    opacity: 0.5;
    font-size: 0.9em;
    user-select: none;
}

/* Light mode overrides */
.light-mode .c888-breadcrumbs__link           { color: var(--c888-light-text-secondary, #666); }
.light-mode .c888-breadcrumbs__link:hover     { color: var(--c888-primary); }
.light-mode .c888-breadcrumbs__item--current span { color: var(--c888-primary); }

/* ---------------------------------------------------------------
   Tri-card row (featured + related)
--------------------------------------------------------------- */

.c888-tri-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--c888-spacing-lg);
}

/* ---------------------------------------------------------------
   Sticky sidebar
--------------------------------------------------------------- */

/* Sidebar columns must stretch to the full grid height so sticky has room to scroll */
.c888-archive__sidebar,
.c888-single__sidebar {
    align-self: stretch;
    grid-column: 2;
}

.c888-sidebar-sticky {
    position: sticky;
    top: calc(var(--c888-header-height) + var(--c888-spacing-lg));
    max-height: calc(100vh - var(--c888-header-height) - var(--c888-spacing-xl));
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--c888-border) transparent;
}

.c888-sidebar-sticky::-webkit-scrollbar {
    width: 4px;
}

.c888-sidebar-sticky::-webkit-scrollbar-track {
    background: transparent;
}

.c888-sidebar-sticky::-webkit-scrollbar-thumb {
    background: var(--c888-border);
    border-radius: 2px;
}

.c888-sidebar-banner__image img,
.c888-sidebar-banner__img {
    width: 100%;
    height: auto;
    border-radius: var(--c888-radius-md);
    display: block;
}

.c888-sidebar-banner__html {
    font-size: var(--c888-font-size-sm);
}

.c888-sidebar-banner__placeholder {
    border: 2px dashed var(--c888-border);
    border-radius: var(--c888-radius-md);
    padding: var(--c888-spacing-xl);
    text-align: center;
    font-size: var(--c888-font-size-sm);
    color: var(--c888-text-secondary);
}

/* ---------------------------------------------------------------
   Table of Contents
--------------------------------------------------------------- */

.c888-toc {
    margin-top: var(--c888-spacing-lg);
    padding: var(--c888-spacing-md) var(--c888-spacing-lg);
    background: var(--c888-surface);
    border: 1px solid var(--c888-border);
    border-radius: var(--c888-radius-md);
}

.c888-toc__title {
    font-size: var(--c888-font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--c888-text-secondary);
    margin: 0 0 var(--c888-spacing-md);
}

.c888-toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    counter-reset: toc-counter;
}

.c888-toc__item {
    counter-increment: toc-counter;
}

.c888-toc__link {
    display: flex;
    align-items: baseline;
    gap: var(--c888-spacing-sm);
    padding: 5px 8px;
    font-size: var(--c888-font-size-sm);
    color: var(--c888-text-secondary);
    border-left: 2px solid transparent;
    border-radius: 0 var(--c888-radius-sm) var(--c888-radius-sm) 0;
    text-decoration: none;
    line-height: 1.4;
    transition: color var(--c888-transition-fast),
                border-color var(--c888-transition-fast),
                background var(--c888-transition-fast);
}

.c888-toc__link::before {
    content: counter(toc-counter);
    flex-shrink: 0;
    font-size: var(--c888-font-size-xs);
    font-weight: 700;
    color: var(--c888-border);
    min-width: 16px;
    transition: color var(--c888-transition-fast);
}

.c888-toc__link:hover {
    color: var(--c888-text);
    background: rgba(124, 58, 237, 0.06);
    border-left-color: var(--c888-border);
}

/* Active: currently in viewport */
.c888-toc__item.is-active > .c888-toc__link {
    color: var(--c888-primary);
    border-left-color: var(--c888-primary);
    background: rgba(124, 58, 237, 0.08);
    font-weight: 600;
}

.c888-toc__item.is-active > .c888-toc__link::before {
    color: var(--c888-primary);
}

/* Passed: already scrolled past */
.c888-toc__item.is-passed > .c888-toc__link {
    color: var(--c888-text-secondary);
    border-left-color: var(--c888-border);
    opacity: 0.55;
}

.c888-toc__item.is-passed > .c888-toc__link::before {
    content: '✓';
    color: var(--c888-primary);
    opacity: 0.6;
}

/* ---------------------------------------------------------------
   Mobile ToC accordion (hidden on desktop)
--------------------------------------------------------------- */

.c888-toc-mobile {
    display: none; /* shown only on mobile via media query below */
}

@media (max-width: 768px) {
    .c888-toc-mobile {
        display: block;
        margin: var(--c888-spacing-lg) 0;
        background: var(--c888-surface);
        border: 1px solid var(--c888-border);
        border-radius: var(--c888-radius-md);
        overflow: hidden;
    }

    .c888-toc-mobile__toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: var(--c888-spacing-md) var(--c888-spacing-lg);
        background: transparent;
        border: none;
        color: var(--c888-text);
        font-size: var(--c888-font-size-sm);
        font-weight: 700;
        cursor: pointer;
        text-align: left;
        gap: var(--c888-spacing-sm);
    }

    .c888-toc-mobile__toggle:hover {
        background: rgba(124, 58, 237, 0.06);
    }

    /* Chevron arrow */
    .c888-toc-mobile__chevron {
        flex-shrink: 0;
        width: 8px;
        height: 8px;
        border-right: 2px solid var(--c888-text-secondary);
        border-bottom: 2px solid var(--c888-text-secondary);
        transform: rotate(45deg);
        transition: transform var(--c888-transition-fast);
        margin-bottom: 3px;
    }

    .c888-toc-mobile.is-open .c888-toc-mobile__chevron {
        transform: rotate(-135deg);
        margin-bottom: -3px;
    }

    .c888-toc-mobile__body {
        padding: 0 var(--c888-spacing-md) var(--c888-spacing-md);
        border-top: 1px solid var(--c888-border);
    }

    /* Reuse .c888-toc__list / .c888-toc__item / .c888-toc__link inside accordion */
    .c888-toc-mobile .c888-toc__list {
        padding-top: var(--c888-spacing-sm);
    }
}

/* ---------------------------------------------------------------
   Post card placeholder (builder)
--------------------------------------------------------------- */

.c888-post-card--placeholder {
    border: 2px dashed var(--c888-border);
    border-radius: var(--c888-radius-lg);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------------------------------------------------------------
   Responsive — interior page layout (archive + single)
--------------------------------------------------------------- */

@media (max-width: 1024px) {
    .c888-archive-layout--with-sidebar,
    .c888-single-layout--with-sidebar {
        grid-template-columns: 1fr 260px;
    }
}

@media (max-width: 768px) {
    .c888-archive-layout--with-sidebar,
    .c888-single-layout--with-sidebar,
    .c888-archive-layout,
    .c888-single-layout {
        grid-template-columns: 1fr;
        gap: var(--c888-spacing-lg);
    }

    /* Sidebar drops below the content column on mobile (single-column grid).
       Spacing comes from the grid gap above — no extra margin needed. */
    .c888-archive__sidebar,
    .c888-single__sidebar {
        grid-column: 1;
    }

    /* Desktop ToC panel is replaced by the mobile accordion (#c888-toc-mobile) */
    .c888-toc {
        display: none;
    }

    .c888-tri-cards {
        grid-template-columns: 1fr;
    }

    .c888-sidebar-sticky {
        position: static;
    }

    .c888-single__title {
        font-size: var(--c888-font-size-2xl);
    }

    .c888-archive__title {
        font-size: var(--c888-font-size-lg);
    }

    .c888-posts-list .c888-post-card--list {
        flex-direction: column;
    }

    .c888-posts-list .c888-post-card--list .c888-post-card__image {
        flex: 0 0 auto;
        width: 100%;
    }

}

/* ----------------------------------------------------------------
# FAQ Accordion
---------------------------------------------------------------- */

.c888-faq {
    padding: var(--c888-spacing-3xl) 0;
}

.c888-faq__list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--c888-border);
}

.c888-faq__item {
    border-bottom: 1px solid var(--c888-border);
}

.c888-faq__question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1.25rem 0;
    background: none;
    border: none;
    color: var(--c888-text);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    gap: 1rem;
    transition: color 0.2s;
}

.c888-faq__question:hover {
    color: var(--c888-primary);
}

.c888-faq__icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    position: relative;
    border: 2px solid currentColor;
    border-radius: 50%;
    transition: color 0.2s;
}

.c888-faq__icon::before,
.c888-faq__icon::after {
    content: '';
    position: absolute;
    background: currentColor;
    border-radius: 2px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.c888-faq__icon::before {
    width: 2px;
    height: 0.55rem;
    transition: opacity 0.2s, transform 0.2s;
}

.c888-faq__icon::after {
    width: 0.55rem;
    height: 2px;
}

.c888-faq__item.is-open .c888-faq__icon::before {
    opacity: 0;
}

.c888-faq__item.is-open .c888-faq__question {
    color: var(--c888-primary);
}

.c888-faq__answer {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease, padding-bottom 0.3s ease;
    padding-bottom: 0;
    color: var(--c888-text-secondary);
    line-height: 1.75;
}

.c888-faq__item.is-open .c888-faq__answer {
    padding-bottom: 1.25rem;
}

.c888-faq__answer p:first-child { margin-top: 0; }
.c888-faq__answer p:last-child  { margin-bottom: 0; }

@media (max-width: 768px) {
    .c888-faq__question {
        font-size: 0.9375rem;
    }
}

/*--------------------------------------------------------------
# Language Switcher
--------------------------------------------------------------*/

/**
 * EXPLANATION:
 * The language switcher is a button + dropdown pattern used in both
 * the header (desktop) and the mobile menu footer row.
 * It is rendered only when Polylang is active and 2+ languages exist.
 *
 * Structure:
 *   .c888-lang-switcher          wrapper (position: relative)
 *   ├── .c888-lang-switcher__toggle   trigger button
 *   │    ├── .c888-lang-switcher__flag   <img> flag
 *   │    ├── .c888-lang-switcher__code   2-letter slug ("ES", "AR")
 *   │    └── .c888-lang-switcher__arrow  chevron SVG
 *   └── .c888-lang-switcher__dropdown   floating <ul>
 *        └── .c888-lang-switcher__item  each language
 *             └── .c888-lang-switcher__link  <a>
 */

.c888-lang-switcher {
    position: relative;
}

/* Toggle button */
.c888-lang-switcher__toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: var(--c888-radius-md);
    font-size: var(--c888-font-size-sm);
    font-weight: 600;
    color: var(--c888-text-secondary);
    background: transparent;
    border: 1px solid transparent;
    transition: color var(--c888-transition-fast),
                border-color var(--c888-transition-fast),
                background-color var(--c888-transition-fast);
    white-space: nowrap;
}

.c888-lang-switcher__toggle:hover,
.c888-lang-switcher.is-open .c888-lang-switcher__toggle {
    color: var(--c888-text);
    border-color: var(--c888-border);
    background-color: var(--c888-surface);
}

/* Flag image inside toggle */
.c888-lang-switcher__flag img {
    width: 18px;
    height: 13px;
    object-fit: cover;
    border-radius: 2px;
    display: block;
}

/* Language code text */
.c888-lang-switcher__code {
    letter-spacing: 0.5px;
}

/* Chevron arrow */
.c888-lang-switcher__arrow {
    transition: transform var(--c888-transition-fast);
    flex-shrink: 0;
}

.c888-lang-switcher.is-open .c888-lang-switcher__arrow {
    transform: rotate(180deg);
}

/* Dropdown list */
.c888-lang-switcher__dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 160px;
    background-color: var(--c888-surface);
    border: 1px solid var(--c888-border);
    border-radius: var(--c888-radius-md);
    box-shadow: var(--c888-shadow-lg);
    z-index: 200;
    overflow: hidden;
    /* Hidden by default — JS adds .is-open to parent */
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity var(--c888-transition-fast),
                transform var(--c888-transition-fast);
}

.c888-lang-switcher.is-open .c888-lang-switcher__dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Each language option */
.c888-lang-switcher__link {
    display: flex;
    align-items: center;
    gap: var(--c888-spacing-sm);
    padding: 10px var(--c888-spacing-md);
    font-size: var(--c888-font-size-sm);
    color: var(--c888-text-secondary);
    transition: background-color var(--c888-transition-fast),
                color var(--c888-transition-fast);
}

.c888-lang-switcher__link:hover,
.c888-lang-switcher__item--active .c888-lang-switcher__link {
    background-color: var(--c888-secondary);
    color: var(--c888-text);
}

/* Language full name */
.c888-lang-switcher__name {
    flex: 1;
}

/* Checkmark for active language */
.c888-lang-switcher__check {
    flex-shrink: 0;
    color: var(--c888-primary);
}

/* Footer placement — dropdown opens upward */
.c888-lang-switcher--footer .c888-lang-switcher__dropdown {
    top: auto;
    bottom: calc(100% + 6px);
    right: 0;
}

/* Mobile placement — full-width inline list (no dropdown) */
.c888-lang-switcher--mobile {
    width: 100%;
}

.c888-lang-switcher--mobile .c888-lang-switcher__toggle {
    display: none; /* no toggle button needed — always expanded */
}

.c888-lang-switcher--mobile .c888-lang-switcher__dropdown {
    position: static;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: transparent;
    display: flex;
    flex-direction: row;
    gap: var(--c888-spacing-sm);
    padding: 0;
    min-width: 0;
}

.c888-lang-switcher--mobile .c888-lang-switcher__link {
    padding: 6px 10px;
    border-radius: var(--c888-radius-md);
    border: 1px solid var(--c888-border);
    font-size: var(--c888-font-size-sm);
}

.c888-lang-switcher--mobile .c888-lang-switcher__item--active .c888-lang-switcher__link {
    border-color: var(--c888-primary);
    color: var(--c888-primary);
    background: transparent;
}

/* Footer legal bar — single definition covering sizing, typography, and flex layout */
.c888-footer__legal {
    max-width: var(--c888-container-max);
    margin: 0 auto;
    font-size: var(--c888-font-size-xs);
    color: var(--c888-text-secondary);
    text-align: center;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--c888-spacing-lg);
    flex-wrap: wrap;
}

.c888-footer__legal-left {
    flex: 1;
}

/*--------------------------------------------------------------
# RTL (Right-to-Left) Support — Arabic
--------------------------------------------------------------*/

/**
 * EXPLANATION:
 * When the active language is Arabic, WordPress adds dir="rtl" to the
 * <html> tag via language_attributes() in header.php. We target that
 * attribute to flip the layout without affecting LTR languages.
 *
 * Key things that need flipping:
 * 1. Navigation underline — starts from the right instead of left
 * 2. Header container — flex direction is auto-reversed by dir="rtl",
 *    but icon/button order needs explicit handling
 * 3. Mobile menu underline — same as nav underline
 * 4. Text alignment for centered/left-aligned elements
 * 5. Language switcher dropdown — opens to the left instead of right
 * 6. Footer legal bar — mirrors
 */

[dir="rtl"] .c888-nav-menu a::after {
    left: auto;
    right: 0;
}

[dir="rtl"] .c888-mobile-nav-menu .current-menu-item a::after,
[dir="rtl"] .c888-mobile-nav-menu .current_page_item a::after {
    left: auto;
    right: 0;
}

/* Hamburger lines — keep visual alignment correct */
[dir="rtl"] .c888-header__menu-toggle {
    order: 1; /* push to right side of flex row */
}

[dir="rtl"] .c888-header__logo {
    order: 0;
}

/* Language switcher dropdown opens to the left in RTL */
[dir="rtl"] .c888-lang-switcher__dropdown {
    right: auto;
    left: 0;
}

[dir="rtl"] .c888-lang-switcher--footer .c888-lang-switcher__dropdown {
    right: auto;
    left: 0;
}

/* Footer legal bar */
[dir="rtl"] .c888-footer__legal {
    flex-direction: row-reverse;
}

/* FAQ question text */
[dir="rtl"] .c888-faq__question {
    text-align: right;
}

/* Footer menu accordions */
[dir="rtl"] .c888-footer-menu__title {
    text-align: right;
}

/* Buttons — icon before text flips naturally with dir="rtl" */
[dir="rtl"] .c888-btn {
    flex-direction: row-reverse;
}

/* Store buttons in app download section */
[dir="rtl"] .c888-store-btn {
    flex-direction: row-reverse;
}

/**
 * RTL font stack
 *
 * EXPLANATION:
 * The default Inter/system font stack has poor or no support for Arabic,
 * Hebrew, Farsi, Urdu and other RTL scripts. We override the font family
 * for any RTL page so browsers pick up a system font that actually covers
 * the script in use.
 *
 * Font priorities (all are system fonts — no extra download needed):
 * - 'Segoe UI'         Windows — covers Arabic, Hebrew, and Latin
 * - 'Tahoma'           Windows — broad Arabic/Hebrew support
 * - 'Arial'            Universal — basic Arabic/Hebrew
 * - 'Noto Sans Arabic' Android / Google Fonts fallback
 * - 'Noto Sans Hebrew' Android / Google Fonts fallback
 * - 'Dubai'            Arabic-optimised (Windows 10+)
 * - 'Geeza Pro'        macOS/iOS — Arabic
 * - 'Lucida Grande'    macOS — Hebrew
 * - sans-serif         OS default (catch-all)
 *
 * If you want to load a web font for Arabic clients (e.g. Google Fonts
 * "Cairo" or "Tajawal"), enqueue it via functions.php and add it first.
 */
[dir="rtl"] body {
    font-family: 'Segoe UI', Tahoma, 'Dubai', 'Geeza Pro',
                 'Lucida Grande', Arial,
                 'Noto Sans Arabic', 'Noto Sans Hebrew',
                 sans-serif;
}

/* ==============================================================
   WC2026 PLUGIN — single-post theme override styles
   ============================================================== */

/* CTA button at bottom of article body */
.c888-single__cta-wrap {
    margin-top: var(--c888-spacing-2xl);
    text-align: center;
}

.c888-single__cta-btn {
    padding: var(--c888-spacing-md) var(--c888-spacing-2xl);
    font-size: var(--c888-font-size-base);
}

/* Sidebar: related entity list (match / team / group) */
.wc2026-sidebar-related {
    margin-top: var(--c888-spacing-xl);
    padding: var(--c888-spacing-lg);
    background: var(--c888-surface);
    border-radius: var(--c888-radius-md);
    border: 1px solid var(--c888-border);
}

.wc2026-sidebar-related__title {
    font-size: var(--c888-font-size-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--c888-text-secondary);
    margin: 0 0 var(--c888-spacing-md);
}

.wc2026-sidebar-related__group + .wc2026-sidebar-related__group {
    margin-top: var(--c888-spacing-md);
    padding-top: var(--c888-spacing-md);
    border-top: 1px solid var(--c888-border);
}

.wc2026-sidebar-related__subtitle {
    font-size: var(--c888-font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--c888-primary);
    margin: 0 0 var(--c888-spacing-sm);
}

.wc2026-sidebar-related__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--c888-spacing-sm);
}

.wc2026-sidebar-related__item a {
    display: block;
    font-size: var(--c888-font-size-sm);
    color: var(--c888-text);
    padding: var(--c888-spacing-xs) 0;
    border-bottom: 1px solid var(--c888-border);
    transition: color var(--c888-transition-fast);
}

.wc2026-sidebar-related__item:last-child a {
    border-bottom: none;
}

.wc2026-sidebar-related__item a:hover {
    color: var(--c888-primary);
}

/* Light mode overrides */
.light-mode .wc2026-sidebar-related {
    background: var(--c888-light-surface, #F5F5F5);
    border-color: rgba(0,0,0,0.1);
}

.light-mode .wc2026-sidebar-related__item a {
    color: var(--c888-light-text, #1F1B2E);
    border-color: rgba(0,0,0,0.08);
}

.light-mode .wc2026-sidebar-related__group + .wc2026-sidebar-related__group {
    border-top-color: rgba(0,0,0,0.1);
}

/* ---------------------------------------------------------------
   Banner + Post section
--------------------------------------------------------------- */

.c888-banner-post__grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--c888-spacing-md);
    align-items: stretch;
}

.c888-banner-post__banner {
    border-radius: var(--c888-radius-md, 8px);
    overflow: hidden;
    position: relative;
    /* img/placeholder are absolutely positioned so they don't contribute to
       grid row sizing — the right-column post card sets the row height instead */
}

.c888-banner-post__banner a {
    display: block;
    position: absolute;
    inset: 0;
}

.c888-banner-post__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.c888-banner-post__placeholder {
    position: absolute;
    inset: 0;
    background: var(--c888-surface);
    border: 2px dashed var(--c888-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c888-text-secondary);
    border-radius: var(--c888-radius-md, 8px);
    padding: var(--c888-spacing-lg);
    text-align: center;
}

.c888-banner-post__post {
    display: flex;
    flex-direction: column;
}

.c888-banner-post__post .c888-post-card--featured {
    flex: 1;
}

.c888-banner-post__post .c888-post-card--featured .c888-post-card__image img,
.c888-banner-post__post .c888-post-card--featured .c888-post-card__image-placeholder {
    height: 180px;
}

@media (max-width: 768px) {
    .c888-banner-post__grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   WC2026 Team Data Tables (Key Facts / Last 5 / Top Players)
   Rendered on /copa-mundial-2026/selecciones/{team}/ from the uploads CSVs.
   ========================================================================== */
.c888-team-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--c888-surface);
    border: 1px solid var(--c888-border);
    border-radius: var(--c888-radius-md);
    overflow: hidden;
    font-size: var(--c888-font-size-sm);
    color: var(--c888-text);
}

.c888-team-table th,
.c888-team-table td {
    padding: 10px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--c888-border);
}

.c888-team-table tr:last-child th,
.c888-team-table tr:last-child td {
    border-bottom: 0;
}

.c888-team-table thead th {
    background: color-mix(in srgb, var(--c888-primary) 14%, transparent);
    color: var(--c888-text);
    font-weight: 600;
    white-space: nowrap;
}

/* Key Facts is a two-column label/value table */
.c888-team-table--facts th {
    width: 42%;
    color: var(--c888-text-secondary);
    font-weight: 600;
}

.c888-team-table--last5 td:nth-child(2),
.c888-team-table--last5 td:nth-child(4) {
    white-space: nowrap;
}

.c888-team-table__result {
    font-weight: 700;
}

.c888-team-table__result--w { color: #22c55e; }
.c888-team-table__result--l { color: #ef4444; }
.c888-team-table__result--d { color: var(--c888-text-secondary); }

.c888-team-table__player {
    font-weight: 600;
    color: var(--c888-text);
}

@media (max-width: 600px) {
    .c888-team-table {
        font-size: var(--c888-font-size-xs);
    }

    .c888-team-table th,
    .c888-team-table td {
        padding: 8px 10px;
    }

    .c888-team-table--facts th {
        width: 46%;
    }
}

/* ==========================================================================
   WC2026 Match Data Sections (Comparison / Head-to-Head / Last 5 / Players)
   Rendered on /copa-mundial-2026/partidos/{match}/. Comparison/last5/players
   are derived from the team CSVs; H2H/preview come from uploads/matches.csv.
   Reuses .c888-team-table for the table chrome.
   ========================================================================== */
.c888-match-data {
    margin-top: 28px;
}

.c888-match-section {
    margin: 28px 0;
}

.c888-match-section__title {
    font-size: var(--c888-font-size-lg, 1.25rem);
    color: var(--c888-text);
    margin: 0 0 14px;
}

.c888-match-preview {
    color: var(--c888-text);
    line-height: 1.7;
}

.c888-match-bottom-content {
    color: var(--c888-text);
    line-height: 1.7;
    margin-top: 32px;
}

/* ── Horizontal-overflow guard for the single match page ──────────────────
   iOS Safari ignores overflow-x on html/body, so clip on the page container
   itself (a normal element it DOES respect). Scoped to the match page. */
.wc2026-single-match {
    overflow-x: clip;
    max-width: 100%;
}

/* Remove the overflow SOURCE too, so it can't overflow even where clip is
   unsupported: the venue/kickoff pills are white-space:nowrap (plugin) and can
   be very long ("MetLife Stadium, East Rutherford, New Jersey"), forcing the
   header grid's center column wider than a narrow phone. Let them wrap. */
.wc2026-single-match .wc2026-single-match__meta-pills .wc2026-single-match__pill {
    white-space: normal;
    max-width: 100%;
}

/* ── Match scoreboard: stage title + before/after results ──────────────────
   Theme styling for the restructured centre column (wc2026/single-match.php):
   a stage/group title on top, the meta pills, then the big value (kickoff time
   "before", final score "after"), then a status sub-label — "Full time" once
   the match is FINISHED, the date before kickoff. Mirrors the plugin's
   __score / __finished-label treatment so it adapts to light + dark themes. */
.wc2026-single-match__stage-title {
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .2px;
    color: #f0f0f8;
    margin-bottom: 2px;
}
.wc2026-single-match__stage-title a {
    color: inherit;
    text-decoration: none;
}
.wc2026-single-match__stage-title a:hover {
    text-decoration: underline;
}
body.light-mode .wc2026-single-match .wc2026-single-match__stage-title {
    color: #0d0d1a;
}

/* "Before" kickoff time — promote to the same prominence as the final score
   (the plugin styles it small + purple; the design wants it big + dark). */
.wc2026-single-match .wc2026-single-match__kickoff-time {
    font-size: 2.6rem;
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1;
    color: #f0f0f8;
}
body.light-mode .wc2026-single-match .wc2026-single-match__kickoff-time {
    color: #0d0d1a;
}

/* Status sub-label beneath the big value ("Full time" / date / live). */
.wc2026-single-match__status-sub {
    font-size: .8rem;
    font-weight: 600;
    color: #666680;
    margin-top: 2px;
}
body.light-mode .wc2026-single-match .wc2026-single-match__status-sub {
    color: #888899;
}

/* Read the score as "1 - 2": widen the separator spacing a touch. */
.wc2026-single-match .wc2026-single-match__score-sep {
    padding: 0 10px;
}

/* Goal scorers row (full width, below the header grid): home scorers right-
   aligned, away left-aligned, single ball icon centred (flashscore-style).
   Only output when at least one side has input — see wc2026/single-match.php. */
.wc2026-single-match__scorers {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 16px;
    max-width: 520px;
    width: 100%;
    margin: 10px auto 0;
    font-size: .82rem;
    line-height: 1.5;
    color: #666680;
}
.wc2026-single-match__scorers-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 0;
    min-width: 0;
    overflow-wrap: anywhere;
}
.wc2026-single-match__scorers-col--home {
    align-items: flex-end;
    text-align: right;
}
.wc2026-single-match__scorers-col--away {
    align-items: flex-start;
    text-align: left;
}
.wc2026-single-match__scorers-icon {
    flex: 0 0 auto;
    font-size: .95rem;
    line-height: 1.5;
    opacity: .6;
}
body.light-mode .wc2026-single-match .wc2026-single-match__scorers {
    color: #555566;
}

@media (max-width: 680px) {
    .wc2026-single-match .wc2026-single-match__kickoff-time { font-size: 2rem; }
    .wc2026-single-match__scorers { gap: 10px; font-size: .78rem; }
}

/* And let any long token in the derived tables wrap rather than overflow. */
.wc2026-single-match__content .c888-team-table td,
.wc2026-single-match__content .c888-team-table th {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* The WC2026 plugin styles `th` inside .wc2026-single-*__content as
   text-transform:uppercase + white-space:nowrap, which leaks into our derived
   tables and stops long labels from wrapping (overflow on mobile). Override it
   with higher specificity so our match tables can wrap and fit. */
.wc2026-single-match__content .c888-team-table th {
    white-space: normal;
}

.wc2026-single-match__content .c888-match-compare th[scope="row"] {
    letter-spacing: normal;
}

/* --- Editorial lists inside team content ---
   The global reset (ul, ol { list-style: none }) strips bullets, so the
   editorial copy in the team content column renders as unstyled lists.
   Restore proper disc/decimal lists here, matching .c888-single__body.
   Scoped to .wc2026-single-team__content — the derived data is in <table>s
   and the "related matches" list lives in the sidebar, so neither is hit. */
.wc2026-single-team__content ul,
.wc2026-single-team__content ol {
    margin: 0 0 var(--c888-spacing-lg) var(--c888-spacing-xl);
    padding: 0;
}

.wc2026-single-team__content ul {
    list-style: disc;
}

.wc2026-single-team__content ol {
    list-style: decimal;
}

.wc2026-single-team__content li {
    margin-bottom: var(--c888-spacing-xs);
    line-height: 1.7;
}

.wc2026-single-team__content li ul,
.wc2026-single-team__content li ol {
    margin: var(--c888-spacing-xs) 0 var(--c888-spacing-sm) var(--c888-spacing-lg);
}

.wc2026-single-team__content li ul {
    list-style: circle;
}

.wc2026-single-team__content li li ul {
    list-style: square;
}

.wc2026-single-team__content li ol {
    list-style: lower-alpha;
}

/* --- Team comparison (3-column: label | home | away) --- */
/* Fixed layout + wrapping so the 3 columns always fit the viewport on mobile
   instead of long values (coach names, clubs, "Campeón (…)") forcing overflow. */
.c888-match-compare {
    table-layout: fixed;
}

.c888-match-compare th,
.c888-match-compare td {
    text-align: center;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Column widths come from the header row under table-layout: fixed. */
.c888-match-compare thead th:first-child {
    width: 32%;
}

/* Override the base .c888-team-table thead nowrap so team names can wrap. */
.c888-match-compare thead th {
    white-space: normal;
}

.c888-match-compare tbody th[scope="row"] {
    text-align: left;
    color: var(--c888-text-secondary);
    font-weight: 600;
}

.c888-match-compare__team {
    vertical-align: middle;
}

/* Flex wrapper keeps the flag and the country name side by side and
   vertically centered; the name wraps within its own column instead of
   dropping onto a new line below the flag. */
.c888-match-compare__team-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.c888-match-compare__team-inner > span {
    font-weight: 700;
    text-align: left;
}

.c888-match-compare__flag {
    flex: none;
    width: 28px;
    height: auto;
    border-radius: var(--c888-radius-sm);
}

/* --- Recent-form badges --- */
.c888-match-form {
    display: inline-flex;
    gap: 4px;
    justify-content: center;
}

.c888-match-form__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: var(--c888-radius-sm);
    font-size: var(--c888-font-size-xs);
    font-weight: 700;
    color: #fff;
}

.c888-match-form__badge--w { background: #22c55e; }
.c888-match-form__badge--l { background: #ef4444; }
.c888-match-form__badge--d { background: var(--c888-text-secondary); }
.c888-match-form__none { color: var(--c888-text-secondary); }

/* --- Head-to-head --- */
.c888-match-h2h__summary {
    color: var(--c888-text);
    font-weight: 600;
    margin: 0 0 14px;
}

/* --- Two-column blocks (last 5 + players) --- */
.c888-match-last5,
.c888-match-players {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.c888-match-last5__team,
.c888-match-players__team {
    font-size: var(--c888-font-size-base, 1rem);
    color: var(--c888-text);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 768px) {
    .c888-match-last5,
    .c888-match-players {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .c888-match-compare thead th:first-child {
        width: 30%;
    }

    /* Tighter cells so three columns fit comfortably on narrow screens. */
    .wc2026-single-match__content .c888-match-compare th,
    .wc2026-single-match__content .c888-match-compare td,
    .c888-match-compare th,
    .c888-match-compare td {
        padding: 7px 6px;
        font-size: var(--c888-font-size-xs);
        line-height: 1.35;
        letter-spacing: normal;
    }

    .c888-match-compare__flag {
        width: 20px;
    }

    .c888-match-form {
        flex-wrap: wrap;
        gap: 3px;
    }

    .c888-match-form__badge {
        width: 18px;
        height: 18px;
    }
}

/*--------------------------------------------------------------
# Back to Top button (floating, desktop + mobile)
--------------------------------------------------------------*/
.c888-back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 990;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--c888-primary);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s ease,
                background-color .2s ease;
}

.c888-back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.c888-back-to-top:hover {
    background: var(--c888-primary-hover, var(--c888-accent-hover));
}

.c888-back-to-top:focus-visible {
    outline: 2px solid var(--c888-primary-hover, var(--c888-accent-hover));
    outline-offset: 2px;
}

.c888-back-to-top svg {
    display: block;
}

/* RTL (Arabic, etc.) — anchor to the left edge instead. */
[dir="rtl"] .c888-back-to-top {
    right: auto;
    left: 20px;
}

@media (max-width: 768px) {
    .c888-back-to-top {
        right: 14px;
        bottom: 14px;
        width: 42px;
        height: 42px;
    }
    [dir="rtl"] .c888-back-to-top {
        right: auto;
        left: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .c888-back-to-top {
        transform: none;
        transition: opacity .2s ease, visibility .2s ease, background-color .2s ease;
    }
}

/* ============================================================================
   888-style casino grid — game tiles, grid, hero, section header
   Built as our own components, matching the captured 888 layout.
   ============================================================================ */

.c888-hero {
    background: linear-gradient(180deg, #1d1d1d 0%, var(--c888-secondary) 100%);
    padding: var(--c888-spacing-2xl) var(--c888-container-padding);
    text-align: center;
    border-bottom: 1px solid var(--c888-border);
}
.c888-hero__title {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 800;
    margin: 0 0 .5rem;
    color: var(--c888-text);
}
.c888-hero__subtitle { color: var(--c888-text-secondary); margin: 0 auto; max-width: 680px; }
.c888-hero__cta {
    display: inline-block; margin-top: var(--c888-spacing-lg);
    background: var(--c888-primary); color: var(--c888-on-primary);
    font-weight: 800; text-transform: uppercase; letter-spacing: .03em;
    padding: 14px 34px; border-radius: 8px; text-decoration: none;
    transition: background var(--c888-transition-fast), transform var(--c888-transition-fast);
}
.c888-hero__cta:hover { background: var(--c888-primary-hover); transform: translateY(-1px); }

/* Section header (e.g. "Slots", "Live Casino") with a green accent rule */
.c888-section { padding: var(--c888-spacing-xl) var(--c888-container-padding); max-width: var(--c888-container-max); margin: 0 auto; }
.c888-section__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--c888-spacing-md); }
.c888-section__title {
    font-size: 1.15rem; font-weight: 800; color: var(--c888-text); margin: 0;
    padding-left: 12px; border-left: 4px solid var(--c888-primary); line-height: 1.1;
}
.c888-section__more { color: var(--c888-primary); font-weight: 700; font-size: .85rem; text-decoration: none; }
.c888-section__more:hover { color: var(--c888-primary-hover); }

/* Game grid */
.c888-game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
@media (min-width: 1024px) { .c888-game-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } }

/* Game tile */
.c888-game-card { display: flex; flex-direction: column; gap: 6px; }
.c888-game-card__art {
    position: relative; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden;
    background: var(--c888-surface); border: 1px solid var(--c888-border);
}
.c888-game-card__link { position: absolute; inset: 0; display: block; }
.c888-game-card__img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--c888-transition-normal); }
.c888-game-card__placeholder {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 800; color: var(--c888-text-secondary);
    background: radial-gradient(circle at 50% 35%, var(--c888-surface-2), var(--c888-surface));
}
/* Hover: zoom art + reveal green Play CTA over a scrim */
.c888-game-card__play {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.85);
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--c888-primary); color: var(--c888-on-primary);
    font-weight: 800; text-transform: uppercase; font-size: .8rem; letter-spacing: .03em;
    padding: 9px 18px; border-radius: 999px; text-decoration: none;
    opacity: 0; transition: opacity var(--c888-transition-fast), transform var(--c888-transition-fast);
    z-index: 2;
}
.c888-game-card__play-icon { font-size: .7em; }
.c888-game-card__art::after {
    content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.45);
    opacity: 0; transition: opacity var(--c888-transition-fast); z-index: 1;
}
.c888-game-card__art:hover .c888-game-card__img { transform: scale(1.06); }
.c888-game-card__art:hover::after { opacity: 1; }
.c888-game-card__art:hover .c888-game-card__play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.c888-game-card__title {
    font-size: .85rem; color: var(--c888-text-secondary); text-decoration: none;
    text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.c888-game-card__title:hover { color: var(--c888-text); }

/* ============================================================================
   888-style shell — top bar + left sidebar + content + rich footer
   ============================================================================ */
:root { --c888-chrome: #1b1b1b; --c888-chrome-2: #141414; --c888-topbar-h: 60px; --c888-sidebar-w: 210px; }

body { background: var(--c888-secondary); color: var(--c888-text); margin: 0; }

/* ---- Top bar ---- */
.c888-topbar {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; gap: 18px;
    height: var(--c888-topbar-h); padding: 0 16px;
    background: var(--c888-chrome); border-bottom: 1px solid var(--c888-border);
}
.c888-topbar__left { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.c888-topbar__logo .c888-logo,
.c888-topbar__logo a { font-size: 1.6rem; font-weight: 900; color: #fff; text-decoration: none; letter-spacing: .02em; }
.c888-topbar__logo img { max-height: 30px; width: auto; }
.c888-topbar__burger { display: none; flex-direction: column; gap: 4px; background: none; border: 0; cursor: pointer; padding: 6px; }
.c888-topbar__burger span { width: 22px; height: 2px; background: #fff; display: block; }

.c888-search { flex: 1; max-width: 460px; display: flex; align-items: center; gap: 8px;
    background: var(--c888-chrome-2); border: 1px solid var(--c888-border); border-radius: 999px; padding: 0 14px; height: 38px; color: var(--c888-text-secondary); }
.c888-search input { flex: 1; background: none; border: 0; outline: none; color: var(--c888-text); font-size: .9rem; }
.c888-search input::placeholder { color: var(--c888-text-secondary); }

.c888-topbar__right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.c888-topbar__tab { display: inline-flex; align-items: center; gap: 6px; color: var(--c888-text); text-decoration: none;
    font-weight: 700; font-size: .8rem; letter-spacing: .04em; padding: 8px 10px; opacity: .85; }
.c888-topbar__tab:hover { opacity: 1; color: var(--c888-primary); }
.c888-topbar__signup, .c888-topbar__login {
    display: inline-flex; align-items: center; height: 38px; padding: 0 20px; border-radius: 999px;
    font-weight: 800; font-size: .82rem; letter-spacing: .03em; text-transform: uppercase; text-decoration: none; }
.c888-topbar__signup { background: var(--c888-accent-gold); color: #1a1a1a; }
.c888-topbar__signup:hover { filter: brightness(1.07); }
.c888-topbar__login { background: var(--c888-primary); color: var(--c888-on-primary); }
.c888-topbar__login:hover { background: var(--c888-primary-hover); }

/* ---- Shell ---- */
.c888-shell { display: flex; align-items: flex-start; }

/* ---- Sidebar ---- */
.c888-sidebar {
    position: sticky; top: var(--c888-topbar-h); flex: 0 0 var(--c888-sidebar-w); width: var(--c888-sidebar-w);
    height: calc(100vh - var(--c888-topbar-h)); overflow-y: auto;
    background: var(--c888-chrome-2); border-right: 1px solid var(--c888-border); padding: 14px 10px; }
.c888-sidebar__account { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 0 16px; border-bottom: 1px solid var(--c888-border); margin-bottom: 10px; }
.c888-sidebar__avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--c888-surface); color: var(--c888-text-secondary); }
.c888-sidebar__login { display: block; width: 100%; text-align: center; background: var(--c888-primary); color: var(--c888-on-primary);
    font-weight: 800; text-transform: uppercase; font-size: .8rem; padding: 9px 0; border-radius: 6px; text-decoration: none; }
.c888-sidebar__login:hover { background: var(--c888-primary-hover); }
.c888-sidebar__nav { display: flex; flex-direction: column; gap: 2px; }
.c888-sidebar__item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px;
    color: var(--c888-text-secondary); text-decoration: none; font-size: .9rem; font-weight: 600; border-left: 3px solid transparent; }
.c888-sidebar__item:hover { background: var(--c888-surface); color: var(--c888-text); }
.c888-sidebar__item.is-active { color: var(--c888-primary); background: rgba(123,240,55,.08); border-left-color: var(--c888-primary); }
.c888-sidebar__icon { flex-shrink: 0; }

/* ---- Content column ---- */
.c888-content { flex: 1 1 auto; min-width: 0; }
.c888-content .c888-main { display: block; }

/* ---- Rich footer ---- */
.c888-footer { background: var(--c888-chrome-2); border-top: 1px solid var(--c888-border); margin-top: 40px; }
.c888-footer__inner { max-width: 1280px; margin: 0 auto; padding: 36px 20px; }
.c888-footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--c888-border); }
.c888-footer__col-title { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--c888-text); margin: 0 0 12px; }
.c888-footer__col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.c888-footer__col a { color: var(--c888-text-secondary); text-decoration: none; font-size: .85rem; }
.c888-footer__col a:hover { color: var(--c888-primary); }
.c888-footer__logos { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; padding: 22px 0; border-bottom: 1px solid var(--c888-border); }
.c888-logo-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 84px; height: 40px; padding: 0 14px;
    background: #fff; color: #333; border-radius: 6px; font-weight: 700; font-size: .8rem; }
.c888-logo-chip--license { background: var(--c888-surface); color: var(--c888-text-secondary); border: 1px solid var(--c888-border); }
.c888-footer__responsible { display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--c888-surface); border-radius: 8px; padding: 14px 18px; margin: 22px 0; }
.c888-footer__safe { font-weight: 800; letter-spacing: .04em; color: var(--c888-text); }
.c888-footer__age { font-weight: 900; color: var(--c888-accent-gold); border: 2px solid var(--c888-accent-gold); border-radius: 50%; width: 34px; height: 34px; display: grid; place-items: center; }
.c888-footer__legal { color: var(--c888-text-secondary); font-size: .75rem; line-height: 1.6; }

/* ---- Responsive: sidebar off-canvas on mobile ---- */
@media (max-width: 900px) {
    .c888-topbar__burger { display: flex; }
    .c888-search { max-width: none; }
    .c888-topbar__tab { display: none; }
    .c888-sidebar { position: fixed; left: 0; top: var(--c888-topbar-h); z-index: 90; transform: translateX(-100%); transition: transform .25s ease; }
    body.c888-sidebar-open .c888-sidebar { transform: translateX(0); }
    .c888-content { width: 100%; }
}

/* ============================================================================
   GCC layout — horizontal top nav header + welcome-bonus footer bar
   (overrides the earlier sidebar shell; markup now uses .c888-header__bar etc.)
   ============================================================================ */
.c888-header { position: sticky; top: 0; z-index: 100; background: #0d0d0d; border-bottom: 1px solid var(--c888-border); }
.c888-header__bar { display: flex; align-items: center; gap: 16px; height: 58px; max-width: 1440px; margin: 0 auto; padding: 0 18px; }
.c888-header__logo { font-size: 1.7rem; font-weight: 900; letter-spacing: .02em; color: var(--c888-accent-gold); text-decoration: none; flex-shrink: 0; }
.c888-header__logo:hover { filter: brightness(1.1); }

.c888-header__nav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.c888-header__nav::-webkit-scrollbar { display: none; }
.c888-header__tab { position: relative; white-space: nowrap; color: var(--c888-text-secondary); text-decoration: none;
    font-size: .85rem; font-weight: 600; padding: 19px 12px; }
.c888-header__tab:hover { color: var(--c888-text); }
.c888-header__tab.is-active { color: var(--c888-primary); }
.c888-header__tab.is-active::before { content: ""; position: absolute; left: 12px; right: 12px; top: 0; height: 3px; background: var(--c888-primary); border-radius: 0 0 3px 3px; }

.c888-header__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.c888-btn-signup, .c888-btn-login {
    display: inline-flex; align-items: center; height: 36px; padding: 0 20px; border-radius: 999px;
    font-weight: 800; font-size: .8rem; letter-spacing: .03em; text-transform: uppercase; text-decoration: none; }
.c888-btn-signup { background: var(--c888-accent-gold); color: #1a1a1a; }
.c888-btn-signup:hover { filter: brightness(1.07); }
.c888-btn-login { background: var(--c888-primary); color: var(--c888-on-primary); }
.c888-btn-login:hover { background: var(--c888-primary-hover); }

.c888-header__burger { display: none; flex-direction: column; gap: 4px; background: none; border: 0; cursor: pointer; padding: 6px; }
.c888-header__burger span { width: 22px; height: 2px; background: #fff; display: block; }

/* Welcome-bonus bar (footer top) */
.c888-footer__welcome { display: flex; align-items: center; justify-content: center; gap: 26px; flex-wrap: wrap;
    background: #111; border-bottom: 1px solid var(--c888-border); padding: 18px 20px; }
.c888-footer__welcome-text { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; justify-content: center; }
.c888-footer__welcome-text strong { color: var(--c888-text); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; }
.c888-footer__welcome-text span { color: var(--c888-primary); font-weight: 800; font-size: 1.05rem; }
.c888-footer__join { background: var(--c888-accent-gold); color: #1a1a1a; font-weight: 800; text-transform: uppercase;
    padding: 11px 26px; border-radius: 999px; text-decoration: none; font-size: .8rem; letter-spacing: .03em; }
.c888-footer__join:hover { filter: brightness(1.07); }
.c888-vip-badge { color: var(--c888-accent-gold); font-weight: 900; font-size: 1.5rem; }
.c888-vip-badge em { color: var(--c888-text); font-style: normal; font-size: .9rem; vertical-align: super; }

/* Full-width content (no sidebar in GCC layout) */
.c888-main { display: block; width: 100%; }

@media (max-width: 900px) {
    .c888-header__burger { display: flex; order: -1; }
    .c888-header__nav { position: fixed; left: 0; right: 0; top: 58px; flex-direction: column; background: #0d0d0d;
        padding: 8px 12px; border-bottom: 1px solid var(--c888-border); transform: translateY(-120%); transition: transform .25s ease; overflow: visible; }
    body.c888-nav-open .c888-header__nav { transform: translateY(0); }
    .c888-header__tab { padding: 12px; width: 100%; }
    .c888-header__tab.is-active::before { left: 0; top: auto; bottom: 0; right: auto; width: 3px; height: 100%; }
}
