/**
 * Theme Name: Astra Child
 * Template: astra
 * Author: NetworkUstad
 * Version: 1.0.0
 * Description: Child theme for Astra with custom modifications
 */

/* ========== Base Styles & Variables ========== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Color Scheme */
    --primary-blue: #2563eb;
    --dark-blue: #1e3a8a;
    --light-gray: #f8fafc;
    --accent-gray: #64748b;
    --text-dark: #1e293b;
    
    /* Effects */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: 1px solid rgba(255, 255, 255, 0.2);
    --glass-blur: blur(12px);
    --shadow-sm: 0 4px 6px rgba(0,0,0,0.05);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--light-gray);
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ========== Responsive Container ========== */
@media (max-width: 1200px) {
    .container {
        max-width: 1000px;
    }
}

@media (max-width: 1024px) {
    .container {
        max-width: 900px;
        padding: 0 30px;
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 0 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
}

/* ========== Modern Section Headers ========== */
.section-header {
    margin: 80px 0;
    position: relative;
    text-align: center;
    padding: 0 20px;
}

.section-title {
    display: inline-block;
    font-size: 2rem;  /* Reduced from 2.8rem */
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 15px;
    position: relative;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #1e3a8a, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    padding: 0 25px 12px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #1e3a8a);
    border-radius: 2px;
}

.section-subtitle {
    color: #64748b;
    font-size: 1.25rem;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
    position: relative;
    padding: 0 20px;
    font-weight: 400;
}

/* Decorative Elements */
.section-header::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, rgba(255,255,255,0) 70%);
    z-index: -1;
    opacity: 0.8;
}

/* Section Containers */
.trending-section,
.articles-section,
.tools-section {
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

/* Unique Background Patterns */
.trending-section {
    background: 
        radial-gradient(circle at 10% 20%, rgba(30, 58, 138, 0.03) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.03) 0%, transparent 20%),
        #ffffff;
    border-top: 1px solid rgba(203, 213, 225, 0.3);
    border-bottom: 1px solid rgba(203, 213, 225, 0.3);
}

.articles-section {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    position: relative;
}

.articles-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(30, 58, 138, 0.1), transparent);
}

.tools-section {
    background: 
        linear-gradient(135deg, #ffffff 0%, #f8fafc 100%),
        repeating-linear-gradient(
            45deg,
            rgba(30, 58, 138, 0.02),
            rgba(30, 58, 138, 0.02) 1px,
            transparent 1px,
            transparent 10px
        );
}

/* Hover Effects */
.section-title {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-title:hover {
    transform: translateY(-2px);
    text-shadow: 0 5px 15px rgba(30, 58, 138, 0.1);
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .section-title {
        font-size: 1.7rem;  /* Reduced from 2.4rem */
    }
    
    .section-subtitle {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .section-header {
        margin: 50px 0 40px;
    }
    
    .section-title {
        font-size: 1.6rem;  /* Reduced from 2rem */
        padding: 0 20px 10px;
    }
    
    .section-subtitle {
        font-size: 1.05rem;
        padding: 0 15px;
    }
    
    .trending-section,
    .articles-section,
    .tools-section {
        padding: 70px 0;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.4rem;  /* Reduced from 1.8rem */
    }
    
    .section-subtitle {
        font-size: 0.95rem;
    }
}

@media (max-width: 360px) {
    .section-title {
        font-size: 1.6rem;
        font-size: 1.4rem;
        padding: 8px 15px;
    }
}

/* ========== Hero Section ========== */
.home-hero {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--dark-blue) 0%, var(--primary-blue) 100%);
    color: white;
    padding: 80px 0;
    overflow: hidden;
}

.hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.hero-bg-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg,
        rgba(30, 58, 138, 0.9) 0%,
        rgba(37, 99, 235, 0.7) 100%
    );
}

.hero-bg-image img { /* Added rule */
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block; /* Ensure it behaves as a block element */
}

.hero-content {
    position: relative;
    z-index: 2;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    margin: 20px;
    max-width: 800px;
}

