/*
Theme Name: PunjabiPosts Premium
Template: generatepress
Version: 1.0.0
Description: Premium style for PunjabiPosts.
Author: Admin
*/
/* ==========================================================================
   PunjabiPosts.com - Premium, Ulta-Fast & Mobile-First Edition
   Optimized for Core Web Vitals, Google Discover & AdSense
   ========================================================================== */

:root {
    /* Brand Colors */
    --primary-color: #0f172a;      /* Deep professional dark blue */
    --accent-color: #f97316;       /* Energetic orange for interaction */
    --accent-hover: #ea580c;
    
    /* Text Colors - High contrast for readability */
    --text-main: #334155;
    --text-muted: #64748b;
    --text-light: #f8fafc;
    
    /* Backgrounds & UI */
    --bg-page: #f8fafc;            /* Slightly off-white for less eye-strain */
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    
    /* Shadows - Smooth & Premium */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-hover: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    
    /* Typography - Fast System Fonts */
    --font-heading: 'Mukta', 'Noto Sans Gurmukhi', system-ui, sans-serif;
    --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
}

/* --- Base Performance & UX --- */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape */
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 16px; /* Optimal for mobile readability */
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.75em;
    word-wrap: break-word; /* Prevent overflow on mobile */
}

/* --- Image Optimization (CLS Fix) --- */
img {
    max-width: 100%;
    height: auto;
    font-style: italic;
    background-repeat: no-repeat;
    background-size: cover;
    shape-margin: 0.75rem;
}

/* --- Header & Navigation --- */
.site-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky; /* Modern UX */
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.main-navigation {
    background-color: var(--primary-color) !important;
}

.main-navigation .main-nav ul li a {
    color: var(--text-light) !important;
    font-weight: 500;
    font-size: 15px;
    padding: 16px 20px; /* Better tap target for AdSense (Mobile) */
    transition: background-color 0.2s ease, color 0.2s ease;
}

.main-navigation .main-nav ul li:hover > a,
.main-navigation .main-nav ul li.current-menu-item > a {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--accent-color) !important;
}

/* Dropdown Fix */
.main-navigation ul ul {
    background-color: #1e293b !important;
    box-shadow: var(--shadow-md) !important;
    border-radius: 0 0 8px 8px;
    padding: 8px 0;
}
.main-navigation ul ul li a {
    font-size: 14px !important;
    padding: 12px 24px !important; /* Tap targets */
}
.main-navigation ul ul li:hover > a {
    background-color: var(--accent-color) !important;
    color: #fff !important;
}

/* Mobile Menu Button - Tap target optimization */
.menu-toggle {
    color: var(--primary-color) !important;
    font-weight: 600;
    padding: 15px 20px !important;
    min-height: 48px; /* Google Discover requirement */
}

/* --- Blog Post Layout (CSS Grid for Speed) --- */
.generate-columns .inside-article,
.blog .inside-article,
.archive .inside-article {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0,0,0,0.03);
    overflow: hidden;
    margin-bottom: 30px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    will-change: transform; /* Performance */
}

.generate-columns .inside-article:hover,
.blog .inside-article:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.post-image {
    margin: -40px -40px 20px -40px;
    overflow: hidden;
    background-color: #e2e8f0; /* Placeholder color before image loads */
}

.post-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 16/9; /* Crucial for CLS (Core Web Vitals) */
    border-radius: 16px 16px 0 0;
    transition: transform 0.5s ease;
}

.inside-article:hover .post-image img {
    transform: scale(1.05);
}

.entry-header {
    padding: 0 24px;
}

.entry-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
}

.entry-title a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.entry-title a:hover {
    color: var(--accent-color);
}

.entry-meta {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-weight: 500;
}

.entry-summary {
    padding: 0 24px 24px;
    flex-grow: 1;
    font-size: 15px;
    color: var(--text-main);
}

/* Modern Button Style */
.read-more,
a.button,
.wp-block-button__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent-color) !important;
    color: #fff !important;
    border-radius: 50px; /* Modern pill shape */
    padding: 10px 24px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    border: none;
    margin-top: auto;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(249, 115, 22, 0.3);
    min-height: 48px; /* Google Tap Target standard */
}

