/*
Theme Name: eCommerce by MyThemeShop Child
Theme URI: https://nhathuocthanhtam.com/
Description: Child theme for eCommerce by MyThemeShop.
Author: Nha Thuoc Thanh Tam
Template: mts_ecommerce
Version: 1.1.12
Text Domain: mts_ecommerce-child
*/

.nttt-category-posts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.nttt-category-post-item {
    background: #fff;
}

.nttt-post-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

.nttt-post-title {
    font-size: 20px;
    margin: 12px 0 6px;
}

.nttt-post-title a {
    text-decoration: none;
}

.nttt-post-date {
    font-size: 14px;
    opacity: 0.7;
    margin-bottom: 8px;
}

.nttt-post-pagination {
    margin-top: 30px;
}

@media (max-width: 768px) {
    .nttt-category-posts {
        grid-template-columns: 1fr;
    }
}
/* -------------------------------------------------------------------------
 * E-E-A-T / Medical editorial blocks
 * ---------------------------------------------------------------------- */
.nttt-eeat-review-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0 20px;
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fafafa;
    font-size: 14px;
    line-height: 1.5;
}

.nttt-eeat-review-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nttt-eeat-label {
    font-weight: 700;
    color: #374151;
}

.nttt-eeat-value,
.nttt-eeat-value a {
    color: #111827;
}



.nttt-medical-references {
    margin: 28px 0 18px;
    padding: 18px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #374151;
    font-size: 15px;
    line-height: 1.65;
}

.nttt-medical-references h3 {
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.35;
}

.nttt-medical-references ol {
    margin: 0 0 0 22px;
}

.nttt-medical-references li {
    margin: 4px 0;
}

.nttt-medical-disclaimer {
    margin: 28px 0 18px;
    padding: 16px 18px;
    border-left: 4px solid #9ca3af;
    background: #f9fafb;
    color: #374151;
    font-size: 15px;
    line-height: 1.65;
}

.nttt-author-profile-card {
    padding: 22px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
}

