/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://generatepress.com
 Description:  Default GeneratePress child theme
 Author:       Tom Usborne
 Author URI:   https://tomusborne.com
 Template:     generatepress
 Version:      3.5.0
*/

/* ============================================
   GLOBAL STYLES & RESET
   ============================================ */

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

body {
    font-family: "Poppins", "Noto Sans Bengali", "Noto Sans Devanagari", sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    font-display: swap;
}

:lang(en) body { direction: ltr; }
:lang(bn) body, :lang(hi) body { direction: ltr; text-align: left; }
:lang(ar) body { direction: rtl; text-align: right; }

/* ============================================
   POST GRID & LAYOUT
   ============================================ */

.latest-posts-wrapper,
.posts-grid,
.modern-post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 20px 0;
    padding: 10px;
}

.post-item,
.modern-post-card {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    animation: fadeIn 0.5s forwards;
}

.post-item:hover,
.modern-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.post-thumbnail img,
.modern-thumb img {
    width: 100%;
    height: auto;
    display: block;
    border-bottom: 3px solid #2ecc71;
}

/* ============================================
   POST CONTENT
   ============================================ */

.post-content,
.modern-content {
    padding: 15px;
}

.post-title,
.modern-content h2 {
    font-size: 1.3em;
    margin-bottom: 10px;
    font-weight: 700;
    color: #0073e6;
}

.post-title a,
.modern-content h2 a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

.post-title a:hover,
.modern-content h2 a:hover {
    color: #ff5722;
}

.post-meta {
    font-size: 0.9em;
    color: #777;
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
}

