/**
 * Blog Home Page Custom Styles
 * SEO & AdSense Optimized
 * Responsive & Fast Loading
 */

/* ============================================
   CSS Variables & Root Settings
   ============================================ */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #f59e0b;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --overlay-dark: rgba(0, 0, 0, 0.6);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ============================================
   Global Resets & Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-fast);
}

a:hover {
    color: var(--primary-color);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

/* ============================================
   Hero Slider Section
   ============================================ */
.hero-section {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #000;
}

.hero-slider {
    position: relative;
}

.hero-slide {
    position: relative;
    height: 650px;
    overflow: hidden;
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-placeholder {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 2rem 0;
}

.hero-category {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background-color: var(--accent-color);
    color: var(--bg-white);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 2px;
    margin-bottom: 1.5rem;
    transition: all var(--transition-base);
}

.hero-category:hover {
    background-color: #d97706;
    transform: translateY(-2px);
    color: var(--bg-white);
}

.hero-title {
    font-size: 3rem;
    color: var(--bg-white);
    margin-bottom: 1.25rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.hero-title a {
    color: var(--bg-white);
}

.hero-title a:hover {
    color: var(--accent-color);
}

.hero-excerpt {
    font-size: 1.125rem;
    color: #e5e7eb;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.hero-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    color: #d1d5db;
    font-size: 0.95rem;
}

.hero-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-meta i {
    font-size: 0.875rem;
}

.btn-hero {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background-color: var(--primary-color);
    color: var(--bg-white);
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-lg);
}

.btn-hero:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    color: var(--bg-white);
}

/* Slick Slider Customization */
.hero-slider .slick-dots {
    bottom: 30px;
    z-index: 3;
}

.hero-slider .slick-dots li button:before {
    font-size: 12px;
    color: var(--bg-white);
    opacity: 0.5;
}

.hero-slider .slick-dots li.slick-active button:before {
    color: var(--accent-color);
    opacity: 1;
}

.hero-slider .slick-prev,
.hero-slider .slick-next {
    width: 50px;
    height: 50px;
    z-index: 3;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: all var(--transition-base);
}

.hero-slider .slick-prev:hover,
.hero-slider .slick-next:hover {
    background-color: var(--primary-color);
}

.hero-slider .slick-prev {
    left: 30px;
}

.hero-slider .slick-next {
    right: 30px;
}

.hero-slider .slick-prev:before,
.hero-slider .slick-next:before {
    font-size: 24px;
    opacity: 1;
}

/* ============================================
   Headlines Section
   ============================================ */
.headlines-section {
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.headlines-wrapper {
    background-color: var(--bg-light);
    border-radius: 4px;
    padding: 0.75rem 1.25rem;
}

.headlines-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    padding-right: 1rem;
    border-right: 2px solid var(--primary-color);
}

.headlines-ticker {
    overflow: hidden;
}

.headline-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.headline-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--accent-color);
    color: var(--bg-white);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 2px;
    text-transform: uppercase;
    white-space: nowrap;
}

.headline-title {
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.headline-title:hover {
    color: var(--primary-color);
}

/* ============================================
   Section Headers
   ============================================ */
.section-header {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-weight: 800;
    position: relative;
    display: inline-block;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-top: 1rem;
}

/* ============================================
   Category Grid Section (6 Categories)
   ============================================ */
.category-grid-section {
    background-color: var(--bg-white);
}

.category-card {
    display: block;
    padding: 2.5rem 2rem;
    background-color: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    text-align: center;
    transition: all var(--transition-base);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.category-card:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: 0;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.category-card:hover:before {
    opacity: 1;
}

.category-card:hover * {
    color: var(--bg-white);
}

.category-icon {
    position: relative;
    z-index: 1;
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 50%;
    font-size: 2rem;
    color: var(--bg-white);
    transition: all var(--transition-base);
}

.category-card:hover .category-icon {
    background: var(--bg-white);
    color: var(--primary-color);
    transform: scale(1.1);
}

.category-title {
    position: relative;
    z-index: 1;
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    font-weight: 700;
    transition: color var(--transition-base);
}

.category-description {
    position: relative;
    z-index: 1;
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
    transition: color var(--transition-base);
}

.category-count {
    position: relative;
    z-index: 1;
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--bg-light);
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 20px;
    transition: all var(--transition-base);
}

.category-card:hover .category-count {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--bg-white);
}

/* ============================================
   Blog Posts Section
   ============================================ */
.blog-posts-section {
    background-color: var(--bg-light);
}

.blog-card {
    background-color: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    height: 100%;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
}

.blog-card.animate-in {
    opacity: 1;
    transform: translateY(0);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.blog-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background-color: var(--bg-light);
}

.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.blog-card:hover .blog-image img {
    transform: scale(1.08);
}

.blog-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e0e7ff 0%, #dbeafe 100%);
    color: var(--primary-color);
    font-size: 3rem;
}

.blog-category-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 0.5rem 1rem;
    background-color: var(--accent-color);
    color: var(--bg-white);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 3px;
    z-index: 2;
    box-shadow: var(--shadow-md);
}

.blog-content {
    padding: 1.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-meta {
    margin-bottom: 0.75rem;
}

.blog-date {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.blog-date i {
    font-size: 0.75rem;
}

.blog-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.blog-title a {
    color: var(--text-color);
    transition: color var(--transition-base);
}

.blog-title a:hover {
    color: var(--primary-color);
}

.blog-excerpt {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 1.25rem;
    line-height: 1.7;
    flex: 1;
}

.blog-read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition-base);
}

