/* =============================================================
   single-post.css
   Styles for the custom single post template
   ============================================================= */

/* ---- Wrapper & Layout ---- */
.ql-single-post-wrapper {
    padding-top: 0 !important;
    color: #45474B;
}

/* ---- Post Header ---- */
.ql-post-header-wrap {
    background-color: #F6F3F2;
    border-bottom: 1px solid #E5E7EB;
    padding: 40px 0 24px;
    margin-bottom: 40px;
}

.ql-post-header {
    margin-bottom: 0;
}

.ql-breadcrumbs {
    font-size: 13px;
    color: #45474B;
    margin-bottom: 16px;
    text-transform: uppercase;
    font-weight: 600;
}

.ql-breadcrumbs a {
    color: #45474B !important;
    text-decoration: none !important;
    transition: color 0.2s;
}

.ql-breadcrumbs a:hover,
.ql-breadcrumbs a:focus,
.ql-breadcrumbs a:active {
    color: #2D2E74 !important;
    text-decoration: none !important;
}

.ql-breadcrumbs .divider {
    margin: 0 6px;
    color: #A9B2C3;
}

.ql-post-meta-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 700;
}

.ql-cat-pill {
    background: #EAF0FF;
    color: #2D2E74;
    padding: 4px 12px;
    border-radius: 4px;
}

.ql-post-date {
    color: #45474B;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.ql-post-title {
    font-size: 36px;
    font-weight: 700;
    color: #2D2E74;
    line-height: 1.3;
    margin-bottom: 24px;
    text-transform: uppercase;
}

.ql-post-author-share {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-top: 1px solid #E5E7EB;
    border-bottom: 1px solid #E5E7EB;
}

.ql-author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ql-author-avatar img {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    object-fit: cover;
}

.ql-author-text {
    display: flex;
    flex-direction: column;
}

.ql-author-name {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.ql-author-role {
    font-size: 12px;
    color: #45474B;
}

.ql-share-btn a {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #45474B !important;
    text-decoration: none !important;
    transition: color 0.2s;
}

.ql-share-btn a:hover,
.ql-share-btn a:focus,
.ql-share-btn a:active {
    color: #2D2E74 !important;
    text-decoration: none !important;
}

/* ---- Post Content ---- */
.ql-post-content {
    font-size: 16px;
    line-height: 1.8;
    color: #45474B;
    margin-bottom: 20px;
}

.ql-post-content h2,
.ql-post-content h3,
.ql-post-content h4 {
    color: #2D2E74;
    font-weight: 800;
    margin-top: 32px;
    margin-bottom: 16px;
}

.ql-post-content p {
    margin-bottom: 16px;
}

.ql-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 24px 0;
}

.ql-post-content blockquote {
    font-style: italic;
    font-size: 18px;
    color: #2D2E74;
    border-left: 4px solid #C49A45;
    padding: 16px 24px;
    background: #F7F8FC;
    margin: 32px 0;
    border-radius: 4px;
}

/* ---- Tags ---- */
.ql-post-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 56px;
    padding-top: 24px;
    border-top: 1px solid #E5E7EB;
}

.ql-tag-label {
    font-size: 14px;
    font-weight: 700;
    color: #A9B2C3;
}

.ql-tag-link {
    font-size: 13px;
    color: #45474B !important;
    background: #F3F4F6 !important;
    padding: 6px 16px;
    border-radius: 20px;
    text-decoration: none !important;
    transition: all 0.2s;
}

.ql-tag-link:link,
.ql-tag-link:visited {
    color: #45474B !important;
    background: #F3F4F6 !important;
    text-decoration: none !important;
}

.ql-tag-link:hover,
.ql-tag-link:focus,
.ql-tag-link:active {
    background-color: #2D2E74 !important;
    color: #FFFFFF !important;
    text-decoration: none !important;
}

/* ===========================================================
   3. Featured News & Related Posts (Bottom Blocks)
   =========================================================== */
.ql-section-block {
    margin-bottom: 56px;
}

.ql-related-posts-block {
    padding-top: 32px;
    padding-bottom: 0;
}

.ql-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.ql-section-title {
    font-size: 20px;
    font-weight: 800;
    color: #2D2E74;
    margin: 0;
    text-transform: uppercase;
    line-height: 1;
    display: flex;
    align-items: center;
}

.ql-slider-nav {
    display: flex;
    gap: 4px;
}

