@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* Original Game Boy Monochrome (DMG-01) Theme */

body.theme-gameboy {
    /* Game Boy DMG Color Palette */
    --gb-darkest: #0f380f;
    --gb-dark: #306230;
    --gb-light: #8bac0f;
    --gb-lightest: #9bbc0f;

    /* Theme Overrides */
    --background: var(--gb-lightest) !important;
    --primary: var(--gb-darkest) !important;
    --secondary: var(--gb-dark) !important;
    --image-bg: var(--gb-light) !important;
    --grey-light: var(--gb-light) !important;
    --grey-lightest: var(--gb-lightest) !important;
    
    /* Font overrides */
    --font-serif: 'Press Start 2P', "Courier New", Courier, monospace !important;
    --font-body: 'Press Start 2P', "Courier New", Courier, monospace !important;
    --font-sans: 'Press Start 2P', "Courier New", Courier, monospace !important;
    --font-mono: 'Press Start 2P', "Courier New", Courier, monospace !important;

    background-color: var(--gb-lightest) !important;
    color: var(--gb-darkest) !important;
    image-rendering: pixelated !important;

    /* Turn-on Screen Flicker Animation */
    animation: gb-turn-on 0.6s ease-out;
    position: relative;
}

/* Screen turn-on effect */
@keyframes gb-turn-on {
    0% { filter: brightness(2.5) contrast(1.5); }
    30% { filter: brightness(0.3) contrast(0.7); }
    60% { filter: brightness(1.3) contrast(1.2); }
    100% { filter: none; }
}

/* Dot matrix LCD screen subpixel grid overlay */
body.theme-gameboy::after {
    content: "" !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-image: linear-gradient(rgba(15, 56, 15, 0.05) 50%, transparent 50%),
                      linear-gradient(90deg, rgba(15, 56, 15, 0.05) 50%, transparent 50%) !important;
    background-size: 3px 3px, 3px 3px !important;
    z-index: 999999 !important;
    pointer-events: none !important;
    opacity: 0.95 !important;
}

