/*
 Theme Name: Gamer Heaven

 Author: Grimms3dworlds
 Author URI: https://grimms3dworlds.ddns.net
 Description: A classic WordPress theme with fixed header/footer and two-column layout for gaming enthusiasts.
 Version: 1.0.7
 License: GNU General Public License v2 or later
 License URI: http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain: gamer-heaven
*/

:root {
    --primary-color: #00ffcc;
    --accent-color: #ff007a;
    --background-color: #1a1a1a;
    --content-background: #2e2e2e;
    --sidebar-background: #222;
    --gradient-start: #1c2526;
    --gradient-end: #2e3b3e;
    --border-color: #444;
    --text-color: #181717;
    --meta-color: #b0b0b0;
    --primary-color-rgb: 0, 255, 204;
    --accent-color-rgb: 255, 0, 122;
    --body-font: 'Orbitron', Arial, sans-serif;
}

body {
    margin: 0;
    font-family: var(--body-font);
    background: var(--background-color);
    color: var(--text-color);
    overflow-y: auto;
    font-size: 16px;
}

header,
footer {
    position: fixed;
    width: 100%;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    color: var(--primary-color);
    z-index: 1000;
    border-bottom: 2px solid var(--primary-color);
}

header {
    top: 0;
    height: 150px;
    margin: 0;
    padding: 0;
}

header.has-admin-bar {
    top: 32px;
}

@media screen and (max-width: 782px) {
    header.has-admin-bar {
        top: 46px;
    }
}

.header-container {
    width: 1232px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    height: 150px;
    box-sizing: border-box;
    padding: 0;
    gap: 20px;
}

footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    color: var(--primary-color);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.footer-container {
    width: 1232px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    height: 100%;
}

.footer-content p {
    margin: 0;
    font-size: 14px;
    color: var(--meta-color);
}

.social-icons {
    display: flex;
    gap: 10px;
    padding: 8px 15px;
    background: var(--content-background);
    border-radius: 50px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3);
}

.social-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 8px;
}

.social-links li {
    margin: 0;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--sidebar-background);
    border-radius: 50%;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.social-links a:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background: var(--primary-color);
}

.social-links a img.social-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: brightness(100%);
    /* Ensure icons are visible */
}

.social-links a:hover img.social-icon {
    filter: brightness(0%) invert(1);
    /* Darken icon on hover for contrast */
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Background Images */
.gamer-heaven-background-image {
    position: fixed;
    z-index: -1;
    max-width: 50vw;
    /* Fill up to half the viewport width */
    max-height: 100vh;
    /* Full viewport height */
    object-fit: cover;
    /* Crop to fit dimensions */
    opacity: 0.8;
    transition: opacity 0.3s;
}

.gamer-heaven-background-image:hover {
    opacity: 1;
}

.gamer-heaven-left-background {
    bottom: 70px;
    /* Above footer (60px + 10px gap) */
    left: 0;
    object-position: left bottom;
    /* Align crop to bottom-left */
}

.gamer-heaven-right-background {
    bottom: 70px;
    /* Above footer (60px + 10px gap) */
    right: 0;
    object-position: right bottom;
    /* Align crop to bottom-right */
}

@media (max-width: 600px) {
    .footer-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 5px 0;
    }

    .social-icons {
        margin: 0 auto;
    }

    .gamer-heaven-background-image {
        max-width: 40vw;
        /* Smaller on mobile to avoid overlap */
        max-height: 80vh;
        /* Limit height on mobile */
    }

    .gamer-heaven-left-background {
        bottom: 80px;
        /* Adjusted for smaller footer */
        left: 0;
    }

    .gamer-heaven-right-background {
        bottom: 80px;
        /* Adjusted for smaller footer */
        right: 0;
    }
}

.container {
    margin: 150px auto 60px;
    width: 1232px;
    max-height: calc(100vh - 250px);
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    box-sizing: border-box;
    padding: 0;
}

.container.has-admin-bar {
    margin-top: 182px;
    max-height: calc(100vh - 282px);
}

