/*
Theme Name: Pun Genius
Theme URI: https://example.com
Author: AntiGravity
Author URI: https://example.com
Description: A custom theme for Pun Genius
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
    --bg-color: #0d0d12;
    --text-color: #ffffff;
    /* Deprecated fallback */
    --text-main: #ffffff;
    --text-heading: #ffffff;
    --link-color: #ffffff;
    --link-hover: #08d9d6;

    --sidebar-text: #ffffff;
    --sidebar-heading: #08d9d6;
    --sidebar-link: #ffffff;

    --accent-primary: #ff2e63;
    --accent-secondary: #08d9d6;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.05);
    --card-hover: rgba(255, 255, 255, 0.08);
    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-heading);
}

a {
    color: var(--link-color);
    transition: color 0.3s;
}

a:hover {
    color: var(--link-hover);
}

/* Sidebar Specific Colors - FORCE OVERRIDES */
#secondary a,
#secondary .widget a,
#secondary ul li a,
#secondary .wp-block-latest-posts__post-title,
#secondary .wp-block-categories__list a,
#secondary .wp-block-archives-list a,
#secondary .wp-block-latest-comments__comment-meta a {
    color: var(--sidebar-link) !important;
    text-decoration: none;
}

#secondary a:hover,
#secondary .widget a:hover,
#secondary ul li a:hover,
#secondary .wp-block-latest-posts__post-title:hover,
#secondary .wp-block-categories__list a:hover {
    color: var(--link-hover) !important;
}

#secondary h1,
#secondary h2,
#secondary h3,
#secondary h4,
#secondary h5,
#secondary h6,
#secondary .widget-title,
#secondary .wp-block-group h2 {
    color: var(--sidebar-heading) !important;
}

#secondary,
#secondary .widget {
    color: var(--sidebar-text) !important;
}

/* Navbar Links Override */
.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    margin-left: 20px;
    font-weight: 400;
}

.nav-links a:hover {
    color: var(--link-hover);
}

/* Rest of the file... ensure text-color usages are updated if needed */
.wp-nav-menu li a {
    color: var(--text-main);
}


#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    background: radial-gradient(circle at center, #1a1a2e 0%, #000000 100%);
    filter: blur(3px) opacity(0.7);
    pointer-events: none;
}

/* Glassmorphism Utilities */
.glass,
.glass-panel,
.glass-footer {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    z-index: 1000;
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.highlight {
    color: var(--accent-secondary);
}

/* Navigation Container */
#pun-header-nav {
    display: flex;
    align-items: center;
    width: auto;
    /* Allow flex distribution (space-between) to work */
}

/* Force Flex Row on the UL */
#pun-header-nav ul,
#pun-header-nav .wp-nav-menu {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    list-style: none !important;
    /* Kill bullets */
    margin: 0 !important;
    padding: 0 !important;
    gap: 20px;
}

/* Force Inline Behavior on LI */
#pun-header-nav ul li,
#pun-header-nav .wp-nav-menu li {
    display: block;
    /* Flex items default */
    list-style-type: none !important;
    /* Double kill bullets */
    margin: 0;
    padding: 0;
    width: auto;
    /* Default auto width */
}

/* Links */
#pun-header-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 400;
    transition: color 0.3s;
    white-space: nowrap;
    padding: 5px 10px;
    /* Clickable area */
}

#pun-header-nav a:hover {
    color: var(--accent-secondary);
}

/* ============================
   DROPDOWN MENUS (Sub-menus)
   ============================ */

/* Parent Items relative for absolute positioning of children */
#pun-header-nav .menu-item-has-children {
    position: relative;
    padding-right: 15px;
    /* Space for arrow */
}

/* Arrow Indicator */
#pun-header-nav .menu-item-has-children>a:after {
    content: "▼";
    font-size: 0.6em;
    margin-left: 6px;
    vertical-align: middle;
    color: var(--accent-secondary);
    display: inline-block;
    transition: transform 0.3s;
}

#pun-header-nav .menu-item-has-children:hover>a:after {
    transform: rotate(180deg);
}

/* Sub-Menu Styling */
#pun-header-nav ul.sub-menu {
    display: block !important;
    /* Override flex */
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    padding: 10px 0 !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 9999;
}

/* Show Sub-Menu on Hover */
#pun-header-nav li:hover>ul.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Sub-Menu Items */
#pun-header-nav ul.sub-menu li {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left;
}

