/*
Theme Name: GeneratePress Child - Desihub
Theme URI: https://generatepress.com
Description: Custom child theme for GeneratePress Premium to match desihub.to design.
Author: Kishan Kumar
Author URI: https://generatepress.com
Template: generatepress
Version: 1.0.0
*/

/* ==========================================================================
   GLOBAL STYLES & VARIABLES (DARK MODE FIRST)
   ========================================================================== */
:root {
    --bg-color: #000000;
    --card-bg: #09090b;
    --card-border: #27272a;
    --card-border-hover: #3f3f46;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --accent-color: #ffffff;
    --header-bg: rgba(0, 0, 0, 0.75);
    --header-border: rgba(255, 255, 255, 0.08);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Light Theme Variables */
body.light-theme,
html.light-theme {
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --card-border: #e5e7eb;
    --card-border-hover: #d1d5db;
    --text-primary: #111111;
    --text-secondary: #4b5563;
    --header-bg: rgba(255, 255, 255, 0.75);
    --header-border: rgba(0, 0, 0, 0.08);
}

body,
.inside-article,
.separate-containers .inside-article,
.separate-containers .comments-area,
.separate-containers .page-header,
.one-container .site-content,
.separate-containers .widget,
.site-info,
.footer-widgets,
.site-main {
    background-color: var(--bg-color) !important;
    color: var(--text-primary) !important;
    font-family: var(--font-family) !important;
    -webkit-font-smoothing: antialiased;
}

/* Base link color mapping */
a {
    color: var(--text-primary);
    transition: color 0.2s ease;
}
a:hover {
    color: var(--text-secondary);
}

/* ==========================================================================
   HEADER & NAVIGATION (GLASSMORPHISM)
   ========================================================================== */
.site-header,
#site-navigation,
#sticky-navigation,
.main-navigation {
    background-color: var(--header-bg) !important;
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--header-border) !important;
}

/* Header Text / Logo */
.navigation-branding .main-title a,
.site-branding .main-title a {
    font-size: 22px !important;
    font-weight: 700 !important;
    letter-spacing: -0.5px;
    color: var(--text-primary) !important;
}

/* Navigation Links */
.main-navigation .main-nav ul li a {
    font-weight: 500;
    font-size: 15px;
    color: var(--text-secondary) !important;
    transition: color 0.2s ease;
}

.main-navigation .main-nav ul li a:hover,
.main-navigation .main-nav ul li.current-menu-item a {
    color: var(--text-primary) !important;
}

/* Mobile Toggle */
.menu-toggle,
.mobile-bar-items a {
    color: var(--text-primary) !important;
}

/* ==========================================================================
   DESIHUB CUSTOM POST GRID
   ========================================================================== */
.desihub-grid-container {
    max-width: 1280px;
    margin: 40px auto;
    padding: 0 20px;
}

.desihub-post-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Responsive Grids */
@media (max-width: 1024px) {
    .desihub-post-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .desihub-post-grid {
        grid-template-columns: repeat(1, 1fr); /* 1 column on mobile to match desihub.to */
        gap: 20px;
        padding: 0 10px;
    }
}

/* ==========================================================================
   CARD LAYOUT
   ========================================================================== */
.desihub-post-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 550px; /* Exact desihub.to desktop card height */
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none !important;
    transition: transform 0.2s ease-in-out, border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (max-width: 768px) {
    .desihub-post-card {
        height: 400px; /* Exact desihub.to mobile card height */
    }
}

/* Hover Scale & Glow Effect */
.desihub-post-card:hover {
    transform: scale(1.03);
    border-color: var(--card-border-hover);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

/* Dual-Image Wrapper */
.desihub-card-image-wrap {
    position: relative;
    width: 100%;
    height: 100%; /* Take full height and let flexbox shrink it for title */
    flex-grow: 1;
    flex-shrink: 1;
    overflow: hidden;
    background-color: #050505;
}

/* 1. Blurred background image */
.desihub-card-blur-bg {
    position: absolute;
    top: -5%;
    left: -5%;
    width: 110%;
    height: 110%;
    object-fit: cover;
    filter: blur(28px) brightness(0.6);
    transform: scale(1.1);
    z-index: 1;
    pointer-events: none;
}

/* 2. Crisp foreground image */
.desihub-card-fg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
    transition: transform 0.3s ease;
}

