/*
Theme Name: TriLayout Pro
Theme URI: https://yourwebsite.com
Author: Your Name
Author URI: https://yourwebsite.com
Description: Professional 3-column responsive WordPress theme with left/right sidebars
Version: 1.0.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: trilayout-pro
Tags: three-columns, right-sidebar, left-sidebar, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --sky-blue: #4fc3f7;
    --sky-blue-dark: #29b6f6;
    --sky-blue-light: #e1f5fe;
    --grayish-black: #263238;
    --grayish-dark: #37474f;
    --gray-medium: #78909c;
    --gray-light: #f5f5f5;
    --gray-lighter: #fafafa;
    --redish: #ff5252;
    --redish-dark: #d32f2f;
    --redish-light: #ffebee;
    --white: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-dark: rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--grayish-dark);
    background-color: #e7e7e7;
    overflow-x: hidden;
    font-size: 16px;
}

/* 1. Container ko mazeed wide karne ke liye */
.container {
    width: 100%;
    max-width: 1600px; /* Pehle 1200px/1300px tha, ise barha diya gaya hai */
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 15px;
    color: var(--grayish-black);
}

h1 { font-size: 36px; }
h2 { font-size: 30px; }
h3 { font-size: 24px; }
h4 { font-size: 20px; }
h5 { font-size: 18px; }
h6 { font-size: 16px; }

p {
    margin-bottom: 15px;
}

a {
    color: var(--sky-blue-dark);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--redish);
}

/* Header Styles */
.site-header {
    background: var(--white);
    box-shadow: 0 2px 15px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.site-header.scrolled {
    box-shadow: 0 5px 20px var(--shadow-dark);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.site-branding {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.header-logo {
    max-height: 60px;
    width: auto;
    transition: var(--transition);
}

.header-logo:hover {
    opacity: 0.9;
}

.site-title {
    margin-left: 15px;
    font-size: 24px;
    color: var(--grayish-black);
    font-weight: 600;
}

.site-title a {
    color: inherit;
}

.site-title a:hover {
    color: var(--redish);
}

/* Navigation */
.main-navigation {
    flex-grow: 1;
    display: flex;
    justify-content: flex-end;
}

.menu-toggle {
    display: none;
    background: var(--sky-blue);
    color: white;
    border: none;
    padding: 12px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
}

.menu-toggle:hover {
    background: var(--sky-blue-dark);
}

.hamburger {
    display: inline-block;
    width: 20px;
    height: 2px;
    background: white;
    position: relative;
}

.hamburger:before,
.hamburger:after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: white;
    left: 0;
}

.hamburger:before {
    top: -6px;
}

.hamburger:after {
    bottom: -6px;
}

.primary-menu {
    display: flex;
    list-style: none;
}

.primary-menu li {
    margin-left: 25px;
    position: relative;
}

.primary-menu a {
    text-decoration: none;
    color: var(--grayish-black);
    font-weight: 500;
    padding: 8px 0;
    transition: var(--transition);
    position: relative;
}

.primary-menu a:hover {
    color: var(--redish);
}

.primary-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--redish);
    transition: width 0.3s;
}

.primary-menu a:hover::after {
    width: 100%;
}

/* Main Content Layout - FIXED 3-COLUMN LAYOUT */
.site-content {
    padding: 15px 0;
    min-height: calc(100vh - 300px);
}

/* 2. Content Wrapper ka gap barhane ke liye */
.content-wrapper {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px; /* Pehle 20px tha, ise barha kar space zyada kar di gayi hai */
}

/* 3. Sidebars ki width aur spacing adjust karne ke liye */
.sidebar {
    flex: 0 0 18%; /* Isay 20% se kam karke 18% kar diya taaky main area ko jagah milay */
    max-width: 18%;
    padding: 25px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 15px var(--shadow);
}

.sidebar-left {
    order: 1;
    background: linear-gradient(135deg, var(--white) 0%, var(--sky-blue-light) 100%);
    border-left: 4px solid var(--sky-blue);
}

.sidebar-right {
    order: 3;
    background: linear-gradient(135deg, var(--white) 0%, var(--redish-light) 100%);
    border-right: 4px solid var(--redish);
}

.sidebar h2.widget-title {
    color: var(--grayish-black);
    font-size: 18px;
    padding-bottom: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--sky-blue);
    font-weight: 600;
}

.sidebar-right h2.widget-title {
    border-bottom-color: var(--redish);
}

