/*
Theme Name: Pixel Modern
Theme URI: https://example.com/pixel-modern
Author: Gemini
Author URI: https://example.com
Description: A clean, modern, pixel-art inspired WordPress theme with retro UI elements and high readability.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pixelmodern
*/

/* Reset & Base Variables */
:root {
    --bg-color: #f4f4f5;
    --card-bg: #ffffff;
    --text-main: #18181b;
    --text-muted: #52525b;
    --border-color: #000000;
    --accent-primary: #ff0055; /* Neon Pink */
    --accent-hover: #e6004c;
    --accent-secondary: #00e676; /* Neon Green */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    background-image: radial-gradient(#d4d4d8 1px, transparent 1px);
    background-size: 20px 20px; /* Subtle pixel grid background */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Press Start 2P', monospace;
    color: var(--text-main, #000);
    line-height: 1.4;
    margin-top: 0;
    margin-bottom: 20px;
    text-transform: uppercase;
}

h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; }
h5 { font-size: 12px; }
h6 { font-size: 10px; }

p, span, div, li, td, th {
    font-family: 'Inter', sans-serif;
    color: var(--text-main, #000);
    font-size: 16px;
    line-height: 1.6;
}

p {
    margin-top: 0;
    margin-bottom: 20px;
}

a {
    color: var(--accent-primary, #ff0055);
    text-decoration: none;
    transition: color 0.1s;
}

a:hover {
    color: var(--accent-hover, #e6004c);
    text-decoration: underline;
    text-decoration-thickness: 2px;
}


/* 3. Global Buttons (Applies pixel style to ANY button automatically) */
button, 
input[type="button"], 
input[type="reset"], 
input[type="submit"] {
    display: inline-block;
    background-color: var(--accent-primary, #ff0055);
    color: #ffffff;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    text-transform: uppercase;
    text-decoration: none;
    padding: 12px 20px;
    border: 4px solid var(--border-color, #000);
    box-shadow: 4px 4px 0px var(--border-color, #000);
    transition: all 0.1s;
    cursor: pointer;
    box-sizing: border-box;
}

button:hover, 
input[type="button"]:hover, 
input[type="reset"]:hover, 
input[type="submit"]:hover {
    background-color: var(--accent-hover, #e6004c);
    color: #ffffff;
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--border-color, #000);
}

button:active, 
input[type="button"]:active, 
input[type="reset"]:active, 
input[type="submit"]:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--border-color, #000);
}

/* 4. Global Form Inputs (Text areas, input fields, selects) */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
textarea,
select {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border: 3px solid #000;
    background: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #000;
    margin-bottom: 20px;
    transition: all 0.2s ease;
    border-radius: 0; /* Prevents mobile browsers from rounding edges */
}

input:focus, 
textarea:focus, 
select:focus {
    outline: none;
    box-shadow: 4px 4px 0px #000;
    transform: translate(-2px, -2px);
}

/* 5. Global Lists */
ul, ol {
    margin-top: 0;
    margin-bottom: 20px;
    padding-left: 20px;
}

ul {
    list-style-type: square; /* 90s blocky bullets */
}

/* 6. Global Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Layout */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background-color: var(--card-bg);
    border-bottom: 4px solid var(--border-color);
    padding: 40px 0;
    margin-bottom: 60px;
    box-shadow: 0 8px 0 rgba(0,0,0,1);
}

.site-title {
    font-size: 24px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.site-title a {
    color: var(--text-main);
    text-decoration: none;
}

.site-description {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Pixel Card (Posts & Widgets) */
.pixel-card {
    background-color: var(--card-bg);
    border: 4px solid var(--border-color);
    box-shadow: 8px 8px 0px var(--border-color);
    padding: 30px;
    margin-bottom: 40px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pixel-card:hover {
    transform: translate(-4px, -4px);
    box-shadow: 12px 12px 0px var(--border-color);
}

/* Post Content */
.post-title {
    font-size: 18px;
    margin-bottom: 15px;
}

.post-title a {
    color: var(--text-main);
    text-decoration: none;
}

.post-title a:hover {
    color: var(--accent-primary);
    text-decoration: none;
}

.post-meta {
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    color: var(--text-muted);
    margin-bottom: 20px;
    text-transform: uppercase;
}

.post-excerpt {
    margin-bottom: 25px;
}

/* Buttons */
.pixel-btn {
    display: inline-block;
    background-color: var(--accent-primary);
    color: #ffffff;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    text-transform: uppercase;
    text-decoration: none;
    padding: 12px 20px;
    border: 4px solid var(--border-color);
    box-shadow: 4px 4px 0px var(--border-color);
    transition: all 0.1s;
    cursor: pointer;
}

.pixel-btn:hover {
    background-color: var(--accent-hover);
    color: #ffffff;
    text-decoration: none;
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--border-color);
}

.pixel-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--border-color);
}

/* Pagination */
.pixel-pagination {
    margin: 40px 0;
    text-align: center;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
}

.pixel-pagination .page-numbers {
    display: inline-block;
    padding: 10px 15px;
    border: 4px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-main);
    margin: 0 5px;
    box-shadow: 4px 4px 0px var(--border-color);
}

.pixel-pagination .page-numbers.current {
    background: var(--accent-secondary);
}

.pixel-pagination a.page-numbers:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--border-color);
    text-decoration: none;
}

/* Footer */
.site-footer {
    margin-top: 60px;
    padding-bottom: 40px;
}

.footer-card {
    text-align: center;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: var(--text-muted);
}

/* ==========================================================================
   Navigation Menus (Primary & Footer)
   ========================================================================== */

/* Reset list styles and align horizontally */
.primary-menu, 
.footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* Base styling for menu links */
.primary-menu li a, 
.footer-menu li a {
    text-decoration: none;
    color: #000; /* Default text color */
    font-family: 'Press Start 2P', cursive; /* Using your enqueued pixel font */
    font-size: 12px;
    display: inline-block;
    padding: 8px 12px;
    position: relative;
    /* Use 'steps' to make the transition choppy like an 8-bit game */
    transition: transform 0.1s steps(3), background-color 0.1s, color 0.1s;
    border: 2px solid transparent; 
}

/* ==========================================================================
   Hover Animation: Pixel Jump & Invert
   ========================================================================== */
.primary-menu li a:hover, 
.footer-menu li a:hover {
    color: #fff;
    background-color: #000;
    border: 2px solid #000;
    transform: translateY(-4px); /* Makes the button "jump" up */
    /* Adds a hard blocky shadow to complete the retro 3D button look */
    box-shadow: 4px 4px 0px #888; 
}

/* ==========================================================================
   Current Page Marker: Blinking Retro Cursor
   ========================================================================== */
/* Target the class WordPress automatically adds to the active menu item */
.primary-menu li.current-menu-item > a::before,
.footer-menu li.current-menu-item > a::before {
    content: "► "; /* The classic retro cursor */
    display: inline-block;
    color: #e53935; /* Give the cursor a pop of arcade red */
    margin-right: 5px;
    animation: pixel-blink 1s step-end infinite;
}

/* Ensure the cursor stays white when hovering over the current page */
.primary-menu li.current-menu-item > a:hover::before,
.footer-menu li.current-menu-item > a:hover::before {
    color: #fff; 
}

/* Animation for the blinking cursor */
@keyframes pixel-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Center footer menu specifically */
.footer-navigation .footer-menu {
    justify-content: center;
}
/* ==========================================================================
   Header Layout (Flexbox)
   ========================================================================== */

/* Turn the header container into a flex row */
.header-container {
    display: flex;
    justify-content: space-between; /* Pushes branding left and menu right */
    align-items: center; /* Vertically centers the items on the same line */
    flex-wrap: wrap; /* Ensures the menu drops down cleanly on mobile screens */
    gap: 20px; /* Adds breathing room if they get too close on smaller screens */
}

/* Keep the title and description stacked neatly on the left */
.site-branding {
    display: flex;
    flex-direction: column;
}

/* Ensure the navigation menu container aligns correctly */
.main-navigation {
    display: flex;
    align-items: center;
}

/* Secondary Button Style */
.pixel-btn-outline {
    background: #fff;
    color: #000;
}
.pixel-btn-outline:hover {
    background: #000;
    color: #fff;
}

/* ==========================================================================
   90s Elements & Custom Grids
   ========================================================================== */

/* Retro Marquee */
.pixel-marquee {
    border-top: 4px solid #000;
    border-bottom: 4px solid #000;
    background-color: #ffeb3b; /* Arcade Yellow */
    padding: 8px 0;
    margin-bottom: 40px;
    overflow: hidden;
}

.pixel-marquee marquee {
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    line-height: 1.5;
    color: #000;
}

/* Projects & Clients Grid */
.cpt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

.cpt-card {
    text-align: center;
    transition: transform 0.1s steps(3);
}

.cpt-card:hover {
    transform: translateY(-5px);
}

.cpt-logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
    border: 3px solid #000;
    background: #fff;
    padding: 10px;
    box-shadow: 4px 4px 0px #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cpt-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    image-rendering: pixelated; /* Enhances the 90s vibe for images */
}


.pixel-list {
    list-style-type: square;
    padding-left: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.pixel-list li {
    margin-bottom: 10px;
    color: #333;
}

/* ==========================================================================
   Homepage Layout: The Retro Bento Grid
   ========================================================================== */

/* The Main Bento Grid Container */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(150px, auto);
    gap: 20px;
    margin: 40px 0 60px;
}

/* Base style for every panel in the Bento Box */
.bento-panel {
    background: #fff;
    border: 4px solid #000;
    box-shadow: 6px 6px 0px #000;
    padding: 25px;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
}

.bento-panel:hover {
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0px #000;
}

/* Cute pixel tabs on the top left of each panel */
.bento-tab {
    position: absolute;
    top: -14px;
    left: 15px;
    background: #000;
    color: #fff;
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    padding: 4px 8px;
}

/* --- specific panel sizes --- */

/* Avatar takes up 1 column but stretches 2 rows tall */
.panel-avatar {
    grid-column: span 1;
    grid-row: span 2;
    background: #ffeb3b; /* Arcade Yellow */
    align-items: center;
    justify-content: center;
    padding: 15px;
}

/* Intro dialogue takes up 3 columns */
.panel-intro {
    grid-column: span 3;
    grid-row: span 1;
    justify-content: center;
}

/* Stats (CV) spans across 3 columns */
.panel-stats {
    grid-column: span 3;
    grid-row: span 1;
    background: #69d0ff;
    color: #333;
}

/* Projects & Clients share the next row */
.panel-inventory {
    grid-column: span 2;
    grid-row: span 2;
    background: #e0f7fa; /* Cyan tint */
}

.panel-guild {
    grid-column: span 2;
    grid-row: span 2;
    background: #fce4ec; /* Pink tint */
}

/* Scrolling Marquee spans the entire width (4 columns) */
.panel-marquee {
    grid-column: span 4;
    padding-top: 30px !important;
    border-left: none;
    border-right: none;
    box-shadow: none;
    background: transparent;
}

/* Mobile Responsiveness: Stack everything on smaller screens */
@media (max-width: 900px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
    .panel-avatar, .panel-intro, .panel-stats, .panel-inventory, .panel-guild, .panel-marquee {
        grid-column: span 1;
        grid-row: auto;
    }
}
/* ==========================================================================
   Global Container (Standardizing Site Width)
   ========================================================================== */
.container {
    max-width: 1200px;      /* Stops the site from stretching too wide on big screens */
    margin: 0 auto;         /* Automatically centers the container in the middle of the screen */
    padding: 0 20px;        /* Adds a little breathing room so content doesn't touch the screen edges on phones */
    width: 100%;            /* Ensures the container scales down properly on smaller screens */
    box-sizing: border-box; /* Ensures padding is included in the total width calculation */
}
/* ==========================================================================
   Neo-Brutalist Modal Popups (Email & Guestbook)
   ========================================================================== */

/* The Modal Overlay Background */
.pixel-modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); 
    backdrop-filter: blur(5px); /* Modern blur effect */
    animation: modalFadeIn 0.3s ease-out forwards;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modern Brutalist Modal Content Box */
