:root {
    --tj-ff-body: 'Lato', 'Sarabun', sans-serif;
    --tj-ff-heading: 'Libre Franklin', 'Sarabun', serif;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--body-font, 'Sarabun', sans-serif);
}
body {
    background: var(--tj-color-common-white, #f7f7f7);
}

/* ============================================
   FOOTER NEWSLETTER BUTTON
   ============================================ */
.footer-widget .newsletter-form .form-input button {
    background: transparent;
    padding: 0;
    cursor: pointer;
}

/* ============================================
   PRELOADER STYLES
   ============================================ */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.font-family-h1 {
    font-family: 'Libre Franklin', 'Sarabun', sans-serif;
    font-weight: 600;
}

.loading-container,
.loading {
    height: 100px;
    position: relative;
    width: 100px;
    border-radius: 100%;
}

.loading-container {
    margin: 40px auto;
}

.loading {
    border: 2px solid transparent;
    border-color: transparent var(--tj-color-theme-primary, #0056b3) transparent
        var(--tj-color-theme-primary, #0056b3);
    animation: rotate-loading 1.5s linear 0s infinite normal;
    transform-origin: 50% 50%;
}

.loading-container:hover .loading,
.loading-container .loading {
    transition: all 0.5s ease-in-out;
}

#loading-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: 66px;
    transform: translate(-50%, -50%);
}

#loading-icon img {
    max-width: 100%;
    height: auto;
}

@keyframes rotate-loading {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ============================================
   HOMEPAGE SECTIONS STYLES
   ============================================ */

/* Section Space */
.section-space {
    padding: 80px 0;
}

@media (max-width: 991px) {
    .section-space {
        padding: 60px 0;
    }
}

/* ============================================
   BRAND PARTNERS SECTION
   ============================================ */
.tj-partner-section {
    background: #f8f9fa;
}

.tj-partner-section .sec-heading {
    margin-bottom: 40px;
}

.tj-partner-section .sub-title {
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    display: block;
}

.tj-partner-section .sec-title {
    font-size: 36px;
    font-weight: 700;
    color: #1a1a1a;
}

.partner-wrapper {
    padding: 30px 0;
}

.partner-slider .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

.partner-item {
    padding: 20px 30px;
    transition: all 0.3s ease;
}

.partner-item img {
    max-width: 150px;
    max-height: 80px;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.partner-item:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

/* ============================================
   CASE STUDIES SECTION
   ============================================ */
.tj-case-study-section {
    background: #fff;
}

.tj-case-study-section .sec-heading {
    margin-bottom: 50px;
}

.tj-case-study-section .sub-title {
    font-size: 14px;
    color: var(--tj-primary-color, #0066cc);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    display: block;
}

.tj-case-study-section .sec-title {
    font-size: 42px;
    font-weight: 700;
    color: #1a1a1a;
}

.case-study-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.case-study-item {
    position: relative;
    height: 350px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.case-study-item .case-study-fallback-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
}

.case-study-item:hover .case-study-fallback-bg {
    transform: scale(1.05);
}

.case-study-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0) 100%
    );
    z-index: 1;
}

.case-study-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.case-study-info .category {
    display: inline-block;
    padding: 5px 15px;
    background: var(--tj-primary-color, #0066cc);
    color: #fff;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.case-study-info .title {
    font-size: 24px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.case-study-action {
    display: flex;
    gap: 10px;
}

.case-study-action .video-btn,
.case-study-action .read-more {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    transition: all 0.3s ease;
}

.case-study-action .video-btn:hover,
.case-study-action .read-more:hover {
    background: var(--tj-primary-color, #0066cc);
    color: #fff;
}

/* ============================================
   CORE VALUES SECTION
   ============================================ */
.tj-core-values-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    background-size: cover;
    background-position: center;
    position: relative;
}

.tj-core-values-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.tj-core-values-section .container {
    position: relative;
    z-index: 1;
}

.tj-core-values-section .sec-heading {
    margin-bottom: 50px;
}

.tj-core-values-section .sub-title {
    font-size: 14px;
    color: var(--tj-primary-color, #0066cc);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    display: block;
}

.tj-core-values-section .sec-title {
    font-size: 42px;
    font-weight: 700;
    color: #fff;
}

.core-value-item {
    text-align: center;
    padding: 40px 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.core-value-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
}

.core-value-item .icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--tj-primary-color, #0066cc);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.core-value-item .icon i {
    font-size: 36px;
    color: #fff;
}

.core-value-item .title {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 15px;
}

.core-value-item .desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin: 0;
}

/* ============================================
   NEWS SECTION
   ============================================ */
.tj-news-section {
    background: #f8f9fa;
}

.tj-news-section .sec-heading {
    margin-bottom: 50px;
}

.tj-news-section .sub-title {
    font-size: 14px;
    color: var(--tj-primary-color, #0066cc);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    display: block;
}

.tj-news-section .sec-title {
    font-size: 42px;
    font-weight: 700;
    color: #1a1a1a;
}

.news-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.news-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.news-thumb {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-item:hover .news-thumb img {
    transform: scale(1.05);
}

.news-content {
    padding: 25px;
}

.news-meta {
    margin-bottom: 10px;
}

.news-meta .date {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.news-content .title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.news-content .title a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-content .title a:hover {
    color: var(--tj-primary-color, #0066cc);
}

.news-content .excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* ============================================
   BLOG CARD TEXT CLAMP
   ============================================ */
/* Title: max 2 lines */
.blog-title-clamp,
.blog-title-clamp a {
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Description: max 3 lines - override display:none from main.css */
/* For all blog cards including first-child and archive page */
.desc.blog-desc-clamp,
.blog-item .blog-content .desc.blog-desc-clamp,
.h7-blog .blog-wrapper .blog-item .blog-content .desc.blog-desc-clamp,
.h7-blog .h7-blog-wrapper .blog-item .blog-content .desc.blog-desc-clamp,
.h7-blog
    .h7-blog-wrapper
    .blog-item:first-child
    .blog-content
    .desc.blog-desc-clamp,
.tj-blog-section.h7-blog
    .h7-blog-wrapper
    .blog-item:first-child
    .blog-content
    .desc.blog-desc-clamp,
.blog-archive-wrapper .blog-item .blog-content .desc.blog-desc-clamp,
.blog-archive-wrapper
    .blog-item:first-child
    .blog-content
    .desc.blog-desc-clamp {
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin-top: 15px;
    max-height: 4.5em !important;
    line-height: 1.5 !important;
}

/* When no category, show date first */
.blog-meta ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

.blog-meta ul li:first-child:not(.category) {
    order: -1;
}

/* ============================================
   CTA SECTION
   ============================================ */
.tj-cta-section {
    background: linear-gradient(
        135deg,
        var(--tj-primary-color, #0066cc) 0%,
        #004499 100%
    );
    background-size: cover;
    background-position: center;
    position: relative;
}

.tj-cta-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 102, 204, 0.9);
}

.tj-cta-section .container {
    position: relative;
    z-index: 1;
}

.cta-content {
    padding: 40px 0;
}

.cta-title {
    font-size: 42px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
}

.cta-desc {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Fix Thai diacritical mark (tone marks / vowels) clipping in button */
.tj-primary-btn .btn_inner .btn_text {
    padding-block: 4px;
    margin-block: -4px;
}

.tj-cta-section .tj-primary-btn {
    background: #fff;
    color: var(--tj-primary-color, #0066cc);
}

.tj-cta-section .tj-primary-btn:hover {
    background: #1a1a1a;
    color: #fff;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 991px) {
    .tj-partner-section .sec-title,
    .tj-case-study-section .sec-title,
    .tj-core-values-section .sec-title,
    .tj-news-section .sec-title,
    .cta-title {
        font-size: 32px;
    }

    .case-study-item {
        height: 280px;
    }

    .case-study-info .title {
        font-size: 20px;
    }
}

@media (max-width: 767px) {
    .tj-partner-section .sec-title,
    .tj-case-study-section .sec-title,
    .tj-core-values-section .sec-title,
    .tj-news-section .sec-title,
    .cta-title {
        font-size: 28px;
    }

    .case-study-item {
        height: 250px;
    }

    .partner-item img {
        max-width: 120px;
    }
}

/* ============================================
   VIDEO CASE STUDY STYLES
   ============================================ */
.video-case-study {
    position: relative;
    overflow: hidden;
}

.case-study-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.case-study-fallback-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 0;
    transition: opacity 0.5s ease;
}

.case-study-content {
    position: relative;
    z-index: 2;
}

/* Hover effects - show video on hover */
.video-case-study:hover .case-study-video {
    opacity: 1;
}

.video-case-study:hover .case-study-fallback-bg {
    opacity: 0;
}

/* Video controls - hide default controls */
.case-study-video::-webkit-media-controls {
    display: none !important;
}

.case-study-video::-webkit-media-controls-panel {
    display: none !important;
}

.case-study-video::-webkit-media-controls-play-button {
    display: none !important;
}

.case-study-video::-webkit-media-controls-start-playback-button {
    display: none !important;
}

/* ============================================
   THAI LANGUAGE - LINE HEIGHT FIX
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.4;
}

/* ============================================
   ABOUT PAGE - SECTION SPACING OVERRIDE
   ============================================ */
.page-template-page-about .section-space {
    padding: 50px 0;
}

/* ============================================
   Learn More Page
   ============================================ */

/* Thai font line-height */
.tj-page-title {
    line-height: 1.6;
}

/* Marquee Section */
.tj-marquee-section-new {
    background: transparent;
    padding: 40px 0;
    overflow: hidden;
    position: relative;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}

.tj-marquee-section-new .marquee-new {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.tj-marquee-section-new .marquee-track {
    display: inline-flex;
    animation: lm-scroll 45s linear infinite;
    gap: 120px;
}

.tj-marquee-section-new .marquee-track h1 {
    display: inline-block;
    margin: 0;
    color: var(--tj-color-theme-primary);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0.8;
}

.tj-marquee-section-new .marquee-track .marquee-line {
    display: inline-block;
    color: var(--tj-color-theme-primary);
    position: relative;
}

@keyframes lm-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(calc(-50% - 60px)); }
}

.tj-marquee-section-new .marquee-new:hover .marquee-track {
    animation-play-state: paused;
}

@media (max-width: 768px) {
    .tj-marquee-section-new { padding: 20px 0; }
    .tj-marquee-section-new .marquee-track { gap: 40px; }
    .tj-marquee-section-new .marquee-track h1 { font-size: clamp(2rem, 10vw, 4rem); }
}

/* Heritage section paragraph color */
.page-template-page-learn-more .tj-about-info .desc,
.page-template-page-learn-more .tj-about-info .desc p {
    color: #364052;
}

/* Contact Section (Learn More style) */
.page-template-page-learn-more .tj-contact-section {
    position: relative;
    padding: 80px 0;
}

.page-template-page-learn-more .tj-contact-section .grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
}

.page-template-page-learn-more .heading-block {
    padding-right: 40px;
}

.page-template-page-learn-more .section-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.page-template-page-learn-more .indicator-dot {
    width: 8px;
    height: 8px;
    background: #0070f3;
    border-radius: 50%;
    flex-shrink: 0;
}

.page-template-page-learn-more .section-indicator h4 {
    color: #0070f3;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.page-template-page-learn-more .heading-block h3 {
    color: #333;
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

@media (max-width: 768px) {
    .page-template-page-learn-more .tj-contact-section .grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .page-template-page-learn-more .heading-block {
        padding-right: 0;
        text-align: center;
    }
    .page-template-page-learn-more .heading-block h3 {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .page-template-page-learn-more .heading-block h3 { font-size: 28px; }
}

.page-template-page-about .section-bottom-space {
    padding-bottom: 50px;
}

.page-template-page-about .tj-skill-section {
    padding-top: 0;
    padding-bottom: 200px;
    display: flex;
    align-items: flex-end;
}