.blog-read-more:hover {
    gap: 0.75rem;
    color: var(--secondary-color);
}

.btn-explore {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    background-color: var(--primary-color);
    color: var(--bg-white);
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-lg);
}

.btn-explore:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
    gap: 1rem;
    color: var(--bg-white);
}

/* ============================================
   Category Posts Section (3 Columns)
   ============================================ */
.category-posts-section {
    background-color: var(--bg-white);
}

.category-post-column {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    height: 100%;
    opacity: 0;
    transform: translateY(20px);
}

.category-post-column.animate-in {
    opacity: 1;
    transform: translateY(0);
    animation: fadeInUp 0.6s ease forwards;
}

.category-post-column:hover {
    box-shadow: var(--shadow-xl);
}

.category-column-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-bottom: 3px solid var(--accent-color);
}

.category-column-title {
    margin: 0;
    font-size: 1.5rem;
    color: var(--bg-white);
    font-weight: 700;
}

.category-column-title a {
    color: var(--bg-white);
    transition: opacity var(--transition-base);
}

.category-column-title a:hover {
    opacity: 0.9;
}

.category-posts-list {
    padding: 1rem;
}

.category-post-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    transition: all var(--transition-base);
    margin-bottom: 0.75rem;
}

.category-post-item:last-child {
    margin-bottom: 0;
}

.category-post-item:hover {
    background-color: var(--bg-light);
    transform: translateX(5px);
}

.category-post-image {
    flex-shrink: 0;
    width: 90px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--bg-light);
}

.category-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.category-post-item:hover .category-post-image img {
    transform: scale(1.1);
}

.category-post-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e0e7ff 0%, #dbeafe 100%);
    color: var(--primary-color);
    font-size: 1.5rem;
}

.category-post-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-post-title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.4;
    font-weight: 600;
}

.category-post-title a {
    color: var(--text-color);
    transition: color var(--transition-base);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-post-title a:hover {
    color: var(--primary-color);
}

.category-post-date {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

.category-post-date i {
    font-size: 0.7rem;
}

.category-column-footer {
    padding: 1.25rem;
    background-color: var(--bg-light);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition-base);
}

.view-all-link:hover {
    gap: 0.75rem;
    color: var(--secondary-color);
}

/* ============================================
   Responsive Design
   ============================================ */

/* Tablet Landscape */
@media (max-width: 1024px) {
    .hero-slide {
        height: 550px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

/* Tablet Portrait */
@media (max-width: 768px) {
    .hero-slide {
        height: 500px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-excerpt {
        font-size: 1rem;
    }
    
    .hero-slider .slick-prev,
    .hero-slider .slick-next {
        width: 40px;
        height: 40px;
    }
    
    .hero-slider .slick-prev {
        left: 15px;
    }
    
    .hero-slider .slick-next {
        right: 15px;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .headlines-wrapper {
        flex-direction: column;
    }
    
    .headlines-label {
        border-right: none;
        border-bottom: 2px solid var(--primary-color);
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .category-icon {
        width: 70px;
        height: 70px;
        font-size: 1.75rem;
    }
    
    .blog-image {
        height: 200px;
    }
}

/* Mobile */
@media (max-width: 576px) {
    .hero-slide {
        height: 450px;
    }
    
    .hero-content {
        padding: 1rem 0;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-excerpt {
        font-size: 0.95rem;
    }
    
    .hero-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-hero {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    .category-card {
        padding: 2rem 1.5rem;
    }
    
    .category-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .category-title {
        font-size: 1.25rem;
    }
    
    .blog-image {
        height: 180px;
    }
    
    .blog-content {
        padding: 1.5rem;
    }
    
    .blog-title {
        font-size: 1.125rem;
    }
    
    .btn-explore {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
    
    .category-column-header {
        padding: 1.25rem;
    }
    
    .category-column-title {
        font-size: 1.25rem;
    }
    
    .category-post-image {
        width: 80px;
        height: 80px;
    }
    
    .category-post-title {
        font-size: 0.95rem;
    }
}

/* ============================================
   Performance Optimizations
   ============================================ */

/* Hardware Acceleration */
.blog-card,
.category-card,
.hero-image img,
.blog-image img {
    transform: translateZ(0);
    will-change: transform;
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print Styles */
@media print {
    .hero-slider .slick-prev,
    .hero-slider .slick-next,
    .hero-slider .slick-dots,
    .btn-hero,
    .btn-explore {
        display: none;
    }
    
    .hero-slide {
        height: auto;
        page-break-inside: avoid;
    }
    
    .blog-card,
    .category-post-column {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}

/* ============================================
   AdSense Friendly Spacing
   ============================================ */
.ad-container {
    margin: 3rem 0;
    padding: 1.5rem;
    background-color: var(--bg-light);
    border-radius: 8px;
    text-align: center;
    min-height: 280px;
}

.ad-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    margin-bottom: 1rem;
}

/* ============================================
   Focus Styles for Accessibility
   ============================================ */
a:focus,
button:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* ============================================
   Loading States
   ============================================ */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Dark Mode Support (Optional)
   ============================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #f9fafb;
        --text-light: #d1d5db;
        --bg-light: #1f2937;
        --bg-white: #111827;
        --border-color: #374151;
    }
    
    .blog-card,
    .category-card,
    .category-post-column {
        background-color: #1f2937;
    }
    
    .blog-placeholder,
    .category-post-placeholder {
        background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    }
}