@media screen and (max-width: 782px) {
    .container.has-admin-bar {
        margin-top: 196px;
        max-height: calc(100vh - 296px);
    }
}

.container:has(.sidebar.has-scrollbar) {
    width: 1290px;
}

.main-content {
    flex: 0 0 1000px;
    background: var(--content-background);
    padding: 20px 20px 20px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    max-height: calc(100vh - 250px);
    box-sizing: border-box;
    margin: 0;
}

.container.has-admin-bar .main-content {
    max-height: calc(100vh - 282px);
}

@media screen and (max-width: 782px) {
    .container.has-admin-bar .main-content {
        max-height: calc(100vh - 296px);
    }
}

.sidebar {
    flex: 0 0 282px;
    align-self: flex-start;
    background: var(--sidebar-background);
    padding: 4px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    max-height: calc(100vh - 250px);
    box-sizing: border-box;
    margin: 0;
}

.container.has-admin-bar .sidebar {
    max-height: calc(100vh - 282px);
}

@media screen and (max-width: 782px) {
    .container.has-admin-bar .sidebar {
        max-height: calc(100vh - 296px);
    }
}

.sidebar.has-scrollbar {
    flex: 0 0 260px;
}

/* Sidebar widget styles */
.sidebar .widget {
    margin: 5px auto 0px !important;
    padding: 0px;
}

.sidebar .widget-title {
    font-size: 18px;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-transform: uppercase;
}

/* Ensure sidebar is visible even if empty for debugging */
.sidebar:empty::before {
    content: "Sidebar is empty. Add widgets in Appearance > Widgets.";
    color: var(--meta-color);
    font-size: 14px;
}

/* More specific margin reset for nested elements */
.sidebar>* * {
    margin: 10px auto 0px !important;
}

/* Custom Scrollbar Styles */
.main-content::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
    width: 8px;
}

.main-content::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track {
    background: var(--gradient-start);
    border-radius: 4px;
}

.main-content::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
    box-shadow: 0 0 5px rgba(var(--primary-color-rgb), 0.5);
}

.main-content::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

.main-content,
.sidebar {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--gradient-start);
}

.site-branding {
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
}

.site-logo img {
    max-height: 100px;
    width: auto;
    filter: drop-shadow(0 0 5px var(--primary-color));
    margin: 0;
    padding: 0;
}

.header-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 150px;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.site-text {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

.site-title {
    margin: 0;
    font-size: 26px;
    font-weight: 400;
    text-transform: uppercase;
    line-height: 1.2;
    font-family: var(--body-font);
}

.site-title a {
    color: var(--primary-color);
    text-decoration: none;
    text-shadow: 0 0 10px var(--primary-color);
}

.site-title a:hover {
    color: var(--accent-color);
}

.site-description {
    margin: 5px 0 0;
    font-size: 14px;
    font-weight: 400;
    text-transform: uppercase;
    color: var(--primary-color);
    font-family: var(--body-font);
    line-height: 1.2;
}

.header-navigation {
    display: flex;
    justify-content: flex-end;
    margin: 0;
    padding: 0;
}

.main-navigation {
    text-align: right;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-navigation ul li {
    display: inline-block;
    margin-left: 5px;
    position: relative;
}

.main-navigation ul li a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 16px;
    font-weight: 400;
    text-transform: uppercase;
    padding: 5px 10px;
    transition: all 0.3s ease;
    font-family: var(--body-font);
}

.main-navigation ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--gradient-start);
    padding: 10px;
    border: 1px solid var(--primary-color);
    z-index: 1000;
}

.main-navigation ul li:hover>ul {
    display: block;
}

.main-navigation ul ul li {
    display: block;
    margin: 0;
}

.main-navigation ul ul li a {
    /* Style submenu links */
    color: var(--text-color);
    font-size: 14px;
    font-family: var(--body-font);
    padding: 8px 15px;
    /* Add padding for better spacing */
    display: block;
    /* Make links full-width for easier clicking */
    white-space: nowrap;
    /* Prevent text wrapping to ensure submenu width fits content */
    transition: background 0.3s, color 0.3s;
    /* Smooth transition for hover effects */
}

