/* Thamarat Organization - Main Stylesheet */

:root {
    --color-primary: #537258;
    --color-light-green: #6C866F;
    --color-brown: #6E5623;
    --color-gold: #A89265;
    --color-white: #ffffff;
    --color-bg: #f8f9f6;
    --color-text: #2c3e2d;
    --color-text-muted: #5a6b5c;
    --shadow-sm: 0 2px 8px rgba(83, 114, 88, 0.08);
    --shadow-md: 0 8px 30px rgba(83, 114, 88, 0.12);
    --shadow-lg: 0 16px 48px rgba(83, 114, 88, 0.16);
    --radius: 16px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    color: var(--color-text);
    background: var(--color-white);
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Site Header */
.site-header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    border-bottom: 2px solid rgba(168, 146, 101, 0.2);
    z-index: 1030;
}

.header-top {
    padding: 0.75rem 0 0.5rem;
    border-bottom: 1px solid rgba(83, 114, 88, 0.08);
}

.header-top-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
}

.header-org-name {
    justify-self: start;
    text-align: start;
}

.header-org-name a {
    color: var(--color-primary);
    font-size: clamp(0.95rem, 2vw, 1.25rem);
    font-weight: 800;
    line-height: 1.4;
    white-space: nowrap;
}

.header-org-name a:hover {
    color: var(--color-brown);
}

.header-logo {
    justify-self: center;
}

.header-top-end {
    justify-self: end;
}

.brand-logo {
    height: 78px;
    width: auto;
    object-fit: contain;
}

.header-nav {
    padding: 0.55rem 0;
}

.header-nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-menus {
    flex: 1;
    min-width: 0;
}

.header-nav-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem;
}

.header-nav .nav-link {
    color: var(--color-primary);
    font-weight: 600;
    padding: 0.45rem 0.9rem !important;
    border-radius: 8px;
    white-space: nowrap;
}

.header-nav .nav-link:hover,
.header-nav .nav-link.active {
    color: var(--color-brown);
    background: rgba(83, 114, 88, 0.08);
}

.header-nav .dropdown-menu {
    border: none;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius);
    padding: 0.5rem;
    min-width: 220px;
}

[dir="rtl"] .header-nav .dropdown-menu {
    text-align: right;
}

[dir="ltr"] .header-nav .dropdown-menu {
    text-align: left;
}

.header-nav .dropdown-item {
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-weight: 500;
    color: var(--color-primary);
}

.header-nav .dropdown-item:hover {
    background: var(--color-primary);
    color: white;
}

.header-lang {
    flex-shrink: 0;
}

.lang-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1rem;
    border: 2px solid var(--color-gold);
    border-radius: 25px;
    background: white;
    color: var(--color-brown);
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.lang-switch-btn:hover {
    background: linear-gradient(135deg, var(--color-brown), var(--color-gold));
    color: white;
    border-color: var(--color-brown);
}

.header-toggler {
    border-color: var(--color-primary);
    margin-inline-end: 0.75rem;
}

.header-toggler .navbar-toggler-icon {
    filter: invert(35%) sepia(15%) saturate(800%) hue-rotate(80deg);
}

.btn-contact {
    background: linear-gradient(135deg, var(--color-primary), var(--color-light-green)) !important;
    color: white !important;
    border-radius: 25px !important;
    padding: 0.5rem 1.5rem !important;
}

.btn-contact:hover {
    background: linear-gradient(135deg, var(--color-brown), var(--color-gold)) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Legacy navbar class support */
.navbar-thamarat {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    padding: 0.6rem 0;
    border-bottom: 2px solid rgba(168, 146, 101, 0.2);
}

/* Hero Slider */
.hero-slider {
    position: relative;
    background: linear-gradient(180deg, #f8f9f6 0%, #eef2eb 100%);
}

.hero-slider .carousel-item {
    height: auto;
    min-height: 420px;
    max-height: 85vh;
}

.slide-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 420px;
    max-height: 85vh;
    padding: 1rem 0;
    background: linear-gradient(180deg, #f8f9f6 0%, #e8ede5 100%);
    overflow: hidden;
}

.slide-image img {
    width: 100%;
    height: auto;
    max-height: 82vh;
    object-fit: contain;
    object-position: center;
    display: block;
}

.slide-image::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        to top,
        rgba(83, 114, 88, 0.45) 0%,
        rgba(83, 114, 88, 0.1) 40%,
        transparent 100%
    );
}

.carousel-caption {
    bottom: 8%;
    text-align: center;
    z-index: 2;
    position: absolute;
    left: 0;
    right: 0;
    padding: 0 1rem;
}

.carousel-caption h2 {
    font-size: 2.8rem;
    font-weight: 800;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
}

.carousel-caption p {
    font-size: 1.2rem;
    opacity: 0.95;
}

