/* Rawcut Insights - Styles */

.rawcut-insights-wrapper {
    width: 100%;
    margin: 0 auto;
}

/* Header */
.insights-header {
    margin-bottom: 0;
}

.insights-title {
    font-weight: 400;
    margin-bottom: 30px;
    color: #1a1a1a;
}

/* Search & Filters Wrapper */
.insights-filters-wrapper {
    padding: 50px 180px;
    border-radius: 8px;
    margin-bottom: 0 !important;
    position: relative;
    width: 100vw;
    max-width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
}

/* Background Overlay */
.insights-filters-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 0;
    pointer-events: none;
}

/* İçeriklerin overlay üzerinde olması için */
.insights-filters-wrapper > * {
    position: relative;
    z-index: 1;
}

/* Unified Grid Container for Search and Filters */
.insights-search-and-filters {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr; /* Default: single column */
}

/* When only search is visible (no filters) */
.insights-search-and-filters:has(.insights-search):not(:has(.insights-filters)) {
    grid-template-columns: 1fr;
}

/* When only filters are visible (no search) */
.insights-search-and-filters:has(.insights-filters):not(:has(.insights-search)) {
    grid-template-columns: 1fr;
}

/* Search + 1 filter = 50-50 */
.subcategories-header .insights-search-and-filters {
    grid-template-columns: 1fr 1fr;
}

/* Search + 2 filters = 1fr 2fr (search takes 1, filters take 2) */
.insights-search-and-filters:has(.insights-search):has(.insights-filters:has(.filter-item:nth-child(2):last-child)) {
    grid-template-columns: 1fr 2fr;
}

/* Search + 3 filters = 1fr 3fr (search takes 1, filters take 3) */
.insights-search-and-filters:has(.insights-search):has(.insights-filters:has(.filter-item:nth-child(3):last-child)) {
    grid-template-columns: 1fr 3fr;
}

@media (max-width: 1440px) {
    .insights-filters-wrapper {
        padding: 50px 60px;
    }
}

