/* 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%;
}

/* Pull footer 100px closer to page content */
footer {
    margin-top: -100px;
    position: relative;
}