/* Layout Blocks */
body.theme-gameboy .single-post__body,
body.theme-gameboy .main-content,
body.theme-gameboy .subhero,
body.theme-gameboy .search-header,
body.theme-gameboy .section,
body.theme-gameboy .wp-block-quote,
body.theme-gameboy .wp-block-list,
body.theme-gameboy ol,
body.theme-gameboy ul,
body.theme-gameboy .site-header,
body.theme-gameboy footer.site-footer,
body.theme-gameboy .section--now-stack,
body.theme-gameboy .section--newsletter-global,
body.theme-gameboy .testimonial,
body.theme-gameboy .wp-block-cover {
    background-color: var(--gb-lightest) !important;
    background: var(--gb-lightest) !important;
    color: var(--gb-darkest) !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* Retro styling: solid chunky borders */
body.theme-gameboy .site-header {
    border-bottom: 6px double var(--gb-darkest) !important;
}

body.theme-gameboy footer.site-footer {
    border-top: 6px double var(--gb-darkest) !important;
}

body.theme-gameboy .site-footer__clients {
    background-color: var(--gb-lightest) !important;
    background: var(--gb-lightest) !important;
    border-top: 3px solid var(--gb-darkest) !important;
    border-bottom: 3px solid var(--gb-darkest) !important;
}

body.theme-gameboy .section--now-stack,
body.theme-gameboy .section--newsletter-global {
    border-top: 4px solid var(--gb-darkest) !important;
    border-bottom: 4px solid var(--gb-darkest) !important;
}

/* Typography elements */
body.theme-gameboy p, 
body.theme-gameboy li, 
body.theme-gameboy span,
body.theme-gameboy div,
body.theme-gameboy strong,
body.theme-gameboy em,
body.theme-gameboy time,
body.theme-gameboy cite,
body.theme-gameboy .footer-nav__link,
body.theme-gameboy .site-footer__copy,
body.theme-gameboy .site-footer p,
body.theme-gameboy .single-post__byline,
body.theme-gameboy .reading-time {
    font-size: 0.75rem !important;
    line-height: 1.8 !important;
    color: var(--gb-darkest) !important;
    text-shadow: none !important;
}

body.theme-gameboy h1,
body.theme-gameboy h2,
body.theme-gameboy h3,
body.theme-gameboy h4,
body.theme-gameboy h5,
body.theme-gameboy h6 {
    color: var(--gb-darkest) !important;
    text-transform: uppercase !important;
    text-shadow: none !important;
    font-weight: 900 !important;
    line-height: 1.8 !important;
}

body.theme-gameboy h1 { font-size: clamp(0.95rem, 2.5vw, 1.5rem) !important; }
body.theme-gameboy h2 { font-size: clamp(0.85rem, 1.8vw, 1.3rem) !important; line-height: 1.8 !important; }
body.theme-gameboy h3 { font-size: clamp(0.8rem, 1.5vw, 1.1rem) !important; }
body.theme-gameboy h4, 
body.theme-gameboy h5, 
body.theme-gameboy h6 { font-size: 0.75rem !important; }

/* Links and Interactive Elements */
body.theme-gameboy a {
    color: var(--gb-darkest) !important;
    text-decoration: underline !important;
    text-underline-offset: 3px !important;
    text-decoration-thickness: 2px !important;
}

/* Close up underlining on card heading links so they don't collision with subsequent lines */
body.theme-gameboy .tile h2 a {
    text-underline-offset: 1px !important;
}

body.theme-gameboy a:hover {
    color: var(--gb-lightest) !important;
    background-color: var(--gb-darkest) !important;
    text-decoration: none !important;
}

/* Buttons, Inputs, Selector styling */
body.theme-gameboy button,
body.theme-gameboy input,
body.theme-gameboy select,
body.theme-gameboy textarea {
    background-color: var(--gb-light) !important;
    color: var(--gb-darkest) !important;
    border: 3px solid var(--gb-darkest) !important;
    border-radius: 0 !important;
    font-family: 'Press Start 2P', monospace !important;
    font-size: 0.7rem !important;
    padding: 0.5rem 1rem !important;
    box-shadow: 3px 3px 0px var(--gb-dark) !important;
    text-transform: uppercase !important;
    transition: none !important;
}

body.theme-gameboy button:hover,
body.theme-gameboy input[type="submit"]:hover {
    background-color: var(--gb-darkest) !important;
    color: var(--gb-lightest) !important;
    box-shadow: none !important;
    transform: translate(3px, 3px) !important;
}

body.theme-gameboy select {
    appearance: none !important;
    -webkit-appearance: none !important;
    padding-right: 2rem !important;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjgiPjxwYXRoIGQ9Ik0wIDBoOHRMNCA4eiIgZmlsbD0i,#0f380f" />PHBhdGggZD0iTTAgMGg4TDQgOHoiIGZpbGw9IiMwZjM4MGYiLz48L3N2Zz4=') !important;
    background-repeat: no-repeat !important;
    background-position: calc(100% - 0.75rem) center !important;
}

/* Image styling */
body.theme-gameboy img,
body.theme-gameboy video,
body.theme-gameboy iframe {
    image-rendering: pixelated !important;
    image-rendering: -moz-crisp-edges !important;
    image-rendering: crisp-edges !important;
    border: 4px solid var(--gb-darkest) !important;
    background-color: var(--gb-light) !important;
    padding: 2px !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

body.theme-gameboy .wp-block-image img {
    max-width: 100% !important;
}

body.theme-gameboy .wp-block-image.size-large {
    background-color: var(--gb-darkest) !important;
    background: var(--gb-darkest) !important;
}

body.theme-gameboy .wp-block-image.size-large figcaption {
    color: var(--gb-lightest) !important;
}

/* SVG Logo fill */
body.theme-gameboy .logo-path,
body.theme-gameboy .back-to-top a .icon {
    fill: var(--gb-darkest) !important;
    stroke: var(--gb-darkest) !important;
}

/* Confetti hidden / replaced with retro particles if jackpot hits */
body.theme-gameboy canvas {
    display: none !important;
}

/* Hide header background graphics */
body.theme-gameboy .site-header-bg,
body.theme-gameboy .site-header-bg::after,
body.theme-gameboy .site-header-bg::before {
    display: none !important;
    background-image: none !important;
    animation: none !important;
}

/* Slot machine styling */
body.theme-gameboy .hero-grid-container {
    border: none !important;
    padding: 10px !important;
}

body.theme-gameboy .spin-button {
    background: var(--gb-light) !important;
    border: 3px solid var(--gb-darkest) !important;
    color: var(--gb-darkest) !important;
    box-shadow: 3px 3px 0px var(--gb-dark) !important;
    border-radius: 0 !important;
}

body.theme-gameboy .spin-button:hover {
    background: var(--gb-darkest) !important;
    color: var(--gb-lightest) !important;
    box-shadow: none !important;
    transform: translate(3px, 3px) !important;
}

/* Subhero overrides */
body.theme-gameboy .subhero {
    background-color: var(--gb-darkest) !important;
    background: var(--gb-darkest) !important;
    border-bottom: 4px solid var(--gb-darkest) !important;
}
body.theme-gameboy .subhero :is(p, h1, h2, h3, h4, h5, h6, span, div, strong, em) {
    color: var(--gb-lightest) !important;
}

/* Navigation overrides */
body.theme-gameboy #primary-nav .primary-nav__link {
    color: var(--gb-darkest) !important;
    border: 2px solid transparent !important;
}

body.theme-gameboy #primary-nav .primary-nav__link:hover,
body.theme-gameboy #primary-nav .is-active .primary-nav__link {
    background-color: var(--gb-darkest) !important;
    color: var(--gb-lightest) !important;
    border: 2px solid var(--gb-darkest) !important;
    text-decoration: none !important;
}

/* Tooltags & testimonial widgets */
body.theme-gameboy .section--now-stack .tool-tag {
    background-color: var(--gb-light) !important;
    color: var(--gb-darkest) !important;
    border: 2px solid var(--gb-darkest) !important;
    border-radius: 0 !important;
}

