:root {
    /* TSH Red Color Palette */
    --tsh-red-50: #fdf2f2;
    --tsh-red-100: #fbe2e2;
    --tsh-red-500: #d73e3e;
    --tsh-red-600: #c52828;
    --tsh-red-700: #a51f1f;
    --tsh-red-900: #711f1f;
    
    --bs-primary: var(--tsh-red-600);
    --bs-primary-rgb: 197, 40, 40;
    
    /* Font Stack: Inter for EN, Sarabun for TH */
    --bs-font-sans-serif: 'Inter', 'Sarabun', sans-serif;
}

/* Global Sharp Edges Override (No Rounded Corners) */
* {
    border-radius: 0 !important;
}

body {
    font-family: var(--bs-font-sans-serif);
    background-color: #fcfcfc;
    color: #333;
}

/* Typography Helper */
.text-brand { color: var(--tsh-red-600) !important; }
.bg-brand { background-color: var(--tsh-red-600) !important; }
.bg-brand-dark { background-color: var(--tsh-red-900) !important; }
.bg-brand-light { background-color: var(--tsh-red-50) !important; }

/* Buttons - Sharp Edges */
.btn-brand {
    background-color: var(--tsh-red-600);
    color: white;
    border: none;
    padding: 0.6rem 1.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}
.btn-brand:hover {
    background-color: var(--tsh-red-700);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(197, 40, 40, 0.2);
}
.btn-outline-brand {
    color: var(--tsh-red-600);
    border: 1px solid var(--tsh-red-600);
    padding: 0.6rem 1.8rem;
    font-weight: 500;
    background-color: transparent;
    transition: all 0.3s ease;
}
.btn-outline-brand:hover {
    background-color: var(--tsh-red-600);
    color: white;
}

/* Topbar & Navbar */
.topbar {
    background-color: var(--tsh-red-900);
    color: white;
    font-size: 0.85rem;
    padding: 0.4rem 0;
}
.topbar a {
    color: white;
    text-decoration: none;
    transition: color 0.2s;
}
.topbar a:hover { color: var(--tsh-red-100); }

.navbar {
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    background: white;
    padding: 1rem 0;
    transition: all 0.3s ease;
}
.navbar-brand .logo-icon {
    width: 45px;
    height: 45px;
    background: var(--tsh-red-600);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 10px;
}
.nav-link {
    font-weight: 500;
    color: #495057;
    padding: 0.5rem 1rem !important;
    transition: color 0.2s;
}
.nav-link:hover, .nav-link.active {
    color: var(--tsh-red-600);
}

.dropdown-toggle::after {
    display: none !important;
}

.dropdown-menu {
    border: 1px solid #eee;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    margin-top: 15px;
}
.dropdown-item:hover {
    background-color: var(--tsh-red-50);
    color: var(--tsh-red-600);
}

/* Hero Carousel Section */
.hero-slider-section {
    position: relative;
}
.hero-slide-item {
    /*height: 75vh;*/
    min-height: 500px;
    background-size: cover;
    /*background-position: center;*/
    position: relative;
    display: flex;
    /*align-items: center;*/
}
.hero-slide-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    /*background: linear-gradient(90deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.3) 100%);
    z-index: 1;*/
}
.hero-slide-content {
    position: relative;
    z-index: 2;
}

/* Owl Carousel Custom Navigation */
.owl-nav button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    color: white !important;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem !important;
    transition: all 0.3s ease;
}
.owl-nav button:hover {
    background: var(--tsh-red-600) !important;
    border-color: var(--tsh-red-600) !important;
}
.owl-prev { left: 30px; }
.owl-next { right: 30px; }
.owl-dots {
    position: absolute;
    bottom: 30px;
    width: 100%;
    text-align: center;
}
.owl-theme .owl-dots .owl-dot span {
    width: 12px;
    height: 4px;
    background: rgba(255,255,255,0.5);
    transition: all 0.3s;
}
.owl-theme .owl-dots .owl-dot.active span, 
.owl-theme .owl-dots .owl-dot:hover span {
    background: var(--tsh-red-500);
    width: 24px;
}

/* Quick Links / Features */
.feature-card {
    background: white;
    padding: 2.5rem 1rem;
    text-align: center;
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    height: 100%;
    text-decoration: none;
    color: inherit;
    display: block;
}
.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(197, 40, 40, 0.08);
    border-color: var(--tsh-red-100);
}
.feature-icon {
    width: 65px;
    height: 65px;
    background: var(--tsh-red-50);
    color: var(--tsh-red-600);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1.2rem;
    transition: all 0.3s ease;
}
.feature-card:hover .feature-icon {
    background: var(--tsh-red-600);
    color: white;
}

