/* ==========================================================================
   Krabi ATV Adventours — Homepage Stylesheet
   All rules scoped to the homepage (body.page-home).
   ========================================================================== */

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.page-home .hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--color-dark);
    padding: calc(var(--header-height) + 60px) 0 120px;
    overflow: hidden;
}

/* Poster + video layers */
.page-home .hero-media {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.page-home .hero-poster {
    position: absolute;
    inset: 0;
    background: var(--color-dark) url('../assets/images/hero-bg.webp') center / cover no-repeat;
    opacity: 1;
    transition: opacity 0.9s ease;
    will-change: opacity;
}

.page-home .hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.9s ease;
    will-change: opacity;
}

/* Playing state — crossfade poster → video */
.page-home .hero.is-playing .hero-poster {
    opacity: 0;
}

.page-home .hero.is-playing .hero-video {
    opacity: 1;
}

.page-home .hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        135deg,
        rgba(10, 17, 40, 0.75) 0%,
        rgba(10, 17, 40, 0.35) 60%,
        rgba(10, 17, 40, 0.5) 100%
    );
    transition: opacity 0.6s ease;
    pointer-events: none;
}

/* Slightly lighter overlay while video plays for better visibility */
.page-home .hero.is-playing .hero-overlay {
    opacity: 0.85;
}

.page-home .hero-content {
    position: relative;
    z-index: 2;
    max-width: 640px;
}

.page-home .hero-title {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: var(--color-white);
    line-height: 1.15;
    margin-bottom: 20px;
}

.page-home .hero-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 32px;
    max-width: 520px;
}

.page-home .hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.page-home .hero-play-btn-icon {
    display: inline-flex;
    flex-shrink: 0;
}

.page-home .hero-play-btn .icon-play,
.page-home .hero-play-btn .icon-pause {
    flex-shrink: 0;
}

/* Toggle icon visibility via data-state on the button */
.page-home .hero-play-btn[data-state="play"] .icon-pause {
    display: none;
}

.page-home .hero-play-btn[data-state="pause"] .icon-play {
    display: none;
}

.page-home .hero-play-btn[data-state="pause"] .icon-pause {
    display: block;
}

/* ==========================================================================
   SEARCH WIDGET — Floating bar
   ========================================================================== */
.page-home .search-section {
    position: relative;
    z-index: 10;
    margin-top: -60px;
    margin-bottom: 40px;
}

.page-home .search-widget {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 24px 28px;
    flex-wrap: wrap;
}

.page-home .search-field {
    flex: 1;
    min-width: 140px;
}

.page-home .search-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.page-home .search-field select,
.page-home .search-field input[type="date"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    background: var(--color-white);
    outline: none;
    transition: border-color var(--transition);
    appearance: auto;
}

.page-home .search-field select:focus,
.page-home .search-field input[type="date"]:focus {
    border-color: var(--color-primary);
}

/* Loading state for station selects */
.page-home .search-field select.is-loading {
    color: var(--color-text-muted);
    background: var(--color-bg-light);
    cursor: wait;
}

.page-home .search-field select:disabled {
    opacity: 0.7;
    cursor: wait;
}

.page-home .btn-search {
    padding: 12px 36px;
    font-size: 1rem;
    align-self: flex-end;
    min-width: 120px;
}

/* ==========================================================================
   FEATURED CATEGORIES
   ========================================================================== */
.page-home .categories-section {
    padding: 20px 0 60px;
}

.page-home .categories-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 40px;
}

.page-home .category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: transform var(--transition);
}

.page-home .category-item:hover {
    transform: translateY(-4px);
}

.page-home .category-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    color: var(--color-text-muted);
    background: var(--color-white);
    transition: border-color var(--transition), color var(--transition),
                box-shadow var(--transition);
}

.page-home .category-item:hover .category-icon {
    border-color: var(--color-primary);
    color: var(--color-primary);
    box-shadow: 0 4px 20px rgba(247, 148, 29, 0.2);
}

.page-home .category-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
}

/* ==========================================================================
   ABOUT US
   ========================================================================== */
.page-home .about-section {
    padding: 80px 0;
}

.page-home .about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.page-home .about-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 16px;
    height: 420px;
}

.page-home .about-img {
    border-radius: var(--radius-lg);
    background-size: cover;
    background-position: center;
    background-color: var(--color-bg-light);
}

.page-home .about-img-main {
    grid-row: 1 / 3;
    background-image: url('../assets/images/about-img-main.jpg');
}

.page-home .about-img-top {
    background-image: url('../assets/images/about-img-top.jpg');
}

.page-home .about-img-bottom {
    background-image: url('../assets/images/about-img-bottom.jpg');
}

.page-home .about-content p {
    color: var(--color-text-muted);
    margin-bottom: 24px;
    line-height: 1.8;
}

.page-home .feature-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
    margin-bottom: 28px;
}

.page-home .feature-list li {
    position: relative;
    padding-left: 28px;
    font-size: 0.9rem;
    color: var(--color-text);
}