.hero-title {
    font-size: 2.8rem;
    line-height: 1.2;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    color: #ffffff; /* White text on desktop */
}

.hero-subtext {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 30px;
    line-height: 1.5;
    color: #ffffff; /* White text on desktop */
}

.hero-cta {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Hero Responsive Design */
@media (max-width: 1200px) {
    .hero-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 1024px) {
    .home-hero {
        min-height: 500px;
        padding: 60px 0;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtext {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .home-hero {
        min-height: 400px;
        padding: 40px 0;
    }
    
    .hero-title,
    .hero-subtext {
        color: #1d4ed8; /* Blue text on mobile */
    }
    
    .hero-content {
        padding: 30px;
        margin: 15px;
    }
    
    .hero-title {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }
    
    .hero-subtext {
        font-size: 1rem;
        margin-bottom: 25px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.6rem;
    }
    
    .hero-content {
        padding: 25px;
        border-radius: 15px;
    }
    
    .hero-cta {
        flex-direction: column;
    }
    
 }

@media (max-width: 360px) {
    .hero-title {
        font-size: 1.4rem;
    }
    
    .hero-subtext {
        font-size: 0.9rem;
    }
}

/* Landscape Mobile Optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .home-hero {
        min-height: 300px;
    }
    
    .hero-title {
        font-size: 1.6rem;
    }
}

/* ========== Trending Technologies Hub ========== */
.trending-section {
    padding: 4rem 0;
    background: #f8fafc;
}

.trend-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.trend-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.trend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.trend-header h3 {
    font-size: 1.375rem;
    color: #1e293b;
    margin: 0;
    line-height: 1.3;
}

.trend-tag {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    padding: 0.375rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.trend-description {
    color: #64748b;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.trend-stats {
    display: grid;
    gap: 1rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
}

.stat-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 1.25rem;
}

.stat-icon.up {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.stat-icon.down {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-value {
    display: block;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.stat-label {
    display: block;
    color: #64748b;
    font-size: 0.875rem;
}

/* Responsive Grid Adjustments */
@media (max-width: 1024px) {
    .trend-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .trend-header h3 {
        font-size: 1.25rem;
    }
    
    .trend-tag {
        padding: 0.3rem 0.9rem;
    }
}

@media (max-width: 768px) {
    .trending-section {
        padding: 3rem 0;
    }
    
    .trend-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .trend-card {
        padding: 1.25rem;
    }
    
    .trend-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stat-item {
        padding: 0.625rem;
    }
}

@media (max-width: 480px) {
    .trend-card {
        padding: 1rem;
    }
    
    .trend-description {
        font-size: 0.875rem;
    }
    
    .stat-icon {
        width: 28px;
        height: 28px;
        font-size: 1.1rem;
    }
    
    .stat-value {
        font-size: 0.875rem;
    }
}

/* Landscape Mobile Layout */
@media (max-width: 768px) and (orientation: landscape) {
    .trend-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .trend-card {
        padding: 1rem;
    }
}

/* ========== Latest Articles ========== */
.articles-section {
    padding: 4rem 0;
    background: white;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.article-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.3s ease;
    overflow: hidden;
}

.article-thumbnail {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    aspect-ratio: 16/9;
}

.article-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.article-content h3 {
    font-size: 1.25rem;
    margin: 0 0 0.75rem 0;
    line-height: 1.3;
}

.article-content h3 a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.category {
    color: #2563eb;
    font-weight: 600;
    background: rgba(37, 99, 235, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .article-content h3 {
        font-size: 1.15rem;
    }
}

@media (max-width: 768px) {
    .articles-section {
        padding: 3rem 0;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .article-card {
        padding: 1.25rem;
    }
    
    .article-content h3 {
        font-size: 1.1rem;
    }
    
    .post-meta {
        font-size: 0.825rem;
    }
}

@media (max-width: 480px) {
    .article-card {
        padding: 1rem;
    }
    
    .article-content h3 {
        font-size: 1rem;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Landscape Optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .article-thumbnail {
        aspect-ratio: 2/1;
    }
}

/* ========== Editor's Picks ========== */
.editors-picks {
    padding: 4rem 0;
    background: #f8fafc;
}

.picks-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.pick-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.3s ease;
    overflow: hidden;
}

.pick-thumbnail {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    aspect-ratio: 16/9;
}

.pick-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.pick-content h3 {
    font-size: 1.25rem;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.pick-content h3 a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.pick-content p {
    font-size: 0.95rem;
    color: #64748b;
    margin-top: 10px;
    line-height: 1.6;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .picks-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .pick-thumbnail {
        margin-bottom: 12px;
    }
    
    .pick-content h3 {
        font-size: 1.15rem;
    }
}

@media (max-width: 768px) {
    .editors-picks {
        padding: 3rem 0;
    }
    
    .picks-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .pick-card {
        padding: 1.25rem;
    }
    
    .pick-content h3 {
        font-size: 1.1rem;
    }
    
    .pick-content p {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .pick-card {
        padding: 1rem;
    }
    
    .pick-content h3 {
        font-size: 1rem;
    }
}

/* Landscape Optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .picks-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pick-thumbnail {
        aspect-ratio: 2/1;
    }
}

/* Hover Effects */
.pick-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}

.pick-content h3 a:hover {
    color: #2563eb;
}

.pick-thumbnail img:hover {
    transform: scale(1.05);
}

/* ========== About Section ========== */
.about-section {
    padding: 100px 0;
    background: linear-gradient(175deg, #ffffff 0%, var(--light-gray) 100%);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-visual {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
}

.visual-main {
    position: relative;
    z-index: 1;
    border-radius: 20px;
    overflow: hidden;
    transform: rotate(-2deg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
}

.visual-main img {
    width: 100%;
    height: 500px;
    object-fit: cover;
}

.visual-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-40%, -50%);
    width: 110%;
    height: 110%;
    background: linear-gradient(45deg, 
        rgba(37, 99, 235, 0.1) 0%, 
        rgba(255,255,255,0.2) 50%, 
        rgba(37, 99, 235, 0.1) 100%
    );
    backdrop-filter: blur(10px);
    border-radius: 25px;
    z-index: 0;
}

.tech-chip {
    position: absolute;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 600;
    color: var(--dark-blue);
}

.tech-chip:nth-child(1) { top: 10%; left: 5%; }
.tech-chip:nth-child(2) { top: 70%; right: 5%; }
.tech-chip:nth-child(3) { bottom: 10%; left: 30%; }

.about-highlight {
    margin-bottom: 40px;
}

.about-highlight h3 {
    font-size: 2.2rem;
    color: var(--dark-blue);
    margin-bottom: 20px;
    line-height: 1.2;
}

.about-highlight p {
    font-size: 1.2rem;
    color: var(--accent-gray);
    border-left: 3px solid var(--primary-blue);
    padding-left: 20px;
}

.modern-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 40px 0;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.core-values {
    display: grid;
    gap: 30px;
    margin-top: 40px;
}

.value-item {
    display: flex;
    gap: 20px;
    align-items: start;
    padding: 25px;
    background: rgba(255,255,255,0.6);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.value-icon {
    font-size: 2rem;
    padding: 15px;
    background: var(--primary-blue);
    color: white;
    border-radius: 10px;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .about-grid {
        gap: 40px;
    }
    
    .visual-main img {
        height: 400px;
    }
}

@media (max-width: 1024px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }
    
    .about-highlight h3 {
        font-size: 2rem;
    }
    
    .modern-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .about-section {
        padding: 60px 0;
    }
    
    .modern-stats {
        grid-template-columns: 1fr;
    }
    
    .value-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .tech-chip {
        font-size: 0.9rem;
        padding: 6px 15px;
    }
}

@media (max-width: 480px) {
    .about-highlight h3 {
        font-size: 1.8rem;
    }
    
    .about-highlight p {
        font-size: 1rem;
        padding-left: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .value-item {
        padding: 20px;
    }
    
    .value-icon {
        font-size: 1.5rem;
        padding: 10px;
    }
}

@media (max-width: 360px) {
    .tech-chip {
        display: none;
    }
    
    .about-highlight h3 {
        font-size: 1.6rem;
    }
}

/* Landscape Optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .about-grid {
        grid-template-columns: 1fr;
    }
    
    .visual-main img {
        height: 300px;
    }
}

/* ========== Tools Section ========== */
.tools-section {
    padding: 80px 0;
    background: var(--light-gray);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.tool-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    padding: 30px;
    border-radius: 15px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.internal-tool {
    border: 2px solid var(--primary-blue);
    background: linear-gradient(145deg, 
        rgba(37, 99, 235, 0.05) 0%, 
        rgba(255,255,255,0.15) 100%
    );
}

.tool-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
    opacity: 0.9;
    color: var(--primary-blue);
}

.tool-title {
    font-size: 1.3rem;
    color: var(--dark-blue);
    margin-bottom: 15px;
    line-height: 1.4;
}

.tool-description {
    font-size: 0.95rem;
    color: var(--accent-gray);
    line-height: 1.6;
    margin-bottom: 20px;
}

.tool-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-blue);
    color: white!important;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    margin-top: 20px;
    transition: var(--transition);
    position: relative;
}

.new-badge {
    background: #22c55e;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    position: absolute;
    right: -8px;
    top: -8px;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .tool-card {
        padding: 25px;
    }
    
    .tool-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    .tools-section {
        padding: 60px 0;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .tool-icon {
        font-size: 2rem;
    }
    
    .tool-cta {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .tool-card {
        padding: 20px;
    }
    
    .tool-title {
        font-size: 1.1rem;
    }
    
    .tool-description {
        font-size: 0.875rem;
    }
    
    .new-badge {
        right: 0;
        top: 0;
    }
}

@media (max-width: 360px) {
    .tool-icon {
        font-size: 1.8rem;
    }
    
    .tool-cta {
        padding: 10px 20px;
    }
}

/* Hover Effects */
.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.tool-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37,99,235,0.2);
}

/* Landscape Optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tool-card {
        padding: 20px;
    }
}

/* ========== Glassmorphism Header ========== */
/* ========== Header Section ========== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: linear-gradient(135deg, 
        rgba(30, 58, 138, 0.95) 0%,
        rgba(37, 99, 235, 0.92) 100%
    );
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.8rem 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Logo Styles */
.logo img {
    height: 42px;
    width: auto;
    filter: brightness(0) invert(1);
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.05);
}

/* Desktop Navigation */
.desktop-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-grow: 1;
}

.primary-menu {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.primary-menu a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-weight: 500;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.primary-menu a:hover,
.primary-menu .current-menu-item a {
    background: rgba(255, 255, 255, 0.12);
}

/* Search Form */
.header-search {
    margin-left: auto;
}

.search-form {
    position: relative;
    width: 240px;
}

.search-form input[type="search"] {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 0.6rem 2.5rem 0.6rem 1.2rem;
    color: white;
    width: 100%;
    backdrop-filter: blur(5px);
}

.search-form button {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
}

/* Mobile Navigation */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 0.5rem;
    cursor: pointer;
}

.mobile-nav {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, 
        rgba(30, 58, 138, 0.98) 0%,
        rgba(37, 99, 235, 0.95) 100%
    );
    backdrop-filter: blur(20px);
    padding: 6rem 2rem 2rem;
    transition: left 0.4s ease;
    z-index: 998;
}

.mobile-nav.active {
    left: 0;
}

.mobile-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    padding: 1rem;
    display: block;
    border-radius: 8px;
    transition: background 0.3s ease;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .desktop-nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .header-search {
        display: none;
    }
    
    .mobile-nav .search-form {
        display: block !important;
        width: 100%;
        max-width: 400px;
        margin: 1rem auto;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 1.5rem;
    }
    
    .logo img {
        height: 36px;
    }
    
    .mobile-nav {
        padding: 5rem 1.5rem;
    }
    
    .search-form input[type="search"] {
        padding: 0.8rem 2.5rem 0.8rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .mobile-nav {
        padding: 4rem 1rem;
    }
    
    .mobile-menu a {
        padding: 0.8rem;
    }
}

/* Hero Section Search Fix */
.home-hero .search-form {
    display: none !important;
}

/* ========== Global Mobile Optimizations ========== */
@media (max-width: 768px) {
    /* Ensure click targets meet WCAG standards */
    a, button, .btn, .menu-toggle {
        min-width: 48px;
        min-height: 48px;
        /* Ensure text/icons within are centered for easier interaction */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Improve touch target spacing - already handled by min-height/width and padding on .btn */
    /* .hero-cta .btn, .tool-cta {
        padding: 14px 25px;
    } */

    /* Prevent horizontal overflow */
    html, body {
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* Optimize images for mobile */
    img {
        max-width: 100%;
        height: auto;
    }
}

/* ========== Performance Optimizations ========== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== Print Styles ========== */
@media print {
    .main-header, .mobile-nav {
        display: none !important;
    }

    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }

    .trend-card, .article-card, .pick-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* ========== WordPress Core Alignment ========== */
.alignwide {
    max-width: 1200px;
    margin: 0 auto;
}

.alignfull {
    margin: 0 calc(50% - 50vw);
    max-width: 100vw;
    width: 100vw;
}

/* ========== Final Accessibility Checks ========== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

[aria-current="page"] {
    font-weight: 700;
}
/* ========== Mobile Grid Force 1 Column & Other Mobile Optimizations ========== */
@media (max-width: 768px) {
    /* Force single column layout for all grids */
    .trend-grid,
    .articles-grid,
    .picks-grid,
    .tools-grid,
    .about-grid, /* Added from later rule */
    .ts-grid, /* Added from later rule */
    .ts-stats-grid, /* Added from later rule */
    .modern-stats {
        grid-template-columns: 1fr !important;
    }

    /* Ensure grid items span full width in single column */
    .articles-grid > *,
    .trend-grid > *,
    .picks-grid > *,
    .tools-grid > *,
    .about-grid > *,
    .ts-grid > *,
    .ts-stats-grid > * {
        grid-column: 1 / -1 !important;
    }

    /* Force single column even in landscape for specified grids */
    @media (orientation: landscape) {
        .trend-grid,
        .articles-grid,
        .picks-grid,
        .tools-grid {
            grid-template-columns: 1fr !important;
        }
    }

    /* Mobile menu spacing */
    .mobile-menu a {
        padding: 15px 0; /* Consistent padding */
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    /* Simplify glass effects on mobile for performance */
    .hero-content,
    .tool-card,
    .value-item {
        backdrop-filter: none !important; /* Ensure override */
        -webkit-backdrop-filter: none !important; /* Ensure override */
        background: rgba(255,255,255,0.9); /* Fallback background */
    }
    .main-header { /* Consolidate header padding for mobile */
        padding: 10px 0;
    }
}

/* ===== Mobile Menu & Overlay ===== */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 997;
    display: none;
}

.mobile-overlay.active {
    display: block;
}

/* This block is now consolidated into the @media (max-width: 768px) above */

/* ===== Image Optimization ===== */
.article-thumbnail img,
.pick-thumbnail img,
.visual-main img {
    width: 100%;
    height: auto; /* This maintains aspect ratio */
    /* max-height: 50vh; Removed as specific containers handle aspect ratios better */
}


/* ========== Performance Optimizations ========== */
/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Optimize image rendering - Removed specific rules, browser defaults are often better */
/* img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
} */

/* Improve scrolling performance - will-change should be used sparingly and specifically */
/* * {
  will-change: unset;
} Removed */

/* Remove transitions on mobile */
@media (max-width: 768px) {
  .pick-card:hover,
  .tool-card:hover {
    transform: none !important;
    box-shadow: none !important;
  }
  
  .pick-thumbnail img:hover,
  .article-thumbnail img:hover {
    transform: none !important;
  }
}