/* News Cards - Sharp Edges */
.news-card {
    border: 1px solid #eaeaea;
    overflow: hidden;
    background: white;
    transition: all 0.3s ease;
    height: 100%;
}
.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(197, 40, 40, 0.08);
    border-color: var(--tsh-red-100);
}
.news-img {
    height: 220px;
    object-fit: cover;
}
.news-badge {
    position: absolute;
    top: 0;
    left: 0;
    padding: 0.4rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.news-title {
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none;
    color: #1a1a1a;
    transition: color 0.2s;
}
.news-card:hover .news-title { color: var(--tsh-red-600); }

/* New Events Section (from image) */
.events-section-bg {
    background-color: #f6f7f9;
}
.event-card-new {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}
.event-date-col {
    flex-shrink: 0;
}
.event-date-box {
    background-color: white;
    padding: 1rem 0;
    width: 65px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
}
.event-day {
    font-size: 1.7rem;
    font-weight: 800;
    color: #1c1f23;
    line-height: 1;
}
.event-month {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--tsh-red-500);
    text-transform: uppercase;
    margin-top: 0.4rem;
}
.event-year {
    font-size: 0.7rem;
    font-weight: 600;
    color: #888;
    margin-top: 0.1rem;
}
.event-info-col h5 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1c1f23;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}
.event-info-col p {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.8rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.event-read-more {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1c1f23;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s;
    text-transform: lowercase;
}
.event-read-more i {
    margin-left: 0.3rem;
    font-size: 1.1em;
    transition: transform 0.2s;
}
.event-read-more:hover {
    color: var(--tsh-red-600);
}
.event-read-more:hover i {
    transform: translateX(4px);
}

/* Footer */
.footer {
    background-color: #16181b;
    color: #adb5bd;
    padding: 4rem 0 2rem;
}
.footer h5 {
    color: white;
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.footer-links a {
    color: #adb5bd;
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: var(--tsh-red-500);
}
.social-btn {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}
.social-btn:hover {
    background: var(--tsh-red-600);
    border-color: var(--tsh-red-600);
    color: white;
}

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}
/* Sidebar Menu */
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: white;
    border: 1px solid #eaeaea;
}
.sidebar-title {
    background: #1a1a1a;
    color: white;
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
}
.sidebar-menu li {
    border-bottom: 1px solid #eaeaea;
}
.sidebar-menu li:last-child {
    border-bottom: none;
}
.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}
.sidebar-menu a i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
    transition: transform 0.3s;
}
.sidebar-menu a:hover {
    color: var(--tsh-red-600);
    background-color: var(--tsh-red-50);
}
.sidebar-menu a:hover i {
    transform: translateX(4px);
}
.sidebar-menu a.active {
    color: white;
    background-color: var(--tsh-red-600);
}

/* Content Styling */
.content-area {
    padding: 0.5rem 0;
}
.content-area h2 {
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 1rem;
}
.content-area h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background-color: var(--tsh-red-600);
}
.content-area p {
    line-height: 1.8;
    color: #555;
    margin-bottom: 1.25rem;
}
.year-highlight {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--tsh-red-600);
    display: block;
    margin-bottom: 0.5rem;
}
/* Custom Breadcrumb */
.custom-breadcrumb {
    background-color: #f8f9fa;
    border-bottom: 1px solid #eaeaea;
    padding: 1rem 0;
    font-size: 0.85rem;
}
.breadcrumb-item { display: inline-flex; align-items: center; }
.breadcrumb-link {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.2s;
}
.breadcrumb-link:hover { color: var(--tsh-red-600); }
.breadcrumb-separator {
    margin: 0 0.5rem;
    color: #ced4da;
    font-size: 1.1em;
}
.breadcrumb-current {
    color: var(--tsh-red-600);
    font-weight: 600;
}



/* ---------------------------------------------------------------
   เพิ่มเติมสำหรับระบบ CI4
   --------------------------------------------------------------- */
.lang-switch a.active { text-decoration: underline; }

