﻿/*Custom editor*/
#body img {
    width: 100% !important;
}

.editorjs-wrapper {
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 0px;
    margin-bottom: 10px;
    box-shadow: 0 6px 18px #e8edfa80;
}

.ce-editorjsColumns_col {
    border: 1px solid #eee;
    border-radius: 5px;
    gap: 10px;
    padding-top: 10px;
}

    .ce-editorjsColumns_col:focus-within {
        box-shadow: 0 6px 18px #e8edfa80;
    }

.media-wrapper {
    width: 100% !important;
}

    .media-wrapper img {
        width: 100% !important;
    }

.media-tool .media-tool__video {
    width: 100% !important;
}

.media-tool__image {
    width: 100% !important;
}

/*Custom carousel-removeBtn*/
.carousel-removeBtn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.editorjs-container > div {
    margin-bottom: 0.5rem;
}

.carousel-removeBtn::after {
    content: "\2716";
    font-size: 14px;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
}

.carousel-removeBtn svg {
    display: none;
}

/*Custom image-gallery textarea*/
.image-gallery textarea {
    display: block !important;
}

/*Custom allowfullscreen*/
[allowfullscreen] {
    width: 100%
}

/*Custom carousel-caption*/
.carousel-caption {
    right: 0 !important;
    left: 0 !important;
    color: var(--bs-text-muted) !important;
}

/*Custom module-image-caption*/
.module-image-caption {
    text-align: center;
}

/*Custom image-tool*/
.image-tool {
    margin-bottom: 20px;
}

.image-tool__image {
    text-align: center;
}

.image-tool__caption {
    margin-top: 10px;
    text-align: center;
    color: #888;
}

.image-tool--with-border img {
    border: 1px solid #e8e8eb;
}

.image-tool--with-background {
    background: #eff2f5;
    padding: 10px;
}

.image-tool--stretched img {
    max-width: none;
    width: 100%;
}

@media (min-width: 1200px) {
    .gg-container {
        --row-height: 250px !important;
        --column-width: 280px !important;
    }
}

@media (max-width: 1199px) and (min-width: 992px) {
    .gg-container {
        --row-height: 220px !important;
        --column-width: 250px !important;
    }
}

@media (max-width: 991px) and (min-width: 768px) {
    .gg-container {
        --row-height: 200px !important;
        --column-width: 220px !important;
    }
}

@media (max-width: 767px) and (min-width: 576px) {
    .gg-container {
        --row-height: 180px !important;
        --column-width: 200px !important;
    }
}

@media (max-width: 575px) {
    .gg-container {
        --row-height: 150px !important;
        --column-width: 180px !important;
    }
}




/*Custom attachment-block*/
.attachment-block {
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px;
    background-color: #f9f9f9;
}

.attachment-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    flex-grow: 1;
}

.attachment-icon {
    margin-right: 10px;
    font-size: 18px;
    color: #007bff;
}

.attachment-filename {
    margin-right: 10px;
    font-weight: 500;
}

.attachment-size {
    color: #6c757d;
    font-size: 0.9em;
}


/*Custom custom-slideshow-container*/
.custom-slideshow-container {
    max-width: 800px;
    width: 100%;
    aspect-ratio: 16 / 9;
    position: relative;
    margin: auto;
    background: #f8f8f8;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.custom-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

    .custom-slide.active {
        opacity: 1;
    }

.custom-slide-image {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Giữ nguyên tỷ lệ ảnh, không bị cắt */
    object-position: center;
}

.custom-slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.5);
    color: white;
    padding: 10px;
    text-align: center;
}

.custom-slide-number {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.5);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
}

.custom-prev, .custom-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    transition: 0.6s ease;
    border-radius: 50%;
    user-select: none;
    background-color: rgba(0,0,0,0.6);
    border: none;
    outline: none;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.custom-next {
    right: 10px;
}

.custom-prev {
    left: 10px;
}

    .custom-prev:hover, .custom-next:hover {
        background-color: rgba(0,0,0,0.8);
    }

.custom-dot-container {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    padding: 10px;
    z-index: 10;
}

.custom-dot {
    cursor: pointer;
    height: 10px;
    width: 10px;
    margin: 0 5px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.6s ease;
}

    .custom-dot.active, .custom-dot:hover {
        background-color: #717171;
    }

.custom-fade {
    animation: custom-fade 1.5s ease-in-out;
}

@keyframes custom-fade {
    from {
        opacity: .4
    }

    to {
        opacity: 1
    }
}

@media only screen and (max-width: 600px) {
    .custom-prev, .custom-next {
        padding: 8px !important;
        font-size: 14px !important;
    }

    .custom-slide-caption {
        font-size: 12px !important;
    }
}


/*Custom quote*/
.custom-quote {
    background-color: #f5f5f5;
    border-left: 4px solid #4CAF50;
    padding: 20px;
    margin: 20px 0;
}

.custom-quote__mark {
    font-size: 24px;
    color: #4CAF50;
    margin-bottom: 10px;
}