body.theme-gameboy .section--now-stack .tool-tag.tool-tag--category {
    background-color: var(--gb-darkest) !important;
    color: var(--gb-lightest) !important;
    border: 2px solid var(--gb-darkest) !important;
}

/* Card/Tile Overrides for Game Boy Theme */
body.theme-gameboy .tile,
body.theme-gameboy .tile.notes {
    border: 3px solid var(--gb-darkest) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transition: none !important;
    background-color: var(--gb-light) !important; /* Default fallback background */
    background: var(--gb-light) !important;
}

/* Hide watermarks / folded corner elements on notes */
body.theme-gameboy .tile.notes::before,
body.theme-gameboy .tile.notes::after,
body.theme-gameboy .tile.notes .note-watermark {
    display: none !important;
}

/* Default card text colors (Dark on Light) */
body.theme-gameboy .tile .tile__text,
body.theme-gameboy .tile .tile__text :is(.single-post__byline, .tag, .tile__text, h1, h2, h2 a, h3, h4, h5, h6, time, p, span, strong, em) {
    color: var(--gb-darkest) !important;
}

/* Disable card hover color inversions and transform transitions completely */
body.theme-gameboy .tile:hover,
body.theme-gameboy .tile.tile--light:hover,
body.theme-gameboy .tile.tile--dark:hover {
    transform: none !important;
    transition: none !important;
}

body.theme-gameboy .tile:hover {
    background-color: var(--gb-light) !important;
    background: var(--gb-light) !important;
}
body.theme-gameboy .tile:hover .tile__text,
body.theme-gameboy .tile:hover .tile__text :is(.single-post__byline, .tag, .tile__text, h1, h2, h2 a, h3, h4, h5, h6, time, p, span, strong, em) {
    color: var(--gb-darkest) !important;
}

body.theme-gameboy .tile.tile--light:hover {
    background-color: var(--gb-light) !important;
    background: var(--gb-light) !important;
}
body.theme-gameboy .tile.tile--light:hover .tile__text,
body.theme-gameboy .tile.tile--light:hover .tile__text :is(.single-post__byline, .tag, .tile__text, h1, h2, h2 a, h3, h4, h5, h6, time, p, span, strong, em) {
    color: var(--gb-darkest) !important;
}

body.theme-gameboy .tile.tile--dark:hover {
    background-color: var(--gb-darkest) !important;
    background: var(--gb-darkest) !important;
}
body.theme-gameboy .tile.tile--dark:hover .tile__text,
body.theme-gameboy .tile.tile--dark:hover .tile__text :is(.single-post__byline, .tag, .tile__text, h1, h2, h2 a, h3, h4, h5, h6, time, p, span, strong, em) {
    color: var(--gb-lightest) !important;
}

/* Ensure post header areas and card links don't highlight background on hover */
body.theme-gameboy .tile a:hover,
body.theme-gameboy .single-post__header a:hover {
    background-color: transparent !important;
    text-decoration: underline !important;
}

body.theme-gameboy .tile:not(.tile--dark) a:hover,
body.theme-gameboy .tile.tile--light a:hover,
body.theme-gameboy .single-post__header a:hover {
    color: var(--gb-darkest) !important;
}

body.theme-gameboy .tile.tile--dark a:hover {
    color: var(--gb-lightest) !important;
}

/* Class tile--dark: applied by JS when average image brightness is dark (<= 128) */
body.theme-gameboy .tile.tile--dark {
    background-color: var(--gb-darkest) !important;
    background: var(--gb-darkest) !important;
}
body.theme-gameboy .tile.tile--dark .tile__text,
body.theme-gameboy .tile.tile--dark .tile__text :is(.single-post__byline, .tag, .tile__text, h1, h2, h2 a, h3, h4, h5, h6, time, p, span, strong, em) {
    color: var(--gb-lightest) !important;
}

/* Class tile--light: applied by JS when average image brightness is light (> 128) */
body.theme-gameboy .tile.tile--light {
    background-color: var(--gb-light) !important;
    background: var(--gb-light) !important;
}
body.theme-gameboy .tile.tile--light .tile__text,
body.theme-gameboy .tile.tile--light .tile__text :is(.single-post__byline, .tag, .tile__text, h1, h2, h2 a, h3, h4, h5, h6, time, p, span, strong, em) {
    color: var(--gb-darkest) !important;
}

/* Client logos styling in footer - disable white invert filter so pixelated dark green logos render correctly, and make background transparent (no blocks/borders) */
body.theme-gameboy .site-footer__clients .client-logos-group {
    opacity: 1 !important;
}

body.theme-gameboy .site-footer__clients .client-logo img {
    filter: none !important;
    border: none !important;
    background-color: transparent !important;
    background: transparent !important;
    padding: 0 !important;
}

/* Hide light/dark mode switch in Game Boy theme */
body.theme-gameboy .theme-toggle-wrapper,
body.theme-gameboy #theme-toggle {
    display: none !important;
}


