/**
 * Morehouse Property Listings - Gallery Stylesheet
 */

/* =================================
   Single Property Styles
================================= */
.mh-property-single {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.mh-property-back {
    margin-bottom: 1.5rem;
}

.mh-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--mh-text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color var(--mh-transition);
}

.mh-back-link:hover {
    color: var(--mh-primary);
}

/* Property Header */
.mh-property-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.mh-property-title-group {
    flex: 1;
    min-width: 280px;
}

.mh-property-ref {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--mh-bg-alt);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--mh-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.mh-property-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--mh-text);
}

.mh-property-address {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--mh-text-muted);
    margin: 0;
}

.mh-property-price-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.mh-price {
    text-align: right;
}

.mh-price-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mh-text-muted);
    margin-bottom: 0.25rem;
}

.mh-price-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.mh-price-sale .mh-price-value {
    color: var(--mh-primary);
}

.mh-price-rent .mh-price-value {
    color: var(--mh-success);
}

/* =================================
   Gallery
================================= */
.mh-gallery {
    margin-bottom: 2rem;
    background: var(--mh-bg);
    border-radius: var(--mh-radius);
    overflow: hidden;
    box-shadow: var(--mh-shadow);
}

.mh-gallery-main {
    position: relative;
    background: #000;
}

.mh-gallery-viewport {
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mh-gallery-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: zoom-in;
}

.mh-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--mh-transition);
    z-index: 10;
}

.mh-gallery-nav:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
}

.mh-gallery-prev {
    left: 1rem;
}

.mh-gallery-next {
    right: 1rem;
}

.mh-gallery-fullscreen {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: var(--mh-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all var(--mh-transition);
}

.mh-gallery-fullscreen:hover {
    background: #fff;
}

.mh-gallery-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

/* Thumbnails */
.mh-gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    background: var(--mh-bg-alt);
}

.mh-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: var(--mh-radius-sm);
    overflow: hidden;
    cursor: pointer;
    opacity: 0.7;
    transition: all var(--mh-transition);
    background: none;
}

.mh-thumb:hover {
    opacity: 1;
}

.mh-thumb.active {
    border-color: var(--mh-primary);
    opacity: 1;
}

.mh-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =================================
   Lightbox
================================= */
.mh-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.mh-lightbox.open {
    display: flex;
}

.mh-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: background var(--mh-transition);
    z-index: 10;
}

.mh-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mh-lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.mh-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--mh-transition);
}

.mh-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mh-lightbox-prev {
    left: 1rem;
}

.mh-lightbox-next {
    right: 1rem;
}

/* =================================
   Property Details
================================= */
.mh-property-details {
    display: grid;
    gap: 2rem;
}

.mh-property-section {
    background: var(--mh-bg);
    border-radius: var(--mh-radius);
    padding: 1.5rem;
    box-shadow: var(--mh-shadow);
}

.mh-property-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--mh-border);
}

/* Key Features */
.mh-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
}

.mh-feature {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.mh-feature svg {
    flex-shrink: 0;
    color: var(--mh-primary);
}

.mh-feature-content {
    display: flex;
    flex-direction: column;
}

.mh-feature-label {
    font-size: 0.75rem;
    color: var(--mh-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mh-feature-value {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Location */
.mh-location p {
    margin: 0;
    font-size: 1.05rem;
}

/* Amenities */
.mh-amenities-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.mh-amenity-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.mh-amenity-item svg {
    color: var(--mh-success);
    flex-shrink: 0;
}

/* =================================
   Responsive
================================= */
@media (max-width: 768px) {
    .mh-property-header {
        flex-direction: column;
    }

    .mh-property-price-group {
        align-items: flex-start;
    }

    .mh-price {
        text-align: left;
    }

    .mh-gallery-nav {
        width: 40px;
        height: 40px;
    }

    .mh-gallery-prev {
        left: 0.5rem;
    }

    .mh-gallery-next {
        right: 0.5rem;
    }

    .mh-thumb {
        width: 60px;
        height: 45px;
    }

    .mh-features-grid,
    .mh-amenities-list {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .mh-property-title {
        font-size: 1.5rem;
    }

    .mh-features-grid {
        grid-template-columns: 1fr;
    }
}

/* =================================
   Page Wrappers for Clean URLs
================================= */
.mh-property-page-wrapper,
.mh-listings-page-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.mh-listings-page-wrapper {
    padding-top: 1rem;
}

/* Touch-friendly gallery enhancements */
.mh-gallery-viewport {
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}

.mh-gallery-image {
    pointer-events: auto;
    transition: opacity 0.15s ease;
}

.mh-gallery-image.loading {
    opacity: 0.5;
}

/* Gallery swipe indicators (mobile) */
.mh-gallery-swipe-hint {
    display: none;
    position: absolute;
    bottom: 3.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    animation: mh-fade-out 3s forwards;
    animation-delay: 2s;
}

@keyframes mh-fade-out {
    from { opacity: 1; }
    to { opacity: 0; visibility: hidden; }
}

@media (max-width: 768px) {
    .mh-gallery-swipe-hint {
        display: block;
    }

    .mh-gallery-nav {
        opacity: 0.6;
    }
}

/* Lightbox touch support */
.mh-lightbox {
    touch-action: none;
}

.mh-lightbox-image {
    touch-action: pan-y pinch-zoom;
}
