:root {
    --ah-light-gray: #f0f0f0;
    --ah-medium-gray: #e0e0e0;
    --ah-white: white;
    --ah-shadow: rgba(0, 0, 0, 0.2);
    --ah-shadow-hover: rgba(0, 0, 0, 0.3);
    --ah-text-dark: #333;
    --ah-text-light: #666;
    --ah-overlay-bg: rgba(255, 255, 255, 0.5);
    --ah-overlay-bg-hover: rgba(255, 255, 255, 0.8);
    --ah-border-gray: #ddd;
}

/* BEGIN Available Homes Grid */
.ah-home {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 15px;
}

.ah-home-details {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.ah-detail-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 16px;
    white-space: nowrap;
}

.ah-detail-item svg {
    width: 14px;
    height: 14px;
    fill: var(--ah-primary);
}

.ah-detail-item strong {
    white-space: nowrap;
}

.ah-homes-grid {
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    gap: 20px;
    max-width: 1300px;
}

.ah-homes-grid-item {
    height: 432px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    padding: 15px;
    border-radius: 4px;
    background: var(--ah-bg-color);
    width: 390px;
}
.ah-homes-grid-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 1;
}
.ah-home-link {
    text-decoration: none;
}
.ah-homes-grid-image {
    position: relative;
    width: 100%;
    overflow: hidden;
    height: 270px;
}

.ah-homes-grid-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ah-homes-grid-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 130px;
    width: 100%;
    padding: 15px 5px;
    background-color: var(--ah-white);
}

.ah-home-price {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--ah-text-dark);
}

.ah-home-subtitle {
    font-size: 1em;
    color: var(--ah-text-light);
}

.ah-home-link:hover .ah-home-price,
.ah-home-link:hover .ah-home-subtitle {
    color: inherit;
}
/* END Available Homes Grid */


/* BEGIN Available Home Single */

.ah-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 75%;
    overflow: hidden;
}

.ah-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ah-home-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.ah-gallery-item {
    width: 100%;
}

.ah-single-home {
    margin: 0 auto;
    padding: 20px;
}

.home-details {
    margin-bottom: 30px;
}

.ah-subtitle {
    font-size: 1.2em;
    color: var(--ah-primary);
    margin-top: -10px;
    margin-bottom: 10px;
    display: inline-block;
}

.ah-subtitle-bar {
    height: 2px;
    width: 50%;
    max-width: 100px;
    background-color: var(--ah-primary);
    margin-top: 20px;
    margin-bottom: 20px;
}

.ah-address, .ah-price, .ah-year-built {
    margin-bottom: 10px;
}

.ah-floorplan a,
.ah-video-tour a {
    display: inline-block;
    padding: 5px 15px;
    background-color: var(--ah-light-gray);
    border-radius: 4px;
    text-decoration: none;
    color: var(--ah-text-dark);
    transition: background-color 0.2s ease;
}

.ah-floorplan a:hover,
.ah-video-tour a:hover {
    background-color: var(--ah-medium-gray);
    text-decoration: none;
}

.ah-title-banner {
    background-color: var(--ah-primary);
    width: 100%;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    box-sizing: border-box;
}

.ah-title-banner h1 {
    color: var(--ah-white);
    padding: 0;
    max-width: 1200px;
    margin: 0 auto;
}

/* Two-column layout */
.ah-two-column-layout {
    display: flex;
    flex-wrap: wrap;
    margin-top: 20px;
    max-width: 1300px;
    margin: 0 auto;
}

.ah-main-column {
    flex: 2;
    min-width: 0;
    padding: 40px;
}

.ah-sidebar-column {
    flex: 1;
    min-width: 250px;
    padding: 40px;
}

.ah-property-details {
    margin: 0 0 30px;
    padding: 20px;
    background-color: var(--ah-bg-color);
    border-radius: 4px;
    border-left: 4px solid var(--ah-primary);
}

.ah-property-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
    gap: 20px;
}

.ah-property-detail-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ah-property-detail-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--ah-primary);
    border-radius: 50%;
    flex-shrink: 0;
}

.ah-property-detail-icon svg {
    width: 20px;
    height: 20px;
    fill: var(--ah-white);
}

.ah-property-detail-content {
    display: flex;
    flex-direction: column;
}

.ah-property-detail-label {
    font-size: 14px;
    color: var(--ah-text-light);
    margin-bottom: 4px;
}

.ah-property-detail-value {
    font-size: 16px;
    font-weight: bold;
    color: var(--ah-text-dark);
}

.ah-action-buttons {
    border: 1px solid var(--ah-border-gray);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ah-button {
    display: inline-block;
    background-color: var(--ah-primary);
    color: var(--ah-white);
    padding: 10px 15px;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.3s, box-shadow 0.3s ease;
    box-shadow: 0 2px 4px var(--ah-shadow);
}

.ah-button:hover {
    background: var(--ah-secondary);
    transform: translateY(-2px);
}

/* Contact Section Styles */
.ah-contact-section {
    margin-top: 30px;
    padding: 20px;
    background-color: var(--ah-light-gray);
    border-radius: 4px;
}

.ah-contact-heading {
    font-size: 1.2em;
    color: var(--ah-text-dark);
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--ah-primary);
}

