/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://generatepress.com
 Description:  GeneratePress Child Theme with Custom Performance & SEO Tweaks
 Author:       BoosterBody
 Template:     generatepress
 Version:      1.0.0
*/

/* ==========================================================================
   1. GLOBAL VARIABLES & TYPOGRAPHY
   ========================================================================== */
:root {
    --brand-primary: #E63946; /* Vibrant Red */
    --brand-dark: #111827;
    --text-main: #374151;
    --text-muted: #6B7280;
    --bg-body: #F9FAFB;
    --bg-card: #FFFFFF;
    --border-soft: #E5E7EB;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-md: 8px;
    --radius-lg: 12px;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition-fast: all 0.2s ease-in-out;
}

body, button, input, select, textarea {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--bg-body);
    font-size: 17px;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6,
.main-title, .entry-title {
    font-family: var(--font-heading);
    color: var(--brand-dark);
    font-weight: 700;
}

a {
    color: var(--brand-primary);
    transition: var(--transition-fast);
}
a:hover {
    color: #b91c1c; /* Darker red */
    text-decoration: none;
}

/* ==========================================================================
   2. HEADER & NAVIGATION
   ========================================================================== */
.site-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-soft);
    box-shadow: var(--shadow-sm);
}

.main-navigation {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: 0.5px;
}
.main-navigation .main-nav ul li a {
    color: var(--brand-dark);
    transition: var(--transition-fast);
}
.main-navigation .main-nav ul li[class*="current-menu-"] > a,
.main-navigation .main-nav ul li:hover > a {
    color: var(--brand-primary);
    background: transparent;
}

/* ==========================================================================
   3. ARCHIVES / CATEGORY GRID (Organizing the messy layout)
   ========================================================================== */
.generate-columns-container {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}
/* GeneratePress creates a complicated float grid. We reset it to use CSS Grid */
.generate-columns {
    float: none !important;
    width: 100% !important;
    padding-left: 0 !important;
    margin-bottom: 0 !important;
}
.generate-columns-container .inside-article {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Base Card Styling */
.inside-article {
    background: var(--bg-card) !important;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 0 !important; /* Reset GP padding */
    transition: var(--transition-fast);
    overflow: hidden;
    border: 1px solid var(--border-soft);
}
.generate-columns .inside-article:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

/* Featured Image in Archive */
.post-image {
    margin: 0 !important;
}
.post-image img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover; /* Forces uniform image sizes */
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transition: var(--transition-fast);
}

/* Content wrapper inside card */
.entry-header, .entry-summary, .entry-meta {
    padding: 0 25px;
}
.entry-header {
    padding-top: 25px;
}
.entry-title {
    font-size: 22px;
    line-height: 1.3;
    margin-bottom: 10px;
}
.entry-title a {
    color: var(--brand-dark);
}
.entry-title a:hover {
    color: var(--brand-primary);
}

/* Entry Meta (Date, Author, Categories) */
.entry-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 15px;
    font-weight: 500;
}
.entry-meta a {
    color: var(--text-muted);
}
.entry-meta a:hover {
    color: var(--brand-primary);
}

/* Summary text */
.entry-summary {
    font-size: 15px;
    color: var(--text-main);
    flex-grow: 1; /* Pushes button to bottom */
    margin-bottom: 20px;
}

/* Read More Button */
a.read-more {
    display: inline-block;
    background-color: var(--brand-dark) !important;
    color: white !important;
    padding: 10px 24px;
    border-radius: 50px; /* Pill shape */
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 1px;
    border: none;
    transition: var(--transition-fast);
    margin: 0 0 25px 25px;
}
a.read-more:hover {
    background-color: var(--brand-primary) !important;
    transform: scale(1.05);
}

/* ==========================================================================
   4. SINGLE ARTICLE LAYOUT
   ========================================================================== */
