/**
 * Custom Blog Templates
 * Categories Carousel
 */

.cbt-categories {
	width: 100%;
	margin: 0;
	padding: 0;
}

.cbt-categories__header {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
}

.cbt-categories__viewport {
	width: 100%;
	overflow: hidden;
}

.cbt-categories__track {
	display: flex;
	gap: 12px;
	width: max-content;
	padding: 0 2px;
}

.cbt-category {
    position: relative;
    flex: 0 0 243px;
    width: 243px;
    height: 140px;
    margin-bottom: 32px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 0;
    box-sizing: border-box;
    border: 0;
    border-radius: 24px;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0) 35%,
        rgba(0, 0, 0, 0.75) 100%
    );

    cursor: pointer;
    transition: box-shadow 0.2s ease;
}

.cbt-category__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 24px;
    overflow: hidden;
}

.cbt-category__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cbt-category__name {
	position: relative;
	left: 0;
	bottom: 0;
	z-index: 2;
	display: block;
	width: 100%;
	margin: 0;
	padding: 0 16px 16px;
	box-sizing: border-box;
	color: #ffffff;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	text-align: left;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}

.cbt-category__image::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 55%;
	background: linear-gradient(
		to top,
		rgba(0, 0, 0, 0.55),
		transparent
	);
	pointer-events: none;
}

.cbt-category--all .cbt-category__image {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #eeeeee;
}

.cbt-category__all-icon {
	display: grid;
	grid-template-columns: repeat(2, 8px);
	gap: 3px;
}

.cbt-category__all-icon span {
	display: block;
	width: 8px;
	height: 8px;
	border-radius: 2px;
	background: #777777;
}

.cbt-category__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: #dddddd;
}

.cbt-category.is-active .cbt-category__image {
	box-shadow: inset 0 0 0 3px #ffffff;
}

.cbt-category.is-active .cbt-category__name {
	font-weight: 600;
}

.cbt-categories__nav {
	position: relative;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	min-width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 1px solid #eeeeee;
	border-radius: 50%;
	background: #ffffff;
    box-sizing: border-box;
	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.18);
	color: #555555;
	cursor: pointer;
	font-size: 20px;
	line-height: 1;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        opacity 0.2s ease;
}

.cbt-categories__nav--prev {
	margin-right: 6px;
}

.cbt-categories__nav--prev:hover {
    border-color: #222222;
    color: #222222;
}

.cbt-categories__nav--prev:disabled {
    opacity: 0.35;
    cursor: default;
}

.cbt-categories__nav--next {
	margin-left: 6px;
}

.cbt-categories__nav:hover {
	background: #f5f5f5;
}

.cbt-categories__nav:disabled {
	opacity: 0.35;
	cursor: default;
}

/* ========================================
   CATEGORÍAS - MOBILE
======================================== */

@media (max-width: 767px) {

    .cbt-categories {
        width: 100%;
        margin-bottom: 24px;
    }

    .cbt-categories__viewport {
        width: 100%;
        overflow: hidden;
    }

    .cbt-categories__track {
        gap: 10px;
    }

    /*
     * Tarjeta de categoría
     */
    .cbt-category {
        position: relative;

        flex: 0 0 136px;
        width: 136px;
        height: 80px;

        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-end;

        padding: 0;
        margin: 0;

        box-sizing: border-box;

        border: 0;
        border-radius: 16px;

        overflow: hidden;
    }

    /*
     * Imagen ocupa toda la tarjeta
     */
    .cbt-category__image {
        position: absolute;
        inset: 0;

        width: 100%;
        height: 100%;

        max-width: none;
        max-height: none;

        object-fit: cover;

        border-radius: 16px;
        overflow: hidden;
    }

    /*
     * Nombre de categoría
     */
    .cbt-category__name {
        position: relative;
        z-index: 2;

        width: 100%;

        margin: 0;
        padding: 0 12px 10px;

        box-sizing: border-box;

        color: #ffffff;

        font-size: 11px;
        line-height: 1.2;
        font-weight: 500;

        text-align: left;
    }

    /*
     * Categoría activa
     */
    .cbt-category.is-active {
        box-shadow: inset 0 0 0 2px #ffffff;
    }

    /*
     * Flechas del carrusel
     */
    .cbt-categories__nav {
        gap: 6px;
    }

    .cbt-categories__nav button {
        width: 28px;
        height: 28px;

        flex: 0 0 28px;

        font-size: 12px;
    }

}