.read-more:hover,
a.button:hover,
.wp-block-button__link:hover {
    background-color: var(--accent-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(249, 115, 22, 0.4);
}

/* Feature/Latest Posts Fix */
h2:contains("Featured Posts") { visibility: hidden; position: relative; }
h2:contains("Featured Posts")::after { visibility: visible; position: absolute; top: 0; left: 0; content: "Latest Posts"; }
.widget-title { visibility: hidden; position: relative; display: inline-block; }
.widget-title::after { visibility: visible; position: absolute; top: 0; left: 0; content: "Latest Posts"; }
.sidebar .widget-title { visibility: visible !important; }
.sidebar .widget-title::after { content: none !important; }

/* --- Layout Grids (Desktop) --- */
@media (min-width: 769px) {
    .generate-columns-container .generate-columns {
        width: 33.333% !important;
        padding-left: 24px;
    }
    .generate-columns-container {
        margin-left: -24px;
    }
    /* Blog Grid Layout */
    body.blog .site-main,
    body.archive .site-main,
    body.search .site-main {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }
    body.blog .site-main > article,
    body.archive .site-main > article {
        margin-bottom: 0 !important;
    }
    body.blog .site-main > header,
    body.archive .site-main > header,
    .nav-links,
    .paging-navigation {
        grid-column: 1 / -1;
    }
}

/* --- Single Pages & Posts --- */
.single .inside-article,
.page .inside-article {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    padding: 40px 5vw; /* Fluid padding */
    border: 1px solid var(--border-color);
}

.page .entry-title,
.single .entry-title {
    font-size: clamp(24px, 4vw, 36px); /* Fluid Typography */
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    position: relative;
    font-weight: 800;
}

.page .entry-title::after,
.single .entry-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

/* --- Sidebar Styling --- */
.sidebar .widget {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.sidebar .widget-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    border-left: 4px solid var(--accent-color);
    padding-left: 12px;
    margin-bottom: 20px;
}

/* --- Professional Footer --- */
.site-footer {
    background-color: var(--primary-color) !important;
    color: #cbd5e1;
    margin-top: 60px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    padding: 60px 20px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-widgets .widget-title {
    color: var(--text-light) !important;
    font-size: 20px !important;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
    margin-bottom: 24px;
    display: inline-block;
}

.footer-widgets ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-widgets ul li {
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
}

.footer-widgets a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

.footer-widgets a:hover {
    color: var(--accent-color);
    transform: translateX(5px);
}

/* Copyright Bar Fixes */
.site-info {
    background-color: #020617 !important;
    padding: 24px 20px !important;
    font-size: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}
.site-info .inside-site-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.site-info .copyright-bar {
    display: none !important; /* Hide default GeneratePress credit */
}
.site-info::after {
    content: "Â© 2026 PunjabiPosts.com | All Rights Reserved.";
    color: #94a3b8;
    display: block;
    font-weight: 500;
}

/* --- Hero Section (Premium Landing) --- */
body.home .generate-columns-container > .inside-article,
body.home .type-page > .inside-article:first-of-type,
body.home .entry-content > .wp-block-group:first-child,
body.home .site-main > article:first-child {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.03) 0%, rgba(249, 115, 22, 0.03) 100%) !important;
    border: 1px solid rgba(15, 23, 42, 0.05);
    border-radius: 20px !important;
    padding: 60px 30px !important;
    text-align: center;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.05);
    margin-bottom: 50px !important;
}

body.home .entry-content > .wp-block-group:first-child h2,
body.home .site-main > article:first-child h2 {
    font-size: clamp(28px, 5vw, 42px) !important;
    font-weight: 800;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    margin-bottom: 16px;
}

/* --- MOBILE SPECIFIC OPTIMIZATIONS --- */
@media (max-width: 768px) {
    body {
        font-size: 16px; /* Best readability on mobile */
    }
    
    .single .inside-article,
    .page .inside-article {
        padding: 24px 16px; /* Save space on small screens */
        border-radius: 12px;
    }

    /* Stack grid properly */
    body.blog .site-main,
    body.archive .site-main,
    .generate-columns-container .generate-columns {
        display: block;
        width: 100% !important;
        padding-left: 0;
    }
    .generate-columns-container {
        margin-left: 0;
    }

    .generate-columns .inside-article,
    .blog .inside-article {
        margin-bottom: 24px;
        border-radius: 12px;
    }
    
    .post-image {
        margin: -24px -16px 16px -16px;
    }
    .post-image img {
        border-radius: 12px 12px 0 0;
    }
    
    .entry-header { padding: 0 16px; }
    .entry-summary { padding: 0 16px 16px; }
    
    /* Bigger tap targets for mobile AdSense policy */
    .widget ul li a,
    .footer-widgets ul li a {
        padding: 8px 0;
        display: block;
    }
}
