/**
 * NewsFlow Theme - Main Stylesheet
 * Modern, Responsive News Theme
 */

/* ============================================
   CSS Variables & Reset
   ============================================ */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #f59e0b;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #ffffff;
    --bg-light: #f9fafb;
    --bg-dark: #111827;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-color);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   Layout
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main {
    flex: 1;
    padding: 2rem 0;
}

.content-area {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    margin-top: 2rem;
}

.content-area:has(.sidebar:empty) {
    grid-template-columns: 1fr;
}

.content-area:has(.sidebar:empty) .sidebar {
    display: none;
}

/* ============================================
   Header
   ============================================ */
.site-header {
    background: var(--bg-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    background: var(--bg-color);
}

.header-top {
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.header-top-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-branding {
    flex: 1;
}

.site-title {
    font-size: 1.5rem;
    margin: 0;
}

.site-title a {
    color: var(--text-color);
    font-weight: 700;
}

.site-title a:hover {
    color: var(--primary-color);
}

.site-description {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0.25rem 0 0 0;
}

.custom-logo {
    max-height: 60px;
    width: auto;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-toggle,
.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-color);
    transition: var(--transition);
}

.search-btn {
    padding: 0.5rem;
}

.search-btn svg {
    color: var(--text-color);
}

/* Navigation */
.main-navigation {
    background: var(--bg-light);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    padding: 1rem 0;
    margin: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 0;
    display: block;
    transition: var(--transition);
}

.nav-menu a:hover {
    color: var(--primary-color);
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.search-overlay.active {
    display: flex;
}

.search-container {
    position: relative;
    width: 90%;
    max-width: 600px;
}

.search-form {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-field {
    flex: 1;
    padding: 1rem 1.5rem;
    font-size: 1.25rem;
    border: 2px solid var(--bg-color);
    border-radius: 50px;
    background: var(--bg-color);
    color: var(--text-color);
    outline: none;
}

.search-field:focus {
    border-color: var(--primary-color);
}

.search-submit {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-close {
    position: absolute;
    top: -60px;
    right: 0;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
}

/* ============================================
   Posts Grid
   ============================================ */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.post-card {
    background: var(--bg-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.post-thumbnail {
    overflow: hidden;
    position: relative;
    padding-top: 56.25%; /* 16:9 aspect ratio */
}

.post-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.post-date time {
    color: var(--text-light);
}

.post-category a {
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.post-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.post-title a {
    color: var(--text-color);
}

.post-title a:hover {
    color: var(--primary-color);
}

.post-excerpt {
    color: var(--text-light);
    margin-bottom: 1rem;
    flex: 1;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.875rem;
}

.read-more:hover {
    color: var(--secondary-color);
}

.read-more svg {
    transition: transform 0.3s ease;
}

.read-more:hover svg {
    transform: translateX(4px);
}

.post-author {
    font-size: 0.875rem;
    color: var(--text-light);
}

.post-author a {
    color: var(--text-color);
    font-weight: 600;
}

/* ============================================
   Single Post
   ============================================ */
.single-post {
    grid-template-columns: 1fr 300px;
}

.entry-header {
    margin-bottom: 2rem;
}

.entry-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.entry-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.entry-author {
    color: var(--text-light);
    font-size: 0.875rem;
}

.entry-thumbnail {
    margin-bottom: 2rem;
    border-radius: 8px;
    overflow: hidden;
}

.entry-thumbnail img {
    width: 100%;
    height: auto;
}

.entry-content {
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.entry-content p {
    margin-bottom: 1.5rem;
}

.entry-content h2,
.entry-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.entry-content ul,
.entry-content ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.entry-content img {
    border-radius: 8px;
    margin: 2rem 0;
}

.entry-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.entry-tags {
    margin-bottom: 2rem;
}

.tags-label {
    font-weight: 600;
    margin-right: 0.5rem;
}

.entry-tags a {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-light);
    border-radius: 20px;
    font-size: 0.875rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.entry-share {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.share-label {
    font-weight: 600;
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
}

.share-buttons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-light);
    transition: var(--transition);
}

.share-buttons a:hover {
    transform: translateY(-2px);
}

.share-facebook:hover {
    background: #1877f2;
    color: white;
}

.share-twitter:hover {
    background: #1da1f2;
    color: white;
}

.share-linkedin:hover {
    background: #0077b5;
    color: white;
}

/* Related Posts */
.related-posts {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.related-posts h3 {
    margin-bottom: 1.5rem;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.related-post-card {
    background: var(--bg-light);
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition);
}

.related-post-card:hover {
    box-shadow: var(--shadow-md);
}

.related-post-thumbnail {
    padding-top: 56.25%;
    position: relative;
    overflow: hidden;
}

.related-post-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-post-content {
    padding: 1rem;
}

.related-post-content h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.related-post-content h4 a {
    color: var(--text-color);
}

.related-post-date {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* ============================================
   Sidebar
   ============================================ */
.widget-area {
    margin-top: 0;
}

.widget {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.widget-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.widget ul {
    list-style: none;
}

.widget li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.widget li:last-child {
    border-bottom: none;
}

.widget a {
    color: var(--text-color);
}

.widget a:hover {
    color: var(--primary-color);
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    background: var(--bg-dark);
    color: #ffffff;
    margin-top: 4rem;
    padding-top: 3rem;
}

.footer-widgets {
    padding-bottom: 2rem;
}

.footer-widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-widget-area {
    color: rgba(255, 255, 255, 0.8);
}

.footer-widget-area .widget {
    background: transparent;
    padding: 0;
}

.footer-widget-area .widget-title {
    color: #ffffff;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.footer-widget-area a {
    color: rgba(255, 255, 255, 0.8);
}

.footer-widget-area a:hover {
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem 0;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-info {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

.site-info p {
    margin: 0.25rem 0;
}

.site-info a {
    color: rgba(255, 255, 255, 0.8);
}

.footer-navigation ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.footer-navigation a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
}

.footer-navigation a:hover {
    color: #ffffff;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
    color: #ffffff;
    transform: translateY(-2px);
}

/* ============================================
   Pagination
   ============================================ */
.page-numbers {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 2rem 0;
    list-style: none;
}

.page-numbers li {
    margin: 0;
}

.page-numbers a,
.page-numbers span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 1rem;
    border-radius: 4px;
    background: var(--bg-light);
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
}

.page-numbers a:hover,
.page-numbers .current {
    background: var(--primary-color);
    color: #ffffff;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    .content-area {
        grid-template-columns: 1fr;
    }
    
    .single-post {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .entry-title {
        font-size: 2rem;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--bg-color);
        flex-direction: column;
        padding: 2rem;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-lg);
        overflow-y: auto;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
    
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .entry-title {
        font-size: 1.75rem;
    }
    
    .post-content {
        padding: 1rem;
    }
}

/* ============================================
   Accessibility
   ============================================ */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: #ffffff;
    padding: 8px 16px;
    z-index: 10000;
}

.skip-link:focus {
    top: 0;
}

/* ============================================
   Comments
   ============================================ */
.comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.comments-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.comment-list {
    list-style: none;
    margin-bottom: 2rem;
}

.comment {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.comment-author .avatar {
    border-radius: 50%;
}

.comment-author .fn {
    font-weight: 600;
    color: var(--text-color);
}

.comment-metadata {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.comment-content {
    margin-top: 1rem;
}

.comment-content p {
    margin-bottom: 0.5rem;
}

.comment-reply-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 600;
}

.comment-form {
    margin-top: 2rem;
}

.comment-form p {
    margin-bottom: 1rem;
}

.comment-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

.comment-form textarea {
    min-height: 150px;
    resize: vertical;
}

.comment-form input[type="submit"] {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.comment-form input[type="submit"]:hover {
    background: var(--secondary-color);
}

.no-comments {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

/* ============================================
   Utilities
   ============================================ */
.no-posts {
    text-align: center;
    padding: 4rem 2rem;
}

.no-posts h2 {
    margin-bottom: 1rem;
}