/* =========================================================
   CBT - Post cards
   ========================================================= */

.cbt-posts {
    width: 100%;
    margin-top: 24px;
}

.cbt-posts__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
}

.cbt-post-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-sizing: border-box;
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.10);
}

.cbt-post-card__image-link {
    display: block;
    width: 100%;
    text-decoration: none;
}

.cbt-post-card__image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #eeeeee;
}

.cbt-post-card__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cbt-post-card__image-placeholder {
    width: 100%;
    height: 100%;
    background: #eeeeee;
}

.cbt-post-card__duration {
    position: absolute;
    right: 7px;
    bottom: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 16px;
    padding: 0 5px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    font-size: 8px;
    line-height: 1;
    font-weight: 500;
}

.cbt-post-card__content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 12px 12px 10px;
    box-sizing: border-box;
}

.cbt-post-card__category {
    overflow: hidden;
    margin-bottom: 5px;
    color: #001438;
    font-size: 12px;
    line-height: normal;
    font-weight: 700;
    letter-spacing: undefined;
    text-transform: uppercase;
    text-overflow: ellipsis;
}

.cbt-post-card__title {
    margin: 0 0 8px;
    font-size: 18px !important;
    line-height: 1.3;
    font-weight: 700;
}

.cbt-post-card__title a {
    color: #222222;
    text-decoration: none;
}

.cbt-post-card__title a:hover {
    text-decoration: none;
}

.cbt-post-card__excerpt {
    margin: 0 0 12px;
    color: #8A94A6;
    font-size: 14px;
    line-height: 1.45;
}

.cbt-post-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
}

.cbt-post-card__tutorial {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #222222;
    font-size: 14px;
    line-height: 1;
    font-weight: 600;
    text-decoration: none;
}

.cbt-post-card__tutorial:hover {
    color: #222222;
    text-decoration: none;
}

.cbt-post-card__tutorial-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    font-size: 7px;
    line-height: 1;
}

.cbt-post-card__save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #777777;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
}

.cbt-post-card__save {
    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.cbt-post-card__save:hover {
    color: #222222;
    transform: scale(1.1);
}

.cbt-post-card__save.is-saved {
    color: #222222;
    font-weight: 700;
}

.cbt-post-card__save.is-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* =========================================================
   CBT - Responsive
   ========================================================= */

@media (max-width: 767px) {

    .cbt-posts {
        margin-top: 18px;
    }

    .cbt-posts__grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .cbt-post-card__content {
        padding: 12px;
    }

    .cbt-post-card__title {
        font-size: 13px;
    }

    .cbt-post-card__excerpt {
        font-size: 10px;
    }

    .cbt-post-card__tutorial {
        font-size: 10px;
    }
}

.cbt-post-card__save-icon {
    display: block;
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cbt-post-card__save.is-saved .cbt-post-card__save-icon {
    fill: currentColor;
}

/* ========================================
   PAGINACIÓN DEL BLOG
======================================== */

.cbt-posts__pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 32px;
}

.cbt-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cbt-pagination__button,
.cbt-pagination__ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    padding: 0;
    margin: 0;

    box-sizing: border-box;

    border: 0;
    border-radius: 50%;

    background: #ffffff;
    color: #555555;

    font-family: inherit;
    font-size: 14px;
    line-height: 1;
    font-weight: 500;

    text-decoration: none;
}

