/**
 * Our Media Styles
 * Using brand colors: --brand-main: #009fe3, --brand-dark: #002d57, --brand-neutral: #3b413f
 */

/* Main Container */
.our-media-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.page-title-wrapper {
    margin-bottom: 30px;
    text-align: center;
}

.page-title {
    color: var(--brand-dark, #002d57);
    font-size: 2.5rem;
    font-weight: 600;
    margin: 0;
}

/* Filter styles */
.our-media-filters {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.filter-form .filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

.filter-group:last-child,
.filter-group.button-group {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-top: 25px;
    justify-content: flex-start;
}

.filter-group label {
    font-weight: 600;
    color: var(--brand-dark, #002d57);
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.filter-group select,
.filter-group input[type="text"] {
    padding: 10px 12px;
    border: 1px solid #ddd;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.filter-group select:focus,
.filter-group input[type="text"]:focus {
    outline: none;
    border-color: var(--brand-main, #009fe3);
    box-shadow: 0 0 0 2px rgba(0, 159, 227, 0.2);
}

.filter-group .action {
    padding: 10px 20px;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s ease;
    margin-right: 10px;
    white-space: nowrap;
}

.filter-group .action.primary {
    background-color: var(--brand-main, #009fe3);
    color: white;
}

.filter-group .action.primary:hover {
    background-color: var(--brand-dark, #002d57);
}

.filter-group .action.secondary {
    background-color: transparent;
    color: var(--brand-neutral, #3b413f);
    border: 1px solid var(--brand-neutral, #3b413f);
}

.filter-group.button-group .action.secondary {
    background: transparent;
    color: var(--brand-main, #009fe3);
    border: 1px solid var(--brand-main, #009fe3);
}

.filter-group .action.secondary:hover {
    background-color: var(--brand-neutral, #3b413f);
    color: white;
}

/* Content Type Buttons */
.content-type-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px 0;
}

.type-btn {
    background: #ffffff;
    border: 2px solid var(--brand-main, #009fe3);
    color: var(--brand-main, #009fe3);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: capitalize;
}

.type-btn:hover {
    background: var(--brand-main, #009fe3);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 159, 227, 0.3);
}

.type-btn.active {
    background: var(--brand-main, #009fe3);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 159, 227, 0.3);
}

/* Results Info */
.results-info {
    margin-bottom: 20px;
    color: var(--brand-neutral, #3b413f);
    font-weight: 500;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.post-item {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Post Layout - Horizontal for list view, vertical for grid */
.post-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* List view styles */
.our-media-posts.list-view .posts-grid {
    display: block;
}

.posts-grid.list-view .post-item {
    margin-bottom: 20px;
    display: block;
    height: auto;
}

.posts-grid.list-view .post-content {
    padding: 15px;
}

.posts-grid.list-view .post-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    height: auto;
}

.post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.post-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.post-featured-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

/* Product file images - taller height */
.post-featured-image.product-file-image {
    height: 350px;
}

/* List view - compact square image */
.posts-grid.list-view .post-featured-image {
    width: 120px;
    height: 120px;
    margin-right: 20px;
    border-radius: 6px;
}

.post-featured-image a {
    display: block;
    width: 100%;
    height: 100%;
}

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

.post-item:hover .post-featured-image img {
    transform: scale(1.05);
}

.post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--brand-main, #009fe3);
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.85rem;
    gap: 10px;
}

.post-type {
    background-color: var(--brand-main, #009fe3);
    color: white;
    padding: 4px 8px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.content-type {
    background-color: var(--brand-neutral, #3b413f);
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-weight: 500;
    font-size: 0.75rem;
}

.post-type-spec_sheet .post-type {
    background-color: #28a745;
}

.post-type-faq .post-type {
    background-color: #ffc107;
    color: #212529;
}

.post-date {
    color: var(--brand-neutral, #3b413f);
}

.post-title {
    margin: 0 0 15px 0;
    font-size: 1.25rem;
    line-height: 1.4;
}

.post-title a {
    color: var(--brand-dark, #002d57);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: var(--brand-main, #009fe3);
}

.post-excerpt {
    color: var(--brand-neutral, #3b413f);
    line-height: 1.6;
    margin-bottom: 15px;
}

.post-categories {
    margin-bottom: 15px;
    font-size: 0.85rem;
}

.categories-label {
    font-weight: 600;
    color: var(--brand-dark, #002d57);
    margin-right: 8px;
}

.category-link {
    display: inline-block;
    background-color: #f8f9fa;
    color: var(--brand-dark, #002d57);
    padding: 4px 8px;
    margin: 2px 4px 2px 0;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.8rem;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.category-link:hover {
    background-color: var(--brand-main, #009fe3);
    color: white;
    border-color: var(--brand-main, #009fe3);
    text-decoration: none;
}

.post-file-types {
    margin-bottom: 15px;
    font-size: 0.85rem;
}

.file-types-label {
    font-weight: 600;
    color: var(--brand-neutral, #3b413f);
    margin-right: 8px;
}

.file-type-link {
    display: inline-block;
    background-color: var(--brand-neutral, #3b413f);
    color: white;
    padding: 4px 8px;
    margin: 2px 4px 2px 0;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.8rem;
    border: 1px solid var(--brand-neutral, #3b413f);
    transition: all 0.3s ease;
}

.file-type-link:hover {
    background-color: var(--brand-main, #009fe3);
    color: white;
    border-color: var(--brand-main, #009fe3);
    text-decoration: none;
}

.post-actions {
    text-align: right;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.read-more {
    color: var(--brand-main, #009fe3);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.read-more:hover {
    color: var(--brand-dark, #002d57);
}

.read-more.file-view {
    background-color: var(--brand-dark, #002d57);
    color: white;
    padding: 10px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: none;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.read-more.file-view:hover {
    background-color: #001a3d;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 45, 87, 0.3);
}

.read-more.file-download {
    background-color: var(--brand-main, #009fe3);
    color: white;
    padding: 10px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: none;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.read-more.file-download:hover {
    background-color: #007bb8;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 159, 227, 0.3);
}

/* Sidebar Category Filter */
.category-filter-block {
    background: white;
    border: 1px solid #e9ecef;
    margin-bottom: 30px;
}

.category-filter-block .block-title {
    background-color: var(--brand-dark, #002d57);
    color: white;
    padding: 15px 20px;
    margin: 0;
}

.category-filter-block .block-content {
    padding: 20px;
}

.category-filter-block ul {
    list-style-image: none !important; 
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    margin-bottom: 8px;
}

.category-item.active .category-link {
    background-color: var(--brand-main, #009fe3);
    color: white;
}

.category-item .category-link {
    display: block;
    padding: 10px 15px;
    color: var(--brand-neutral, #3b413f);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.category-item .category-link:hover {
    background-color: #f8f9fa;
    color: var(--brand-dark, #002d57);
}

.post-count {
    float: right;
    font-size: 0.85rem;
    opacity: 0.7;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--brand-neutral, #3b413f);
}

.no-results p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Pagination Styles */
.pagination-wrapper {
    margin-top: 40px;
    text-align: center;
}

.pagination {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 20px 0;
}

.page-link {
    display: inline-block;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--brand-dark, #002d57);
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.page-link:hover {
    background-color: var(--brand-main, #009fe3);
    color: white;
    border-color: var(--brand-main, #009fe3);
    text-decoration: none;
}

.page-link.current {
    background-color: var(--brand-main, #009fe3);
    color: white;
    border-color: var(--brand-main, #009fe3);
    cursor: default;
}

.page-link.prev,
.page-link.next {
    font-weight: 600;
    padding: 8px 16px;
}

.page-dots {
    padding: 8px 4px;
    color: var(--brand-neutral, #3b413f);
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .our-media-container {
        padding: 15px;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .filter-form .filter-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-group {
        min-width: auto;
        width: 100%;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .post-item {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.5rem;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .filter-group .action {
        width: auto;
        margin-right: 10px;
        margin-bottom: 0;
        display: inline-block;
    }
}

.post-meta .post-type { display: none; }