/**
 * Channels Management - Frontend Styles
 */

/* ========================================
   Color Bars Widget
   ======================================== */

.cm-color-bars-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    align-items: flex-start;
}

.cm-color-bar-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.cm-color-bar {
    width: 100%;
    height: 50px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 15px;
    box-sizing: border-box;
    transition: transform 0.2s ease;
}

.cm-color-bar:hover {
    transform: translateY(-2px);
}

.cm-bar-label {
    font-size: 14px;
    font-weight: 500;
    display: block;
}

.cm-bar-label.label-inside {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.cm-bar-label.label-below {
    margin-top: 10px;
    color: #000;
    font-style: italic;
}

.cm-editor-notice {
    padding: 20px;
    background: #f0f0f1;
    border: 1px dashed #ccc;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Responsive Color Bars */
@media (max-width: 768px) {
    .cm-color-bars-container {
        flex-wrap: wrap;
    }
    
    .cm-color-bar-wrapper {
        flex: 0 0 calc(50% - 1px);
    }
}

@media (max-width: 480px) {
    .cm-color-bar-wrapper {
        flex: 0 0 100%;
    }
}


/* ========================================
   Posts Slider Widget
   ======================================== */

.cm-posts-slider-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Navigation */
.cm-slider-nav {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.cm-slider-nav button {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.cm-slider-nav button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.5);
}

.cm-slider-nav button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.cm-slider-nav button svg {
    width: 24px;
    height: 24px;
}

/* Slider Track */
.cm-slider-track-container {
    width: 100%;
    overflow: hidden;
    cursor: default;
}

.cm-posts-slider-wrapper.cm-dragging {
    cursor: grabbing;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.cm-posts-slider-wrapper.cm-dragging .cm-slider-track-container {
    cursor: grabbing;
}

.cm-posts-slider-wrapper.cm-dragging a,
.cm-posts-slider-wrapper.cm-dragging img {
    pointer-events: none;
}

.cm-slider-track {
    display: flex;
    transition: transform 0.4s ease-out;
    will-change: transform;
}

/* Slider Columns */
.cm-slider-column {
    flex: 0 0 33.333%;
    min-width: 0;
    padding: 20px;
    box-sizing: border-box;
}

/* Header Column */
.cm-slider-header {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 40px;
}

.cm-slider-header h2 {
    font-size: 48px;
    font-weight: 900;
    line-height: 1.1;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: -1px;
}

/* Mobile-only header shown BEFORE the slider track.
   Hidden on desktop so desktop view remains unchanged. */
.cm-slider-header-mobile {
    display: none;
}

/* Post Card */
.cm-post-card {
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease;
}

.cm-post-card.cm-inactive {
    opacity: 0.6;
}

.cm-post-card.cm-active {
    opacity: 1;
}

.cm-post-image {
    width: 100%;
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 4px;
}

.cm-post-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.cm-post-image:hover img {
    transform: scale(1.03);
}

.cm-post-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cm-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 12px;
}

.cm-post-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

.cm-post-title a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.cm-post-title a:hover {
    opacity: 0.8;
}

.cm-post-date {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
    flex-shrink: 0;
}

.cm-post-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 15px;
    flex: 1;
}

.cm-post-channels {
    font-size: 13px;
    font-weight: 500;
    color: #000;
    margin-top: auto;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.cm-post-channel-name {
    display: inline-block;
}

.cm-post-channel-separator {
    display: inline-block;
    opacity: 0.8;
}

.cm-no-posts {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-style: italic;
}

/* Footer Background Dynamic Class */
.slider_footer_background {
    transition: background-color 0.4s ease;
}


/* ========================================
   Posts Mosaic Grid Widget - Bootstrap Layout
   ======================================== */

/* Container */
.cm-mosaic-container {
    padding: 0;
    margin: 0;
    max-width: 100%;
}

/* Rows */
.cm-mosaic-container .row {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
}

.cm-mosaic-row-1,
.cm-mosaic-row-2,
.cm-mosaic-row-3 {
    margin-bottom: 0;
}

/* Columns */
.cm-mosaic-col {
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Column Widths using Bootstrap classes */
.cm-mosaic-container .col-5 {
    flex: 0 0 41.666667%;
    max-width: 41.666667%;
}

.cm-mosaic-container .col-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

.cm-mosaic-container .col-7 {
    flex: 0 0 58.333333%;
    max-width: 58.333333%;
}

/* Mosaic Items */
.cm-mosaic-item {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
    color: #fff;
    width: 100%;
    min-height: 250px;
}

/* Specific post heights for better layout */
.cm-mosaic-item.post1,
.cm-mosaic-item.post3 {
    min-height: 350px;
}

.cm-mosaic-item.post2,
.cm-mosaic-item.post5 {
    min-height: 250px;
}

.cm-mosaic-item.post4 {
    min-height: 400px;
}

.cm-mosaic-item.start-box,
.cm-mosaic-item.end-box {
    min-height: 200px;
}

/* Start and End Boxes */
.cm-mosaic-start-box,
.cm-mosaic-end-box {
    background-color: #333333;
    color: #ffffff;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 30px;
    box-sizing: border-box;
    background-size: cover;
    background-position: center;
}

.cm-mosaic-box-content {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    position: relative;
    z-index: 2;
}

.cm-mosaic-box-link {
    display: flex;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    align-items: flex-start;
    justify-content: flex-start;
}

.cm-mosaic-box-link:hover {
    color: inherit;
    opacity: 0.9;
}

/* Post Items */
.cm-mosaic-post {
    background-color: #f0f0f0;
    position: relative;
    overflow: hidden;
}

.cm-mosaic-content {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    align-items: flex-end;
}

/* Legacy support for old class name */
.cm-mosaic-link {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    align-items: flex-end;
}

.cm-mosaic-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    line-height: 0;
    font-size: 0;
}

.cm-mosaic-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cm-mosaic-no-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: #e0e0e0;
}

/* Overlay with Gradient */
.cm-mosaic-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 15px;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 15px;
    font-size: 14px;
    line-height: 1.4;
    z-index: 2;
    background-color: rgba(0, 0, 0, 0.7); /* Default fallback */
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.cm-mosaic-post:hover .cm-mosaic-overlay {
    transform: translateY(0);
}

.cm-mosaic-post::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
    pointer-events: none;
    z-index: 1;
}