.single .inside-article {
    padding: 40px !important;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    background: var(--bg-card);
}
.single .entry-header {
    padding: 0;
    margin-bottom: 30px;
}
.single .entry-title {
    font-size: 36px;
    line-height: 1.2;
}
.single .post-image {
    margin-bottom: 30px !important;
    border-radius: var(--radius-md);
    overflow: hidden;
}
.single .post-image img {
    border-radius: var(--radius-md);
    width: 100%;
    height: auto;
}
.entry-content {
    font-size: 18px;
}
.entry-content h2, .entry-content h3 {
    margin-top: 40px;
    margin-bottom: 15px;
}

/* ==========================================================================
   5. SIDEBAR WIDGETS
   ========================================================================== */
.sidebar .widget {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-soft);
}
.sidebar .widget-title {
    font-family: var(--font-heading);
    font-size: 20px;
    color: var(--brand-dark);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--bg-body);
}

/* Search Form Widget */
.search-form {
    display: flex;
    gap: 10px;
}
.search-field {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 12px 15px;
    width: 100%;
    font-family: var(--font-body);
    font-size: 15px;
    transition: var(--transition-fast);
}
.search-field:focus {
    border-color: var(--brand-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}
.search-submit {
    background-color: var(--brand-dark);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 20px;
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}
.search-submit:hover {
    background-color: var(--brand-primary);
}

/* Recent Posts Widget */
.widget_recent_entries ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.widget_recent_entries li {
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-soft);
}
.widget_recent_entries li:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}
.widget_recent_entries a {
    color: var(--text-main);
    font-weight: 500;
    line-height: 1.4;
    display: block;
}
.widget_recent_entries a:hover {
    color: var(--brand-primary);
}

/* ==========================================================================
   6. COMMENTS SECTION
   ========================================================================== */
.comments-area {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 2px solid var(--border-soft);
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}
.comments-title, .comment-reply-title {
    font-family: var(--font-heading);
    font-size: 24px;
    color: var(--brand-dark);
    margin-bottom: 30px;
}
.comment-form-comment {
    margin-bottom: 20px;
}
.comment-form-comment textarea,
.comment-form-author input,
.comment-form-email input,
.comment-form-url input {
    width: 100%;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 15px;
    font-family: var(--font-body);
    font-size: 16px;
    transition: var(--transition-fast);
}
.comment-form-comment textarea:focus,
.comment-form-author input:focus,
.comment-form-email input:focus,
.comment-form-url input:focus {
    border-color: var(--brand-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}
.form-submit .submit {
    background-color: var(--brand-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 25px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition-fast);
}
.form-submit .submit:hover {
    background-color: #b91c1c; /* Darker red */
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ==========================================================================
   ELITE TRANSFORMATION: Smart Header, Fluid Typography & Animations
   ========================================================================== */

/* 1. Glassmorphism & Smart Sticky Header */
.site-header {
    background-color: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 9999;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.site-header.headroom--unpinned {
    transform: translateY(-100%);
}
.site-header.headroom--pinned {
    transform: translateY(0);
}

/* Compensate for fixed header */
body {
    padding-top: 80px;
}

/* 2. Fluid Typography */
html {
    font-size: clamp(16px, 1vw + 12px, 18px);
}
h1, .entry-title {
    font-size: clamp(28px, 4vw + 1rem, 42px) !important;
}
h2 {
    font-size: clamp(24px, 3vw + 1rem, 32px) !important;
}

/* Note: Scroll Animations Removed for stability */

/* ==========================================================================
   UNIQUE V3: Editorial Overlap, Smart Cursor, Kinetic Background
   ========================================================================== */

/* 1. Deep Parallax Kinetic Background */
.bg-kinetic-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    font-size: 25vw;
    font-weight: 800;
    color: rgba(0, 0, 0, 0.02); /* Extremely subtle */
    z-index: -1;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

/* ==========================================================================
   THE TRUE UNIQUE V3 DESIGNS (Safe & Bulletproof)
   ========================================================================== */

/* --- 1. The Bulletproof Layout Grid for Home & Archives --- */
/* The smartest way to force a beautiful grid on GeneratePress without breaking it */
@media (min-width: 769px) {
    body.blog #main, 
    body.archive #main,
    body.category #main,
    body.search #main {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
    }
    
    /* Make the Category Header span the entire top row */
    body.blog #main > .page-header,
    body.archive #main > .page-header,
    body.category #main > .page-header,
    body.search #main > .page-header {
        width: 100% !important;
        flex: 0 0 100% !important;
        margin-bottom: 30px !important;
    }
    
    /* Reset individual articles to exactly 50% width minus half gap */
    body.blog #main > article, 
    body.archive #main > article,
    body.category #main > article,
    body.search #main > article {
        width: calc(50% - 16px) !important;
        flex: 0 0 calc(50% - 16px) !important;
        margin-right: 30px !important;
        margin-bottom: 30px !important;
        display: flex !important;
        flex-direction: column;
        height: auto !important;
        clear: none !important; /* Critical fix */
        float: none !important;
    }

    /* Remove right margin from every 2nd article to fit perfectly */
    body.blog #main > article:nth-of-type(2n), 
    body.archive #main > article:nth-of-type(2n),
    body.category #main > article:nth-of-type(2n),
    body.search #main > article:nth-of-type(2n) {
        margin-right: 0 !important;
    }
}