.nttt-author-profile-inner {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.nttt-author-avatar img {
    border-radius: 999px;
    display: block;
}

.nttt-author-details {
    flex: 1;
    min-width: 0;
}

.nttt-author-name {
    margin: 0 0 4px;
    font-size: 24px;
    line-height: 1.25;
}

.nttt-author-title {
    margin-bottom: 10px;
    font-weight: 700;
    color: #374151;
}

.nttt-author-profile-line {
    margin: 6px 0;
    line-height: 1.55;
}

.nttt-author-summary,
.nttt-author-note {
    margin-top: 12px;
    line-height: 1.65;
}

.nttt-author-posts-heading {
    margin: 28px 0 16px;
    font-size: 22px;
}

.nttt-medical-policy {
    line-height: 1.75;
}

.nttt-medical-policy h2,
.nttt-medical-policy h3 {
    margin-top: 28px;
}

.nttt-medical-policy ul,
.nttt-medical-policy ol {
    margin-left: 22px;
}

@media (max-width: 768px) {
    .nttt-eeat-review-summary {
        grid-template-columns: 1fr;
    }

    .nttt-author-profile-inner {
        flex-direction: column;
    }
}

.post-info .nttt-eeat-reviewed-by,
.post-info .nttt-eeat-updated-at {
    display: inline-block;
    margin-right: 12px;
}

.post-info .nttt-eeat-postinfo-label,
.post-info .nttt-published-label {
    font-weight: 600;
}

.post-info .nttt-published-label {
    margin-right: 4px;
}


/* -------------------------------------------------------------------------
 * Single post metadata: fixed responsive grid
 * ---------------------------------------------------------------------- */
.single-post .single_post .thecontent > header .post-info {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas:
        "author reviewed category"
        "published updated comments";
    column-gap: 24px;
    row-gap: 12px;
    align-items: start;
    clear: both;
    float: none;
    width: 100%;
    margin: 0 0 10px;
}

.single-post .single_post .thecontent > header .post-info > span,
.single-post .single_post .thecontent > header .post-info > a {
    display: block !important;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    float: none;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.single-post .single_post .thecontent > header .post-info .theauthor {
    grid-area: author;
}

.single-post .single_post .thecontent > header .post-info .nttt-eeat-reviewed-by {
    grid-area: reviewed;
}

.single-post .single_post .thecontent > header .post-info .thecategory {
    grid-area: category;
}

.single-post .single_post .thecontent > header .post-info .thetime.date.updated {
    grid-area: published;
}

.single-post .single_post .thecontent > header .post-info .nttt-eeat-updated-at {
    grid-area: updated;
}

.single-post .single_post .thecontent > header .post-info .thecomment {
    grid-area: comments;
}

/* -------------------------------------------------------------------------
 * Article rating summary
 * ---------------------------------------------------------------------- */
.nttt-article-rating {
    clear: both;
    margin: 28px 0 20px;
    padding: 18px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fafafa;
}

.nttt-article-rating__title {
    margin: 0 0 10px;
    font-size: 20px;
    line-height: 1.35;
}

.nttt-article-rating__row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.nttt-article-rating__stars {
    position: relative;
    display: inline-block;
    font-size: 28px;
    line-height: 1;
    letter-spacing: 2px;
}

.nttt-article-rating__stars::before {
    content: "★★★★★";
    background: linear-gradient(
        90deg,
        #f5a623 0,
        #f5a623 var(--nttt-rating-percent),
        #d1d5db var(--nttt-rating-percent),
        #d1d5db 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.nttt-article-rating__score {
    color: #374151;
    font-size: 15px;
}

.nttt-article-rating__prompt {
    margin: 9px 0 0;
    font-size: 14px;
}

/* Keep the existing SASWP rating control visibly star-based. */
.single-post #respond .saswp-rating-container,
.single-post #respond .jq-ry-container {
    max-width: 100%;
}

/* -------------------------------------------------------------------------
 * Single post comments: priority carousel
 * ---------------------------------------------------------------------- */
.single-post #comments .nttt-comments-carousel-shell {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.single-post #comments ol.commentlist.nttt-comments-carousel {
    display: flex;
    width: 100%;
    gap: 16px;
    margin: 13px 0 0;
    padding: 2px 2px 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    cursor: grab;
}

.single-post #comments ol.commentlist.nttt-comments-carousel.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    user-select: none;
}

.single-post #comments ol.commentlist.nttt-comments-carousel > li.comment {
    flex: 0 0 calc((100% - 48px) / 4);
    width: auto;
    min-width: 0;
    float: none;
    margin: 0;
    padding: 18px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(41, 55, 65, 0.06);
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.single-post #comments .nttt-comments-carousel > li.comment > div[id^="comment-"] {
    height: 100%;
}

.single-post #comments .nttt-comments-carousel .comment-author.vcard,
.single-post #comments .nttt-comments-carousel .avatar {
    float: none;
}

.single-post #comments .nttt-comments-carousel .comment-author.vcard {
    margin-bottom: 10px;
}

.single-post #comments .nttt-comments-carousel .avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
}

.single-post #comments .nttt-comments-carousel .post-info {
    display: block;
    margin-bottom: 8px;
}

.single-post #comments .nttt-comments-carousel .post-info .theauthor,
.single-post #comments .nttt-comments-carousel .post-info .thetime {
    float: none;
}

.single-post #comments .nttt-comments-carousel .post-info .theauthor a {
    display: inline;
    font-size: 17px;
    line-height: 1.35;
}

.single-post #comments .nttt-comments-carousel .post-info .thetime {
    margin-top: 3px;
    font-size: 12px;
}

.single-post #comments .nttt-comments-carousel .commentmetadata {
    margin-top: 10px;
    overflow: visible;
}

.single-post #comments .nttt-comments-carousel .commenttext {
    overflow-wrap: anywhere;
}

.single-post #comments .nttt-comments-carousel .reply a {
    float: none;
}

