/* Twitter-like Layout Styles for Homepage */

/* Global Content Items (Post) */
.post-item {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    display: block;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-decoration: none;
    display: flex;
}

.post-item:hover {
    background-color: var(--bg-hover);
}

.post-item:last-child {
    border-bottom: none;
}

/* Flex Container for the news-style layout */
.post-body {
    display: flex;
    align-items: center;
    /* Vertically center content */
    gap: 15px;
    width: 100%;
}

.post-content {
    flex: 1;
    min-width: 0;
    /* Important for text truncation */
    order: 1;
}

.post-title {
    font-size: var(--font-15);
    font-weight: var(--font-weight-medium);
    margin: 0;
    color: var(--text-primary);
    line-height: var(--line-height-relaxed);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.post-title a {
    text-decoration: none;
    color: inherit;
}

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

.content-meta {
    color: var(--text-secondary);
}

.content-date {
    font-size: var(--font-14);
    color: var(--text-muted);
}

.post-image {
    width: 75px;
    height: 75px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    order: 2;
}

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

/* Publisher info (above title) */
.content-publisher {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    font-size: var(--font-14);
    color: var(--text-secondary);
}

.publisher-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.publisher-image {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-right: 6px;
    object-fit: cover;
}

.publisher-name {
    font-weight: var(--font-weight-medium);
}

/* =========================================
   Modern News Style Category Boxes (Homepage)
   ========================================= */

.job-portal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 2 columns for better width on desktop */
    gap: 15px;
    padding: 15px;
    background-color: var(--bg-primary);
}

.category-box {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ad-box-body {
    padding: 12px 15px;
}

.category-header {
    background-color: transparent;
    color: var(--text-primary);
    padding: 12px 15px 5px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-title {
    margin: 0;
    font-size: var(--font-17);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

/* Category Header Icon styling (matched to Trending box) */
.category-icon {
    vertical-align: middle;
    margin-left: 5px;
    margin-top: -2px;
    color: var(--text-primary);
}

.view-all-link {
    color: var(--primary-color) !important;
    text-decoration: none !important;
    font-size: var(--font-15);
    font-weight: var(--font-weight-medium);
}

.view-all-link:hover {
    text-decoration: underline !important;
}

.portal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.portal-item:last-child {
    border-bottom: none;
}

.portal-item:hover {
    background-color: var(--bg-hover);
}

.portal-item-text {
    flex: 1;
    min-width: 0;
}

.portal-item-link {
    color: var(--text-primary) !important;
    text-decoration: none !important;
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-relaxed);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: var(--font-16);
}

.portal-item-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.portal-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.new-badge {
    display: inline-block;
    color: #ff3b30;
    font-weight: var(--font-weight-bold);
    margin-right: 6px;
    font-size: 0.8em;
}

/* Error/Empty states */
.no-items,
.error-loading {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: var(--font-14);
}

/* =========================================
   Utility Styles
   ========================================= */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

@media (max-width: 1000px) {
    .job-portal-grid {
        grid-template-columns: 1fr;
        /* Stack on smaller screens */
        padding: 0;
        gap: 20px;
        margin-top: 5px;
    }

    .category-box {
        border: none;
        border-radius: 0;
    }

    .category-header {
        padding: 12px 15px;
    }

    .post-image {
        width: 60px;
        height: 60px;
    }

    .post-title {
        font-size: var(--font-14);
    }
}