.ah-contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.ah-contact-item:last-child {
    margin-bottom: 0;
}

.ah-contact-label {
    font-weight: bold;
    color: var(--ah-text-dark);
    min-width: 60px;
    margin-right: 10px;
}

.ah-contact-value {
    color: var(--ah-text-light);
}
/* END Available Home Single */  

/* Responsive adjustments */
@media (max-width: 1024px) {
    .ah-homes-grid {
        grid-template-columns: repeat(2, 1fr);
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .ah-homes-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0px;
        justify-content: center;
    }
    
    .ah-home-details {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 5px;
    }
    
    .ah-detail-item {
        flex: 0 0 auto;
    }
    
    .ah-title-banner h1 {
        margin: 10px auto;
        font-size: 30px;
    }
    
    .ah-main-column {
        min-width: unset;
        padding: 0px;
    }
    .ah-home-link {
        padding: 0;
    }
    .ah-homes-grid-item {
        margin-bottom: 30px;
    }
    .ah-sidebar-column {
        padding: 0px;
    }
    .ah-slider-dots {
        display: none !important;
    }
}

/* Image Slider */
.ah-image-slider-container {
    position: relative;
    width: 100%;
    margin-bottom: 30px;
    overflow: hidden;
}

.ah-image-slider {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* Maintain aspect ratio */
}

.ah-slider-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
}

.ah-slider-slide.active {
    opacity: 1;
    z-index: 2;
}

.ah-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: var(--ah-primary);
    color: var(--ah-white);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    transition: background-color 0.3s;
}

.ah-slider-nav:hover {
    background-color: var(--ah-secondary);
    opacity: .8;
}

.ah-slider-prev {
    left: 10px;
}

.ah-slider-next {
    right: 10px;
}

.ah-slider-dots {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 3;
}

.ah-slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--ah-overlay-bg);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.3s;
}

.ah-slider-dot.active {
    background-color: var(--ah-white);
}

.ah-slider-dot:hover {
    background-color: var(--ah-overlay-bg-hover);
}

.ah-slider-details-overlay {
    position: relative;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--ah-primary);
    opacity: 0.9;
    padding: 10px 15px;
    z-index: 3;
}

.ah-slider-details-overlay .ah-home-details {
    justify-content: center;
    color: var(--ah-white);
}

.ah-slider-details-overlay .ah-detail-item {
    color: var(--ah-white);
}

.ah-slider-details-overlay .ah-detail-item svg {
    fill: var(--ah-white);
}

.ah-detail-separator {
    display: inline-block;
    width: 1px;
    height: 20px;
    background-color: var(--ah-white);
    margin: 0 10px;
}

.ah-sidebar-content {
    background-color: var(--ah-bg-color);
    border-radius: 4px;
    padding: 20px;
}

.ah-sidebar-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--ah-primary);
    text-transform: uppercase;
    margin-bottom: 20px;
}

.ah-divider {
    border: none;
    border-top: 2px solid var(--ah-primary);
    margin: 66px auto;
    width: 80%;
}

/* Gravity Forms */
.ah-sidebar-content .gform_fields {
    row-gap: 20px !important;
}

.ah-sidebar-content .gform_button.button {
    width: 100% !important;
    font-size: var(--wp--preset--font-size--base) !important;
    text-transform: uppercase !important;
    --gf-local-bg-color: var(--ah-primary) !important;
    border-radius: 4px !important;
    padding: 10px 15px !important;
    font-weight: bold !important;
}

.ah-sidebar-content .gform_button.button:hover {
    background-color: var(--ah-secondary) !important;
    box-shadow: 0 4px 8px var(--ah-shadow-hover) !important;
}

/* Block Theme Adjustments */
.wp-block-group .ah-homes-grid p {
    display: none;
}

.ah-status-ribbon {
    color: #fff;
    display: block;
    font-size: 16px;
    font-weight: 700;
    height: 26px;
    line-height: 22px;
    opacity: 1;
    padding-bottom: 1px;
    padding-left: 0;
    padding-right: 0;
    padding-top: 2px;
    position: absolute;
    right: -22px;
    top: 37px;
    text-align: center;
    width: 250px;
    transform: matrix(0.866025, 0.7, -0.7, 0.866025, 32.9449, 10.9378);
    z-index: 10;
}

/* Home List Button */
.ah-home-list-button-container {
    text-align: center;
    margin: 30px 0;
}

.ah-home-list-button {
    display: inline-block;
    background: var(--ah-primary);
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    transition: background-color 0.3s ease;
}

.ah-home-list-button:hover {
    background: var(--ah-secondary);
    color: white;
}