.carousel-indicators [data-bs-target] {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-gold);
    border: 2px solid white;
    opacity: 0.6;
}

.carousel-indicators .active {
    opacity: 1;
    background: white;
}

.hero-fallback {
    background: linear-gradient(135deg, var(--color-primary), var(--color-light-green));
    color: white;
    padding: 8rem 0;
}

.hero-fallback h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

/* Sections */
.section-block {
    padding: 5rem 0;
}

.section-alt {
    background: var(--color-bg);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.section-header h2 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem auto;
}

.section-divider span {
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-gold), var(--color-brown), var(--color-gold));
    border-radius: 2px;
    position: relative;
}

.section-divider span::before {
    content: '🌿';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1rem;
    background: var(--color-white);
    padding: 0 8px;
}

.section-alt .section-divider span::before {
    background: var(--color-bg);
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--color-brown);
    font-weight: 600;
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

.view-all-link:hover {
    color: var(--color-gold);
    gap: 0.7rem;
}

/* Animated Carousel Track */
.carousel-track-wrapper {
    overflow: hidden;
    mask-image: linear-gradient(
        to right,
        transparent,
        black 5%,
        black 95%,
        transparent
    );
    -webkit-mask-image: linear-gradient(
        to right,
        transparent,
        black 5%,
        black 95%,
        transparent
    );
}

.carousel-track {
    display: flex;
    gap: 1.5rem;
    width: max-content;
    animation-duration: var(--scroll-duration, 40s);
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.carousel-track-reverse {
    animation-direction: reverse;
}

.carousel-track:hover {
    animation-play-state: paused;
}

@keyframes scroll-rtl {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(50%);
    }
}

@keyframes scroll-ltr {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

[dir="rtl"] .carousel-track {
    animation-name: scroll-rtl;
}

[dir="ltr"] .carousel-track {
    animation-name: scroll-ltr;
}

[dir="ltr"] .carousel-track-reverse {
    animation-direction: reverse;
}

.card-item {
    flex: 0 0 320px;
    width: 320px;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(83, 114, 88, 0.08);
}

.card-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.card-image {
    height: 200px;
    overflow: hidden;
    position: relative;
}

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

.card-item:hover .card-image img {
    transform: scale(1.08);
}

.card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.card-body p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    flex: 1;
}

.card-badge {
    display: inline-block;
    background: rgba(83, 114, 88, 0.1);
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    margin-bottom: 0.5rem;
    width: fit-content;
}

.date-badge {
    display: inline-block;
    color: var(--color-gold);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.quote-text {
    font-style: italic;
    color: var(--color-brown) !important;
}

/* Testimonial cards */
.testimonial-image {
    height: 180px;
}

.testimonial-image img {
    object-position: top center;
}

/* Partner cards */
.partner-card {
    text-align: center;
    padding: 1.5rem;
    align-items: center;
    justify-content: center;
    height: 220px;
}

.partner-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: center;
}

.partner-logo {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.partner-logo img {
    max-height: 80px;
    max-width: 160px;
    object-fit: contain;
    filter: grayscale(30%);
    transition: var(--transition);
}

.partner-card:hover .partner-logo img {
    filter: grayscale(0%);
    transform: scale(1.05);
}

.partner-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-primary);
    margin: 0;
}

/* Page Hero */
.page-hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-light-green) 100%);
    color: white;
    padding: 4rem 0 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.page-hero .container {
    position: relative;
    z-index: 1;
}

.page-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.page-hero-sm {
    padding: 3rem 0 2rem;
}

.page-hero-sm h1 {
    font-size: 2rem;
}

.breadcrumb {
    justify-content: center;
    margin: 0;
    background: transparent;
}

.breadcrumb-item a {
    color: rgba(255, 255, 255, 0.8);
}

.breadcrumb-item a:hover {
    color: white;
}

.breadcrumb-item.active {
    color: var(--color-gold);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.5);
}

/* Grid Cards */
.grid-card {
    display: block;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
    border: 1px solid rgba(83, 114, 88, 0.08);
}

.grid-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.grid-card-image {
    height: 220px;
    overflow: hidden;
}

.grid-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.grid-card:hover .grid-card-image img {
    transform: scale(1.06);
}

.grid-card-body {
    padding: 1.5rem;
}

.grid-card-body h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.grid-card-body p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* Info Cards (About) */
.info-card {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    height: 100%;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(83, 114, 88, 0.08);
    transition: var(--transition);
}

.info-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-gold);
}

.info-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-light-green));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.info-icon i {
    font-size: 1.5rem;
    color: white;
}

.info-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
}

.content-box {
    background: white;
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
}

