/*
Theme Name: Hiniux Red (Ultimate V3)
Theme URI: https://www.hiniux.com
Author: Hiniux Dev
Description: A modern, responsive red-themed template for Smart Electronics projects.
Version: 4.2
*/

:root {
    --primary-red: #D80032;
    --hover-red: #b3002a;
    --dark-bg: #111827;
    --light-bg: #f3f4f6;
    --text-main: #333;
    --text-light: #fff;
    /* Social Colors */
    --wa-green: #25D366;
    --fb-blue: #1877F2;
    --insta-grad: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* --- Header & Navigation --- */
header {
    background-color: var(--dark-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    padding: 10px 0;
}

.navbar-brand {
    padding: 0;
    margin-right: 2rem;
    display: flex;
    align-items: center;
}

.custom-logo-link img { max-height: 55px; width: auto; }

.site-title-text {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-red) !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
}
.site-title-text span { color: white; }

.navbar-nav .nav-link {
    color: #e0e0e0 !important;
    font-weight: 500;
    padding-right: 1rem;
    padding-left: 1rem;
    transition: color 0.3s;
}
.navbar-nav .nav-link:hover { color: var(--primary-red) !important; }

.dropdown-menu { background-color: var(--dark-bg); border: 1px solid #333; }
.dropdown-item { color: #fff; }
.dropdown-item:hover { background-color: var(--primary-red); color: #fff; }

/* --- Hero Section --- */
.hero-section {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d0a0a 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
    margin-bottom: 50px;
    border-bottom: 4px solid var(--primary-red);
}

/* --- Homepage Project Cards (Grid) --- */
.project-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
}
.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(216, 0, 50, 0.15);
    border-color: var(--primary-red);
}
.project-img {
    height: 220px;
    background-color: #eee;
    overflow: hidden;
    position: relative;
}
.project-img img { width: 100%; height: 100%; object-fit: cover; }
.project-body { padding: 25px; flex-grow: 1; display: flex; flex-direction: column; }
.project-title a {
    text-decoration: none;
    color: #222;
    font-size: 1.35rem;
    font-weight: 700;
    display: block;
    margin-bottom: 10px;
}
.project-title a:hover { color: var(--primary-red); }

/* Grid Buttons (View & Buy) */
.card-btn-group {
    margin-top: auto;
    display: flex;
    gap: 10px;
}
.btn-hiniux {
    background-color: var(--primary-red);
    color: white;
    padding: 8px 0;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    flex: 1;
    transition: background 0.2s;
}
.btn-hiniux:hover { background-color: var(--hover-red); color: white; }

.btn-buy-now {
    background-color: #25D366; 
    color: white;
    padding: 8px 0;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    flex: 1;
    transition: background 0.2s;
}
.btn-buy-now:hover { background-color: #1ebe57; color: white; }


/* --- Sidebar Widgets --- */
.widget-card {
    background: white;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}
.widget-header {
    background: var(--primary-red);
    color: white;
    padding: 15px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
}
.widget-body { padding: 20px; }
.hover-red:hover { color: var(--primary-red) !important; font-weight: bold; }

/* --- Footer --- */
footer {
    background-color: var(--dark-bg);
    color: #aaa;
    padding: 60px 0 30px;
    margin-top: 80px;
    border-top: 5px solid var(--primary-red);
}
footer h4 {
    color: #fff;
    margin-bottom: 25px;
    border-left: 3px solid var(--primary-red);
    padding-left: 15px;
}
footer a { color: #aaa; text-decoration: none; transition: 0.2s; }
footer a:hover { color: var(--primary-red); padding-left: 5px; }


/* =======================================================
   NEW SINGLE POST LAYOUT (V3 Responsive Fix)
   ======================================================= */

/* 1. Main Post Container */
.post-card {
    background-color: #ffffff;
    width: 100%;
    margin-bottom: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    border: 1px solid #eaeaea;
    overflow: hidden;
}

/* 2. Featured Image Wrapper */
.featured-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

/* 3. Content Area Padding (Desktop Default) */
.post-content {
    padding: 50px 60px; /* Spacious reading area */
}

/* 4. Post Typography */
.post-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #111;
    margin-bottom: 15px;
    line-height: 1.2;
}

.content-area {
    font-size: 1.125rem; /* ~18px for better readability */
    line-height: 1.8;
    color: #333;
}
.content-area p { margin-bottom: 25px; }

/* 5. Code Block Fixes */
pre, code {
    white-space: pre-wrap;
    word-wrap: break-word;
    background: #f8f9fa;
    color: #d63384;
    padding: 2px 5px;
    border-radius: 4px;
}
pre { padding: 15px; border: 1px solid #ddd; }

/* --- Affiliate & Social Elements --- */
.share-btn {
    color: white !important;
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 10px;
    border: none;
    cursor: pointer;
    transition: opacity 0.3s;
}
.share-btn:hover { opacity: 0.9; color: white; }
.btn-wa { background-color: var(--wa-green); }
.btn-fb { background-color: var(--fb-blue); }
.btn-insta { background: var(--insta-grad); }

.affiliate-box {
    background-color: #fff;
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 25px;
    margin-top: 40px;
    text-align: center;
    transition: 0.3s;
}
.affiliate-box:hover { border-color: var(--primary-red); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.affiliate-title { font-size: 1.2rem; font-weight: bold; margin-bottom: 20px; color: #444; text-transform: uppercase; }

.aff-btn {
    display: flex; align-items: center; justify-content: center; width: 100%; padding: 12px; margin-bottom: 10px;
    border-radius: 8px; text-decoration: none; font-weight: 700; font-size: 1.1rem; transition: transform 0.2s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.aff-btn:hover { transform: translateY(-3px); text-decoration: none; color: white; }
.btn-amazon { background-color: #232F3E; color: #ffffff !important; border-left: 5px solid #FEBD69; }
.btn-amazon span { color: #FEBD69; margin-left: 5px; }
.btn-flipkart { background-color: #2874F0; color: #ffffff !important; border-left: 5px solid #FFE500; }
.btn-flipkart span { color: #FFE500; margin-left: 5px; }

.aff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.wa-order-box { margin-top: 20px; padding-top: 20px; border-top: 1px dashed #ddd; text-align: center; }
.btn-wa-direct {
    background-color: #25D366; color: white !important; display: block; width: 100%; padding: 15px; border-radius: 8px;
    font-size: 1.1rem; font-weight: bold; text-decoration: none; box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
    transition: transform 0.2s, box-shadow 0.2s; border: 2px solid #25D366;
}
.btn-wa-direct:hover { background-color: #1ebe57; transform: translateY(-3px); box-shadow: 0 8px 15px rgba(37, 211, 102, 0.4); color: white; }
.form-control:focus { border-color: var(--primary-red); box-shadow: 0 0 0 0.25rem rgba(216, 0, 50, 0.25); }


/* =======================================================
   MOBILE RESPONSIVE OVERRIDES (THE FIX)
   ======================================================= */
@media screen and (max-width: 768px) {
    
    /* 1. Affiliates stack vertically */
    .aff-grid { grid-template-columns: 1fr; } 

    /* 2. Flatten the Post Card */
    .post-card {
        border-radius: 0;
        box-shadow: none;
        border: none;
        margin-bottom: 20px;
    }

    /* 3. Reduce Padding (Low Margin) */
    .post-content {
        padding: 20px 15px; /* 15px padding for mobile */
    }

    /* 4. Typography Scaling */
    .post-title {
        font-size: 1.8rem;
    }
    .content-area {
        font-size: 1rem; /* 16px */
    }

    /* 5. Full Bleed Images */
    .content-area img,
    .content-area figure {
        width: calc(100% + 30px) !important;
        max-width: calc(100% + 30px) !important;
        margin-left: -15px !important;
        margin-right: -15px !important;
        height: auto;
        border-radius: 0;
    }
}