.pixel-modal .modal-content {
    background-color: #fff; /* Clean white background */
    margin: 8% auto;
    width: 90%;
    max-width: 450px;
    border: 4px solid #000;
    box-shadow: 12px 12px 0px #000; /* Deep, sharp drop shadow */
    position: relative;
    transform: translateY(20px);
    animation: modalSlideUp 0.3s ease-out forwards;
}

@keyframes modalSlideUp {
    from { transform: translateY(20px); }
    to { transform: translateY(0); }
}

/* Modern Header Bar */
.pixel-modal-header {
    background-color: #ffeb3b; /* Arcade Yellow for high contrast */
    border-bottom: 4px solid #000;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pixel-modal-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    color: #000;
    margin: 0;
}

/* The New "Close" Button */
.pixel-close-btn {
    background: #e53935; /* Punchy Red */
    color: #fff;
    border: 3px solid #000;
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    padding: 5px 8px;
    cursor: pointer;
    box-shadow: 2px 2px 0px #000;
    transition: transform 0.1s steps(2);
}

.pixel-close-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 0px 0px 0px #000;
}

.pixel-modal-body {
    padding: 30px;
    background: #fff;
}

/* Modern Form Inputs inside Modal */
.pixel-form label {
    display: block;
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    margin-bottom: 10px;
    color: #000;
}