.page-home .feature-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: 700;
}

/* ==========================================================================
   STATS
   ========================================================================== */
.page-home .stats-section {
    background: var(--color-bg-light);
    padding: 50px 0;
}

.page-home .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    text-align: center;
}

.page-home .stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(247, 148, 29, 0.12);
    color: var(--color-primary);
    margin-bottom: 12px;
}

.page-home .stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-dark);
    line-height: 1.2;
}

.page-home .stat-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* ==========================================================================
   POPULAR CHOICES (SERVICES)
   ========================================================================== */
.page-home .services-section {
    padding: 80px 0;
}

.page-home .section-header {
    text-align: center;
    margin-bottom: 48px;
}

.page-home .section-header-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    text-align: left;
    flex-wrap: wrap;
    gap: 16px;
}

.page-home .services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Service card */
.page-home .service-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 360px;
    background: var(--color-dark);
}

.page-home .service-card-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
}

.page-home .service-card:hover .service-card-img {
    transform: scale(1.05);
}

.page-home .service-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 17, 40, 0.92) 0%, rgba(10, 17, 40, 0.2) 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
}

.page-home .service-card h3 {
    color: var(--color-white);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-home .service-card .service-operator {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.page-home .service-card .service-price {
    color: var(--color-primary);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.page-home .service-card .btn {
    align-self: flex-start;
    padding: 8px 20px;
    font-size: 0.85rem;
}

/* Skeleton loading cards */
.page-home .skeleton-card {
    background: var(--color-bg-light);
    min-height: 360px;
}

.page-home .skeleton-img {
    height: 220px;
    background: linear-gradient(90deg, #e8ecf0 25%, #f5f7fa 50%, #e8ecf0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.page-home .skeleton-body {
    padding: 20px;
}

.page-home .skeleton-line {
    height: 14px;
    background: #e8ecf0;
    border-radius: 4px;
    margin-bottom: 10px;
    animation: shimmer 1.5s infinite;
    background: linear-gradient(90deg, #e8ecf0 25%, #f5f7fa 50%, #e8ecf0 75%);
    background-size: 200% 100%;
}

.page-home .skeleton-line.short {
    width: 60%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.page-home .services-error {
    text-align: center;
    color: var(--color-text-muted);
    padding: 40px 0;
}

/* ==========================================================================
   TESTIMONIALS
   ========================================================================== */
.page-home .testimonials-section {
    padding: 80px 0;
    background: var(--color-bg-light);
}

.page-home .testimonials-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.page-home .testimonial-cards {
    position: relative;
    min-height: 380px;
}

.page-home .testimonial-card {
    background: var(--color-primary);
    color: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 340px;
    box-shadow: var(--shadow);
}

.page-home .testimonial-card-offset {
    position: absolute;
    top: 140px;
    left: 60px;
}

.page-home .testimonial-quote {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 20px;
    font-style: italic;
}

.page-home .testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-home .testimonial-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--color-white);
    flex-shrink: 0;
}

.page-home .testimonial-author strong {
    display: block;
    font-size: 0.9rem;
}

.page-home .testimonial-author span {
    font-size: 0.75rem;
    opacity: 0.8;
}

.page-home .testimonial-video-bg {
    border-radius: var(--radius-lg);
    min-height: 380px;
    background-size: cover;
    background-position: center;
    background-color: var(--color-dark);
    background-image: url('../assets/images/testimonial-video-bg.jpg');
    overflow: hidden;
}

.page-home .testimonial-video-overlay {
    height: 100%;
    min-height: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10, 17, 40, 0.55);
    padding: 40px;
    text-align: center;
}

.page-home .section-tag-light {
    color: var(--color-primary-light);
}

.page-home .section-title-light {
    color: var(--color-white);
}

.page-home .play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid var(--color-white);
    background: transparent;
    color: var(--color-white);
    cursor: pointer;
    margin-top: 20px;
    transition: background var(--transition), transform var(--transition);
}

.page-home .play-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.08);
}

/* ==========================================================================
   EXPERIENCE
   ========================================================================== */
.page-home .experience-section {
    padding: 80px 0;
}

.page-home .experience-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.page-home .experience-content p {
    color: var(--color-text-muted);
    line-height: 1.8;
    margin-bottom: 28px;
}

.page-home .experience-image {
    border-radius: var(--radius-lg);
    min-height: 380px;
    background-size: cover;
    background-position: center;
    background-color: var(--color-bg-light);
    background-image: url('../assets/images/experience-image.jpg');
}

/* ==========================================================================
   PRICING PACKAGES
   ========================================================================== */
.page-home .pricing-section {
    padding: 80px 0;
    background: var(--color-bg-light);
}

.page-home .pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: start;
}

.page-home .pricing-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    text-align: center;
    box-shadow: var(--shadow);
    position: relative;
    transition: transform var(--transition), box-shadow var(--transition);
}

.page-home .pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.page-home .pricing-card-featured {
    background: var(--color-primary);
    color: var(--color-white);
    transform: scale(1.04);
}

