/*
Theme Name: E-Cellphone Modern
Description: Modern, fast, and SEO-optimized news theme
Version: 2.0
Author: E-Cellphone
*/

/* CSS Variables for consistent theming */
:root {
    --primary-color: #D97706;
    --primary-dark: #B45309;
    --text-color: #1F2937;
    --text-light: #6B7280;
    --background: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-800: #1F2937;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --border-radius: 0.5rem;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

body {
    line-height: 1.6;
    font-family: var(--font-family);
    color: var(--text-color);
    background: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-color);
    font-weight: 700;
    line-height: 1.3;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

img {
    max-width: 100%;
    height: auto;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.site-header {
    background: var(--background);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

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

.site-logo {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
}

.site-logo:hover {
    color: var(--primary-dark);
}

/* Navigation */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.main-nav a {
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
    position: relative;
}

.main-nav a:hover,
.main-nav a.current-menu-item {
    color: var(--primary-color);
    background: rgba(217, 119, 6, 0.1);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 0.25rem;
}

.hamburger {
    width: 1.5rem;
    height: 2px;
    background: var(--text-color);
    transition: all 0.3s ease;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
}

/* Category Navigation */
.category-nav {
    background: var(--gray-50);
    padding: 2rem 0;
    margin-bottom: 3rem;
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    background: var(--background);
    border-radius: 3rem;
    padding: 0.5rem;
    box-shadow: var(--shadow-md);
    max-width: 600px;
    margin: 0 auto;
    overflow-x: auto;
}

.tab-button {
    flex: 1;
    background: none;
    border: none;
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    color: var(--text-light);
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
    text-align: center;
    min-width: fit-content;
}

.tab-button.active,
.tab-button:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Articles Section */
.articles-section {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-color);
    position: relative;
    transition: all 0.3s ease;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 4rem;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.article-card {
    background: var(--background);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--gray-100);
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.article-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.article-link:hover {
    text-decoration: none;
    color: inherit;
}

.article-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
}

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

.article-card:hover .article-image img {
    transform: scale(1.05);
}

.article-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.article-content {
    padding: 1.5rem;
}

.article-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.article-title {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-link:hover .article-title {
    color: var(--primary-color);
}

.article-excerpt {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-light);
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Loading state */
.articles-grid.loading {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.articles-grid.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2rem;
    height: 2rem;
    border: 2px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Single Post Styles */
.single-post-main {
    padding: 2rem 0;
}

.single-post {
    max-width: 800px;
    margin: 0 auto;
}

.breadcrumb {
    margin-bottom: 2rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

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

.breadcrumb span {
    margin: 0 0.5rem;
}

.post-header {
    margin-bottom: 2rem;
}

.post-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.post-featured-image {
    margin-bottom: 2rem;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.post-featured-image img {
    width: 100%;
    height: auto;
}

.post-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-color);
}

.post-content h2,
.post-content h3,
.post-content h4 {
    margin: 2rem 0 1rem;
    color: var(--text-color);
}

.post-content h2 {
    font-size: 1.875rem;
}

.post-content h3 {
    font-size: 1.5rem;
}

.post-content h4 {
    font-size: 1.25rem;
}

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

.post-content img {
    border-radius: var(--border-radius);
    margin: 2rem 0;
    box-shadow: var(--shadow-md);
}

.post-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background: var(--gray-50);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-style: italic;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

/* Social Share */
.social-share {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    padding: 1.5rem 0;
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
}

.social-share span {
    font-weight: 600;
    color: var(--text-color);
}

.social-share a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    color: white;
}

.share-twitter { background: #1DA1F2; }
.share-facebook { background: #4267B2; }
.share-linkedin { background: #0077B5; }
.share-whatsapp { background: #25D366; }

.social-share a:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: white;
}

/* Post Tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.post-tag {
    background: var(--gray-100);
    color: var(--text-color);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.post-tag:hover {
    background: var(--primary-color);
    color: white;
}

/* Author Bio */
.author-bio {
    display: flex;
    gap: 1.5rem;
    background: var(--gray-50);
    padding: 2rem;
    border-radius: var(--border-radius);
    margin: 3rem 0;
}

.author-avatar img {
    border-radius: 50%;
    width: 80px;
    height: 80px;
}

.author-name {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.author-description {
    margin-bottom: 1rem;
    color: var(--text-light);
}

.author-links a {
    color: var(--primary-color);
    margin-right: 1rem;
    font-weight: 500;
}

/* Related Posts */
.related-posts {
    margin: 4rem 0;
}

.related-posts h3 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text-color);
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.related-post {
    background: var(--background);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--gray-100);
}

.related-post:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.related-image {
    aspect-ratio: 16/10;
    overflow: hidden;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-content {
    padding: 1.5rem;
}

.related-content h4 {
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

.related-content a {
    color: var(--text-color);
}

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

.related-date {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Footer */
.site-footer {
    background: var(--gray-800);
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.footer-section p {
    color: #D1D5DB;
    line-height: 1.6;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #D1D5DB;
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #374151;
    color: #9CA3AF;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--background);
        border-top: 1px solid var(--gray-200);
        box-shadow: var(--shadow-lg);
    }

    .main-nav.active {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 1rem;
    }

    .main-nav a {
        display: block;
        padding: 1rem;
        border-bottom: 1px solid var(--gray-100);
    }

    .menu-toggle {
        display: flex;
    }

    .menu-toggle.active .hamburger:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .menu-toggle.active .hamburger:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active .hamburger:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .category-tabs {
        padding: 0.25rem;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .category-tabs::-webkit-scrollbar {
        display: none;
    }

    .tab-button {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .post-meta {
        gap: 1rem;
    }

    .author-bio {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }

    .social-share {
        flex-wrap: wrap;
        justify-content: center;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.875rem;
    }

    .post-title {
        font-size: 1.875rem;
    }

    .article-content {
        padding: 1rem;
    }

    .post-content {
        font-size: 1rem;
    }
}

/* Performance optimizations */
.lazyload {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazyloaded {
    opacity: 1;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles */
a:focus,
button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .site-header,
    .category-nav,
    .social-share,
    .related-posts,
    .site-footer {
        display: none;
    }

    .post-content {
        font-size: 12pt;
        line-height: 1.5;
    }

    .post-title {
        font-size: 18pt;
    }
}