/* Homepage Specific Styles - Chestertons Marbella */

/* Hero Search Properties Button */
.btn-search-properties .wp-block-button__link {
    font-size: 15px !important;
    font-weight: 600 !important;
    padding: 12px 20px !important;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .btn-search-properties .wp-block-button__link {
        font-size: 12px !important;
        padding: 8px 14px !important;
    }
}

/* Hero Section */

.home-hero-slider,
.home-hero-cover {
    height: 100vh !important;
}

.home-hero-slider .superblockslider__slide_inner {
    padding: 0 !important;
}

.home-hero-slider .superblockslider__buttons {
    gap: 12px;
    bottom: 12%;
}


.home-hero-slider .superblockslider__button {
    opacity: 1 !important;
    transition: all .6s cubic-bezier(0.46, 0.03, 0.52, 0.96) !important;
    border-radius: 50% !important;
    background: #fff !important;
    border: 2px solid var(--chestertons-white) !important;
    display: inline-block;
    padding: 0 !important;
    width: 12px !important;
    height: 12px !important;
    min-width: 12px !important;
}

.home-hero-slider .superblockslider__button svg {
    display: none !important;
    /* Hiding the Gutenberg SVG outline to use pure CSS dot */
}

.home-hero-slider .superblockslider__button--active {
    opacity: 1 !important;
    background: var(--chestertons-purple) !important;
    border-color: var(--chestertons-purple) !important;
    transform: scale(1.30) !important;
}

.home-hero-cover {
    position: relative;
    justify-content: center;
    display: flex;
    flex-direction: column;
    height: 100%;
}



/* Subtle Downward Arrow Cue */
.home-hero {
    position: relative;
}

.home-hero .downward-arrow-btn {
    position: absolute;
    bottom: 30px;
    left: 50%;
    width: 30px;
    height: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent !important;
    border: none !important;
    z-index: 100;
    cursor: pointer;
    animation: bounceDown 2s infinite;
    opacity: 0.8;
    padding: 0;
}

.home-hero .downward-arrow-btn a {
    background: transparent;
}

.home-hero .downward-arrow-btn:hover {
    opacity: 1;
}

@keyframes bounceDown {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0) translateX(-50%);
    }

    40% {
        transform: translateY(-10px) translateX(-50%);
    }

    60% {
        transform: translateY(-5px) translateX(-50%);
    }
}

.home-hero-cover::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    width: 100%;
    transition: 0.5s ease;
    background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.6));
}

/* Property Gallery (Complex Grid with Gutenberg Covers) */
.home-our-marbella-properties-gallery {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    grid-template-rows: repeat(2, 1fr);
    gap: 10px;
    width: 100% !important;
}

.home-our-marbella-properties-gallery-item {
    margin: 0 !important;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    height: 100%;
}

.home-our-marbella-properties-gallery-item:first-child {
    grid-column: span 2;
    grid-row: span 2;
}

.home-our-marbella-properties-gallery-item .wp-block-cover {
    height: 100% !important;
    min-height: 220px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 4px;
    /* Adds premium corner curves */
    overflow: hidden;
}

.home-our-marbella-properties-gallery-item:first-child .wp-block-cover {
    min-height: 450px !important;
    /* Fixed math: 220px + 220px + 10px gap */
}

/* Image zoom effect on hover */
.home-our-marbella-properties-gallery-item .wp-block-cover__image-background {
    transition: transform 0.4s ease;
}

.home-our-marbella-properties-gallery-item:hover .wp-block-cover__image-background {
    transform: scale(1.03);
}

/* Text alignment overlay */
.home-our-marbella-properties-gallery-item .wp-block-cover__inner-container {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 15px !important;
    /* Bottom spacing */
    box-sizing: border-box;
}

.home-our-marbella-properties-gallery-item p {
    margin: 0 !important;
    line-height: 1.2;
}

.home-our-marbella-properties-gallery-item .wp-block-cover__inner-container>.wp-block-group {
    align-items: flex-end;
    gap: 10px;
    width: 100%;
}

.home-our-marbella-properties-gallery-item .hero-properties-title-type {
    align-items: flex-start !important;
    width: 100%;
    gap: 10px;
}

.home-our-marbella-properties-gallery-item .wp-block-cover__inner-container>.wp-block-group .title,
.home-our-marbella-properties-gallery-item .wp-block-cover__inner-container>.wp-block-group .type {
    max-width: 100%;
    text-align: left;
    white-space: normal !important;
    line-height: 1.2 !important;
}

.home-our-marbella-properties-gallery-item .wp-block-cover__inner-container>.wp-block-group>p:last-child {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    text-align: right;
}

/* Fix nested flex layout for smaller property items universally */
.home-our-marbella-properties-gallery-item:not(:first-child) .wp-block-cover__inner-container>.wp-block-group {
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-end !important;
    gap: 5px !important;
}

/* Adjust font sizes for smaller blocks, overriding the default large fonts */
.home-our-marbella-properties-gallery-item:not(:first-child) .title {
    font-size: 16px !important;
}

.home-our-marbella-properties-gallery-item:not(:first-child) .type {
    font-size: 14px !important;
}

.home-our-marbella-properties-gallery-item:not(:first-child) .wp-block-cover__inner-container>.wp-block-group>p:last-child {
    text-align: left !important;
    font-size: 16px !important;
}