#pun-header-nav ul.sub-menu li a {
    display: block;
    padding: 12px 20px;
    color: var(--text-color);
    width: 100%;
    white-space: normal;
    /* Allow long text to wrap if needed, or keep nowrap */
    font-size: 0.95em;
}

#pun-header-nav ul.sub-menu li a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-secondary);
    padding-left: 25px;
    /* Slide effect */
}

/* Deep Nesting (Level 3+) */
#pun-header-nav ul.sub-menu ul.sub-menu {
    top: 0;
    left: 100%;
    margin-top: -5px !important;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 140px 20px 100px;
}

.hero-split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 40px;
}

.hero-text {
    flex: 1;
    padding: 60px;
    text-align: left;
    /* Text alignment left */
    animation: fadeIn 1s ease-out;
}

.hero-image {
    flex: 1;
    min-height: 500px;
    /* Increased min-height for portrait */
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    animation: fadeIn 1s ease-out 0.2s;
    /* Slight delay */
    position: relative;
    /* overflow hidden removed */
}

.placeholder-img-content {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
}

.emoji-img {
    font-size: 8rem;
    display: block;
    margin-bottom: 10px;
}

.hero h1 {
    font-size: 4.5rem;
    line-height: 1.1;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(8, 217, 214, 0.3);
}

.hero h4 {
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    font-weight: 600;
}