.widget {
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.widget:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.widget ul {
    list-style: none;
}

.widget li {
    padding: 5px 0;
    border-bottom: 1px dotted #ddd;
    transition: var(--transition);
}

.widget li:hover {
    padding-left: 5px;
}

.widget li:last-child {
    border-bottom: none;
}

.widget a {
    color: var(--grayish-black);
    text-decoration: none;
    transition: var(--transition);
}

.widget a:hover {
    color: var(--redish);
}

/* 4. Main Content Area ko balance karne ke liye */
.main-content {
    flex: 0 0 64%; /* 18% + 18% sidebars = 36%. Baqi 64% main content ke liye */
    max-width: 64%;
    order: 2;
    padding: 10px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 15px var(--shadow);
}

/* Posts */
.article-post {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.article-post:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.post-header {
    margin-bottom: 20px;
}

.post-title {
    font-size: 28px;
    color: var(--grayish-black);
    margin-bottom: 10px;
    line-height: 1.3;
}

.post-title a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

.post-title a:hover {
    color: var(--redish);
}

.post-meta {
    color: var(--gray-medium);
    font-size: 14px;
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-meta i {
    font-style: normal;
    opacity: 0.8;
}

.post-thumbnail {
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: 6px;
}

.featured-image {
    width: 100%;
    height: auto;
    transition: var(--transition);
}

.featured-image:hover {
    transform: scale(1.02);
}

.post-content {
    line-height: 1.8;
    margin-bottom: 20px;
}

.read-more {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 25px;
    background: var(--sky-blue);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: var(--transition);
    font-weight: 500;
    border: none;
    cursor: pointer;
}

.read-more:hover {
    background: var(--sky-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 195, 247, 0.3);
}

/* Footer */
.site-footer {
    background: var(--grayish-black);
    color: var(--white);
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.footer-logo {
    max-height: 40px;
    width: auto;
    margin-bottom: 15px;
    transition: var(--transition);
}

.footer-logo:hover {
    opacity: 0.9;
}

.footer-branding {
    flex: 0 0 25%;
}

.footer-menu {
    flex: 0 0 50%;
}

.footer-menu ul {
    display: flex;
    justify-content: center;
    list-style: none;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-menu a {
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
    padding: 5px 0;
    position: relative;
}

.footer-menu a:hover {
    color: var(--sky-blue);
}

.footer-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--sky-blue);
    transition: width 0.3s;
}

.footer-menu a:hover::after {
    width: 100%;
}

.copyright {
    flex: 0 0 100%;
    text-align: center;
    margin-top: 1px;
    padding-top: 20px;
    border-top: 1px solid #444;
    color: #aaa;
    font-size: 14px;
}

/* Pagination */
.posts-navigation {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.page-numbers {
    display: inline-block;
    padding: 8px 16px;
    background: var(--white);
    border: 1px solid #ddd;
    border-radius: 4px;
    color: var(--grayish-dark);
    text-decoration: none;
    transition: var(--transition);
}

.page-numbers:hover {
    background: var(--sky-blue);
    color: white;
    border-color: var(--sky-blue);
}

.page-numbers.current {
    background: var(--redish);
    color: white;
    border-color: var(--redish);
}

/* Widget Search */
.widget_search .search-form {
    display: flex;
}

.widget_search input[type="search"] {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
}

.widget_search input[type="submit"] {
    padding: 10px 20px;
    background: var(--sky-blue);
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: var(--transition);
}

.widget_search input[type="submit"]:hover {
    background: var(--sky-blue-dark);
}

/* Comments */
.comments-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Responsive Design */
@media screen and (max-width: 1024px) {
    .content-wrapper {
        gap: 15px;
    }
    
    .sidebar {
        flex: 0 0 25%;
        max-width: 25%;
        padding: 20px;
    }
    
    .main-content {
        flex: 0 0 50%;
        max-width: 50%;
        padding: 25px;
    }
    
    .post-title {
        font-size: 24px;
    }
}

@media screen and (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
        gap: 20px;
    }
    
    .sidebar,
    .main-content {
        flex: 0 0 100%;
        max-width: 100%;
        order: 0;
    }
    
    .sidebar-left,
    .sidebar-right {
        width: 100%;
        margin: 0;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .header-container {
        flex-wrap: wrap;
    }
    
    .menu-toggle {
        display: block;
        order: 2;
    }
    
    .primary-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        order: 3;
        margin-top: 20px;
        background: var(--white);
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 5px 15px var(--shadow);
    }
    
    .primary-menu.active {
        display: flex;
    }
    
    .primary-menu li {
        margin: 0;
        width: 100%;
    }
    
    .primary-menu a {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid #eee;
    }
    
    .primary-menu li:last-child a {
        border-bottom: none;
    }
    
    .primary-menu a::after {
        display: none;
    }
    
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-branding,
    .footer-menu {
        flex: 0 0 100%;
        margin-bottom: 20px;
    }
    
    .footer-menu ul {
        justify-content: center;
        flex-direction: column;
        gap: 10px;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 8px;
    }
}

@media screen and (max-width: 480px) {
    .header-logo {
        max-height: 40px;
    }
    
    .site-title {
        font-size: 20px;
        margin-left: 10px;
    }
    
    .post-title {
        font-size: 22px;
    }
    
    .main-content,
    .sidebar {
        padding: 15px;
    }
    
    .read-more {
        width: 100%;
        text-align: center;
    }
    
    .widget_search input[type="search"] {
        width: 70%;
    }
    
    .widget_search input[type="submit"] {
        width: 30%;
    }
}

/* Large Desktops */
@media screen and (min-width: 1600px) {
    .container {
        max-width: 1600px;
    }
    
    .content-wrapper {
        gap: 8px;
    }
}

/* Accessibility */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-weight: bold;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}










/* Force the container to fill the flex-grow space */
.table-container {
    width: 100%;
    margin-bottom: 20px;
}

/* Force the table to span the full width of the container */
.responsive-post-table {
    width: 100%;
    border-collapse: collapse;
    /* This ensures columns respect the width percentages you set in the HTML */
    table-layout: fixed; 
}

/* Optional: ensure images or long text inside cells don't push the width out */
.responsive-post-table td {
    word-wrap: break-word;
    overflow: hidden;
}

/* Header Styling */
.responsive-post-table thead tr {
    background: #f8f9fa;
    border-bottom: 2px solid #28a745;
}

.responsive-post-table th {
    padding: 10px 12px;
    font-size: 12px;
    text-transform: uppercase;
    color: #000000;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Table Cells */
.responsive-post-table td {
    padding: 8px 12px; /* Tighter padding for neatness */
    font-size: 13px; /* Smaller, cleaner text */
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

/* Force One-Line Text */
.nowrap {
    white-space: nowrap;
}

/* Title Truncation Logic */
.title-wrapper {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: wrap; /* Prevents title from wrapping */
}

.table-title {
    text-decoration: none;
    color: #004a99;
    font-weight: 500;
    font-size: 13px;
}

.table-title:hover {
    text-decoration: underline;
    color: #28a745;
}

/* Badges & Text Labels */
.badge-cat a {
    color: #2e7d32;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
}

.source-text {
    color: #666;
    font-size: 12px;
}

.text-small {
    font-size: 12px;
    color: #888;
}

/* Adjusting PostRatings Size */
.rating-cell .post-ratings {
    font-size: 11px !important;
    display: flex;
    align-items: center;
}

.rating-cell img {
    width: 14px !important; /* Makes stars smaller to fit one line */
    height: 14px !important;
}

/* Pagination Styling */
.posts-navigation {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.posts-navigation .page-numbers {
    padding: 5px 12px;
    margin: 0 2px;
    font-size: 12px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    border-radius: 3px;
}

.posts-navigation .current {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

/* Mobile Responsiveness remains, but Desktop is now super tight */
@media (max-width: 1024px) {
    .responsive-post-table { table-layout: auto; }
}




/* Filter Bar Styling */
.table-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.table-filter-bar input[type="text"], 
.filter-dropdown {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    outline: none;
    font-size: 14px;
}
.table-filter-bar input[type="text"] { width: 300px; }

/* Table Styling */
.table-container {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}
.responsive-post-table {
    width: 100%;
    border-collapse: collapse;
}
.responsive-post-table thead tr {
    background: #28a745;
    color: #ffffff;
    text-align: left;
}
.responsive-post-table th, 
.responsive-post-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f1f1;
}
.responsive-post-table tbody tr:hover { background: #f9f9f9; }

/* Content Specifics */
.table-title {
    text-decoration: none;
    color: #2c3e50;
    font-weight: 600;
    transition: color 0.2s;
}
.table-title:hover { color: #28a745; }
.badge-cat {
    background: #e8f5e9;
    color: #28a745;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}
.source-tag { color: #6c757d; font-size: 13px; font-weight: 500; }
.text-muted { color: #adb5bd; font-size: 13px; }

/* Pagination Styling */
.custom-pagination {
    margin-top: 30px;
    text-align: center;
}
.custom-pagination .page-numbers {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 4px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}
.custom-pagination .page-numbers.current {
    background: #28a745;
    color: #fff;
    border-color: #28a745;
}
.custom-pagination .page-numbers:hover:not(.current) {
    background: #f1f1f1;
}

/* Mobile View (Card Layout) */
@media (max-width: 992px) {
    .table-filter-bar { flex-direction: column; align-items: stretch; }
    .table-filter-bar input[type="text"] { width: 100%; }
    
    .responsive-post-table thead { display: none; }
    .responsive-post-table tr { 
        display: block; 
        border: 1px solid #eee; 
        margin-bottom: 15px; 
        border-radius: 8px;
    }
    .responsive-post-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #f9f9f9;
        text-align: right;
    }
    .responsive-post-table td:before {
        content: attr(data-label);
        font-weight: bold;
        color: #888;
        font-size: 12px;
    }
}













/* Layout Container for the Filter */
.full-width-filter-section {
    margin-bottom: 20px; /* Space between filter and content below */
}

.table-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

/* Maintain the Stylish Search Form */
.modern-search-form {
    display: flex;
    align-items: center;
    background: #fdfdfd;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 2px;
    width: 450px; /* Increased for top position */
    transition: border-color 0.3s;
}

.modern-search-form:focus-within {
    border-color: #28a745;
}

.modern-search-form input[type="text"] {
    flex: 1;
    border: none;
    padding: 8px 15px;
    font-size: 14px;
    outline: none;
}

.search-submit-btn {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Responsive Logic for Filter Bar */
@media (max-width: 992px) {
    .table-filter-bar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .modern-search-form {
        width: 100%;
    }
    
    .filter-dropdown {
        width: 100%;
    }
    
    .btn-text {
        display: inline; /* Keep text on tablet/mobile if needed, or hide if too cramped */
    }
}

@media (max-width: 480px) {
    .btn-text {
        display: none; /* Icon only on very small phones */
    }
}






.footer-menu-list {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    gap: 20px;
}
.footer-menu-list a {
    color: #29b6f6;
    text-decoration: none;
    font-size: 13px;
}
.footer-menu-list a:hover {
    color: #fff;
}







/* Ensure the page takes up full height for the iframe */
html, body {
    height: auto; /* Changed from 100% */
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Changed from overflow: hidden */
    overflow-y: auto;   /* Explicitly allow vertical scrolling */
}

/* Fix for mobile responsiveness of the bar */
@media (max-width: 768px) {
    .embed-info-bar {
        flex-wrap: wrap;
        height: auto;
    }
    .info-ads {
        display: none; /* Hide ads on small mobile to save space */
    }
}















/* Professional Footer Widget Grid */
.footer-widget-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    width: 100%;
    margin: 30px 0;
}

.footer-widget-title {
    color: var(--sky-blue);
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 20px;
    border-left: 3px solid var(--redish); /* Using your theme's redish variable */
    padding-left: 12px;
}

.footer-widget ul {
    list-style: none;
    padding: 0;
}

.footer-widget li {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Mobile Adjustment for Footer Widgets */
@media screen and (max-width: 768px) {
    .footer-widget-section {
        grid-template-columns: 1fr; /* Stacks widgets on phone */
        text-align: center;
    }
    
    .footer-widget-title {
        border-left: none;
        border-bottom: 2px solid var(--redish);
        display: inline-block;
        padding: 0 10px 5px;
    }
}







/* Styling for the centered Ad above footer */
.ad-section-wrapper {
    width: 100%;
    clear: both;
    margin-top: 20px;
}

.above-footer-ad-container {
    max-width: 100%;
    display: inline-block; /* Helps with centering */
}

.above-footer-ad-container img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
    margin: 0 auto;
}

/* Hide the ad if it's empty or hidden on mobile */
@media screen and (max-width: 768px) {
    .ad-section-wrapper {
        padding: 10px 0;
    }
}











/* Centered Ad Section Styling */
.pre-footer-ad {
    padding: 30px 0;
    background: transparent;
    text-align: center;
    width: 100%;
    clear: both;
}

.ad-flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Footer Widget Grid - Full Width */
.footer-widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Automatically creates columns based on widget count */
    gap: 50px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 30px;
}

/* Styling the titles inside the footer grid */
.footer-widget-title {
    color: var(--sky-blue);
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
    border-left: 4px solid #e50914; /* Your Red Accents */
    padding-left: 15px;
}

/* Ensure images in the centered ad don't overflow */
.pre-footer-ad img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Responsive Fix for Mobile */
@media screen and (max-width: 768px) {
    .footer-widgets-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-widget-title {
        border-left: none;
        border-bottom: 2px solid #e50914;
        display: inline-block;
        padding: 0 10px 5px;
    }
}
















/* Container */
.table-filter-bar {
    display: flex;
    justify-content: center;
    padding: 20px 0;
    width: 100%;
}

/* The Bar - Changed back to a standard rectangular box */
.modern-search-form.unified-search {
    display: flex;
    width: 100%;
    max-width: 850px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px; /* Back to original square-ish corners */
    overflow: hidden;
}

.search-input-group {
    display: flex;
    align-items: center;
    width: 100%;
}

/* Search Input */
.search-field {
    flex: 1;
    border: none !important;
    padding: 10px 15px !important;
    font-size: 14px;
    outline: none;
}

/* Category Wrapper */
.category-select-wrapper {
    border-left: 1px solid #ddd;
    padding: 0 10px;
    background: #f9f9f9; /* Light grey background for the dropdown area */
}

/* Restoring the Old Button Style */
.search-submit-btn {
    background: var(--sky-blue); /* Original Blue */
    color: white;
    border: none;
    padding: 10px 20px !important;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 0; /* Original square style */
    transition: background 0.3s;
}

.search-submit-btn:hover {
    background: var(--sky-blue-dark);
}

/* Down Arrow for Dropdown */
.custom-arrow-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.custom-arrow-wrapper::after {
    content: '▼';
    font-size: 10px;
    color: #555;
    position: absolute;
    right: 8px;
    pointer-events: none;
}

.search-cat-dropdown {
    appearance: none;
    -webkit-appearance: none;
    padding: 5px 25px 5px 10px !important;
    border: none !important;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
}

/* MOBILE VERSION: Full Visibility Fix */
@media screen and (max-width: 768px) {
    .modern-search-form.unified-search {
        flex-direction: column;
        border: none;
        background: transparent;
    }

    .search-input-group {
        flex-direction: column;
        display: block; /* Force block for mobile */
    }

    .search-field, .category-select-wrapper, .search-submit-btn {
        width: 100%;
        margin-bottom: 10px;
        border: 1px solid #ddd !important;
        border-radius: 4px !important;
        height: 45px; /* Fixed height for touch visibility */
    }
    
    .category-select-wrapper {
        display: flex;
        align-items: center;
    }
    
    .search-submit-btn {
        justify-content: center;
    }
}


/* Highlights the "Today" text in a professional Blue badge style */
.responsive-post-table td[data-label="Date"] strong {
    color: #007bff; /* Primary Blue */
    background-color: #e7f3ff; /* Light Blue tint */
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
    border: 1px solid #b8daff;
    display: inline-block;
}







.sub-title-badge:hover {
    opacity: 0.8;
    filter: brightness(95%);
    color: inherit; /* Keeps the Blue/Green text color */
}

@media screen and (max-width: 991px) {
    .sub-title-badge {
        margin-left: 0 !important;
        margin-top: 5px;
        display: inline-flex !important;
    }
}






















/* --- PROFESSIONAL DROPDOWN MENU STYLES --- */

/* Ensure parent items can hold the dropdowns */
.primary-menu li {
    position: relative;
    margin-left: 20px;
}

/* Hide sub-menus by default */
.primary-menu ul.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    min-width: 220px;
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    display: none; /* Hide */
    list-style: none;
    padding: 10px 0;
    z-index: 999;
    border-top: 3px solid var(--sky-blue);
    border-radius: 0 0 4px 4px;
}

/* Show Sub-menu on Hover */
.primary-menu li:hover > ul.sub-menu {
    display: block;
    animation: fadeInMenu 0.3s ease;
}

/* Sub-Submenu positioning (Third Level) */
.primary-menu ul.sub-menu ul.sub-menu {
    top: 0;
    left: 100%; /* Positions it to the right of the parent sub-menu */
    border-top: none;
    border-left: 3px solid var(--redish);
}

/* Styling for sub-menu links */
.primary-menu ul.sub-menu li {
    margin: 0;
    width: 100%;
}

.primary-menu ul.sub-menu a {
    padding: 10px 20px;
    display: block;
    font-size: 14px;
    color: var(--grayish-black);
    border-bottom: 1px solid #f0f0f0;
}

.primary-menu ul.sub-menu a:hover {
    background: var(--sky-blue-light);
    color: var(--sky-blue-dark);
}

.primary-menu ul.sub-menu li:last-child a {
    border-bottom: none;
}

/* Animation for a smooth feel */
@keyframes fadeInMenu {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}









@media screen and (max-width: 768px) {
    .primary-menu ul.sub-menu,
    .primary-menu ul.sub-menu ul.sub-menu {
        position: static;
        display: block; /* Always visible on mobile once menu is open */
        width: 100%;
        box-shadow: none;
        padding-left: 20px; /* Indent subcategories */
        border: none;
        background: #f9f9f9;
    }
}