.main-navigation ul ul li a:hover {
    /* Hover effect for submenu links */
    color: var(--primary-color);
    background: var(--sidebar-background);
}

/* Nested Submenus (Third Level and Beyond) */
.main-navigation ul ul ul {
    /* Position nested submenus to the right of their parent */
    top: 0;
    left: 100%;
    margin-left: 1px;
    /* Small gap to prevent overlap */
}

/* Fallback menu styling */
.main-navigation .menu>ul,
.main-navigation .menu>div>ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-navigation .menu>ul li,
.main-navigation .menu>div>ul li {
    display: inline-block;
    margin-left: 20px;
    position: relative;
}

.main-navigation .menu>ul li a,
.main-navigation .menu>div>ul li a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 16px;
    font-weight: 400;
    text-transform: uppercase;
    padding: 5px 10px;
    transition: all 0.3s ease;
    font-family: var(--body-font);
}

.main-navigation ul li a:hover,
.main-navigation .menu>ul li a:hover,
.main-navigation .menu>div>ul li a:hover {
    color: var(--accent-color);
    background: rgba(var(--accent-color-rgb), 0.2);
    border-radius: 5px;
}

/* Post Layout */
.posts-wrapper {
    max-width: 700px;
    margin: 0 auto;
}

.post-item {
    background: var(--gradient-start);
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(var(--primary-color-rgb), 0.3);
}

.post-thumbnail {
    width: 100%;
    overflow: hidden;
}

.post-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-bottom: 2px solid var(--primary-color);
    filter: drop-shadow(0 0 5px var(--primary-color));
    overflow: hidden;
}

.post-title {
    font-size: 22px;
    margin: 15px 0;
    font-family: var(--body-font);
    font-weight: 400;
}

.post-title a {
    color: var(--primary-color);
    text-decoration: none;
    text-transform: uppercase;
}

.post-title a:hover {
    color: var(--accent-color);
}

.post-meta {
    font-size: 13px;
    color: var(--meta-color);
    margin-bottom: 15px;
    font-family: var(--body-font);
}

.post-meta a {
    color: var(--primary-color);
    text-decoration: none;
}

.post-meta a:hover {
    color: var(--accent-color);
}

.post-excerpt,
.post-content {
    font-size: 15px;
    line-height: 1.6;
    font-family: var(--body-font);
}

.post-gallery {
    margin: 20px 0;
}

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

.post-gallery .gallery-item {
    margin: 0;
}

.post-gallery .gallery-item img {
    width: 100%;
    height: auto;
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    transition: transform 0.3s ease;
}

.post-gallery .gallery-item img:hover {
    transform: scale(1.05);
}

.read-more {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary-color);
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 400;
    border-radius: 5px;
    transition: background 0.3s ease;
    font-family: var(--body-font);
    font-size: 14px;
}

.read-more:hover {
    background: var(--accent-color);
    color: #fff;
}

/* Pagination */
.nav-links {
    text-align: center;
    margin: 20px 0;
}

.nav-links a,
.nav-links span {
    display: inline-block;
    padding: 10px 15px;
    margin: 0 5px;
    color: var(--primary-color);
    text-decoration: none;
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    font-family: var(--body-font);
    font-size: 14px;
}

.nav-links .current {
    background: var(--primary-color);
    color: #1a1a1a;
}

.nav-links a:hover {
    background: var(--accent-color);
    color: #fff;
}

/* Ensure Admin Only Checkbox is Visible in Customizer */
.customize-control-nav_menu_item .field-admin-only {
    display: block !important;
    margin: 10px 0;
    padding: 5px;
}

.customize-control-nav_menu_item .field-admin-only label {
    font-size: 14px;
    color: #333;
}

.customize-control-nav_menu_item .gamer-heaven-admin-only-checkbox {
    margin-right: 5px;
}

.featured-image {}

.featured-img {
    aspect-ratio: unset;

    max-width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    object-position: 50% 50%;
}

