/* Global styles - Scoped to work-listings-wrapper if possible, but keeping global for now as per react app */
:root {
    --black: #000000;
    --white: #ffffff;
    --gray: #999999;
    --dark-gray: #545A5B;
    --light-gray: #dee2e4;
    --blueish-gray: #e2e8f0;
    --border-color: #545a5b80;
    --yelow-bg: #F2EFDC;
    --orange: #EB5642;
    --dark-red: #A11E21;
    --desaturated-red: #aa7778af;
    --studio: #608767;
    --modern: #6398B4;
    --classic: #536F84;
    --student: #D05932;
    --aqua_blue: #8CD2D2;

    /* Reverse Button Style */
    --reverse-btn-bg: var(--dark-red);
    --reverse-btn-text: var(--white);
    --reverse-btn-hover-bg: var(--white);
    --reverse-btn-hover-text: var(--orange);

    --font-Regular: 'Harmonia Sans Pro Cyr', sans-serif;
    --font-Semi_bold: 'Harmonia Sans Pro Cyr Semi Bd', sans-serif;
    --font-bold: 'Harmonia Sans Pro Cyr', sans-serif;
    --font-italic: 'Editorial New', serifbox;
    --light-yellow: #f8f6ed;
    --heading-lg: 72px;
    --heading-xl: 64px;
    --heading-md: 48px;
    --heading-sm: 32px;
    --heading-xs: 24px;
    --text-content: 20px;
    --view-details-color: #6398B4;
}

/* Ensure border-box sizing for all elements in this component to prevent layout overflow */
#work-listings-container *,
#work-listings-container *::before,
#work-listings-container *::after {
    box-sizing: border-box;
}

/* Modals */
#work-listings-container.wrapper {
    width: 100%;
    max-width: 1200px;
    /* Keep max width to match design intent */
    margin: 0 auto;
}

.work-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.work-modal-overlay.active {
    display: flex;
}

.work-modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    background-color: #fff;
    padding: 20px;
    overflow: auto;
    border-radius: 8px;
    box-sizing: border-box;
}

.work-description-modal .work-modal-content {
    max-width: 800px;
}

.work-calendly-modal .work-modal-content {
    max-width: 1000px;
    padding: 20px;
    overflow: hidden;
    /* Let widget handle scroll or fit */
    background: #fff;
    /* Ensure background is white since we have padding now */
    height: auto;
    width: auto;
    display: inline-block;
    /* Shrink to fit if needed */
}

.work-listing-detail-modal-content {
    max-width: 1000px;
    padding: 0;
    /* Padding handled inside */
}

/* Close Button */
.work-modal-close-button,
.work-listing-detail__close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #fff;
    /* Ensure visibility */
    border: none;
    font-size: 28px;
    /* Larger touch target */
    cursor: pointer;
    color: #000;
    font-weight: bold;
    z-index: 100;
    /* High z-index */
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    /* Shadow for contrast */
}

@media (max-width: 768px) {

    /* Fixed position for close button on mobile to ensure it's always visible */
    .work-modal-close-button,
    .work-listing-detail__close {
        position: fixed;
        top: 20px;
        right: 20px;
        background: #fff;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
}

.work-modal-content h2 {
    margin-top: 0;
}

/* Filter Component Styles */
.work-filters-container {
    background: #fff;
    padding: 16px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    margin-bottom: 30px;
}

.work-filters-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.work-filter-group {
    flex: 1;
    min-width: 150px;
    display: flex;
    flex-direction: column;
}

.work-filter-group.search-group {
    min-width: 200px;
    flex: 1.5;
}

.work-filter-group.action-group {
    flex: 0 0 auto;
    min-width: auto;
}

.work-filter-input,
.work-filter-select {
    height: 40px;
    padding: 0 16px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 16px;
    font-family: var(--font-Regular);
    background-color: #fff;
    width: 100%;
}

.work-filter-input::placeholder {
    color: #a0aec0;
}

.work-filter-clear-btn {
    height: 40px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    color: #4a5568;
}

.work-filter-clear-btn:hover {
    background-color: #f7fafc;
}

/* Listings Grid */
.work-listings-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    /* Mobile default */
    gap: 16px;
}

@media (min-width: 1200px) {
    .work-listings-grid {
        grid-template-columns: repeat(2, 1fr);
        /* Desktop 2 columns */
        gap: 32px;
    }
}

/* Listing Card */
.work-listing-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease-in-out;
    aspect-ratio: 1 / 1;
}