/* Area Guides Gallery Grid (2x2) */
.home-area-guides-gallery {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px;
    width: 100% !important;
}

.home-area-guides-gallery-item {
    margin: 0 !important;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.home-area-guides-gallery-item .wp-block-cover {
    height: 100% !important;
    min-height: 250px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 4px;
}

/* Base Hover Effects */
.home-area-guides-gallery-item .wp-block-cover__image-background {
    transition: transform 0.4s ease;
}

.home-area-guides-gallery-item:hover .wp-block-cover__image-background {
    transform: scale(1.03);
}

/* Push overlay content to the bottom */
.home-area-guides-gallery-item .wp-block-cover__inner-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px !important;
    box-sizing: border-box;
}

/* Align text and arrow perfectly */
.home-area-guides-gallery-item .wp-block-group.is-content-justification-space-between {
    align-items: flex-end;
    width: 100%;
    gap: 15px;
}

.home-area-guides-gallery-item .wp-block-group>p {
    margin: 0 !important;
    line-height: 1.2;
}

.home-area-guides-gallery-item .wp-block-group>.wp-block-group>p {
    margin-bottom: 5px !important;
    line-height: 1.2;
}

.home-area-guides-gallery-item .wp-block-group>.wp-block-group>p:last-child {
    margin-bottom: 0 !important;
}

/* Circular Arrow Icon */
.home-area-guides-gallery-item .wp-block-button__link {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    border: 2px solid white !important;
    background-color: transparent !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    position: relative;
    transition: all 0.3s ease !important;
    flex-shrink: 0;
}

/* SVG Right Arrow inside the circle */
.home-area-guides-gallery-item .wp-block-button__link::after {
    content: "";
    width: 21px;
    height: 21px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: inline-block;
    transition: all 0.3s ease;
}

/* Hover effect on arrow circle -> fill with white */
.home-area-guides-gallery-item:hover .wp-block-button__link {
    background-color: white !important;
}

/* Hover effect on SVG -> Change color to #6B207D */
.home-area-guides-gallery-item:hover .wp-block-button__link::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B207D' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E");

    filter: none;
}

.home-area-guide-bookmark-icon-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
    min-width: 60px;
    border-radius: 100%;
}

/* Responsive Adjustments */
@media (min-width: 1025px) and (max-width: 1440px) {
    .home-our-marbella-properties-gallery-item .wp-block-cover {
        min-height: 250px !important;
    }

    .home-our-marbella-properties-gallery-item:first-child .wp-block-cover {
        min-height: 510px !important;
    }

    .home-our-marbella-properties-gallery-item:not(:first-child) .wp-block-cover__inner-container>.wp-block-group {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 5px !important;
    }

    .home-our-marbella-properties-gallery-item:not(:first-child) .title {
        font-size: 14px !important;
    }

    .home-our-marbella-properties-gallery-item:not(:first-child) .type {
        font-size: 13px !important;
    }

    .home-our-marbella-properties-gallery-item:not(:first-child) .wp-block-cover__inner-container>.wp-block-group>p:last-child {
        text-align: left !important;
        font-size: 15px !important;
    }

    /* Decrease height for Area Guides Gallery on small laptops */
    .home-area-guides-gallery-item .wp-block-cover {
        height: 320px !important;
        min-height: 320px !important;
    }
}

@media (max-width: 1024px) {
    .home-our-marbella-properties .home-our-marbella-properties-gallery {
        grid-template-columns: repeat(2, 1fr) !important;
        grid-template-rows: auto !important;
    }

    /* Main property spans full width on tablet */
    .home-our-marbella-properties .home-our-marbella-properties-gallery-item:first-child {
        grid-column: span 2;
        grid-row: span 1;
    }

    /* Adjust block heights nicely for tablet */
    .home-our-marbella-properties .home-our-marbella-properties-gallery-item .wp-block-cover {
        min-height: 250px !important;
    }

    .home-our-marbella-properties .home-our-marbella-properties-gallery-item:first-child .wp-block-cover {
        min-height: 380px !important;
    }
}

@media (max-width: 768px) {


    .home-hero-slider,
    .home-hero-cover {
        height: 80vh !important;
    }

    .home-hero-slider .superblockslider__button {
        width: 7px !important;
        height: 7px !important;
        min-width: 7px !important;
    }

    .home-hero-slider .superblockslider__button--active {
        transform: scale(1.2) !important;
    }

    .home-our-marbella-properties h2 br {
        display: none;
    }

    .home-our-marbella-properties .heading-bar {
        flex-basis: 150px;
    }

    .home-our-marbella-properties .home-our-marbella-properties-gallery {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    .home-our-marbella-properties .home-our-marbella-properties-gallery-item:first-child {
        grid-column: span 1;
        grid-row: span 1;
    }

    /* Fix image issues by targeting the cover container instead of the absolute image tag */
    .home-our-marbella-properties .home-our-marbella-properties-gallery-item .wp-block-cover,
    .home-our-marbella-properties .home-our-marbella-properties-gallery-item:first-child .wp-block-cover {
        min-height: 280px !important;
        height: 100% !important;
    }

    /* Area Guides Grid Mobile Settings */
    .home-area-guides-gallery {
        grid-template-columns: 1fr !important;
    }
}