.custom-quote__text {
    font-style: italic;
    color: #333;
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.custom-quote__caption {
    font-weight: bold;
    color: #666;
    margin: 0;
}

.custom-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 4px;
    padding: 12px 20px;
    display: flex;
    align-items: flex-start;
}

.custom-warning__icon {
    color: #856404;
    margin: auto;
    display: flex;
    align-items: center;
}

.custom-warning__content {
    flex: 1;
    margin-left: 10px
}

.custom-warning__title {
    color: #856404;
    font-weight: bold;
    margin-bottom: 5px;
}

.custom-warning__message {
    color: #856404;
}

.custom-table-wrapper {
    overflow-x: auto;
    margin-bottom: 1em;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-family: Arial, sans-serif;
}

.custom-table__cell {
    border: 1px solid #dee2e6;
    padding: 8px 12px;
    text-align: left;
}

.custom-table__cell--header {
    font-weight: bold;
    background-color: #f8f9fa;
}

.custom-table tr:hover {
    background-color: #f5f5f5;
}

.custom-table a {
    color: #007bff;
    text-decoration: none;
}

    .custom-table a:hover {
        text-decoration: underline;
    }

.cdx-checklist__item {
    display: flex !important;
    box-sizing: content-box !important;
    align-items: center !important;
}


.p-editor {
    margin: 0 0 1em;
    line-height: 160%;
    text-rendering: optimizeSpeed;
}

.gg-box.slider-layout {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}

    .gg-box.slider-layout .gg-media {
        flex: 0 0 auto;
        width: 100%;
        scroll-snap-align: start;
    }

.gg-media {
    max-width: 100%;
    height: auto;
}

.gg-caption {
    padding: 5px;
    text-align: center;
    color: #888;
    background-color: #F0F0F0;
}

[data-text] {
    position: relative;
    display: inline-block;
    cursor: pointer;
    border-bottom: 1px dashed #000;
}

    [data-text]::after {
        content: attr(data-text);
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        background-color: #333;
        color: #fff;
        padding: 5px 10px;
        border-radius: 3px;
        white-space: pre-wrap;
        width: max-content;
        max-width: 200px;
        visibility: hidden;
        opacity: 0;
        transition: opacity 0.3s, visibility 0.3s;
        z-index: 1;
    }

    [data-text]:hover::after {
        visibility: visible;
        opacity: 1;
    }

.delimiter {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

    .delimiter::before,
    .delimiter::after {
        content: "";
        flex-grow: 1;
        background: linear-gradient(to right, #ccc, #666, #ccc);
        height: 1px;
    }

.delimiter-icon {
    padding: 0 15px;
    font-size: 12px;
    color: #666;
}

/* Two Columns Layout */
.two-columns-container {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Chia đều 2 cột */
    gap: 20px; /* Khoảng cách giữa 2 cột */
    width: 100%;
    margin-bottom: 20px;
}

    .two-columns-container .column {
        min-width: 0; /* Ngăn content bị overflow */
    }

    /* Đảm bảo các phần tử bên trong cột hiển thị đúng */
    .two-columns-container img {
        max-width: 100%;
        height: auto;
    }

    .two-columns-container .image-grid {
        margin-bottom: 0;
    }

    /* Đảm bảo các block khác trong cột hiển thị đúng */
    .two-columns-container .attachment-block,
    .two-columns-container .custom-slideshow-container,
    .two-columns-container .image-container {
        width: 100%;
    }

/* Responsive design */
@media (max-width: 768px) {
    .two-columns-container {
        grid-template-columns: 1fr; /* Chuyển thành 1 cột trên mobile */
        gap: 15px;
    }
}


.image-grid {
    display: grid;
    gap: 2px; /* Khoảng cách nhỏ giữa các ảnh */
    width: 100%;
    margin-bottom: 8px; /* Tạo khoảng cách với phần description */
}

/* Single image style */
.single-image-container {
    width: 100%;
    max-width: 100%;
    margin-bottom: 8px;
}

    .single-image-container img {
        width: 100%;
        height: auto;
        /*max-height: 600px;*/
        object-fit: contain;
    }

/* Multiple images style */
.image-container {
    width: 100%;
}

.image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

.news-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Description style */
.image-description {
    margin-top: 8px;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    font-style: italic;
}

/* Grid layouts */
.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .grid-cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-cols-3, .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .grid-cols-2, .grid-cols-3, .grid-cols-4 {
        grid-template-columns: 1fr;
    }

    .image-wrapper {
        padding-top: 66.67%;
    }
}


/* Block */
.editor-columns {
    display: flex;
    width: 100%;
    margin: 1.5rem 0;
}

/* Elements */
.editor-columns__inner {
    display: flex;
    gap: 20px;
}

.editor-columns__col {
    flex: 1;
    min-width: 0; /* Ngăn overflow với nội dung dài */
}

/* Responsive */
@media (max-width: 768px) {
    .editor-columns__inner {
        flex-direction: column;
    }

    .editor-columns__col {
        width: 100%;
    }
}