.work-listing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.work-listing-card-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Image Area — top 2/3 of card */
.work-listing-image-container {
    flex: 0 0 66.67%;
    position: relative;
    overflow: hidden;
    background: #f0f0f0;
}

.work-card-img-slider {
    width: 100%;
    height: 100%;
}

.work-card-slide-img {
    width: 100%;
    height: 100%;
    display: none;
    /* Changed for simple JS management */
}

.work-card-slide-img.active {
    display: block;
}

.work-card-slide-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #f0f0f0;
}

.work-card-slide-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 10;
    color: white;
    border-radius: 50%;
    transition: background 0.3s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.work-card-slide-arrow:hover {
    background: rgba(0, 0, 0, 0.5);
}

.prev-arrow {
    left: 10px;
}

.next-arrow {
    right: 10px;
}

/* Info overlay — price/sqft chips + View Details button at bottom of photo */
.work-card-info-overlay {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    z-index: 5;
}

.work-info-chip {
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    pointer-events: none;
}

/* Unit name chip — top-left corner, independent of bottom overlay */
.work-info-chip--name {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 16px;
    z-index: 5;
}

/* View Details button — lives inside the overlay row, pushed to the right */
.work-view-details-button {
    margin-left: auto;
    flex-shrink: 0;
    background: #000;
    color: #fff;
    border: none;
    padding: 5px 13px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background 0.2s ease;
}

.work-view-details-button:hover {
    background: #333;
    color: #fff;
}

/* Feature chips row in details section */
.work-listing-details .work-space-use-chips-container {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    gap: 5px;
    align-items: center;
}

.work-listing-details .work-space-use-chip {
    background-color: #e2e8f0;
    color: #4a5568;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

/* Details Area — bottom 1/3 of card */
.work-listing-details {
    flex: 0 0 33.33%;
    display: flex;
    flex-direction: column;
    padding: 16px 16px 12px 16px;
    gap: 10px;
    box-sizing: border-box;
    overflow: hidden;
}

.work-listing-body-text {
    font-size: 15px;
    line-height: 1.45;
    color: #4a5568;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.work-listing-body-text--highlight {
    font-size: 18px;
    font-weight: 700;
    color: #1a202c;
    -webkit-line-clamp: 2;
}

/* Action buttons — right-aligned at bottom of card */
.work-action-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: auto;
    flex-wrap: wrap;
}

.btn-work {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.5;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
}

.btn-inquire {
    background-color: #1a202c;
    color: white;
}

.btn-inquire:hover {
    background-color: #4a5568;
    color: white;
}

.btn-outline-grey {
    background-color: transparent;
    border: 1px solid #cbd5e0;
    color: #4a5568;
}

.btn-outline-grey:hover {
    background-color: #edf2f7;
    color: #1a202c;
}

.btn-hourly {
    background-color: var(--modern, #6398B4);
    color: #fff;
    border-color: transparent;
}

.btn-hourly:hover {
    background-color: #4a7a95;
    color: #fff;
}

/* Listing Detail Modal Specifics */
.work-listing-detail__header {
    background-color: #dee2e4;
    /* light-gray from work.css */
    padding: 15px 20px 15px 20px;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
    color: #545A5B;
    /* dark-gray */
}

.work-listing-detail__title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #000;
}

.work-listing-detail__info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 10px;
    padding-top: 10px;
    flex-wrap: wrap;
    gap: 20px;
}

.work-listing-detail__left-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.work-listing-detail__right-column {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding-right: 20px;
    max-width: 40%;
}

.work-listing-detail__price {
    font-size: 22px;
    font-weight: 700;
    color: #1a202c;
}

.work-listing-detail__hourly-price {
    font-size: 16px;
    font-weight: 600;
    color: var(--modern, #6398B4);
    margin-top: 2px;
}

.work-listing-detail__features dd {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 16px;
}

/* Image Container - Aspect Ratio Fix */
.work-listing-detail__image-container {
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
    position: relative;
    background: transparent;
    overflow: hidden;
    width: 100%;
}

.work-listing-detail__slide {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.work-listing-detail__slide.active {
    display: block;
}

.work-listing-detail__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #f0f0f0;
}

/* Gallery Band */
.work-listing-detail__gallery-band {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 10px 20px;
    background-color: #f0f0f0;
    /* Hide scrollbar for cleaner look */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.work-listing-detail__gallery-band::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.work-listing-detail__gallery-thumb {
    flex: 0 0 80px;
    height: 60px;
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    opacity: 0.6;
    transition: opacity 0.2s, border-color 0.2s;
}

.work-listing-detail__gallery-thumb:hover {
    opacity: 1;
}

.work-listing-detail__gallery-thumb.active {
    opacity: 1;
    border-color: #6398B4; /* Modern blueish color from work.css */
}

.work-listing-detail__gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Amenities Section - Grid Fix */
.work-listing-detail__amenities {
    padding: 20px;
    padding-top: 20px;
    padding-bottom: 10px;
    background-color: #F2EFDC;
    /* yelow-bg / tan */
}

.work-listing-detail__amenities h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-left: 10px;
}

.work-listing-detail__amenities-list {
    list-style-type: none;
    padding-left: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 3.75px;
    background-color: #F2EFDC;
    /* tan/yellow */
}

.work-listing-detail__amenity-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    break-inside: avoid-column;
    font-size: 14px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.5);
    /* Semi-transparent bg for items */
    border-radius: 4px;
    /* Slight radius */
}