.single-post #comments .nttt-comments-carousel .children {
    width: 100%;
    margin: 16px 0 0;
    padding: 14px 0 0;
    border-top: 1px solid #eef0f2;
}

.single-post #comments .nttt-comment-rating {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 2px 0 6px;
}

.single-post #comments .nttt-comment-rating__stars {
    --nttt-comment-rating-percent: 0%;
    position: relative;
    display: inline-block;
    font-size: 18px;
    line-height: 1;
    letter-spacing: 1px;
}

.single-post #comments .nttt-comment-rating__stars::before,
.single-post #comments .nttt-comment-rating__stars::after {
    content: "★★★★★";
}

.single-post #comments .nttt-comment-rating__stars::before {
    color: #d8dde3;
}

.single-post #comments .nttt-comment-rating__stars::after {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--nttt-comment-rating-percent);
    overflow: hidden;
    color: #f5a623;
    white-space: nowrap;
}

.single-post #comments .nttt-comment-rating__value {
    color: #53616b;
    font-size: 12px;
    font-weight: 700;
}

/* -------------------------------------------------------------------------
 * Single post sidebar: Archives dropdown + collapsible Categories
 * ---------------------------------------------------------------------- */
.single-post #sidebar .nttt-archive-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: stretch;
}

.single-post #sidebar .nttt-archive-select {
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 0 34px 0 10px;
    border: 1px solid #d6d9dc;
    border-radius: 4px;
    background-color: #fff;
    color: #374151;
}

.single-post #sidebar .nttt-archive-submit {
    min-width: 58px;
    height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 4px;
    background: #657b89;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.single-post #sidebar .nttt-archive-submit:hover,
.single-post #sidebar .nttt-archive-submit:focus-visible {
    background: #26bfa1;
}

.single-post #sidebar .widget_categories li,
.single-post #sidebar .wp-block-categories-list li {
    position: relative;
}

.single-post #sidebar li.nttt-category-has-children {
    padding-right: 34px;
}

.single-post #sidebar li.nttt-category-has-children > ul.children {
    display: none;
    width: calc(100% + 34px);
    margin-right: -34px;
}

.single-post #sidebar li.nttt-category-has-children.nttt-category-open > ul.children {
    display: block;
}

.single-post #sidebar .nttt-category-toggle {
    position: absolute;
    top: 5px;
    right: 0;
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #d6d9dc;
    border-radius: 4px;
    background: #fff;
    color: #657b89;
    cursor: pointer;
}

.single-post #sidebar .nttt-category-toggle span {
    display: block;
    font-size: 18px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.single-post #sidebar .nttt-category-open > .nttt-category-toggle span {
    transform: rotate(180deg);
}

.single-post #sidebar .nttt-category-toggle:hover,
.single-post #sidebar .nttt-category-toggle:focus-visible {
    border-color: #26bfa1;
    color: #26bfa1;
}

@media (max-width: 768px) {
    .single-post .single_post .thecontent > header .post-info {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "author reviewed"
            "category comments"
            "published updated";
        column-gap: 16px;
        row-gap: 12px;
        font-size: 11.2px;
    }

    .single-post .single_post .thecontent > header .post-info > *,
    .single-post .single_post .thecontent > header .post-info > * a,
    .single-post .single_post .thecontent > header .post-info > * span,
    .single-post .single_post .thecontent > header .post-info > * time {
        font-size: inherit !important;
    }

    .single-post #comments ol.commentlist.nttt-comments-carousel {
        gap: 12px;
    }

    .single-post #comments ol.commentlist.nttt-comments-carousel > li.comment {
        flex-basis: calc((100% - 12px) / 2);
        padding: 14px 12px;
    }

    .single-post #comments .nttt-comments-carousel .post-info .theauthor a {
        font-size: 15px;
    }

    .nttt-article-rating__stars {
        font-size: 25px;
    }
}

/* Keep the current breadcrumb visually non-interactive while retaining href/item schema data. */
.breadcrumb a.nttt-current-breadcrumb {
    color: inherit;
    cursor: default;
    pointer-events: none;
    text-decoration: none;
}

