/* Heritage Property Map Styles - Updated Layout */

/* Main container */
#heritage-property-map {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #333;
    display: flex;
    flex-direction: column;
}

/* Map container - takes full width */
.map-container {
    width: 100%;
    margin-bottom: 0;
}

#map.acf-map {
    width: 100%;
    height: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e1e1;
}

/* Search container - below map with teal background */
.search-container {
    width: 100%;
    background-color: #007681;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.map-search {
    position: relative;
    width: 100%;
}

.map-search input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.map-search input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5), 0 2px 5px rgba(0, 0, 0, 0.1);
}

.map-search::before {
    content: "🔍";
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #777;
}

/* Property list container - always visible now */
.property-list-container {
    width: 100%;
    margin-top: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e1e1;
    background-color: white;
    display: block; /* Ensure it's always visible */
    max-height: 500px; /* Set max height for scrollable container */
    overflow: hidden; /* Hide overflow on main container */
}

/* Property list - make this the scrollable element */
#property-list {
    max-height: 450px; /* Slightly less than container to account for header */
    overflow-y: auto;
    padding: 0;
}

/* Results header - UPDATED for sticky behavior */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #007681;
    color: white;
    border-radius: 8px 8px 0 0;
    /* Make it sticky */
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.results-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

/* Remove close button since it's no longer in the PHP */
.close-button {
    display: none;
}

/* Custom scrollbar */
#property-list::-webkit-scrollbar {
    width: 8px;
}

#property-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#property-list::-webkit-scrollbar-thumb {
    background: #007681;
    border-radius: 4px;
}

#property-list::-webkit-scrollbar-thumb:hover {
    background: #005a61;
}

.property {
    margin: 0;
    border-bottom: 1px solid #e1e1e1;
    transition: all 0.3s;
}

.property:last-child {
    border-bottom: none;
}

.property:hover {
    background-color: #f5f9fa;
}

.hide-property {
    display: none;
}

/* Highlighted property style */
.property.highlighted-property {
    background-color: #f0f8ff;
    border-left: 3px solid #007681;
}

.accordion-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
}

.accordion-title .title {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    flex: 1;
    position: relative;
    padding-left: 0;
    transition: all 0.2s;
}

.accordion-title .title a {
    color: #007681;
    text-decoration: none;
    font-weight: 500;
}

.accordion-title .title a:hover {
    color: #005a61;
    text-decoration: underline;
}

.accordion-title .property-actions {
    margin-left: 15px;
    display: flex;
    gap: 10px;
}

.accordion-title .property-actions a {
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s;
}

.accordion-title .property-actions a.details-link {
    color: #555;
    border: 1px solid #ddd;
    background: #f9f9f9;
}

.accordion-title .property-actions a.details-link:hover {
    background: #eee;
    color: #333;
}

.accordion-title .property-actions a.map-link {
    background: #007681;
    color: white;
}

.accordion-title .property-actions a.map-link:hover {
    background: #005a61;
}

/* Improved accordion content styling */
.accordion-content {
    display: none;
    padding: 20px;
    border-top: 1px solid #eee;
    background-color: #f9f9f9;
    border-radius: 0 0 8px 8px;
}

/* Property details styling - enhanced */
.property-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    background-color: white;
    border-radius: 6px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.property-details .meta-field {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.property-details .meta-field:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.property-details .meta-label {
    font-weight: 600;
    color: #007681;
    margin-bottom: 8px;
    font-size: 15px;
}

.property-details .meta-value {
    font-weight: normal;
    color: #333;
    line-height: 1.5;
    word-break: break-word;
}

/* Description field specific styling */
.property-details .description {
    margin-top: 0;
    padding-top: 0;
}

.property-details .description-content {
    font-weight: normal !important;
    line-height: 1.6;
}

.property-details .description-content p {
    margin-bottom: 0.8em;
    font-weight: normal;
}

.property-details .description-content p:last-child {
    margin-bottom: 0;
}

.property-details .description-content strong,
.property-details .description-content b {
    font-weight: 600;
}

/* Fix spacing in accordion */
.property:last-child .accordion-content {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Info window styling */
.map-info-window {
    min-width: 250px;
    padding: 8px 12px;
    cursor: pointer;
}

.map-info-window:hover {
    background-color: #f9f9f9;
}

.map-info-window h4 {
    color: #007681;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.map-info-window p {
    margin: 7px 0;
    font-size: 13px;
    line-height: 1.4;
}

/* Featured Image in Info Window */
.info-window-featured-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.featured-image-container {
    margin-bottom: 12px;
}

/* Property featured image in details */
.property-featured-image {
    max-width: 100%;
    height: auto;
    margin-bottom: 15px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Responsive styles */
@media screen and (max-width: 768px) {
    #heritage-property-map {
        padding: 0 15px;
    }
    
    .accordion-title {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .accordion-title .property-actions {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }
    
    .accordion-title .property-actions a {
        display: block;
        text-align: center;
    }
}

.gm-style .gm-style-iw-c {max-width:400px!important;max-height:400px;overflow-x:hidden!important;}