/* Tablet: Adjust grid for medium screens */
@media (max-width: 1024px) {
    /* Search + 3 filters: Stack search on top, filters below */
    .insights-search-and-filters:has(.insights-search):has(.insights-filters:has(.filter-item:nth-child(3):last-child)) {
        grid-template-columns: 1fr;
    }
    
    /* Filters in 2 columns when there are 3 filters */
    .insights-filters:has(.filter-item:nth-child(3):last-child) {
        grid-template-columns: 1fr 1fr;
    }
    
    .subcategories-filters .insights-filters:has(.filter-item:nth-child(3):last-child) {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 690px) {
    .insights-filters-wrapper {
        padding: 38px 20px !important;
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        transform: none;
        margin-bottom: 0 !important;
    }
    
    .insights-filters-wrapper::before {
        border-radius: 10px;
    }
    
    /* Mobile: Force single column layout */
    .insights-search-and-filters {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    body.page-id-14159 .insights-filters-wrapper,
    body.page-id-13741 .insights-filters-wrapper {
        padding: 45px 20px !important;
    }
}


/* Search Bar */
.insights-search {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 50px;
    overflow: hidden;
}

.insights-search-label {
    padding: 13px 0 13px 20px;
    font-weight: 300;
    color: #1a1a1a;
    white-space: nowrap;
}

.insights-search-title {
    color: #fff;
    display: block;
    margin-bottom: 5px;
}
    
.insights-search-input {
    flex: 1;
    padding: 13px 20px 13px 15px !important;
    font-size: inherit !important;
    font-weight: 300 !important;
    border: none;
    border-radius: 0 !important;
    background: #fff !important;
    color: #1a1a1a;
    box-sizing: border-box;
    border: none !important;
}

.insights-search-input:focus {
    outline: none;
    box-shadow: none !important;
    background: #fff !important;
}

.insights-search-input::placeholder {
    color: #999;
}

/* Filters */
.insights-filters {
    display: grid;
    gap: 15px;
}

/* Dynamic filter grid based on number of filters */
/* 1 filter */
.insights-filters:has(.filter-item:nth-child(1):last-child) {
    grid-template-columns: 1fr;
}

/* 2 filters */
.insights-filters:has(.filter-item:nth-child(2):last-child) {
    grid-template-columns: 1fr 1fr;
}

/* 3 filters */
.insights-filters:has(.filter-item:nth-child(3):last-child) {
    grid-template-columns: 1fr 1fr 1fr;
}

.filter-item {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 50px;
    overflow: hidden;
}

.filter-label {
    padding: 13px 0 13px 20px;
    font-size: inherit !important;
    font-weight: 300;
    color: #1a1a1a;
    white-space: nowrap;
}

.insights-filter-select {
    flex: 1;
    padding: 10px 40px 10px 10px;
    font-size: inherit !important;
    border: none;
    border-radius: 0;
    background: #fff;
    color: #999;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3e%3cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23333333' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 20px center;
    background-size: 12px 8px;
    box-sizing: border-box;
}

.insights-filter-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Results Info */
.insights-results-info {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 15px 0;
}

.results-count {
    font-size: 17px;
    color: #969696;
}

.results-subtitle {
    font-size: 17px;
    color: #969696;
}

@media (max-width: 690px) {
    .results-subtitle, .results-count {
        font-size: 14px;
    }
}

/* Loading */
.insights-loading {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1a1a1a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Insights Grid */
.insights-grid {
    display: grid;
    gap: 30px;
    margin-bottom: 50px;
}

.insights-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.insights-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.insights-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Insight Card */
.insight-card {
    display: flex;
    flex-direction: row;
    background: #FDFDFD;
    border-radius: 0;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    gap: 0;
    align-items: center;
    border: 1px solid #E6E6E6;
    border-radius: 10px;
    padding: 20px 20px;
}

@media (min-width: 691px) {
    .insight-card:hover {
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    }
}

.insight-left {
    width: 293px;
}

@media (min-width: 691px) {

}

.insight-image {
    width: 100% !important;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    height: 170px !important;
}

@media (max-width: 690px) {
    .insight-image {
        height: 200px !important;
    }
}

.insight-image a {
    display: block;
    width: 100%;
    height: 170px;
}

@media (max-width: 690px) {
    .insight-image a {
        height: 200px;
    }
}

.insight-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    transition: transform 0.3s ease;
    margin: 0 auto !important;
}

.insight-image {
    width: 100% !important;
    height: 100% !important;
    display: block;
    object-fit: cover;
    margin: 0 !important;
}

.insight-card:hover .insight-image img {

}

.insight-content {
    padding: 5px 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.insight-title {
    font-size: 18px !important;
    font-weight: 500;
    margin: 0 0 15px 0;
    line-height: 1.4 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.insight-title a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.3s ease;
}

.insight-title a:hover {
    color: #B11656;
}

.insight-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.insight-excerpt .read-more {
    text-decoration: none;
    font-weight: 500;
}

.insight-excerpt .read-more:hover {
    text-decoration: underline;
}

.insight-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding-top: 5px;
}

.insight-date {
    font-size: 12px;
    color: #999;
    font-weight: 500;
}

.insight-tag {
    display: inline-block;
    padding: 0 12px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    letter-spacing: 0.5px;
    border-radius: 15px;
}

.insight-category {
    background: #f0f0f0;
    color: #333;
}

.insight-practice {
    background: #e8f4f8;
    color: #0066cc;
}

/* Pagination */
.insights-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 40px 0;
}

.insights-pagination .page-numbers {
    display: inline-block;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    background: #fff;
    border: 1px solid #e0e0e0;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.insights-pagination .page-numbers:hover,
.insights-pagination .page-numbers.current {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

.insights-pagination .page-numbers.dots {
    border: none;
    background: transparent;
}

.insights-pagination .page-numbers.prev,
.insights-pagination .page-numbers.next {
    font-weight: 600;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    font-size: 16px;
    color: #999;
    grid-column: 1 / -1;
    width: 100%;
}

/* Responsive */
@media (max-width: 1600px) {
    .insight-left {
        width: 250px;
    }
}

@media (max-width: 1440px) {
    .insight-left {
        width: 220px;
    }
}

@media (max-width: 1280px) {
    .insight-left {
        width: 200px;
    }
    
    .insight-content {
        padding: 5px 20px;
    }
}

@media (max-width: 1024px) {
    .insights-grid.columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .insight-left {
        width: 180px;
    }
}

@media (max-width: 768px) {
    .insights-filters {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .insights-grid.columns-2,
    .insights-grid.columns-3,
    .insights-grid.columns-4 {
        grid-template-columns: 1fr;
    }
    
    .insights-filters-wrapper {
        padding: 20px;
    }
    
    .insights-title {
        font-size: 28px;
    }
    
    .insight-card {
        flex-direction: column;
    }
    
    .insight-left {
        flex: 0 0 auto;
        min-width: 100%;
    }
   
    .insight-content {
        padding: 20px;
    }
}

@media (max-width: 690px) {
    .insights-title {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .insights-results-info {
        flex-direction: inherit;
        align-items: flex-start;
        gap: 5px;
        border-top: 1px solid #eee;
        border-bottom: 1px solid #eee;
        margin: 20px 0;
    }
    
    /* Mobile: Force single column for filters */
    .insights-filters {
        grid-template-columns: 1fr !important;
    }
    
    .search-results-container {
        gap: 30px;
    }
    
    .search-section-title {
        font-size: 20px;
    }
    
    .team-members-section .rawcut-team-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .practice-areas-section .rawcut-practices-grid-search {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .insight-card {
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
        border-bottom: 1px solid #E6E6E6 !important;
        border-radius: 0 !important;
    }

    .insight-content {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* Search Results Page - Sections Layout */
.search-results-wrapper .search-results-container {
    display: flex;
    flex-direction: column;
    gap: 50px;
    width: 100%;
}

.search-results-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.search-section-title {
    font-size: 52px;
    font-weight: 400;
    color: #1a1a1a;
    margin: 0;
    padding-bottom: 20px;
    border-bottom: 1px solid #e8e8e8;
}

.search-section-title.no-border {
    border-bottom: none;
    padding-bottom: 0;
}

/* Team Members Section */
.team-members-section .rawcut-team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    width: 100%;
}

/* Practice Areas Section */
.practice-areas-section .rawcut-practices-grid-search {
    display: grid;
    gap: 30px;
    width: 100%;
}

/* Insights Section */
.posts-section .insights-grid-search {
    display: grid;
    gap: 30px;
    width: 100%;
}

.posts-section .insights-grid-search.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.posts-section .insights-grid-search.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Category Card (for subcategories mode) */
.category-card {
    display: flex;
    flex-direction: row;
    background: #FDFDFD;
    border-radius: 0;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    gap: 0;
    align-items: center;
    border: 1px solid #E6E6E6;
    border-radius: 10px;
    padding: 20px 20px;
}

@media (min-width: 691px) {
    .category-card:hover {
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    }
}

.category-left {
    width: 293px;
}

.category-image {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 200px;
    border-radius: 10px;
}

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

.category-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    margin: 0 !important;
}

.category-card:hover .category-image img {
    margin: 0 !important;
}

.category-content {
    padding: 5px 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.category-title {
    font-size: 18px !important;
    font-weight: 500;
    margin: 0 0 15px 0;
    line-height: 1.4 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-title a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.3s ease;
}

.category-card:hover .category-title a {
    color: #B11656;
}

.category-description {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-description .read-more {
    text-decoration: none;
    font-weight: 500;
}

.category-description .read-more:hover {
    text-decoration: underline;
}

.category-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding-top: 5px;
}

.category-count {
    color: #999;
}

/* Subcategories Filters */
.subcategories-filters {
    margin-bottom: 30px;
}

.subcategories-filters .insights-search-title {
    color: #fff;
}

/* Subcategories mode specific styles */
.subcategories-filters .insights-filters {
    gap: 15px;
}

/* Dynamic filter grid for subcategories - same as posts mode */
.subcategories-filters .insights-filters:has(.filter-item:nth-child(1):last-child) {
    grid-template-columns: 1fr;
}

.subcategories-filters .insights-filters:has(.filter-item:nth-child(2):last-child) {
    grid-template-columns: 1fr 1fr;
}

.subcategories-filters .insights-filters:has(.filter-item:nth-child(3):last-child) {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Responsive: Mobilde üst üste */
@media (max-width: 768px) {
    .subcategories-filters .insights-filters {
        grid-template-columns: 1fr !important;
    }
    
    .insights-search-and-filters {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 1600px) {
    .category-left {
        width: 250px;
    }
    
    .category-image {
        max-height: 170px;
    }
}

@media (max-width: 1440px) {
    .category-left {
        width: 220px;
    }
    
    .category-image {
        max-height: 150px;
    }
}

@media (max-width: 1280px) {
    .category-left {
        width: 200px;
    }
    
    .category-image {
        max-height: 140px;
    }
    
    .category-content {
        padding: 5px 20px;
    }
}

@media (max-width: 1024px) {
    .category-left {
        width: 180px;
    }
    
    .category-image {
        max-height: 130px;
    }
}

@media (max-width: 768px) {
    .team-members-section .rawcut-team-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
    
    .practice-areas-section .rawcut-practices-grid-search {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .posts-section .insights-grid-search.columns-2 {
        grid-template-columns: 1fr;
    }

    .category-card {
        flex-direction: column;
    }
    
    .category-left {
        flex: 0 0 auto;
        min-width: 100%;
    }
    
    .category-image {
        height: 200px;
        min-height: 200px;
    }
    
    .category-content {
        padding: 20px;
    }
}

@media (max-width: 690px) {
    .category-card {
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
        border-bottom: 1px solid #E6E6E6 !important;
        border-radius: 0 !important;
    }

    .category-content {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}
