/* Front: mobile + iPad (portrait ~768, landscape ~1024) */

html, body {
    overflow-x: hidden;
}

@media (max-width: 1023px) {
    .blog.single .card-body {
        padding: 1.25rem !important;
    }

    .blog.single .h1 {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
    }

    .blog.single .h3 {
        font-size: 1rem !important;
        line-height: 1.45 !important;
    }

    .swiper-slide .card-body {
        padding: 1.15rem !important;
    }
}

@media (max-width: 767px) {
    .blog.single .card-body {
        padding: 1rem !important;
    }

    .blog.single .h1 {
        font-size: 1.35rem !important;
    }
}

/* Home section titles: don't overlap "แสดงทั้งหมด" */
.section-heading-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    position: relative;
    width: 100%;
}

.section-heading-title {
    order: 1;
    position: static;
    transform: none;
    left: auto;
    width: 100%;
    text-align: center;
    font-size: 1.35rem;
    line-height: 1.25;
    font-weight: 600;
    margin: 0;
    padding: 0 0.25rem;
    pointer-events: none;
}

.section-heading-more {
    order: 2;
    align-self: flex-end;
}

@media (min-width: 1024px) {
    .section-heading-row {
        flex-direction: row;
        align-items: center;
        min-height: 2.6rem;
    }

    .section-heading-title {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        font-size: 2.1rem;
        padding: 0 2.5rem;
        white-space: nowrap;
    }

    .section-heading-more {
        margin-left: auto;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .section-heading-title {
        font-size: 1.6rem;
        padding: 0 0.5rem;
    }
}

/* Multimedia cards: stack image above text on phones */
@media (max-width: 767px) {
    .media-card {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .media-img-box {
        width: 100% !important;
        height: 180px !important;
        margin-bottom: 0.75rem;
    }

    .media-content {
        padding-left: 0 !important;
        min-height: 0 !important;
    }
}

/* 404 number: keep 5x on desktop, cap on small screens */
.page-404-code {
    font-size: clamp(2.75rem, 18vw, 5em);
    line-height: 1;
}

img, video, iframe {
    max-width: 100%;
}

/* Content credibility box: keep compact and dock to a corner on desktop */
.article-byline--compact {
    margin: 1.25rem 0 1.25rem auto;
    max-width: 24rem;
    font-size: 0.8rem;
    line-height: 1.55;
    color: #60697b;
    border: 1px solid rgba(96, 93, 186, 0.2);
    border-radius: 0.75rem;
    background: #faf9ff;
    padding: 0.75rem 0.9rem;
}

.article-byline__chip {
    display: inline-block;
    font-size: 0.74rem;
    font-weight: 600;
    color: #605dba;
    background: rgba(96, 93, 186, 0.12);
    border-radius: 9999px;
    padding: 0.2rem 0.55rem;
}

.article-byline__details {
    margin: 0;
}

.article-byline__summary {
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    color: #343f52;
    list-style: none;
}

.article-byline__summary::-webkit-details-marker {
    display: none;
}

.article-byline__summary::before {
    content: "+";
    display: inline-block;
    width: 1rem;
    color: #605dba;
    font-weight: 700;
}

.article-byline__details[open] .article-byline__summary::before {
    content: "-";
}

.article-byline__body {
    margin-top: 0.55rem;
    color: #60697b;
}

.article-byline__body .article-byline__label {
    color: #000;
    font-weight: 600;
}

.article-disclaimer--after-content,
.article-editorial-policy-link {
    clear: both;
    width: 100%;
    color: #60697b;
}

@media (max-width: 767px) {
    .article-byline--compact {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}

/* Footer: centered container, stacked on phones, 2x2 tablet, 4 columns desktop */
.site-footer {
    position: relative;
    margin-top: 0;
}

.site-footer__inner {
    margin-inline: auto;
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
}

.site-footer__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    justify-items: center;
    text-align: center;
    width: 100%;
}

.site-footer__col {
    width: 100%;
    max-width: 22rem;
}

.site-footer__logo {
    display: inline-block;
    max-width: 180px;
    height: auto;
}

.site-footer__line {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.site-footer__line-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.site-footer__line-btn img {
    display: block;
    height: 2.916rem;
    width: auto;
    max-width: 100%;
}

.site-footer__line-btn:hover {
    opacity: 0.85;
}

.chat-page__line {
    display: flex;
    align-items: flex-start;
}

.chat-page__line-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.chat-page__line-btn img {
    display: block;
    height: 3.25rem;
    width: auto;
    max-width: 100%;
}

.chat-page__line-btn:hover {
    opacity: 0.85;
}

.site-footer__title {
    margin: 0 0 0.85rem;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.45;
    color: #1e2228;
    letter-spacing: 0.01em;
}

.site-footer .nav.social {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.7rem;
}

.site-footer .nav.social > a {
    margin: 0 !important;
}

.site-footer__link-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer__link-list li {
    position: relative;
    padding-left: 1.15em;
    margin-bottom: 0.4rem;
}

.site-footer__link-list li:last-child {
    margin-bottom: 0;
}

.site-footer__link-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
    color: #605dba;
    font-weight: 700;
    line-height: inherit;
}

@media (max-width: 767px) {
    .site-footer__title {
        width: 100%;
    }

    .site-footer__link-list {
        display: inline-block;
        text-align: left;
    }
}

@media (min-width: 768px) {
    .site-footer__inner {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    .site-footer__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-items: start;
        text-align: left;
        column-gap: 2rem;
        row-gap: 2.5rem;
    }

    .site-footer__col {
        max-width: none;
    }

    .site-footer .nav.social {
        justify-content: flex-start;
    }

    .site-footer__line {
        align-items: flex-start;
    }
}

@media (min-width: 992px) {
    .site-footer__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        align-items: start;
    }
}