.gradient-text {
    background: linear-gradient(45deg, var(--accent-secondary), var(--accent-primary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 30px;
    opacity: 0.8;
}

.cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(45deg, var(--accent-primary), #ff0055);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 46, 99, 0.3);
}

/* Features Section */
.features-section {
    padding: 140px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    padding: 40px;
    text-align: center;
    transition: transform 0.3s, background 0.3s;
}

.card:hover {
    transform: translateY(-15px);
    background: var(--card-hover);
    border-color: var(--accent-secondary);
    box-shadow: 0 10px 40px rgba(8, 217, 214, 0.1);
}

.icon-box {
    font-size: 3rem;
    margin-bottom: 20px;
}

.card h3 {
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.card p {
    line-height: 1.6;
    opacity: 0.8;
}

/* About Section */
.about-section {
    margin: 100px auto;
    max-width: 1100px;
    padding: 80px;
}

.split-layout {
    display: flex;
    align-items: center;
    gap: 80px;
}

.placeholder-avatar {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.text-content h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.text-content p {
    margin-bottom: 15px;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Latest Puns Section */
.latest-section {
    padding: 140px 0;
}

.latest-section h2 {
    text-align: center;
    margin-bottom: 60px;
    font-size: 3rem;
}

/* Pun Slider Styles */
.pun-slider {
    max-width: 1200px;
    /* Wider to fit 3 items */
    margin: 0 auto;
    padding: 40px;
    position: relative;
    overflow: hidden;
    /* Hide overflow */
}

.slides-container {
    display: flex;
    /* Horizontal layout */
    width: 100%;
    transition: transform 0.5s ease-in-out;
    /* Smooth sliding */
}

.pun-slide {
    flex: 0 0 33.333%;
    /* Show 3 slides */
    max-width: 33.333%;
    padding: 10px;
    /* Reduced padding to fit image */
    opacity: 0.5;
    transform: scale(0.9);
    transition: opacity 0.3s, transform 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    /* Slight card bg */
    border-radius: 16px;
    margin: 0 10px;
    /* Add margin for card look */
    overflow: hidden;
    /* container for image */
    height: 480px;
    /* Increased Fixed height for uniformity and space */
}

.pun-slide img {
    width: 100%;
    height: 250px;
    /* Fixed height for image */
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.pun-slide.active {
    opacity: 1;
    transform: scale(1);
}

.pun-date {
    display: block;
    color: var(--accent-secondary);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pun-slide p {
    font-size: 1.5rem;
    line-height: 1.5;
}

.slider-dots {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

.dot {
    width: 10px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}

.dot.active,
.dot:hover {
    background-color: var(--accent-secondary);
}

/* Footer */
.glass-footer {
    text-align: center;
    padding: 40px;
    margin-top: 50px;
    border-radius: 16px 16px 0 0;
    color: var(--footer-text);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
/* Responsive */
@media (max-width: 768px) {
    .navbar {
        width: 100%;
        top: 0;
        border-radius: 0 0 16px 16px;
        flex-wrap: wrap;
        /* Allow wrapping */
        padding: 15px 20px;
    }

    /* Hamburger Button */
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 21px;
        background: transparent;
        border: none;
        cursor: pointer;
        z-index: 1001;
    }

    .mobile-menu-toggle span {
        width: 100%;
        height: 3px;
        background-color: var(--text-color);
        border-radius: 3px;
        transition: all 0.3s ease;
    }

    /* Animate Hamburger */
    .mobile-menu-toggle.open span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-toggle.open span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.open span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    /* Mobile Menu Container */
    #pun-header-nav {
        display: none;
        /* Hidden by default */
        width: 100%;
        order: 3;
        /* Move below logo and toggle */
        margin-top: 20px;
        flex-direction: column !important;
        /* Force column */
        align-items: center !important;
    }

    #pun-header-nav.active {
        display: flex !important;
        /* Show when active */
    }

    #pun-header-nav ul,
    #pun-header-nav .wp-nav-menu {
        flex-direction: column !important;
        width: 100%;
        gap: 0 !important;
        text-align: center;
    }

    #pun-header-nav ul li,
    #pun-header-nav .wp-nav-menu li {
        width: 100% !important;
        margin: 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    #pun-header-nav a {
        display: block;
        padding: 15px 0;
        font-size: 1.1rem;
    }

    /* Reset Dropdowns for Mobile */
    #pun-header-nav ul.sub-menu {
        position: static;
        display: none !important;
        /* Use Toggle/Hover override? For simple usage, always show or show on hover */
        visibility: visible;
        opacity: 1;
        transform: none;
        background: rgba(0, 0, 0, 0.2);
        box-shadow: none;
        border: none;
        padding-left: 20px !important;
    }

    /* Show sub-menu on hover/click (simple fallback: hover works on many mobiles, or always show) */
    #pun-header-nav li:hover>ul.sub-menu {
        display: block !important;
    }

    .hero-split {
        flex-direction: column-reverse;
        text-align: center;
        gap: 30px;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-text {
        padding: 20px;
        text-align: center;
    }

    .container {
        flex-direction: column;
    }

    #secondary {
        width: 100%;
        margin-top: 50px;
        padding-left: 0 !important;
        /* Reset sidebar padding */
    }

    .pun-slide {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Desktop Only: Hide Toggle */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none;
    }
}

/* Floating Animation for Hero Image */
@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(2deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

.floating-image {
    animation: float 6s ease-in-out infinite;
}

.hero-img-element {
    width: 100%;
    height: auto;
    max-width: 450px;
    border-radius: 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

/* Footer Menu Styles */
.footer-menu {
    display: flex;
    flex-direction: row;
    /* Force Row */
    justify-content: center;
    list-style: none;
    gap: 30px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.footer-menu li a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity 0.3s, color 0.3s;
}

.footer-menu li a:hover {
    opacity: 1;
    color: var(--accent-secondary);
}

.wp-nav-menu li a:hover,
.wp-nav-menu li.current-menu-item>a {
    color: var(--accent-secondary);
}

/* Custom Logo */
.custom-logo-link img {
    max-height: 50px;
    width: auto;
}

/* Content Styles */
.entry-content a {
    color: var(--accent-secondary);
}

.entry-content h2,
.entry-content h3 {
    margin-top: 30px;
    margin-bottom: 15px;
}

.entry-content p {
    margin-bottom: 20px;
}

/* Pagination */
.pagination .page-numbers {
    display: inline-block;
    padding: 10px 15px;
    margin: 0 5px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Sidebar & Layouts */
.container.has-sidebar {
    /* Flex is handled inline by template logic to keep style.css clean or added here */
    display: flex;
    gap: 40px;
}

@media (max-width: 900px) {
    .container.has-sidebar {
        flex-direction: column;
    }

    .sidebar-container {
        width: 100%;
    }
}

/* Widget Styles */
.widget ul {
    list-style: none;
    padding: 0;
}

.widget ul li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.widget ul li a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.widget ul li a:hover {
    color: var(--accent-secondary);
}

/* List Layout Card */
.cards-list .card.list-item {
    transition: transform 0.3s, background 0.3s;
}

.cards-list .card.list-item:hover {
    transform: translateX(10px);
    /* Move right instead of up */
    background: var(--card-hover);
    border-color: var(--accent-secondary);
}

@media (max-width: 768px) {
    .card.list-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .card.list-item a {
        width: 100%;
        flex: auto !important;
    }

    .card.list-item img {
        width: 100% !important;
        height: 200px !important;
    }
}