/* ========================================
   The White Rehab - Main Stylesheet
   ======================================== */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-green: #4a7c59;
    --dark-green: #2d5a3d;
    --light-green: #6b9b7a;
    --accent-red: #d32f2f;
    --gold: #c9a961;
    --cream: #f5f1e8;
    --brown: #8b6914;
    --text-dark: #333;
    --text-gray: #666;
}

body {
    font-family: 'DB Heavent', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
}
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    overflow: visible;
}

img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   Hero Section with Header
   ======================================== */
.hero-section {
    height: 100vh;
    min-height: 900px;
    position: relative;
    display: flex;
    flex-direction: column;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), 
                url('https://thewhiterehab.com/media/index/bg/bg1.avif') center/cover no-repeat;
}

/* ========================================
   Header & Navigation
   ======================================== */
.header {
    position: relative;
    z-index: 1000;
    padding: 20px 0 0 0;
    
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 50px;
    gap: 40px;
}

.nav-left,
.nav-right {
    flex: 1;
}

.nav-left {
    display: flex;
    justify-content: flex-end;
}

.nav-right {
    display: flex;
    justify-content: flex-start;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo img {
    height: 100px;
    width: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 35px;
    align-items: center;
    margin: 0;
}

.nav-menu a {
    text-decoration: none;
    color: #ffffff;
    font-size: 20px;
    font-weight: 400;
    transition: all 0.3s ease;
    padding: 8px 0;
    position: relative;
}

/* Active menu item style */
.nav-menu a.active {
    background: linear-gradient(to bottom, #a6d391 10%, #30a656 50%, #648f71 100%);
    padding: 3px 20px;
    border-radius: 20px;
}

.nav-menu a.active:hover {
    background: #4c7b5a;
    color: #ffffff;
}

.nav-menu a.active::after {
    display: none;
}

.nav-menu a:hover {
    color: #4c7b5a;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-green);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
    position: absolute;
    right: 70px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: #ffffff;
    transition: 0.3s;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ========================================
   Sidebar Menu
   ======================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: -350px;
    width: 350px;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    transition: left 0.3s ease;
    z-index: 2000;
    overflow-y: auto;
}

.sidebar.active {
    left: 0;
}

.sidebar-content {
    padding: 40px 40px 40px;
}

.sidebar-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0 30px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo img {
    height: 120px;
    width: auto;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sidebar-menu li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-menu a {
    display: block;
    text-decoration: none;
    color: #ffffff;
    font-size: 20px;
    font-weight: 400;
    padding: 20px 0;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-menu a:hover {
    color: #4c7b5a;
    padding-left: 15px;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1999;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   Hero Content
   ======================================== */
.hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 900px;
    color: white;
    padding: 0 50px 0 120px;
}

.hero-label {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 5px;
    letter-spacing: 3px;
    line-height: 1;
}

.hero-title {
    font-size: 7rem;
    font-weight: 700;
    line-height: 0.8;
    margin-bottom: 5px;
    letter-spacing: 4px;
}

.hero-subtitle {
    font-size: 2.5rem;
    font-weight: 300;
    line-height: 1.2;
}

/* ========================================
   About Section
   ======================================== */
.about-section {
    padding: 80px 0;
    background: #f7f4eb;
    overflow: visible;
}

.section-label {
    color: var(--primary-green);
    font-size: 18px;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.section-title {
    font-size: 56px;
    color: var(--primary-green);
    font-weight: 700;
    margin-bottom: 30px;
    line-height: 1.2;
}

.section-subtitle {
    font-size: 28px;
    color: var(--text-dark);
    font-weight: 300;
    margin-bottom: 40px;
}

.about-content {
    display: flex;
    align-items: center;
    gap: 60px;
    max-width: 1400px;
    margin: 50px auto 0;
}

.about-image {
    flex: 0 0 45%;
    position: relative;
    overflow: hidden;
}

.about-image img {
    width: 100%;
    height: auto;
    display: block;
}

.about-text {
    flex: 1;
    padding: 20px 0;
}

.about-text p {
    font-size: 1.5rem;
    line-height: 1.2;
    color: #000000;
    /* font-weight: 500; */
    margin-bottom: 10px;
    /* text-align: justify; */
}

.text-highlight {
    color: var(--primary-green);
    font-weight: 900;
    font-size: 1.7rem;
    /* letter-spacing: -0.3px; */
    /* word-spacing: -1px; */
}

.about-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.about-image {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.about-image:first-child {
    grid-column: 1 / -1;
    height: 300px;
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* About Image Bar */
.about-image-bar {
    margin: 60px auto;
    max-width: 1400px;
    overflow: hidden;
}

.about-image-bar img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    object-position: center 60%;
    display: block;
}

/* ========================================
   Rebirth Section (inside About)
   ======================================== */
.rebirth-section {
    margin-top: 60px;
    overflow: visible;
}

.rebirth-title {
    font-size: 3.5rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: -10px;
}

.rebirth-subtitle {
    font-size: 2.5rem;
    color: var(--text-gray);
    margin-top: 0;
    margin-bottom: 60px;
}

.rebirth-cards {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: 50px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    align-items: flex-start;
    overflow: visible;
}

.rebirth-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    flex: 0 0 calc(33.333% - 20px);
    max-width: 380px;
    cursor: pointer;
}

.rebirth-card:nth-child(2) {
    margin-top: 40px !important;
}

.rebirth-card:hover {
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
}

.rebirth-card:nth-child(1):hover {
    transform: translateY(-18px) rotate(-1deg);
}

.rebirth-card:nth-child(2):hover {
    transform: translateY(25px);
}

.rebirth-card:nth-child(3):hover {
    transform: translateY(-18px) rotate(1deg);
}

.rebirth-card-image {
    width: 100%;
    position: relative;
    overflow: hidden;
    aspect-ratio: 3/4;
    border-radius: 15px;
}

.rebirth-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.rebirth-card:hover .rebirth-card-image img {
    transform: scale(1.08);
}

.rebirth-card-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    font-size: 1.9rem;
    font-weight: 500;
    color: white;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.3), transparent);
    line-height: 1.5;
    border-radius: 0 0 15px 15px;
    text-align: center;
    transition: all 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateY(0);
}

.rebirth-card:hover .rebirth-card-text {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.55), transparent);
    padding-bottom: 30px;
    letter-spacing: 0.5px;
}