.ql-slider-nav button {
    width: 32px !important;
    height: 32px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid #E5E7EB;
    background: #fff;
    color: #45474B !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.ql-slider-nav button:hover,
.ql-slider-nav button:focus,
.ql-slider-nav button:active {
    background: #2D2E74 !important;
    color: #FFFFFF !important;
    border-color: #2D2E74 !important;
    outline: none !important;
}

.ql-slider-nav button:hover svg,
.ql-slider-nav button:focus svg,
.ql-slider-nav button:active svg {
    stroke: #FFFFFF !important;
}

.ql-slider-nav button svg {
    width: 16px !important;
    height: 16px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    stroke: #2D2E74 !important;
}

.ql-slider-nav button svg path,
.ql-slider-nav button svg polyline,
.ql-slider-nav button svg circle {
    stroke: inherit !important;
}

/* ---- Featured News Grid ---- */
.ql-featured-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-areas:
        "large small"
        "wide wide";
    gap: 20px;
}

.ql-feat-large {
    grid-area: large;
}

.ql-feat-small-stack {
    grid-area: small;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ql-feat-wide {
    grid-area: wide;
}

/* Feat Cards Common */
.ql-feat-card,
.ql-feat-small-card,
.ql-feat-wide-card {
    display: flex;
    color: inherit !important;
    text-decoration: none !important;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.ql-feat-card:hover,
.ql-feat-small-card:hover,
.ql-feat-wide-card:hover,
.ql-feat-card:focus,
.ql-feat-small-card:focus,
.ql-feat-wide-card:focus,
.ql-feat-card:active,
.ql-feat-small-card:active,
.ql-feat-wide-card:active {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    color: inherit !important;
    text-decoration: none !important;
}

/* Large Card */
.ql-feat-card {
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    min-height: 360px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.ql-feat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 60%);
}

.ql-feat-card .ql-feat-content {
    position: relative;
    padding: 24px;
    z-index: 1;
}

.ql-feat-card .ql-cat-pill {
    background: #2D2E74 !important;
    color: #fff !important;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 12px;
}

.ql-feat-card .ql-feat-title {
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.4;
    margin: 0 0 12px;
}

.ql-feat-card .ql-feat-meta {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    display: flex;
    gap: 16px;
}

/* Small Card */
.ql-feat-small-card {
    flex-direction: column;
    flex: 1;
}

.ql-feat-small-card:only-child {
    flex: 0 0 calc(50% - 10px);
}

.ql-feat-small-img {
    height: 120px;
    background-size: cover;
    background-position: center;
    background-color: #E5E7EB;
}

.ql-feat-small-content {
    padding: 16px;
}

.ql-feat-small-content .ql-feat-title {
    font-size: 14px;
    font-weight: 700;
    color: #2D2E74;
    margin: 0 0 8px;
    line-height: 1.4;
}

.ql-feat-small-content .ql-date {
    font-size: 12px;
    color: #A9B2C3;
}

/* Wide Card */
.ql-feat-wide-card {
    height: 120px;
}

.ql-feat-wide-img {
    width: 200px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    background-color: #E5E7EB;
}

.ql-feat-wide-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ql-feat-wide-content .ql-feat-title {
    font-size: 16px;
    font-weight: 700;
    color: #2D2E74;
    margin: 0 0 8px;
}

.ql-feat-wide-content .ql-feat-excerpt {
    font-size: 14px;
    color: #45474B;
    margin: 0;
    line-height: 1.5;
}

/* ---- Related Posts Card ---- */

.ql-related-card {
    display: flex;
    flex-direction: column;
    color: inherit !important;
    text-decoration: none !important;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.ql-related-card:hover,
.ql-related-card:focus,
.ql-related-card:active {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    color: inherit !important;
    text-decoration: none !important;
}

.ql-related-img {
    height: 180px;
    background-size: cover;
    background-position: center;
    background-color: #F3F4F6;
    flex-shrink: 0;
}

.ql-related-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.ql-related-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 10px;
    line-height: 1.5;

    /* Truncate to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ql-related-content .ql-date {
    font-size: 12px;
    color: #A9B2C3;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    /* Pushes the date to the bottom */
}

/* ===========================================================
   Responsive Adjustments
   =========================================================== */
@media (max-width: 850px) {
    .ql-featured-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "large"
            "small"
            "wide";
    }

    .ql-feat-small-stack {
        flex-direction: row;
    }

    .ql-feat-small-card {
        height: auto;
        flex: 1;
    }
}