.post-meta .author { font-weight: 600; color: #333; }
.post-meta .time { color: #888; }

/* ============================================
   ARCHIVE & BLOG PAGES
   ============================================ */

body.archive .generate-columns-container .inside-article,
body.blog .generate-columns-container .inside-article,
body.search .generate-columns-container .inside-article {
    border: 2px solid #a29bfe;
    border-radius: 10px;
    padding: 16px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

body.archive .generate-columns-container .inside-article:hover,
body.blog .generate-columns-container .inside-article:hover,
body.search .generate-columns-container .inside-article:hover {
    box-shadow: 0 8px 20px rgba(162, 155, 254, 0.2);
    transform: translateY(-4px);
}

/* ============================================
   PAGE HEADER
   ============================================ */

.page-header {
    padding: 20px 0;
    text-align: center;
    border-bottom: 2px solid #2ecc71;
    margin-bottom: 30px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    font-family: inherit;
}

/* ============================================
   AUTHOR BOX
   ============================================ */

.author-box {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    margin-top: 30px;
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.06);
}

.author-avatar {
    margin-right: 20px;
}

.author-avatar-img {
    border-radius: 50%;
    border: 2px solid #2ecc71;
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.author-name {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #2c3e50;
}

.author-bio {
    font-size: 15px;
    color: #555;
    margin: 0 0 10px;
    line-height: 1.6;
}

/* ============================================
   RELATED POSTS
   ============================================ */

.related-title-item a {
    display: block;
    background: #fff;
    padding: 12px 16px;
    border-left: 4px solid #2ecc71;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.related-title-item a:hover {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #fff;
    border-left-color: #1abc9c;
    transform: scale(1.02);
}

/* ============================================
   LANGUAGE SWITCHER
   ============================================ */

.menu-item-language a {
    background-color: #3498db;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    margin-right: 6px;
    text-transform: capitalize;
    transition: all 0.3s ease;
}

.menu-item-language a:hover {
    background-color: #2c3e50;
}

/* ============================================
   SEARCH FILTER
   ============================================ */

.search-filter-wrapper {
    display: flex;
    justify-content: center;
    margin: 0 auto 30px;
}

.sf-input-select {
    border: 2px solid #0984e3;
    border-radius: 6px;
    padding: 10px 14px;
    background: #f0faff;
    font-weight: 600;
    color: #2d3436;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sf-input-select:hover {
    background: #eaf6ff;
    border-color: #007acc;
}

/* ============================================
   TABLES (FIXED - NO WHITESPACE ISSUE)
   ============================================ */

.wp-block-table {
    width: 100%;
    overflow-x: auto;
    margin: 1rem 0;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    background: white;
}

.wp-block-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    table-layout: auto;
}

.wp-block-table th,
.wp-block-table thead td {
    background: #2ecc71;
    color: white;
    font-weight: 600;
    padding: 12px 15px;
    border: 1px solid #27ae60;
    text-align: center;
    white-space: nowrap;
    position: sticky;
    top: 0;
    min-width: 120px;
}

.wp-block-table td {
    padding: 10px 12px;
    border: 1px solid #e1e1e1;
    text-align: center;
    min-width: 120px;
}

.wp-block-table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

.wp-block-table tbody tr:hover {
    background: #f0f7f0;
}

/* Fix for text spacing in table cells */
.wp-block-table td,
.wp-block-table th {
    word-spacing: normal;
    letter-spacing: normal;
    line-height: 1.4;
}

/* Specific fix for your screenshot issue */
.wp-block-table td p,
.wp-block-table td span,
.wp-block-table td div {
    margin: 0;
    padding: 0;
    word-spacing: normal;
    letter-spacing: normal;
    display: inline;
}

/* ============================================
   LINKS & BUTTONS
   ============================================ */

.single article a {
    color: #6e09ef;
    text-decoration: none;
    border-bottom: 1px dashed #40e0d0;
    transition: all 0.3s;
}

.single article a:hover {
    color: #ff5722;
    border-bottom-color: #ff5722;
}

a.read-more.button {
    display: inline-block;
    background: #fff;
    font-size: 17px;
    padding: 8px 20px;
    text-align: center;
    color: #000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    border: 2px solid #000;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
}

a.read-more.button:hover {
    background: #000;
    color: #fff;
    transform: translateY(-2px);
}

/* ============================================
   META INFO BLOCKS
   ============================================ */

.qa-meta,
.news-meta,
.tools-meta {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 14px;
    color: #555;
}

/* ============================================
   AUTHOR MODERN LAYOUT
   ============================================ */

.author-modern-container {
    max-width: 1300px;
    margin: auto;
    padding: 30px 15px;
    background: #f9f9f9;
}

.author-header {
    text-align: center;
    margin-bottom: 40px;
}

.author-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #27ae60;
}

.modern-tab-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.tab-item {
    padding: 10px 20px;
    background: #e0e0e0;
    border-radius: 50px;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    transition: all 0.3s;
}

.tab-item.active,
.tab-item:hover {
    background: #27ae60;
    color: #fff;
}

.modern-date {
    font-size: 0.85rem;
    color: #888;
    margin-top: 5px;
}

/* ============================================
   UTILITIES & ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hide URL field in comment form */
.comment-form #url {
    display: none !important;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    .latest-posts-wrapper,
    .posts-grid,
    .modern-post-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .wp-block-table {
        font-size: 14px;
    }
    
    .wp-block-table th,
    .wp-block-table td {
        padding: 10px;
        min-width: 100px;
    }
}

@media (max-width: 768px) {
    .latest-posts-wrapper,
    .posts-grid,
    .modern-post-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .author-box {
        flex-direction: column;
        text-align: center;
    }
    
    .author-avatar {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    .author-header h1 {
        font-size: 1.8rem;
    }
    
    .tab-item {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    .wp-block-table {
        font-size: 13px;
    }
    
    .wp-block-table th,
    .wp-block-table td {
        padding: 8px;
        min-width: 80px;
    }
}

@media (max-width: 480px) {
    .post-title,
    .modern-content h2 {
        font-size: 1.1em;
    }
    
    .qa-meta,
    .news-meta,
    .tools-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .page-title {
        font-size: 20px;
    }
    
    .author-header h1 {
        font-size: 1.5rem;
    }
    
    a.read-more.button {
        font-size: 15px;
        padding: 6px 15px;
    }
    
    /* Fix table spacing on mobile */
    .wp-block-table td,
    .wp-block-table th {
        white-space: normal;
        word-break: break-word;
        line-height: 1.3;
        padding: 6px 8px;
    }
}

/* Desktop optimization */
@media (min-width: 1200px) {
    .latest-posts-wrapper,
    .posts-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Print styles */
@media print {
    .post-item,
    .modern-post-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .wp-block-table {
        break-inside: avoid;
    }
}