/* ========================================
   PAGE CUSTOM BLOCK - SIGNATURE THEME
   Read more/collapse functionality

   Aligned with signature theme spacing:
   - Desktop: 240px horizontal padding (like package-section)
   - Tablet: 40px horizontal padding
   - Mobile: 16px horizontal padding
   ======================================== */

/* Fix: Override .main-wrapper fixed width from legacy layout_v1.3.css */
/* Using :has() for modern browsers */
.main-wrapper:has(.block-content-full.page-location) {
    width: 100% !important;
}

/* Fallback: Also target common wrapper patterns for older browsers */
.main-wrapper.html,
.main-wrapper.package_camera,
.main-wrapper.package_combo_camera {
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
}

/* Page location specific - aligned with package-section padding */
.block-content-full.page-location {
    margin-top: 80px;
    margin-bottom: 60px;
    margin-left: 240px;
    margin-right: 240px;
}

@media screen and (max-width: 1439px) {
    .block-content-full.page-location {
        margin-left: 40px;
        margin-right: 40px;
    }
}

@media screen and (max-width: 767px) {
    .block-content-full.page-location {
        margin-top: 40px;
        margin-left: 16px;
        margin-right: 16px;
    }
}

/* Main content block */
.block-content-full {
    padding: 32px;
    position: relative;
    box-shadow: 0px 4px 6px -2px rgba(16, 24, 40, 0.03),
                0px 0px 16px -4px rgba(16, 24, 40, 0.08);
    margin-bottom: 60px;
    border-radius: 12px;
    background: #ffffff;
    /* Override any fixed height from legacy CSS */
    height: auto !important;
    overflow: visible !important;
}

/* Box content body wrapper */
.block-content-full .box-content-body {
    position: relative;
    transition: max-height 0.5s ease-in-out;
}

/* Collapsed state - giới hạn chiều cao của content body */
.block-content-full.collapsed .box-content-body {
    max-height: 400px;
    overflow: hidden;
}

/* Gradient overlay khi collapsed - đè lên body */
.block-content-full.collapsed .box-content-body::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0) 40%,
        rgba(255, 255, 255, 0.5) 70%,
        #FFFFFF 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* Expanded state - không giới hạn body */
.block-content-full.expanded .box-content-body {
    max-height: none;
    overflow: visible;
}

/* Remove gradient when expanded */
.block-content-full.expanded .box-content-body::after {
    display: none;
}

/* Mobile adjustments */
@media screen and (max-width: 767px) {
    .block-content-full {
        padding: 24px;
    }

    .block-content-full.collapsed .box-content-body {
        max-height: 250px;
    }

    .block-content-full.collapsed .box-content-body::after {
        height: 150px;
    }
}

/* Content header */
.block-content-full .box-content-header {
    width: 100%;
    border-bottom: 1px solid #E7E7E7;
    padding-bottom: 32px;
    margin-bottom: 32px;
}

.block-content-full .box-content-header .title {
    color: #3D3D3D;
    font-weight: 600;
    font-size: 28px;
    line-height: 100%;
    text-align: left;
}

@media screen and (max-width: 767px) {
    .block-content-full .box-content-header .title {
        font-size: 20px;
    }

    .block-content-full .box-content-header {
        padding-bottom: 16px;
        margin-bottom: 16px;
    }
}

/* Content body */
.block-content-full .box-content-body {
    color: #3D3D3D;
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
}

.block-content-full .box-content-body img {
    max-width: 100%;
    border-radius: 8px;
}

/* Lists styling */
.block-content-full ul {
    list-style: none;
    padding-left: 0;
}

.block-content-full ul li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    position: relative;
    padding-left: 14px;
}

.block-content-full ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    background: #4CAF50;
    border-radius: 50%;
    flex-shrink: 0;
}

.block-content-full ol {
    padding-left: 20px;
}

.block-content-full ol li {
    list-style: decimal;
    list-style-position: outside;
    margin-bottom: 8px;
}

/* Nút "Xem thêm" - nằm đè lên gradient */
.block-content-full .read-more-btn {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    height: 48px;
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid #D1D1D1;
    background: #fff;
    font-size: 16px;
    font-weight: 510;
    line-height: 22px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10; /* Higher z-index to ensure clickability */
    display: none; /* Ẩn mặc định, JS sẽ hiện khi cần */
    pointer-events: auto !important; /* Ensure button is always clickable */
}

.block-content-full .read-more-btn:hover {
    background: #f5f5f5;
    border-color: #b0b0b0;
}

/* Khi collapsed - hiện nút */
.block-content-full.collapsed .read-more-btn {
    display: block;
    pointer-events: auto !important;
}

/* Khi expanded - nút ở vị trí bình thường */
.block-content-full.expanded .read-more-btn {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    display: block;
    margin: 32px auto 0;
    pointer-events: auto !important;
}

/* ========================================
   LEGACY CSS OVERRIDES
   Override conflicting styles from:
   - page-block.css (height: 488px, overflow: hidden)
   - layout_v1.3.css (fixed widths)
   ======================================== */

/* Override legacy fixed height and overflow */
.block-content-full.page-location,
.main-wrapper .block-content-full.page-location,
section.block-content-full.page-location {
    height: auto !important;
    overflow: visible !important;
    min-height: auto !important;
}

/* Override legacy .content-read-more button styles - we use .read-more-btn instead */
.block-content-full .content-read-more {
    display: none !important;
}

/* Ensure container has proper positioning context for button */
.block-content-full.page-location {
    position: relative !important;
}

/* Override any inline styles that might be set */
.block-content-full.page-location[style] {
    height: auto !important;
    overflow: visible !important;
}

/* Ensure collapsed state works correctly */
.block-content-full.page-location.collapsed {
    height: auto !important;
    overflow: visible !important;
    padding-bottom: 80px; /* Space for button */
}

/* Ensure expanded state works correctly */
.block-content-full.page-location.expanded {
    height: auto !important;
    overflow: visible !important;
    padding-bottom: 0;
}