/* เนื้อหาจาก editor (TinyMCE / ข้อมูลเดิม) */
.rich-content { line-height: 1.8; color: #444; overflow-wrap: anywhere; }
.rich-content img { max-width: 100%; height: auto; }
.rich-content iframe, .rich-content video { max-width: 100%; }
.rich-content table { width: 100%; max-width: 100%; margin-bottom: 1rem; border-collapse: collapse; }
.rich-content table td, .rich-content table th { border: 1px solid #e5e5e5; padding: .5rem .75rem; vertical-align: top; }
.rich-content .table-wrap { overflow-x: auto; }
.rich-content a { color: var(--tsh-red-600); }
.rich-content h3, .rich-content h4 { font-weight: 700; margin-top: 1.5rem; }
.rich-content .p--header { font-size: 1.15rem; font-weight: 700; margin-bottom: .5rem; }

/* รายการแบบการ์ด */
.list-card { border: 1px solid #eaeaea; transition: all .3s ease; }
.list-card:hover { border-color: var(--tsh-red-100); box-shadow: 0 10px 25px rgba(197, 40, 40, .06); }
.list-card .list-thumb { width: 160px; height: 110px; object-fit: cover; flex-shrink: 0; }
@media (max-width: 575.98px) { .list-card .list-thumb { width: 100%; height: 180px; } }
.list-card .badge-members { background: var(--tsh-red-50); color: var(--tsh-red-700); font-weight: 600; }

/* Pagination */
.pagination .page-link { color: var(--tsh-red-600); }
.pagination .page-item.active .page-link { background-color: var(--tsh-red-600); border-color: var(--tsh-red-600); color: #fff; }

/* Journal */
.journal-card .journal-cover { display: block; height: 260px; background: #f6f7f9; overflow: hidden; }
.journal-card .journal-cover img { width: 100%; height: 100%; object-fit: cover; }
.journal-card .journal-cover.is-placeholder img { object-fit: contain; padding: 2.5rem 1.5rem; opacity: .55; }
.year-filter a { margin: 0 .25rem .5rem 0; }

/* Partner logos */
.partners-carousel .item img { max-height: 90px; width: auto !important; margin: 0 auto; }

/* Hero */
.carousel-item img { max-height: 620px; object-fit: cover; }
.carousel-caption-tsh { background: rgba(0,0,0,.45); padding: .75rem 1.25rem; }

/* ---------------------------------------------------------------
   เมนูหลัก: ไม่ตัดบรรทัด, ปรับขนาดตามความกว้างจอ (เมนู 8 รายการ + TH/EN)
   --------------------------------------------------------------- */
#mainNav .navbar-nav .nav-link { white-space: nowrap; display: flex; align-items: center; }
#mainNav .dropdown-toggle i { line-height: 1; }
#mainNav .site-logo { width: 300px; max-width: 70vw; height: auto; }
@media (min-width: 1200px) {
    #mainNav .site-logo { width: 220px; }
    #mainNav .navbar-nav .nav-link { padding: .5rem .45rem !important; font-size: .88rem; }
}
@media (min-width: 1400px) {
    #mainNav .site-logo { width: 270px; }
    #mainNav .navbar-nav .nav-link { padding: .5rem .6rem !important; font-size: .95rem; }
}
@media (max-width: 1199.98px) {
    #mainNav .navbar-collapse { max-height: calc(100vh - 90px); overflow-y: auto; }
    #mainNav .navbar-nav .nav-link { padding: .65rem .25rem !important; border-bottom: 1px solid #f1f1f1; }
    #mainNav .dropdown-menu { border: 0; box-shadow: none; margin-top: 0; padding-left: 1rem; }
}

/* ---------------------------------------------------------------
   กล่องแจ้งการใช้คุกกี้ (PDPA)
   --------------------------------------------------------------- */
.cookie-consent {
    position: fixed; left: 1.25rem; bottom: 1.25rem; z-index: 1080;
    width: min(420px, calc(100vw - 2.5rem));
    background: #2f3a56; color: #fff;
    padding: 1.25rem 1.25rem 1rem;
    border-radius: 10px !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .25);
    font-size: .95rem; line-height: 1.6;
}
.cookie-consent[hidden] { display: none; }
.cookie-consent__text { margin: 0 0 1rem; }
.cookie-consent__link { color: #fff; text-decoration: underline; text-underline-offset: 3px; display: inline-block; margin-top: .25rem; }
.cookie-consent__link:hover { color: #ffd6d6; }
.cookie-consent__actions { display: flex; gap: .75rem; justify-content: flex-end; align-items: center; }
.cookie-consent__btn { border: 0; cursor: pointer; font-weight: 600; padding: .6rem 1.4rem; border-radius: 6px !important; transition: background-color .2s ease; }
.cookie-consent__btn--reject { background: transparent; color: #fff; }
.cookie-consent__btn--reject:hover { background: rgba(255, 255, 255, .1); }
.cookie-consent__btn--accept { background: var(--tsh-red-600); color: #fff; min-width: 9rem; }
.cookie-consent__btn--accept:hover { background: var(--tsh-red-700); }
@media (max-width: 575.98px) {
    .cookie-consent { left: .75rem; right: .75rem; bottom: .75rem; width: auto; }
    .cookie-consent__actions { justify-content: stretch; }
    .cookie-consent__btn { flex: 1; }
}