/* -------------------------------------------------------------------------
 * Static homepage hero + promo cards (mobile first)
 *
 * The hero image intentionally stays in normal document flow on mobile.
 * Desktop uses CSS Grid layering instead of absolute positioning. This keeps
 * the image measurable and visible even when another stylesheet changes img,
 * picture, position, or stacking rules.
 * ---------------------------------------------------------------------- */
.nttt-static-home {
    --nttt-hero-bg: #f2f7f4;
    --nttt-hero-text: #173b2b;
    --nttt-hero-accent: #198754;
    --nttt-hero-accent-dark: #126a41;
    --nttt-card-border: #dfe8e2;
    --nttt-card-shadow: 0 10px 30px rgba(23, 59, 43, 0.08);
    display: block;
    width: 100%;
    background: #fff;
}

.nttt-static-home__hero {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    background: var(--nttt-hero-bg);
}

/* Mobile first: keep the full hero image visible with a 3px side gutter. */
.nttt-static-home__media {
    position: relative;
    display: block;
    width: calc(100% - 6px);
    min-height: 0;
    margin-right: 3px;
    margin-left: 3px;
    overflow: hidden;
    background: #dfe9e3;
}

.nttt-static-home__media picture {
    position: static;
    display: block;
    width: 100%;
    height: auto;
}

.nttt-static-home__image {
    position: static;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0;
    margin: 0;
    opacity: 1 !important;
    visibility: visible !important;
    object-fit: contain;
    object-position: center;
}

.nttt-static-home__media::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    height: 34%;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(242, 247, 244, 0) 0%, rgba(242, 247, 244, 0.42) 100%);
}

.nttt-static-home__hero-inner {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    width: 100%;
    padding-top: 30px;
    padding-bottom: 38px;
    background: var(--nttt-hero-bg);
}

.nttt-static-home__content {
    width: min(100%, 660px);
}

.nttt-static-home__eyebrow {
    margin: 0 0 10px;
    color: var(--nttt-hero-accent-dark);
    font-size: clamp(12px, 3.2vw, 15px);
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.4;
    text-transform: uppercase;
}

.nttt-static-home__title {
    margin: 0;
    color: var(--nttt-hero-text);
    font-size: clamp(30px, 9vw, 52px);
    font-weight: 800;
    letter-spacing: -0.035em;
}

.nttt-static-home__description {
    max-width: 58ch;
    margin: 16px 0 0;
    color: #365346;
    font-size: clamp(15px, 4vw, 18px);
    line-height: 1.62;
}

.nttt-static-home__button,
.nttt-static-home__promo-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border-radius: 8px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.nttt-static-home__button {
    width: 100%;
    margin-top: 24px;
    padding: 14px 22px;
    background: var(--nttt-hero-accent);
    color: #fff;
    font-size: 16px;
}

.nttt-static-home__button:hover,
.nttt-static-home__button:focus-visible {
    background: var(--nttt-hero-accent-dark);
    color: #fff;
    transform: translateY(-1px);
}

.nttt-static-home__promos {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding-top: 18px;
    padding-bottom: 34px;
}

.nttt-static-home__promo {
    display: grid;
    grid-template-columns: minmax(112px, 34vw) minmax(0, 1fr);
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--nttt-card-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--nttt-card-shadow);
}

.nttt-static-home__promo-media,
.nttt-static-home__promo-placeholder {
    aspect-ratio: 4 / 5;
    min-height: 100%;
    overflow: hidden;
    background: #e9f2ec;
}

.nttt-static-home__promo-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nttt-static-home__promo-placeholder {
    display: grid;
    place-items: center;
    color: rgba(23, 59, 43, 0.34);
    font-size: clamp(30px, 9vw, 54px);
    font-weight: 800;
}

.nttt-static-home__promo-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    padding: clamp(16px, 4vw, 24px);
}

.nttt-static-home__promo-title {
    margin: 0;
    color: var(--nttt-hero-text);
    font-size: clamp(18px, 5vw, 23px);
    font-weight: 750;
    line-height: 1.22;
}