.content-box h2 {
    color: var(--color-primary);
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.content-text {
    color: var(--color-text-muted);
    font-size: 1.05rem;
    line-height: 1.9;
}

/* Detail Pages */
.detail-layout {
    max-width: 900px;
    margin: 0 auto;
}

.detail-image {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.detail-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}

.detail-content {
    font-size: 1.1rem;
    line-height: 2;
}

/* Testimonial Detail */
.testimonial-detail {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.testimonial-detail-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 2rem;
    border: 4px solid var(--color-gold);
    box-shadow: var(--shadow-md);
}

.testimonial-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.testimonial-detail-quote i {
    font-size: 3rem;
    color: var(--color-gold);
    opacity: 0.5;
}

.testimonial-detail-quote blockquote {
    font-size: 1.4rem;
    font-style: italic;
    color: var(--color-brown);
    margin: 1rem 0;
    line-height: 1.8;
}

.testimonial-detail-quote cite {
    color: var(--color-primary);
    font-weight: 700;
    font-style: normal;
}

/* Contact */
.contact-info-box,
.contact-form-box {
    background: white;
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    height: 100%;
    border: 1px solid rgba(83, 114, 88, 0.08);
}

.contact-info-box h3,
.contact-form-box h3 {
    color: var(--color-primary);
    font-weight: 700;
}

.contact-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-info-list li {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(83, 114, 88, 0.08);
}

.contact-info-list li:last-child {
    border-bottom: none;
}

.contact-info-list i {
    font-size: 1.3rem;
    color: var(--color-gold);
    margin-top: 0.2rem;
}

.contact-info-list strong {
    display: block;
    color: var(--color-primary);
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}

.contact-info-list a {
    color: var(--color-text-muted);
}

.contact-info-list a:hover {
    color: var(--color-primary);
}

.form-control {
    border: 2px solid rgba(83, 114, 88, 0.15);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-family: 'Cairo', sans-serif;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(83, 114, 88, 0.15);
}

.form-label {
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.4rem;
}

.btn-primary-custom {
    background: linear-gradient(135deg, var(--color-primary), var(--color-light-green));
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary-custom:hover {
    background: linear-gradient(135deg, var(--color-brown), var(--color-gold));
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.filter-tab {
    padding: 0.5rem 1.25rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-primary);
    background: white;
    border: 2px solid rgba(83, 114, 88, 0.15);
    transition: var(--transition);
}

.filter-tab:hover,
.filter-tab.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-text-muted);
}

.empty-state i {
    font-size: 4rem;
    color: var(--color-light-green);
    opacity: 0.5;
    margin-bottom: 1rem;
    display: block;
}

/* Footer */
.site-footer {
    background: linear-gradient(180deg, #2d3f30 0%, #1a2a1c 100%);
    color: rgba(255, 255, 255, 0.85);
}

.footer-top {
    padding: 4rem 0 2rem;
}

.footer-logo {
    height: 80px;
    width: auto;
    filter: brightness(1.1);
}

.footer-brand h5 {
    font-weight: 700;
    color: white;
    margin-bottom: 0.25rem;
}

.text-muted-en {
    font-size: 0.85rem;
    opacity: 0.7;
}

.footer-slogan {
    color: var(--color-gold);
    font-weight: 500;
    font-style: italic;
}

.footer-heading {
    color: var(--color-gold);
    font-weight: 700;
    margin-bottom: 1.25rem;
    font-size: 1.1rem;
}

.footer-contact li,
.footer-links li {
    margin-bottom: 0.6rem;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.footer-contact i {
    color: var(--color-gold);
    margin-top: 0.2rem;
}

.footer-contact a,
.footer-links a {
    color: rgba(255, 255, 255, 0.75);
}

.footer-contact a:hover,
.footer-links a:hover {
    color: var(--color-gold);
}

.social-links {
    display: flex;
    gap: 0.75rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--color-gold);
    color: white;
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 991px) {
    .header-top-row {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 0.5rem;
    }

    .header-org-name {
        justify-self: center;
        text-align: center;
        order: 2;
    }

    .header-logo {
        order: 1;
    }

    .header-top-end {
        display: none;
    }

    .brand-logo {
        height: 64px;
    }

    .header-nav-row {
        flex-direction: column;
        align-items: stretch;
    }

    .header-lang {
        align-self: end;
        order: -1;
    }

    .header-nav-list {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .header-nav .nav-link {
        text-align: start;
    }

    .carousel-caption h2 {
        font-size: 1.8rem;
    }

    .hero-slider .carousel-item {
        min-height: 280px;
        max-height: 70vh;
    }

    .slide-image {
        min-height: 280px;
        max-height: 70vh;
        padding: 0.5rem 0;
    }

    .slide-image img {
        max-height: 68vh;
    }

    .card-item {
        flex: 0 0 280px;
        width: 280px;
    }

    .section-block {
        padding: 3rem 0;
    }

    .section-header h2 {
        font-size: 1.8rem;
    }

    .page-hero h1 {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .card-item {
        flex: 0 0 260px;
        width: 260px;
    }

    .card-image {
        height: 170px;
    }
}