@media (max-width: 600px) {
    .ql-related-grid {
        grid-template-columns: 1fr;
    }

    /* Large Card Mobile Overrides */
    .ql-feat-card {
        min-height: 220px;
    }

    .ql-feat-card .ql-feat-title {
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 8px;
        line-height: 17.5px;
    }

    .ql-feat-card .ql-feat-meta {
        font-size: 12px;
    }

    .ql-feat-card .ql-cat-pill {
        padding: 4px 8px !important;
        font-size: 10px !important;
        margin-bottom: 8px !important;
    }

    .ql-feat-small-stack {
        flex-direction: column;
        gap: 12px;
    }

    .ql-feat-small-card {
        flex-direction: row;
        align-items: center;
        box-shadow: none;
        background: transparent;
    }

    .ql-feat-small-img {
        width: 96px;
        height: 64px;
        flex-shrink: 0;
        border-radius: 6px;
    }

    .ql-feat-small-content {
        padding: 0 0 0 12px;
        flex: 1;
    }

    .ql-feat-small-content .ql-feat-title {
        font-size: 14px;
        line-height: 1.4;
        margin-bottom: 4px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .ql-feat-small-content .ql-date {
        font-size: 12px;
    }

    .ql-feat-wide-card {
        flex-direction: row;
        align-items: flex-start;
        height: auto;
        padding: 12px;
        background: #F6F3F2;
        border-radius: 12px;
        box-shadow: none;
        border: 1px solid #E5E7EB;
    }

    .ql-feat-wide-img {
        width: 70px;
        height: 70px;
        border-radius: 8px;
        flex-shrink: 0;
    }

    .ql-feat-wide-content {
        padding: 0 12px;
        flex: 1;
    }

    .ql-feat-wide-content .ql-feat-title {
        font-size: 12px;
        text-transform: uppercase;
        margin-bottom: 4px;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .ql-feat-wide-content .ql-feat-excerpt {
        font-size: 11px;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin: 0;
    }

    .ql-feat-wide-card::after {
        content: "";
        width: 20px;
        height: 20px;
        background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="none" stroke="%232D2E74" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>');
        background-size: contain;
        background-repeat: no-repeat;
        margin-left: auto;
        flex-shrink: 0;
        margin-top: 4px;
    }

    /* Post Header Adjustments */
    .ql-post-header-wrap {
        padding: 24px 0 0;
        margin-bottom: 16px;
        background-color: #FFFFFF;
        border-bottom: none;
    }

    .ql-post-header-wrap .ql-header-row .col {
        padding-bottom: 0px !important;
    }

    .ql-post-meta-top {
        justify-content: space-between;
        margin-bottom: 16px;
    }

    .ql-cat-pill {
        background: transparent !important;
        padding: 0 !important;
        font-size: 14px;
    }

    .ql-post-title {
        font-size: 24px;
        margin-bottom: 16px;
    }

    /* Section Title & Slider Nav */
    .ql-section-header {
        align-items: center;
        margin-bottom: 20px;
    }

    .ql-section-title {
        font-size: 16px;
    }

    /* Related Section Mobile */
    .ql-related-posts-block {
        background: #F6F3F2;
        margin-left: -15px;
        margin-right: -15px;
        padding-top: 32px;
        padding-bottom: 0;
        padding-left: 15px;
        padding-right: 15px;
        margin-bottom: 0;
    }
}

/* ===========================================================
   4. Share Modal
   =========================================================== */
.ql-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.ql-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.ql-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.ql-modal-content {
    position: relative;
    background: #fff;
    width: 90%;
    max-width: 700px;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1;
}

.ql-modal.active .ql-modal-content {
    transform: translateY(0);
}

.ql-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ql-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #2D2E74;
}

.ql-modal-close {
    cursor: pointer;
    color: #9CA3AF;
    transition: color 0.2s;
}

.ql-modal-close:hover {
    color: #ef4444;
}

.ql-share-link-wrap {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    align-items: center;
}

.ql-share-link-wrap input {
    flex: 1;
    padding: 0 12px;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    font-size: 14px;
    color: #4B5563;
    background: #F9FAFB;
    margin-bottom: 0;
    height: 40px;
}

.ql-share-copy-btn {
    padding: 0 16px;
    height: 40px;
    background: #2D2E74;
    color: #FFFFFF !important;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ql-share-copy-btn:hover,
.ql-share-copy-btn:focus,
.ql-share-copy-btn:active {
    background: #1e1f4d !important;
    color: #FFFFFF !important;
    outline: none !important;
}

.ql-custom-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.ql-social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #2D2E74;
    color: #FFFFFF !important;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
    min-width: 100px;
    white-space: nowrap;
}

.ql-social-btn:link,
.ql-social-btn:visited,
.ql-social-btn:hover,
.ql-social-btn:focus,
.ql-social-btn:active {
    color: #FFFFFF !important;
    text-decoration: none !important;
}

.ql-social-btn:hover,
.ql-social-btn:focus,
.ql-social-btn:active {
    background-color: #1e1f4d !important;
}

.ql-social-btn i,
.ql-social-btn svg {
    font-size: 16px;
    fill: #fff;
}

/* ============================================================
   Responsive: single post
   ============================================================ */
@media (max-width: 768px) {
    /* Mobile: bỏ margin-bottom của header wrapper, layout liền mạch */
    .ql-post-header-wrap {
        margin-bottom: 0 !important;
    }
}