.page-home .pricing-card-featured:hover {
    transform: scale(1.04) translateY(-4px);
}

.page-home .pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-dark);
    color: var(--color-white);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.page-home .pricing-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.page-home .pricing-price {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 24px;
    line-height: 1;
}

.page-home .pricing-price .currency {
    font-size: 1.2rem;
    vertical-align: super;
}

.page-home .pricing-price .period {
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.7;
}

.page-home .pricing-features {
    text-align: left;
    margin-bottom: 28px;
}

.page-home .pricing-features li {
    position: relative;
    padding: 8px 0 8px 28px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.page-home .pricing-card-featured .pricing-features li {
    border-bottom-color: rgba(255, 255, 255, 0.15);
}

.page-home .pricing-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    font-weight: 700;
}

.page-home .pricing-card-featured .pricing-features li::before {
    color: var(--color-white);
}

.page-home .pricing-card:not(.pricing-card-featured) .pricing-features li::before {
    color: var(--color-primary);
}

/* ==========================================================================
   CTA BANNER
   ========================================================================== */
.page-home .cta-section {
    position: relative;
    padding: 100px 0;
    background: var(--color-dark) url('../assets/images/cta-section.jpg') center / cover no-repeat;
    background-attachment: fixed;
    text-align: center;
}

.page-home .cta-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 17, 40, 0.7);
}

.page-home .cta-content {
    position: relative;
    z-index: 1;
}

.page-home .cta-content h2 {
    color: var(--color-white);
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 700;
    max-width: 700px;
    margin: 0 auto 28px;
    line-height: 1.4;
}

/* ==========================================================================
   LATEST BLOG
   ========================================================================== */
.page-home .blog-section {
    padding: 80px 0;
}

.page-home .blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.page-home .blog-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-white);
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
}

.page-home .blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.page-home .blog-img {
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: var(--color-bg-light);
}

.page-home .blog-card:nth-child(1) .blog-img {
    background-image: url('../assets/images/blog-img01.jpg');
}

.page-home .blog-card-2 .blog-img,
.page-home .blog-card:nth-child(2) .blog-img {
    background-image: url('../assets/images/blog-img02.jpg');
}

.page-home .blog-card-3 .blog-img,
.page-home .blog-card:nth-child(3) .blog-img {
    background-image: url('../assets/images/blog-img03.jpg');
}

.page-home .blog-body {
    padding: 20px 24px 24px;
}

.page-home .blog-meta {
    display: flex;
    gap: 16px;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}

.page-home .blog-body h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 10px;
    line-height: 1.4;
}

.page-home .blog-body p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 14px;
}

.page-home .blog-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    transition: color var(--transition);
}

.page-home .blog-link:hover {
    color: var(--color-primary-dark);
}

/* ==========================================================================
   NEWSLETTER (homepage standalone section)
   ========================================================================== */
.page-home .newsletter-section {
    padding: 60px 0;
    background: var(--color-bg-light);
    text-align: center;
}

.page-home .newsletter-inner h2 {
    font-size: 1.6rem;
    color: var(--color-dark);
    margin-bottom: 8px;
}

.page-home .newsletter-inner p {
    color: var(--color-text-muted);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.page-home .newsletter-form-wide {
    max-width: 520px;
    margin: 0 auto;
}

.page-home .newsletter-form-wide .newsletter-input-group input[type="email"] {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-right: none;
}

.page-home .newsletter-form-wide .newsletter-input-group input[type="email"]::placeholder {
    color: var(--color-text-muted);
}

/* ==========================================================================
   RESPONSIVE — Homepage
   ========================================================================== */
@media (max-width: 1024px) {
    .page-home .services-grid,
    .page-home .pricing-grid,
    .page-home .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-home .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-home .about-grid,
    .page-home .experience-grid,
    .page-home .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .page-home .testimonial-card-offset {
        position: relative;
        top: 0;
        left: 0;
        margin-top: -20px;
        margin-left: 40px;
    }
}

@media (max-width: 768px) {
    .page-home .hero {
        min-height: 80vh;
        padding-bottom: 100px;
    }

    .page-home .search-widget {
        flex-direction: column;
        align-items: stretch;
    }

    .page-home .btn-search {
        width: 100%;
    }

    .page-home .categories-list {
        gap: 24px;
    }

    .page-home .category-icon {
        width: 72px;
        height: 72px;
    }

    .page-home .about-images {
        height: 300px;
    }

    .page-home .feature-list {
        grid-template-columns: 1fr;
    }

    .page-home .services-grid,
    .page-home .pricing-grid,
    .page-home .blog-grid {
        grid-template-columns: 1fr;
    }

    .page-home .pricing-card-featured {
        transform: none;
    }

    .page-home .section-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-home .cta-section {
        background-attachment: scroll;
    }
}

@media (max-width: 480px) {
    .page-home .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .page-home .hero-actions {
        flex-direction: column;
    }

    .page-home .hero-actions .btn {
        width: 100%;
    }
}
