/**
 * Category Gallery Tabs - Public Styles
 */

/* Error messages */
.cgt-error {
    padding: 15px;
    background-color: #fff3f3;
    border-left: 4px solid #f44336;
    margin-bottom: 20px;
    color: #333;
    font-weight: 500;
}

/* No posts message */
.cgt-no-posts {
    padding: 15px;
    background-color: #f9f9f9;
    border-left: 4px solid #ddd;
    margin-bottom: 20px;
    color: #666;
    font-weight: 500;
}

/* Main wrapper */
.cgt-wrapper {
    margin: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Category header */
.cgt-category-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.cgt-category-header .cgt-category-title {
    margin: 0 0 10px;
    font-size: 24px;
    color: #fff;
}

.cgt-category-header .cgt-category-description {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Posts grid */
.cgt-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 20px;
    margin-bottom: 20px;
}

.cgt-post-item {
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cgt-post-item:hover {
    transform: translateY(-5px);
}

.cgt-post-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.cgt-post-image {
    height: 180px;
    overflow: hidden;
    position: relative;
}

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

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

.cgt-post-title {
    margin: 18px 0px 6px;
    font-size: 18px;
    color: #fff;
    line-height: 1.3;
}

.cgt-post-meta {
    margin: 0 15px 10px;
    font-size: 12px;
    color: #888;
    display: none;
}

.cgt-post-excerpt {
    margin: 0 15px 15px;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.cgt-post-image.cgt-no-image {
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Скрытые посты показываются/скрываются через атрибут style="display:none;" */

/* Tabs navigation */
.cgt-tabs-nav {
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.45);
}

.cgt-tabs {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
    list-style: none;
}

.cgt-tab-item {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cgt-tab-item a {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: #fff;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.cgt-tab-item.active a {
    color: #EF4763;
    border-bottom: 3px solid #EF4763;
}

.cgt-tab-item a:hover {
    color: #EF4763;
    background-color: rgba(0, 115, 170, 0.05);
}

html .cgt-tab-item.active a {
    color: #fff;
    border-bottom: 3px solid #dd3333;
}


/* Tabs content */
.cgt-tab-content {
    display: none;
}

.cgt-tab-content.active {
    display: block;
}

/* Categories grid */
.cgt-categories-grid {
    display: grid;
    grid-gap: 20px;
}

.cgt-columns-1 {
    grid-template-columns: 1fr;
}

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

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

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

/* Category item */
.cgt-category-item {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cgt-category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.cgt-category-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.cgt-category-image {
    height: 180px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.cgt-category-title {
    margin: 0;
    padding: 15px 15px 5px;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.cgt-category-count {
display: none;
    padding: 0 10px;
    font-size: 14px;
    color: #777;
}

/* View more button */
.cgt-view-more {
    text-align: center;
    margin-top: 30px;
}

.cgt-view-more + .cgt-view-more , .cgt-loading + .cgt-loading{
    display: none !important;
}

.cgt-view-more-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #EF4763;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.cgt-view-more-btn:hover {
    background-color: #EF4763;
}

/* Loading indicator */
.cgt-loading {
    text-align: center;
    padding: 30px;
    color: #777;
    font-style: italic;
}

/* Skeleton loader */
.cgt-skeleton-container {
    width: 100%;
    margin-bottom: 20px;
}

.cgt-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 20px;
    min-height: 250px; /* Ensure minimum height for visibility */
}

.cgt-skeleton-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    height: 300px;
}

.cgt-skeleton-image {
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

.cgt-skeleton-title {
    height: 20px;
    margin: 15px 15px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.cgt-skeleton-meta {
    height: 14px;
    width: 60%;
    margin: 0 15px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.cgt-skeleton-excerpt {
    height: 14px;
    width: 80%;
    margin: 0 15px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.cgt-skeleton-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 20px;
    min-height: 200px; /* Ensure minimum height for visibility */
}

.cgt-skeleton-list-item {
    height: 40px;
    background-color: #f0f0f0;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

/* Skeleton animation */
.cgt-skeleton-image::after,
.cgt-skeleton-title::after,
.cgt-skeleton-meta::after,
.cgt-skeleton-excerpt::after,
.cgt-skeleton-list-item::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.05) 20%,
        rgba(255, 255, 255, 0.1) 60%,
        rgba(255, 255, 255, 0)
    );
    animation: cgt-shimmer 2s infinite;
    will-change: transform; /* Optimize animation performance */
}

@keyframes cgt-shimmer {
    100% {
        transform: translateX(100%);
    }
}

@media screen and (max-width: 992px) {
    .cgt-skeleton-grid,
    .cgt-skeleton-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 576px) {
    .cgt-skeleton-grid,
    .cgt-skeleton-list {
        grid-template-columns: 1fr;
    }
}

/* Hierarchical categories (for Categories tab) */
.cgt-category-children {
    margin-left: 20px;
    margin-top: 20px;
    border-left: 1px solid #eee;
    padding-left: 20px;
}

/* Categories List View */
.cgt-categories-list-container {
    width: 100%;
    box-sizing: border-box;
}

.cgt-categories-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    grid-gap: 20px;
    justify-content: space-between;
}

.cgt-category-children-list {
    list-style: none;
    margin: 0;
    margin-top: 10px;
    padding: 0;
    padding-left: 15px;
    border-left: 1px solid rgba(255, 255, 255, 0.25);
}

.cgt-posts-loading {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 20px 0;
}

.cgt-category-posts-wrapper {
    margin-top: 20px;
    position: relative;
}

.cgt-back-to-categories {
    margin-bottom: 0;
    position: absolute;
    right: 0;
    top: 10px;
}

.cgt-back-btn {
    background-color: transparent;
    border: 0;
    border-radius: 4px;
    padding: 8px 15px;
    font-size: 14px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cgt-back-btn:hover {
    background-color: #e9e9e9;
    color: #EF4763;
}

.cgt-category-list-item {
    margin-bottom: 0;
    padding: 5px 0;
    list-style: none;
    font-weight: normal;
 
}


.cgt-category-list-link a{
    font-weight: normal;
}

.cgt-category-list-item:first-child{
    display: none;
}

.cgt-category-children-list a{
      color: #fff !important; 
}

.cgt-category-list-link {
    color: #dd3333;
    text-decoration: none;
    font-weight: 500;
    display: block;
    transition: color 0.3s ease, background-color 0.3s ease;
    padding: 0;
    display: flex;
}

.cgt-category-list-link:hover {
    color: #dd3333;
}



.cgt-category-list-link .cgt-category-count {
    color: #777;
    font-size: 0.9em;
    font-weight: normal;
}





/* Responsive styles */
@media screen and (max-width: 992px) {
    .cgt-columns-3, .cgt-columns-4,
    .cgt-posts-grid.cgt-columns-3, .cgt-posts-grid.cgt-columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 576px) {
    .cgt-columns-2, .cgt-columns-3, .cgt-columns-4,
    .cgt-posts-grid.cgt-columns-2, .cgt-posts-grid.cgt-columns-3, .cgt-posts-grid.cgt-columns-4 {
        grid-template-columns: 1fr;
    }
    
    .cgt-tabs {
        flex-wrap: wrap;
    }
    
    .cgt-tab-item a {
        padding: 8px 15px;
        font-size: 14px;
    }
}