/* Subtle image scale on card hover */
.desihub-post-card:hover .desihub-card-fg-img {
    transform: scale(1.02);
}

/* Card Content / Title Area */
.desihub-card-content {
    display: block;
    padding: 12px 8px;
    box-sizing: border-box;
    flex-shrink: 0; /* Do not let the title area shrink */
    background-color: transparent;
}

.desihub-card-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    text-align: center;
    margin-top: 8px;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .desihub-card-title {
        font-size: 13px;
        margin-top: 6px;
    }
}

/* ==========================================================================
   HOMEPAGE HERO SECTION
   ========================================================================== */
.desihub-hero-section {
    text-align: center;
    padding: 60px 20px 40px;
    max-width: 900px;
    margin: 0 auto;
}

.desihub-hero-title {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #ffffff;
    margin-bottom: 12px;
    line-height: 1.2;
}

.desihub-hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .desihub-hero-section {
        padding: 40px 15px 20px;
    }
    .desihub-hero-title {
        font-size: 26px;
    }
    .desihub-hero-subtitle {
        font-size: 15px;
    }
}

/* ==========================================================================
   PROMO BANNER
   ========================================================================== */
.desihub-promo-banner {
    display: block;
    max-width: 340px;
    margin: 0 auto 30px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    transition: transform 0.2s ease;
}

.desihub-promo-banner:hover {
    transform: scale(1.02);
}

.desihub-promo-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   HEADER ACTIONS (TOGGLE BUTTON & SEARCH ICON)
   ========================================================================== */
.desihub-header-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    color: var(--text-secondary) !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    margin-left: 10px !important;
    transition: background-color 0.2s, color 0.2s !important;
    padding: 0 !important;
    vertical-align: middle !important;
}

.desihub-header-icon:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-primary) !important;
}

body.light-theme .desihub-header-icon:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
}

/* Sun Icon visibility (dark mode default) */
.desihub-toggle-btn .theme-icon-sun {
    display: block !important;
    color: #eab308 !important; /* Golden Sun */
}
.desihub-toggle-btn .theme-icon-moon {
    display: none !important;
}

/* Moon Icon visibility (light mode active) */
body.light-theme .desihub-toggle-btn .theme-icon-sun {
    display: none !important;
}
body.light-theme .desihub-toggle-btn .theme-icon-moon {
    display: block !important;
    color: #4b5563 !important; /* Dark Grey Moon */
}

/* General Layout Compatibility for GP Main Navigation Items */
.menu-bar-items {
    display: flex !important;
    align-items: center !important;
}

/* Add search icon style focus */
.desihub-search-btn svg,
.desihub-toggle-btn svg {
    display: block !important;
}

/* ==========================================================================
   FOOTER NAVIGATION STYLES
   ========================================================================== */
.desihub-footer-content {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important; /* Copyright left, links right */
    width: 100% !important;
    flex-wrap: wrap !important;
    font-size: 14px !important;
    color: var(--text-secondary) !important;
    text-align: left !important; /* Align text left on desktop */
}

@media (max-width: 768px) {
    .desihub-footer-content {
        justify-content: center !important;
        flex-direction: column !important;
        text-align: center !important; /* Centered text on mobile */
        gap: 16px !important;
    }
    .desihub-footer-nav ul {
        justify-content: center !important; /* Centered links on mobile */
    }
}

.desihub-footer-nav {
    display: inline-block !important;
}

.desihub-footer-nav ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
}

.desihub-footer-nav ul li {
    display: inline-block !important;
}

.desihub-footer-nav ul li a {
    color: var(--text-secondary) !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: color 0.2s ease !important;
}

.desihub-footer-nav ul li a:hover {
    color: var(--text-primary) !important;
}

.desihub-footer-separator {
    display: none !important; /* Hide separator bullet since layout is split */
}
