/*
Theme Name:AdsensePress
Theme URI: http://afly.in
Author: AFLY INDIA
Author URI: http://afly.in
Description: A modern, premium blog theme featuring a sleek glassmorphism design. Specially crafted to meet AdSense-friendly standards, with a clean layout, fast loading speed, and optimized structure to improve approval chances and enhance user experience..
Version: 2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: aflyblog
*/

/* CSS Reset & Variables for easy color management */
:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --text-main: #111827;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --bg-table-header: #f1f5f9;
    --bg-info-box: #f0f9ff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- Premium Floating Site Header Styling --- */
.site-header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 1.5rem;
    z-index: 1000;
    max-width: 1200px;
    margin: 1.5rem auto 3rem auto;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

.header-container {
    padding: 1rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; 
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    color: var(--primary-color);
}

.logo img {
    max-height: 40px;
    width: auto;
}

/* Hamburger Menu Toggle Button (Hidden on Desktop) */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger-bar {
    display: block;
    width: 24px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--text-main);
    transition: all 0.3s ease-in-out;
    border-radius: 3px;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.main-navigation a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.main-navigation a:hover {
    color: var(--primary-color);
}

.nav-cta a {
    background-color: var(--primary-color);
    color: white !important;
    padding: 0.5rem 1.25rem;
    border-radius: 30px;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: inline-block;
}

.nav-cta a:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

/* --- Main Content & Grid Layout (Home) --- */
.home-main {
    max-width: 1280px;
    margin: 0 auto 4rem auto;
    padding: 0 2rem;
}

.section-title {
    margin-bottom: 2.5rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

/* --- Article Card Styling --- */
.card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02), 0 10px 15px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    height: 100%;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.08), 0 10px 10px rgba(0, 0, 0, 0.04);
}

/* Image Wrapper with exact 1024x559 Aspect Ratio */
.card-img-wrapper {
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1024 / 559; 
    background-color: #f1f5f9; 
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    border-bottom: 1px solid var(--border-color);
    transition: transform 0.5s ease;
    display: block;
}

.card:hover .card-img {
    transform: scale(1.03);
}

.card-content {
    /* Reduced padding to trim the card height */
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}

.card-category {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
    display: inline-block;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    color: var(--text-main);
}

.card-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    /* Removed bottom margin since there is no button below it */
    margin-bottom: 0; 
}
.card-excerpt p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

/* --- Single Article Layout --- */
.layout-container {
    max-width: 1280px;
    margin: 0 auto 4rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 3rem;
}

.article-main {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
}

.article-header {
    margin-bottom: 2.5rem;
    position: static;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
}

.article-category {
    display: inline-block;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.article-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: var(--text-light);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    flex-wrap: wrap;
}

.meta-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    color: var(--text-main);
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* WP Content Elements */
.article-content {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content h1, .article-content h2, .article-content h3, .article-content h4, .article-content h5, .article-content h6 {
    color: var(--text-main);
    line-height: 1.3;
}

.article-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 3rem;
    margin-bottom: 1.25rem;
}

.article-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.wp-caption {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: -1.5rem;
    margin-bottom: 2rem;
    font-style: italic;
}

.wp-block-quote, blockquote {
    background-color: var(--bg-info-box);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
    font-size: 1rem;
    color: var(--text-main);
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
    margin: 2.5rem 0;
}

.article-content th {
    background-color: var(--bg-table-header);
    font-weight: 600;
    color: var(--text-main);
    padding: 1rem 1.25rem;
    border-bottom: 2px solid var(--border-color);
}

.article-content td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* --- Sidebar Styling (WP Widgets) --- */
.sidebar {
    position: sticky;
    top: 7rem;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.widget {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--bg-body);
}

.widget ul {
    list-style: none;
}

.widget li {
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget li:last-child {
    margin-bottom: 0;
}

.widget a {
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.widget a:hover {
    color: var(--primary-color);
}

.widget_categories .post-count, .widget_archive .post-count {
    background: var(--bg-body);
    padding: 0.1rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* --- Footer Styling --- */
footer {
    background: var(--bg-card);
    padding: 4rem 2rem 2rem 2rem;
    border-top: 1px solid var(--border-color);
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.footer-menu ul {
    list-style: none;
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-menu a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.footer-menu a:hover {
    color: var(--primary-color);
}

.copyright {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
}


/* --- Responsive Design (Hamburger Menu & Mobile Layout) --- */

@media (max-width: 1240px) {
    .site-header { margin-left: 1rem; margin-right: 1rem; }
}

@media (max-width: 1024px) {
    .grid-container { grid-template-columns: repeat(3, 1fr); }
    .layout-container { grid-template-columns: 1fr; }
    .sidebar { position: static; }
}

/* Tablet & Mobile Menu Toggle Point */
@media (max-width: 768px) {
    
    .menu-toggle {
        display: block; 
    }
    
    /* Forced display none to block WP core CSS conflicts */
    .main-navigation {
        display: none !important; 
        width: 100%;
        margin-top: 1rem;
        padding-top: 1.5rem;
        padding-bottom: 1rem;
        border-top: 1px solid var(--border-color);
    }
    
    /* Forced display block when toggled */
    .main-navigation.toggled {
        display: block !important; 
        animation: slideDown 0.3s ease-out;
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
    }
    
    .menu-toggle.is-active .hamburger-bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .menu-toggle.is-active .hamburger-bar:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.is-active .hamburger-bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .grid-container { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
    .site-header { top: 1rem; margin-top: 1rem; border-radius: 30px; }
    .article-title { font-size: 2rem; }
    .article-main { padding: 2rem; }
}

/* Small Mobile Screen */
@media (max-width: 600px) {
    .home-main, .layout-container {
        padding: 0 1rem;
    }
    
    .site-header {
        top: 0.5rem;
        margin: 0.5rem 1rem 2rem 1rem;
        border-radius: 20px;
    }
    .header-container { 
        padding: 1rem; 
    }

    .grid-container { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 1rem; 
    }
    
    .card-content {
        padding: 0.75rem;
    }
    .card-category {
        font-size: 0.65rem;
        margin-bottom: 0.4rem;
        padding: 0.15rem 0.5rem;
    }
    .card-title {
        font-size: 0.95rem;
        margin-bottom: 0.4rem;
        line-height: 1.3;
    }
    .card-excerpt p {
        -webkit-line-clamp: 2;
        font-size: 0.8rem;
    }

    .article-main {
        padding: 1.5rem 1rem;
        border-radius: 12px;
    }
    .article-title {
        font-size: 1.6rem;
    }
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .article-content {
        font-size: 1rem;
    }

    .widget {
        padding: 1.5rem;
    }

    footer {
        padding: 3rem 1rem 2rem 1rem;
    }
    .footer-menu ul { 
        gap: 1rem; 
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 380px) {
    .grid-container {
        grid-template-columns: 1fr; 
    }
}