.amenity-icon-detail {
    margin-right: 12px;
    font-size: 1.2em;
    width: 24px;
    text-align: center;
    color: #6398B4;
    /* Modern blueish color from work.css */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Chips in Header */
.detail-space-use-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 100%;
    justify-content: flex-end;
}

.detail-space-use-chip {
    background-color: #999999;
    /* var(--gray) */
    color: #ffffff;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Description */
.work-listing-detail__description {
    margin: 20px;
    font-size: 16px;
    line-height: 1.6;
}

/* Reinstated: Layout for buttons container within ListingDetail */
.work-listing-detail__buttons {
    margin-top: 5%;
    /* Restore top margin */
}

/* The ul inside the container */
.work-listing-detail__buttons ul {
    display: flex;
    flex-direction: row;
    /* Ensure horizontal layout */
    justify-content: flex-end;
    /* Align to the right as before */
    gap: 10px;
    /* Spacing between buttons */
    list-style: none;
    /* Remove default list styling */
    padding: 0;
    /* Remove default list padding */
    margin: 0;
    /* Remove default list margin */
    width: 100%;
    /* Ensure it takes available width */
}

/* Styling for list items within the button container */
.work-listing-detail__buttons li {
    flex-grow: 0;
    /* Prevent items from growing */
    flex-shrink: 0;
    /* Prevent items from shrinking */
}

/* Open in New Tab button — pushed to the far left */
.work-listing-detail__open-tab-li {
    margin-right: auto;
}

.work-listing-detail__open-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Responsive */
@media (max-width: 768px) {
    .work-listing-card {
        aspect-ratio: unset;
        min-height: 420px;
    }

    .work-listing-card-content {
        height: 100%;
        min-height: 420px;
    }

    .work-listing-image-container {
        flex: 0 0 280px;
        width: 100%;
    }

    .work-listing-details {
        flex: 1 1 auto;
    }

    /* Mobile overlay: chips on top row (centered), View Details on its own row (centered) */
    .work-card-info-overlay {
        flex-wrap: wrap;
        justify-content: center;
        bottom: 20px;
        gap: 5px;
    }

    .work-card-info-overlay .work-info-chip {
        flex-shrink: 0;
    }

    .work-view-details-button {
        width: 100%;
        margin-left: 0;
        text-align: center;
        justify-content: center;
    }

    .work-filters-grid {
        flex-direction: column;
        align-items: stretch;
    }

    .work-filter-group,
    .work-filter-group.search-group {
        width: 100%;
        min-width: 0;
    }
}

/* === Serious findings — 2026-08-18 ==================================
   Contrast only; the brand palette is unchanged. ==================== */

/* S-06 — white on #6398B4 was 3.14:1, white on #999999 was 2.85:1 */
.btn-hourly              { background: #507b92; }
.detail-space-use-chip   { background: #6b6b6b; }
.work-listing-detail__hourly-price,
.amenity-icon-detail     { color: #507b92; }
.work-filter-input::placeholder { color: #637895; opacity: 1; }
.work-info-chip          { background: rgba(0, 0, 0, 0.62); }
.work-card-slide-arrow   { background: rgba(0, 0, 0, 0.55); }

/* S-09 — gallery thumbnails are now <button>; keep the visual identical. */
button.work-listing-detail__gallery-thumb {
    border: 0;
    padding: 0;
    background: none;
    font: inherit;
    cursor: pointer;
}

/* M-14 — the card name is now an <h3> so the results grid has a heading
   structure and each card has an accessible name. These reset the UA
   heading styles so the chip renders exactly as the old <span> did. */
h3.work-info-chip--name {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
}