.cm-mosaic-overlay-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.cm-mosaic-overlay-channel {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Mobile-only channels list (all selected channels with colored dots) */
.cm-mosaic-channels-mobile {
    display: none; /* Hidden on desktop - do not affect desktop view */
}

.cm-mosaic-no-posts {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    color: #666;
    font-style: italic;
    min-height: 200px;
    font-size: 14px;
    line-height: 1.4;
}

.cm-mosaic-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e0e0e0;
    color: #999;
    font-style: italic;
    min-height: 150px;
}

/* Responsive Mosaic */
@media (max-width: 768px) {
    .cm-mosaic-container .col-5,
    .cm-mosaic-container .col-6,
    .cm-mosaic-container .col-7 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .cm-mosaic-box-content {
        font-size: 20px;
    }
    
    .cm-mosaic-item {
        min-height: 200px;
    }
    
    .cm-mosaic-item.post1,
    .cm-mosaic-item.post2,
    .cm-mosaic-item.post3,
    .cm-mosaic-item.post4,
    .cm-mosaic-item.post5 {
        min-height: 0;
    }

    .cm-mosaic-post .cm-mosaic-content {
        display: block;
        height: auto;
        min-height: 0;
    }

    .cm-mosaic-post .cm-mosaic-image {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        height: auto;
    }

    .cm-mosaic-post .cm-mosaic-image img {
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    .cm-mosaic-post .cm-mosaic-no-image {
        position: relative;
        min-height: 250px;
    }
    
    /* Show overlay on mobile by default */
    .cm-mosaic-overlay {
        transform: translateY(0);
        flex-wrap: wrap;
    }
    
    /* Hide the single (first) channel label on mobile - replaced by full list */
    .cm-mosaic-overlay-channel {
        display: none;
    }
    
    /* Show the full channels list on mobile with colored dots */
    .cm-mosaic-channels-mobile {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 10px;
        width: 100%;
        flex-basis: 100%;
        margin-top: 6px;
    }
    
    .cm-mosaic-channel-pill {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 12px;
        font-weight: 500;
        line-height: 1.2;
        color: #ffffff;
        background-color: rgba(0, 0, 0, 0.25);
        padding: 4px 8px;
        border-radius: 12px;
        white-space: nowrap;
    }
    
    .cm-mosaic-channel-dot {
        display: inline-block;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        flex-shrink: 0;
        border: 1px solid rgba(255, 255, 255, 0.6);
    }
    
    .cm-mosaic-channel-name {
        display: inline-block;
        line-height: 1;
    }
}


/* Responsive Slider */
@media (max-width: 1024px) {
    .cm-slider-column {
        flex: 0 0 50%;
    }
    
    .cm-slider-header h2 {
        font-size: 36px;
    }
}

@media (max-width: 768px) {
    .cm-slider-column {
        flex: 0 0 80%;
    }
    
    /* Hide the in-track header column on mobile (first column) */
    .cm-slider-track .cm-slider-header {
        display: none;
    }
    
    /* Show the pre-track mobile header */
    .cm-slider-header-mobile {
        display: block;
        padding: 20px 20px 10px;
        box-sizing: border-box;
    }
    
    .cm-slider-header-mobile h2 {
        font-size: 32px;
        font-weight: 900;
        line-height: 1.1;
        margin: 0;
        text-transform: uppercase;
        letter-spacing: -1px;
    }
    
    .cm-slider-header h2 {
        font-size: 32px;
    }
    
    .cm-slider-nav {
        top: 10px;
        right: 10px;
    }
    
    .cm-slider-nav button {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .cm-slider-header {
        padding-top: 60px;
    }
    
    .cm-slider-header h2 {
        font-size: 28px;
    }
    
    .cm-post-meta {
        flex-direction: column;
        gap: 5px;
    }
}


/* ========================================
   Posts Slider - Style Two (Grid)
   ======================================== */

.cm-style-two-wrapper {
    width: 100%;
    margin: 0 auto;
    clear: both;
}

.cm-style-two-header {
    margin-bottom: 30px;
}

.cm-style-two-title {
    font-size: 32px;
    font-weight: 600;
    color: #000;
    margin: 0;
    line-height: 1.2;
}

/* Grid */
.cm-style-two-grid {
    display: grid;
    gap: 40px;
    align-items: stretch;
}

.cm-style-two-no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    font-size: 16px;
    color: #999;
}

/* Card */
.cm-style-two-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: transparent;
}