.pixel-form input[type="text"],
.pixel-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border: 3px solid #000; /* Solid borders instead of inset */
    background: #f9f9f9;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #000;
    margin-bottom: 20px;
    transition: all 0.2s ease;
}

.pixel-form input[type="text"]:focus,
.pixel-form textarea:focus {
    outline: none;
    background: #fff;
    box-shadow: 4px 4px 0px #000; /* Adds pop-out shadow on focus */
    transform: translate(-2px, -2px);
}

/* ==========================================================================
   Typewriter Blinking Cursor
   ========================================================================== */
.blinking-cursor {
    font-family: 'Press Start 2P', cursive;
    font-weight: bold;
    color: #000;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ==========================================================================
   Mobile Navigation Menu (Hamburger)
   ========================================================================== */

/* Hide the toggle button by default (on desktop) */
.menu-toggle {
    display: none;
    background: #000;
    color: #fff;
    border: 3px solid #000;
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    padding: 10px;
    cursor: pointer;
    box-shadow: 4px 4px 0px #888;
}

.menu-toggle:active {
    transform: translate(2px, 2px);
    box-shadow: 0px 0px 0px #000;
}

/* Mobile Screen Breakpoint */
@media screen and (max-width: 768px) {
    
    /* Make header layout handle the toggle button */
    .header-container {
        flex-wrap: wrap; /* Allows menu to drop below the branding */
    }

    /* Show the hamburger button */
    .menu-toggle {
        display: block;
        margin-left: auto; /* Pushes button to the far right */
    }

    /* Hide the navigation wrapper by default on mobile */
    .main-navigation {
        display: none;
        width: 100%; /* Take up full width when opened */
        margin-top: 15px;
    }

    /* Class added by JavaScript when toggle is clicked */
    .main-navigation.toggled {
        display: block;
    }

    /* Style the mobile menu list as a vertical stack */
    .primary-menu {
        flex-direction: column; /* Stack items vertically */
        background: #fff;
        border: 4px solid #000;
        box-shadow: 6px 6px 0px #000;
        padding: 10px;
        gap: 0; /* Remove gap for traditional stacked look */
    }

    .primary-menu li {
        border-bottom: 2px dashed #ccc;
    }
    
    .primary-menu li:last-child {
        border-bottom: none;
    }

    /* Make links fill the whole row for easy finger tapping */
    .primary-menu li a {
        display: block;
        padding: 15px 10px;
        width: 100%;
        box-sizing: border-box;
    }

    /* Remove the 'jump' hover effect on mobile */
    .primary-menu li a:hover {
        transform: none;
        box-shadow: none;
    }
}
/* ==========================================================================
   Typewriter Panel Responsiveness & Overflow Control
   ========================================================================== */

/* Target the specific wrapper holding the typewriter text */
.panel-marquee > div {
    width: 100%;
    overflow: hidden;         /* Prevents the text from stretching outside the box */
    text-overflow: ellipsis;  /* Safely clips the text if it gets too long */
    white-space: nowrap;      /* Keeps the text on a single line */
}

/* Mobile responsive font sizing */
@media screen and (max-width: 768px) {
    /* Reduce container height slightly for mobile */
    .panel-marquee.pixel-marquee {
        height: 60px !important; 
        padding: 0 10px !important;
    }
    
    /* Shrink the pixel font size on small screens */
    .panel-marquee > div {
        font-size: 12px !important; /* Shrunk from 24px */
    }
}

/* Very small phones (like iPhone SE) */
@media screen and (max-width: 400px) {
    .panel-marquee > div {
        font-size: 10px !important;
    }
}

/* --- Sidebar Mobile Stacking Fix --- */
@media screen and (max-width: 900px) {
    /* Change the flex layout to stack vertically */
    main.site-main {
        flex-direction: column !important;
        gap: 20px !important;
    }

    /* Make the primary content area take full width */
    .primary-content {
        flex: none !important;
        width: 100% !important;
    }

    /* Override inline fixed width so the sidebar stacks underneath */
    aside#secondary.widget-area {
        width: 100% !important;
        flex-shrink: 1 !important;
        margin-top: 20px;
    }
}