.nttt-static-home__promo-text {
    display: -webkit-box;
    margin: 10px 0 0;
    overflow: hidden;
    color: #53685e;
    font-size: clamp(13px, 3.6vw, 15px);
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.nttt-static-home__promo-button {
    min-height: 42px;
    margin-top: auto;
    padding: 11px 0 0;
    color: var(--nttt-hero-accent-dark);
    font-size: 14px;
}

.nttt-static-home__promo-button::after {
    content: "\2192";
    margin-left: 7px;
    transition: transform 160ms ease;
}

.nttt-static-home__promo-button:hover,
.nttt-static-home__promo-button:focus-visible {
    color: var(--nttt-hero-accent);
}

.nttt-static-home__promo-button:hover::after,
.nttt-static-home__promo-button:focus-visible::after {
    transform: translateX(3px);
}

@media (max-width: 599px) {
    .nttt-static-home__promo {
        align-items: start;
    }

    .nttt-static-home__promo-media,
    .nttt-static-home__promo-placeholder {
        position: relative;
        align-self: start;
        width: 100%;
        min-height: 0;
        aspect-ratio: 1 / 1;
    }

    .nttt-static-home__promo-image {
        position: absolute;
        top: -1px;
        right: -1px;
        bottom: -1px;
        left: -1px;
        width: calc(100% + 2px) !important;
        height: calc(100% + 2px) !important;
        max-width: none;
        object-fit: cover;
        object-position: center;
    }
}

@media (min-width: 600px) {
    .nttt-static-home__button {
        width: auto;
        min-width: 180px;
    }

    .nttt-static-home__promos {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .nttt-static-home__promo {
        display: flex;
        flex-direction: column;
    }

    .nttt-static-home__promo-media,
    .nttt-static-home__promo-placeholder {
        width: 100%;
        min-height: 0;
        aspect-ratio: 16 / 10;
    }
}

@media (min-width: 768px) {
    /* Desktop layering is grid-based; no image element is absolutely positioned. */
    .nttt-static-home__hero {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        height: clamp(380px, calc(100vh - 190px), 560px);
        height: clamp(380px, calc(100svh - 190px), 560px);
        min-height: 0;
    }

    .nttt-static-home__media,
    .nttt-static-home__hero-inner {
        grid-column: 1;
        grid-row: 1;
    }

    .nttt-static-home__media {
        z-index: 0;
        width: 100%;
        height: 100%;
        min-height: 0;
        margin-right: 0;
        margin-left: 0;
        aspect-ratio: auto;
    }

    .nttt-static-home__media picture,
    .nttt-static-home__image {
        width: 100%;
        height: 100% !important;
        min-height: 0;
    }

    .nttt-static-home__image {
        object-fit: cover;
    }

    .nttt-static-home__media::after {
        top: 0;
        right: auto;
        bottom: 0;
        left: 0;
        z-index: 1;
        width: min(64%, 900px);
        height: auto;
        background: linear-gradient(90deg, rgba(244, 250, 246, 0.94) 0%, rgba(244, 250, 246, 0.78) 34%, rgba(244, 250, 246, 0.28) 62%, rgba(244, 250, 246, 0) 100%);
    }

    .nttt-static-home__hero-inner {
        z-index: 2;
        align-items: center;
        padding-top: clamp(32px, 7vh, 64px);
        padding-bottom: clamp(32px, 7vh, 64px);
        background: transparent;
    }

    .nttt-static-home__content {
        width: min(52%, 660px);
    }

    .nttt-static-home__promos {
        gap: 22px;
        padding-top: 28px;
        padding-bottom: 48px;
    }
}

@media (min-width: 1100px) {
    .nttt-static-home__promo-content {
        padding: 24px 26px 26px;
    }

    .nttt-static-home__promo-text {
        -webkit-line-clamp: 4;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nttt-static-home__button,
    .nttt-static-home__promo-button,
    .nttt-static-home__promo-button::after {
        transition: none;
    }
}