@media (max-width: 768px) {
    body.blog #main > article, 
    body.archive #main > article,
    body.category #main > article,
    body.search #main > article {
        width: 100% !important;
        margin-bottom: 20px !important;
        display: flex !important;
        flex-direction: column;
    }
}

/* --- Internal Card Alignment (Fix for uneven titles) --- */
body.blog #main article .inside-article, 
body.archive #main article .inside-article,
body.category #main article .inside-article,
body.search #main article .inside-article {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

/* Remove order: -1 since DOM nesting prevents it from moving above the header */
body.blog #main article .post-image, 
body.archive #main article .post-image,
body.category #main article .post-image,
body.search #main article .post-image {
    margin-bottom: 20px !important;
}

/* Reverted strict min-height. We will align these using the native Customizer tool instead for perfection! */
body.blog #main article header.entry-header, 
body.archive #main article header.entry-header,
body.category #main article header.entry-header,
body.search #main article header.entry-header {
    height: auto !important;
    min-height: 0 !important;
    margin-bottom: 15px !important; /* Closer to text below */
}

/* Compact specific typography so cards aren't too long */
body.blog #main article .entry-title, 
body.archive #main article .entry-title,
body.category #main article .entry-title,
body.search #main article .entry-title {
    font-size: 24px !important; /* Fixed smaller size */
    line-height: 1.3 !important;
    margin-bottom: 5px !important; /* Make it hug the date */
}

body.blog #main article .entry-meta, 
body.archive #main article .entry-meta,
body.category #main article .entry-meta,
body.search #main article .entry-meta {
    margin-bottom: 15px !important;
    margin-top: 0 !important;
    font-size: 13px !important;
}

body.blog #main article .entry-summary p, 
body.archive #main article .entry-summary p,
body.category #main article .entry-summary p,
body.search #main article .entry-summary p {
    line-height: 1.6 !important;
    margin-bottom: 15px !important;
    font-size: 15px !important;
}

/* Ensure empty space is absorbed at the bottom pushing the button down */
body.blog #main article .entry-summary, 
body.archive #main article .entry-summary,
body.category #main article .entry-summary,
body.search #main article .entry-summary {
    flex-grow: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    margin-top: 0 !important; /* Fix Gap 1: Removes spacing above the text */
}

body.blog #main article .entry-summary p:first-child,
body.archive #main article .entry-summary p:first-child,
body.category #main article .entry-summary p:first-child,
body.search #main article .entry-summary p:first-child {
    margin-top: 0 !important;
}