/* Image */
.cm-style-two-image-wrap {
    display: block;
    width: 100%;
    height: 280px;
    overflow: hidden;
    margin-bottom: 20px;
    background: #f5f5f5;
    text-decoration: none;
}

.cm-style-two-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.cm-style-two-card:hover .cm-style-two-image {
    transform: scale(1.04);
}

.cm-style-two-no-image {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 13px;
}

/* Body */
.cm-style-two-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.cm-style-two-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.cm-style-two-post-title {
    font-size: 20px;
    font-weight: 600;
    color: #000;
    margin: 0;
    flex: 1;
    line-height: 1.3;
}

.cm-style-two-post-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.cm-style-two-post-title a:hover {
    color: #555;
}

.cm-style-two-post-date {
    font-size: 14px;
    color: #999;
    white-space: nowrap;
    flex-shrink: 0;
}

.cm-style-two-excerpt {
    font-size: 15px;
    color: #555;
    margin: 0 0 20px 0;
    line-height: 1.6;
}

/* Footer (publication link + channels) */
.cm-style-two-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.cm-style-two-pub-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #000;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: gap 0.3s ease;
    align-self: flex-start;
}

.cm-style-two-pub-link:hover {
    gap: 12px;
}

.cm-style-two-pub-arrow {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.cm-style-two-pub-link:hover .cm-style-two-pub-arrow {
    transform: translate(2px, -2px);
}

/* Channels with colored dots */
.cm-style-two-channels {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.cm-style-two-channel-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
}

.cm-style-two-channel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

.cm-style-two-channel-label {
    line-height: 1;
}

/* Responsive */
@media (max-width: 1024px) {
    .cm-style-two-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 640px) {
    .cm-style-two-grid {
        grid-template-columns: 1fr !important;
        gap: 30px;
    }
    
    .cm-style-two-title {
        font-size: 24px;
    }
    
    .cm-style-two-image-wrap {
        height: 220px;
    }
    
    .cm-style-two-title-row {
        flex-direction: column;
        gap: 6px;
    }
}


/* ========================================
   Custom Breadcrumbs Widget
   ======================================== */

.cm-custom-breadcrumbs {
    width: 100%;
    font-size: 14px;
    line-height: 1.4;
    color: #666666;
}

.cm-custom-breadcrumbs-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cm-custom-breadcrumbs-item,
.cm-custom-breadcrumbs-separator {
    display: inline-flex;
    align-items: center;
}

.cm-custom-breadcrumbs-link {
    color: #666666;
    text-decoration: none;
    transition: color 0.25s ease;
}

.cm-custom-breadcrumbs-link:hover {
    color: #000000;
}

.cm-custom-breadcrumbs-current {
    color: #000000;
    font-weight: 500;
}

.cm-custom-breadcrumbs-separator {
    color: #999999;
}