.cbt-pagination__button {
    border: 1px solid #eeeeee;
    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.cbt-pagination__button:hover {
    border-color: #d9d9d9;
    background: #ffffff;
    color: #222222;
}

.cbt-pagination__button.is-active {
    border-color: #001b44;
    background: #001b44;
    color: #ffffff;
}

.cbt-pagination__button:disabled {
    opacity: 0.45;
    cursor: default;
}

.cbt-pagination__button:focus {
    outline: none;
}

.cbt-pagination__arrow {
    font-size: 11px;
    font-weight: 400;
}

.cbt-pagination__ellipsis {
    border: 1px solid #eeeeee;
    color: #555555;
}


/* ========================================
   PAGINACIÓN - MOBILE
======================================== */

@media (max-width: 767px) {

    .cbt-posts__pagination {
        margin-top: 24px;
    }

    .cbt-pagination {
        gap: 6px;
    }

    .cbt-pagination__button,
    .cbt-pagination__ellipsis {
        width: 20px;
        height: 20px;
        font-size: 8px;
    }

    .cbt-pagination__arrow {
        font-size: 11px;
    }
}

/* =========================================================
   PAGINACIÓN - POST GUARDADOS
   ========================================================= */

   .cbt-saved-posts {
        min-height: 100vh;
        box-sizing: border-box;
    }

   .cbt-saved-posts__title {
    text-align: center;
    margin-bottom: 32px;
    color: #001438;
    font-size: 32px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
}

   .cbt-saved-posts__pagination {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 32px;
}

.cbt-saved-posts__pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cbt-saved-posts__pagination .page-numbers li {
    margin: 0;
    padding: 0;
}

.cbt-saved-posts__pagination .page-numbers a,
.cbt-saved-posts__pagination .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    border: 0;
    border-radius: 50%;
    background: #ffffff;
    color: #555555;
    font-family: inherit;
    font-size: 14px;
    line-height: 1;
    font-weight: 500;
    text-decoration: none;
}

.cbt-saved-posts__pagination .page-numbers a:hover {
    border-color: #d9d9d9;
    background: #ffffff;
    color: #222222;
}

.cbt-saved-posts__pagination .page-numbers a.is-active {
    border-color: #001b44;
    background: #001b44;
    color: #ffffff;
}

.cbt-saved-posts__pagination .page-numbers .current {
    border-color: #222222;
    background: #222222;
    color: #ffffff;
}

.cbt-saved-posts__pagination .page-numbers .prev,
.cbt-saved-posts__pagination .page-numbers .next {
    padding: 0 12px;
}



/* Mobile */

@media (max-width: 767px) {

    .cbt-saved-posts__pagination {
        margin-top: 24px;
    }

    .cbt-saved-posts__pagination .page-numbers {
        gap: 4px;
    }

    .cbt-saved-posts__pagination .page-numbers a,
    .cbt-saved-posts__pagination .page-numbers span {
        min-width: 30px;
        height: 30px;
        font-size: 9px;
    }

    .cbt-saved-posts__pagination .page-numbers .prev,
    .cbt-saved-posts__pagination .page-numbers .next {
        padding: 0 9px;
    }

}

.cbt-header-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    height: 35px;
    padding: 0 16px;
    margin: 0;
    border: 1px solid #001438;
    border-radius: 8px;
    background: transparent;
    color: #001438;
    font-family: inherit;
    font-size: 13px;
    font-style: normal;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    box-sizing: border-box;
}

.cbt-header-save .cbt-post-card__save-icon {
    width: 14px !important;
    height: 14px !important;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.cbt-header-save__text {
    display: inline-block;
    white-space: nowrap;
}

.cbt-header-save:hover {
    background: #f5f5f5;
}

.cbt-header-save.is-saved {
    background: #001438;
    color: #fff;
}

/* =========================================================
   CBT - Categorías desktop sin slider
   ========================================================= */

@media (min-width: 768px) {

    .cbt-categories__header {
        width: 100%;
    }

    .cbt-categories__viewport {
        width: 100%;
        overflow: visible;
    }

    .cbt-categories__track {
        display: flex;
        width: 100%;
        gap: 12px;
        padding: 0;
    }

    .cbt-category {
        flex: 1 1 0;
        width: auto;
        height: 100px;
        margin-bottom: 32px;
        border-radius: 16px;
    }

    .cbt-category__image {
        border-radius: 16px;
    }

    .cbt-category__name {
        padding: 0 12px 12px;
        font-size: 12px;
    }

    /*
     * Las flechas ya no son necesarias en desktop.
     * Las mantenemos disponibles en el HTML para no
     * modificar la lógica existente.
     */
    .cbt-categories__nav {
        display: none;
    }

}

/* =========================================================
   CBT - Search Results Title
   ========================================================= */

.cbt-search-results__title {
    margin: 0 0 32px;
    padding: 0;
    color: #001438;
    font-size: 32px;
    line-height: 1.2;
    font-weight: 700;
    text-align: center;
}

.cbt-search-results__title span {
    font-weight: 700;
}