body.blog #main article .entry-summary p:last-child, 
body.archive #main article .entry-summary p:last-child,
body.category #main article .entry-summary p:last-child,
body.search #main article .entry-summary p:last-child {
    margin-top: auto !important;
    margin-bottom: 5px !important; /* Fix Gap 2: Pulls the final button closer to footer */
}

/* Fix Gap 3: Pull the footer (category meta) closer to the button */
body.blog #main article footer.entry-meta,
body.archive #main article footer.entry-meta,
body.category #main article footer.entry-meta,
body.search #main article footer.entry-meta {
    margin-top: 0 !important;
    padding-top: 10px !important;
}

/* Lock image aspect ratio so it NEVER stretches like a slit */
body.blog .post-image img, 
body.archive .post-image img,
body.category .post-image img,
body.search .post-image img {
    aspect-ratio: 4/3 !important;
    height: 100% !important;
    object-fit: cover !important;
    max-height: none !important; /* Remove the old 400px restriction */
}

/* --- 2. The Editorial Overlap for Single Articles --- */
.single .inside-article {
    background: transparent !important; /* Main container is invisible */
    box-shadow: none !important;
    padding: 0 !important;
    border: none !important;
    height: auto !important; /* Critical fix for text overlapping */
    display: block !important;
}

.single .post-image {
    margin: 0 0 -80px 0 !important; /* Negative bottom margin is safe! Pulls content UP */
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}

.single .post-image img {
    border-radius: var(--radius-lg);
    width: 100%;
}

.single .entry-header {
    background: rgba(255, 255, 255, 0.85); /* Frosted glass */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 50px !important;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hover);
    position: relative;
    z-index: 10;
    margin-left: 5%;
    margin-right: 5%;
    text-align: center;
}

.single .entry-content {
    background: var(--bg-card);
    padding: 60px 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-top: 20px;
}

/* --- 3. Static Pages Styling (Privacy, Contact, Terms) --- */
.page .inside-article {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 80px 10% !important; /* Massive elegant padding */
    max-width: 1000px;
    margin: 0 auto;
    height: auto !important; /* Critical fix for text overlapping */
    display: block !important;
}

.page .entry-title {
    font-size: 48px;
    margin-bottom: 40px;
    border-bottom: 2px solid var(--brand-primary); /* Bold red line */
    padding-bottom: 20px;
    text-align: center;
}

/* Contact Us Form Elite Styling (Includes WPForms and Elementor Forms) */
.wpforms-container input[type=text], 
.wpforms-container input[type=email], 
.wpforms-container textarea,
.elementor-field-group input,
.elementor-field-group textarea {
    width: 100% !important;
    border: 2px solid var(--border-soft) !important;
    border-radius: var(--radius-md) !important;
    padding: 18px !important;
    font-family: var(--font-body) !important;
    font-size: 16px !important;
    transition: var(--transition-fast) !important;
    background: var(--bg-body) !important;
}

.wpforms-container input:focus, 
.wpforms-container textarea:focus,
.elementor-field-group input:focus,
.elementor-field-group textarea:focus {
    border-color: var(--brand-primary) !important;
    outline: none !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 4px rgba(230, 57, 70, 0.15) !important;
}

.wpforms-container button[type=submit],
.elementor-button {
    background-color: var(--brand-dark) !important;
    color: white !important;
    border: none !important;
    border-radius: 50px !important;
    padding: 18px 40px !important;
    font-family: var(--font-heading) !important;
    font-weight: 700 !important;
    font-size: 18px !important;
    cursor: pointer !important;
    transition: var(--transition-fast) !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    box-shadow: var(--shadow-md) !important;
    width: 100%; /* Massive block button */
}

.wpforms-container button[type=submit]:hover,
.elementor-button:hover {
    background-color: var(--brand-primary) !important;
    transform: translateY(-3px) !important;
    box-shadow: var(--shadow-hover) !important;
}