.card-label {
    font-size: 18px;
    font-weight: 600;
    color: white;
    text-align: center;
}

/* ========================================
   Services Section
   ======================================== */
/* ========================================
   Services Section
   ======================================== */
.services-section {
    padding: 80px 0;
    background: linear-gradient(to top, #ffe5bb, #f0e1c9);
}

.services-content {
    display: grid;
    grid-template-columns: 45% 55%;
    gap: 80px;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

/* Left Side */
.services-left {
    text-align: left;
}

.services-header {
    margin-bottom: 40px;
}

.services-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0;
    line-height: 1.2;
}

.services-subtitle {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-top: 0;
    line-height: 1.6;
}

/* Main Therapy Programs */
.therapy-main {
    margin-top: 30px;
}

.therapy-main-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.therapy-main-list li {
    font-size: 1.5rem;
    color: #9e6100;
    font-weight: 500;
    padding-left: 25px;
    position: relative;
    line-height: 1.6;
}

.therapy-main-list li:before {
    content: "●";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: #9e6100;
    font-size: 15px;
}

/* Right Side */
.services-right {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Three Features Row */
.therapy-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    width: 100%;
}

.therapy-feature-item {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.feature-icon {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.feature-icon i {
    font-size: 80px;
    color: #9e6100;
}

.feature-text h4 {
    font-size: 14px;
    font-weight: 600;
    color: #9e6100;
    margin-bottom: 5px;
    line-height: 1.4;
}

.feature-text p {
    font-size: 1.5rem;
    color: #9e6100;
    /* ทำให้ความสูงตัวอักษรติดกัน */
    line-height: 1;
    font-weight: 500;


}

/* Therapy Sections */
.therapy-section {
    margin-top: 30px;
}

.therapy-section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 15px;
}

/* Occupational Therapy Grid (6 items) */
.therapy-grid-6 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

/* Recreational Activities Grid (3 items) */
.therapy-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.therapy-card {
    background: var(--brown);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    border: 2px solid var(--brown);
}

.therapy-card:hover {   
    background: white;
    color: var(--brown);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.therapy-card i {
    font-size: 32px;
}

.therapy-card span {
    font-size: 14px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .services-content {
        grid-template-columns: 1fr;
        gap: 60px;
    }
    
    .services-left {
        text-align: center;
    }
    
    .therapy-main-list {
        align-items: center;
    }
    
    .services-right {
        padding: 0;
        width: 100%;
    }
    
    .therapy-features {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
        margin: 0 auto;
    }

    .feature-icon {
        width: 90px;
        height: 90px;
    }
    
    .therapy-grid-6 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .services-section {
        padding: 60px 0;
    }
    
    .services-title {
        font-size: 2.5rem;
    }
    
    .services-subtitle {
        font-size: 1.5rem;
    }
    
    .services-right {
        padding: 0;
    }
    
    .therapy-main-list li {
        font-size: 1.25rem;
    }
    
    .therapy-features {
        gap: 20px;
    }
    
    .feature-icon {
        width: 70px;
        height: 70px;
    }
    
    .feature-icon i {
        font-size: 48px;
    }
    
    .feature-text h4 {
        font-size: 12px;
    }
    
    .feature-text p {
        font-size: 1rem;
    }
    
    .therapy-grid-6,
    .therapy-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Activity Section
   ======================================== */
.activity-section {
    padding: 30px 0;
    background: #9e6100;
    position: relative;
    overflow: hidden;
}

.activity-section::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 50%;
    background-image: url('../../media/index/bg-activity-plant.avif');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.activity-content {
    display: grid;
    grid-template-columns: 50% 50%;
    gap: 0;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 280px;
    position: relative;
    z-index: 1;
}

/* Right Side - Activity Grid */
.activity-right {
    display: flex;
    flex-direction: column;
    gap: 15px;
    justify-content: center;
    padding-left: 30px;
    position: relative;
    z-index: 2;
}

.activity-section-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-section-title {
    font-size: 1.5rem;
    /* font-weight: 600; */
    color: #e4c3a2;
    margin: 0 0 8px 0;
    padding-bottom: 0;
    position: relative;
    z-index: 2;
}

.activity-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    width: 100%;
}

.activity-item {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    padding: 0;
    transition: all 0.3s ease;
    border: none;
}

.activity-item:hover {
    transform: scale(1.05);
}

.activity-icon {
    margin-right: 20px; 
    width: 100%;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}

.activity-icon img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    border: none;
    border-radius: 0;
    transform: scale(1.15);
}

/* Activity Responsive Design */
@media (max-width: 1024px) {
    .activity-section {
        padding: 40px 0;
    }

    .activity-section::before {
        display: none;
    }
    
    .activity-content {
        display: flex;
        flex-direction: column;
        gap: 20px;
        min-height: auto;
    }
    
    .activity-left {
        display: none;
    }

    .activity-right {
        width: 100%;
        max-width: 800px;
        margin: 0 auto;
        padding-left: 0;
    }
    
    .activity-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
}

@media (max-width: 768px) {
    .activity-section {
        padding: 30px 0;
    }

    .activity-right {
        gap: 20px;
        width: 100%;
        max-width: 600px;
        padding-left: 0;
    }

    .activity-section-group {
        gap: 10px;
    }
    
    .activity-section-title {
        font-size: 1.225rem;
        margin-bottom: 10px;
    }
    
    .activity-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .activity-item {
        padding: 0;
    }
}

@media (max-width: 480px) {
    .activity-section {
        padding: 25px 0;
    }

    .activity-right {
        gap: 15px;
        width: 100%;
        padding-left: 0;
    }

    .activity-section-title {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }

    .activity-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .activity-icon img {
        width: 100%;
        transform: scale(1.15);
    }
}

/* ========================================
   Animations & Effects
   ======================================== */
.fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header.scrolled {
    padding: 10px 0 !important;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15) !important;
}

/* Back to top button styles handled in JS */

/* ========================================
   Responsive Design
   ======================================== */

/* Laptop screens - Hide desktop menu, show sidebar */
@media (max-width: 1400px) {
    .nav-left,
    .nav-right {
        display: none;
    }
    
    .menu-toggle {
        display: flex;
        right: 50px;
    }
    
    .nav-container {
        padding: 0 40px;
    }
}

@media (max-width: 1024px) {
    .logo img {
        height: 100px;
    }
    
    .hero-title {
        font-size: 80px;
    }
    
    .hero-subtitle {
        font-size: 28px;
    }
    
    .hero-label {
        font-size: 20px;
    }
    
    .section-title {
        font-size: 42px;
    }
    
    .rebirth-title {
        font-size: 58px;
    }
    
    .rebirth-subtitle {
        font-size: 28px;
        margin-bottom: 50px;
    }
    
    .about-content {
        flex-direction: column;
        gap: 40px;
    }
    
    .about-image {
        flex: 0 0 auto;
        width: 100%;
    }
    
    .services-content {
        grid-template-columns: 1fr;
    }
    
    .rebirth-cards {
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .rebirth-card {
        flex: 0 0 calc(50% - 10px);
        max-width: 100%;
    }
    
    .rebirth-card:nth-child(2) {
        margin-top: 40px !important;
    }
    
    .about-image-bar img {
        height: 220px;
    }
    
    .therapy-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
        right: 20px;
    }
    
    .nav-left,
    .nav-right {
        display: none;
    }
    
    .logo img {
        height: 100px;
    }
    
    .nav-container {
        padding: 0 20px;
    }
    
    .hero-section {
        min-height: 600px;
    }
    
    .hero-content {
        padding: 0 30px;
    }
    
    .hero-label {
        font-size: 16px;
    }
    
    .hero-title {
        font-size: 56px;
    }
    
    .hero-subtitle {
        font-size: 22px;
    }
    
    .section-title {
        font-size: 36px;
    }
    
    .rebirth-title {
        font-size: 58px;
    }
    
    .rebirth-subtitle {
        font-size: 28px;
        margin-bottom: 40px;
    }
    
    .rebirth-cards {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
    
    .rebirth-card {
        flex: 1 1 100%;
        max-width: 300px;
        width: 100%;
    }
    
    .rebirth-card:nth-child(2) {
        margin-top: 0 !important;
    }
    
    .rebirth-section {
        padding-bottom: 0;
    }
    
    .about-image-bar {
        margin: 40px auto;
    }
    
    .about-image-bar img {
        height: 180px;
    }
    
    .about-images {
        grid-template-columns: 1fr;
    }
    
    .recreational-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .menu-toggle {
        right: 15px;
    }
    
    .logo img {
        height: 100px;
    }
    
    .nav-container {
        padding: 0 15px;
    }
    
    .hero-section {
        min-height: 500px;
    }
    
    .hero-label {
        font-size: 24px;
    }
    
    .hero-title {
        font-size: 72px;
    }
    
    .hero-subtitle {
        font-size: 24px;
    }
    .about-text p {
        font-size: 1.25rem;
    }

    /* — About Section — */
    .section-label {
        font-size: 1.25rem;
    }

    /* — Rebirth Section — */
    .rebirth-title {
        font-size: 3rem;
    }
    
    .rebirth-subtitle {
        font-size: 1.5rem;
        margin-bottom: 30px;
    }

    .rebirth-card-text {
        font-size: 1.25rem;
    }
    
    .rebirth-cards {
        gap: 15px;
    }

    .rebirth-card {
        max-width: 260px;
    }

    /* — Services Section — */
    .services-title {
        font-size: 2rem;
    }

    .services-subtitle {
        font-size: 1.25rem;
    }

    .therapy-main-list li {
        font-size: 1rem;
    }

    .therapy-features {
        gap: 10px;
    }

    .feature-icon {
        width: 55px;
        height: 55px;
    }

    .feature-icon i {
        font-size: 36px;
    }

    .feature-text p {
        font-size: 0.9rem;
        line-height: 1.2;
    }

    /* — Activity Section — */
    .activity-section-title {
        font-size: 1.5rem;
    }
    
    .about-image-bar img {
        height: 150px;
    }
}