/* =========================================
   1. Variables & Reset
   ========================================= */
:root {
    /* Primary Palette */
    --brand-color: #FFFFFF;      /* White - titles, main text contrasts */
    --text-color: #E8E8E8;       /* Light grey - paragraphs */
    --bg-main: #93997B;          /* Olive Green - main background */
    
    /* Button Colors */
    --btn-bg: #5E6348;           /* Dark Olive Green */
    --btn-hover: #4A4F36;        /* Darker Olive for hover */
    
    /* Card Colors */
    --card-bg: #e7e7e7;          /* Light Grey for cards */
    --card-text: #919978;        /* Olive Green for card text */
    
    /* Special Colors */
    --bg-salento: #A6C3E1;       /* Casa Olga - Puglia blue */
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Mulish', sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background-color: var(--bg-main);
    min-height: 100vh;
    line-height: 1.8;
    overflow-x: hidden;
    width: 100%;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'CMU Serif', serif;
    color: var(--brand-color);
}

/* =========================================
   2. Global Layout & Utilities
   ========================================= */
#main-content {
    background-color: var(--bg-main);
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    background-color: var(--btn-bg);
    color: white;
    padding: 0.6rem 1.5rem;
    text-decoration: none;
    border-radius: 30px; /* Rounded corners */
    transition: background-color 0.3s, transform 0.2s;
    font-family: 'Mulish', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    font-size: 0.9rem;
}

.btn:hover {
    background-color: var(--btn-hover);
    transform: translateY(-2px);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    will-change: opacity, transform;
}

.fade-in-up.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   3. Language Selector (Floating)
   ========================================= */
.lang-floating {
    position: absolute;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
}

.header-lang {
    z-index: 1000;
}

.lang-floating select, .header-lang select {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: none;
    padding: 0.5rem 1rem;
    font-family: 'Mulish', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: color 0.3s ease;
}

.lang-floating select:hover, .header-lang select:hover {
    color: white;
}

.lang-floating select:focus, .header-lang select:focus {
    outline: none;
}

/* =========================================
   4. Header / Hero Section
   ========================================= */
#hero {
    position: relative;
    height: 100vh;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--brand-color);
    background-image: url('pictures/old_pic/sfondo-welcome-1920-1.jpg');
    background-size: cover;
    background-position: center;
}

.hero-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Dark overlay for readability */
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 15vh;
    align-items: center;
    height: 100%;
    color: white;
    text-align: center;
    padding-left: 20px;
    padding-right: 20px;
}

.hero-text-container {
    text-align: center;
    margin-bottom: 1rem;
    animation: fadeInUp 1.5s ease-out;
}

.hero-main-logo {
    margin-bottom: 1rem;
    animation: fadeInUp 1.5s ease-out;
    display: flex;
    justify-content: center;
    width: 100%;
}

.hero-holiday-text {
    font-family: 'CMU Serif', serif;
    font-size: 2rem;
    font-style: normal;
    font-weight: 400;
    letter-spacing: 0.1rem;
    color: var(--brand-color);
    margin: 0 0 1rem 0;
    text-transform: none;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    animation: fadeInUp 1.6s ease-out;
}

.hero-main-logo img {
    width: min(200px, 35vw);
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
}

.hero-logo-mark {
    margin-top: 0;
    animation: fadeInUp 1.8s ease-out;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-logo-mark img {
    width: min(220px, 55vw);
    height: auto;
    display: block;
}

.hero-sup-text {
    display: block;
    font-family: 'Mulish', sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: 0.8rem;
    margin-bottom: -1vw;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.hero-big-text {
    font-family: 'CMU Serif', serif;
    font-weight: 900;
    font-size: 18vw;
    line-height: 0.85;
    margin: 0;
    color: white;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    text-shadow: 0 4px 10px rgba(0,0,0,0.6);
}

.hero-subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 1px;
    margin-bottom: 3rem;
    max-width: 500px;
    animation: fadeInUp 2s ease-out;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.hero-btn {
    background-color: var(--btn-bg);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 30px;
    transition: background-color 0.3s, transform 0.3s;
    animation: fadeInUp 2.5s ease-out;
    margin-top: 15vh;
    font-family: 'Mulish', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-btn:hover {
    background-color: var(--btn-hover);
    transform: translateY(-3px);
}

.hero-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    max-width: 1200px;
    margin-top: 2rem;
    padding: 0 2rem;
    box-sizing: border-box;
    animation: fadeInUp 3s ease-out;
}

.hero-mini-img {
    width: 250px;
    height: 160px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.hero-mini-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hero-mini-img:hover img {
    transform: scale(1.05);
}

.hero-mini-text {
    margin-top: 4rem; /* Staggered lower than the image */
    text-align: right;
    font-family: 'Mulish', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding-top: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.hero-inline-photo {
    width: min(320px, 80vw);
    aspect-ratio: 4 / 3;
    margin-top: 2rem;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.hero-inline-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-bottom-info {
    margin-top: 3rem;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
    padding: 0 2rem;
    box-sizing: border-box;
    animation: fadeInUp 2.8s ease-out;
}

.hero-photo-caption {
    font-size: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    max-width: 280px;
    line-height: 1.6;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.hero-bottom-info .hero-inline-photo {
    margin-top: 0;
}

.hero-visuals {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .hero-bottom-info {
        flex-direction: column-reverse;
        align-items: flex-start;
        padding: 0 1rem;
        gap: 1.2rem;
    }

    .hero-photo-caption {
        max-width: none;
        letter-spacing: 1.5px;
        font-size: 0.95rem;
    }

    .hero-visuals {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .hero-logo-mark img {
        width: min(180px, 65vw);
    }
}



/* =========================================
   5. About Section
   ========================================= */
#about {
    padding: 1rem 2rem;
    text-align: center;
    color: var(--text-color);
    position: relative;
}

#about .container {
    max-width: 800px;
    margin: 0 auto;
}

#about h2 {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--brand-color);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

#about p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.about-hero-image {
    width: 100%;
    max-width: 800px;
    height: auto;
    margin: 1rem auto 0;
    position: relative;
    overflow: visible;
    padding: 1.5rem;
    box-sizing: border-box;
}

.about-hero-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px solid white;
    z-index: 0;
    transition: transform 0.5s ease;
    pointer-events: none;
}

.about-hero-image::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    width: 100%;
    height: 100%;
    border: 1px solid white;
    opacity: 0.5;
    z-index: 0;
    transition: transform 0.5s ease;
    pointer-events: none;
}

.about-hero-image:hover::before {
    transform: translate(-10px, -10px);
}

.about-hero-image:hover::after {
    transform: translate(10px, 10px);
}

.about-hero-image p {
    position: relative;
    z-index: 1;
    margin-bottom: 1.5rem;
}

.about-hero-image p:last-child {
    margin-bottom: 0;
}

/* =========================================
   6. Houses Section
   ========================================= */
#houses {
    padding: 0 2rem;
    text-align: center;
    position: relative;
    overflow: visible;
    background: var(--bg-main);
    border-radius: 0;
    max-width: 1100px;
    margin: 0 auto;
    color: var(--text-color);
    box-shadow: none;
}

#houses h2 {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--brand-color);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    white-space: nowrap;
}

.house-card {
    background: var(--card-bg);
    border: none;
    color: var(--text-color);
    margin: 0 auto 3rem;
    max-width: 1000px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    box-sizing: border-box;
}

.house-card-title {
    margin: 0;
    padding: 1.5rem;
    font-size: 2.5rem;
    font-family: 'CMU Serif', serif;
    text-align: center;
    background: var(--brand-color);
    color: var(--card-bg); /* Dark text on white background */
}

.house-card-carousel {
    position: relative;
    height: 500px;
    overflow: hidden;
}

.house-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.45s ease;
}

.house-card-description {
    padding: 2rem;
    text-align: center;
}

.house-card-description p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

.house-card-details {
    padding: 2rem;
    background: var(--card-bg);
    text-align: left;
    border-top: 1px solid rgba(147, 153, 123, 0.3);
}

.house-card-label {
    font-family: 'CMU Serif', serif;
    font-size: 1.5rem;
    margin: 0 0 1rem 0;
    color: var(--brand-color);
}

.house-card-full {
    margin: 0;
    color: var(--text-color);
    line-height: 1.8;
    white-space: pre-line;
}

.house-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: white;
    font-size: 0;
    padding: 1rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
}

.house-arrow::after {
    content: '';
    display: block;
    width: 14px;
    height: 14px;
    border-top: 2px solid rgba(255, 255, 255, 0.6);
    border-right: 2px solid rgba(255, 255, 255, 0.6);
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.35));
}

.house-arrow:hover {
    background: transparent;
    transform: translateY(-50%) scale(1.1);
}

.house-arrow-left {
    left: 0.5rem;
}

.house-arrow-left::after {
    transform: rotate(-135deg);
    margin-left: 5px;
}

.house-arrow-right {
    right: 0.5rem;
}

.house-arrow-right::after {
    transform: rotate(45deg);
    margin-right: 5px;
}

@media (max-width: 768px) {
    .house-card {
        margin: 0 0 2rem;
    }

    .house-card-carousel {
        height: 350px;
    }

    .house-card-title {
        font-size: 1.5rem;
    }

    .house-card-details {
        padding: 1.5rem;
    }
}


.main-house {
    max-width: 1100px;
    margin: 0 auto 3rem;
    padding: 2rem 1.5rem 3rem;
    background: transparent;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    opacity: 0;
    transform: translateY(-40px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.7s ease, transform 0.7s ease;
}

#houses.card-visible .main-house {
    display: flex;
}

#houses.card-visible .main-house.is-active {
    opacity: 1;
    transform: translateY(20px) scale(1);
    pointer-events: auto;
}

.main-house .house-media {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
    width: 100%;
}

#houses.card-visible .main-house .house-media {
    opacity: 1;
    transform: translateY(0);
}

.house-media {
    display: flex;
    justify-content: center;
}

.house-media .carousel {
    max-width: 700px;
    width: 90%;
}

.house-media img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    border-radius: 0;
    transition: opacity 0.6s ease;
    opacity: 1;
}

.house-media img.is-hidden {
    opacity: 0;
}

.carousel {
    position: relative;
}

.arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.arrow.left {
    left: 10px;
}

.arrow.right {
    right: 10px;
}

.house-divider {
    width: 60%;
    border-bottom: 1px solid rgba(140, 140, 140, 0.8);
    opacity: 0;
    transform: scaleX(0.5);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

#houses.card-visible .house-divider {
    opacity: 1;
    transform: scaleX(1);
}


.house-description {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    transition: opacity 0.6s ease, transform 0.6s ease;
    opacity: 0;
    transform: translateY(20px);
}


.house-media-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    max-width: 1100px;
    margin: 2.5rem auto 0;
    width: 100%;
    padding: 0 1.5rem 2rem;
}

.mock-media {
    position: relative;
    aspect-ratio: 9 / 16;
    border-radius: 0;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.25);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.mock-layer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.mock-layer.is-visible {
    opacity: 1;
}

.mock-media:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.35);
}


.house-description h3 {
    margin-bottom: 1rem;
    font-size: 1.8rem;
    color: white;
}

.house-description p {
    color: var(--bg-main);
    font-size: 1rem;
    line-height: 1.8;
    white-space: pre-line;
    margin-bottom: 1.5rem;
}

.house-description .btn {
    align-self: center;
}

.house-description.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.house-selector {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.house-thumb {
    width: 140px;
    height: 150px;
    border-radius: 0;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.3s, transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--brand-color);
    text-align: center;
    background: #FFFFFF;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0.5rem;
}

.house-thumb:hover {
    opacity: 1;
    transform: scale(1.03);
}

.house-thumb.active {
    opacity: 1;
    border-color: var(--brand-color);
    transform: scale(1.02);
    box-shadow: 0 14px 28px rgba(55, 24, 16, 0.45);
}

.house-thumb img {
    width: 100%;
    height: 85px;
    object-fit: cover;
    border-radius: 0;
    transition: transform 0.3s ease;
    box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.15);
}

.house-thumb span {
    display: block;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    color: var(--brand-color);
    font-weight: 600;
}


@media (max-width: 900px) {
    .house-media img {
        height: 340px;
        border-radius: 0;
    }

    .house-divider {
        width: 90%;
    }

    .house-media-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 5px;
    }

    /* Hero Section Mobile */
    .hero-big-text {
        font-size: 15vw;
    }

    .hero-bottom-content {
        flex-direction: column;
        align-items: center;
        margin-top: 2rem;
        gap: 2rem;
    }

    .hero-mini-text {
        text-align: center;
        border-top: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.3);
        padding-bottom: 1rem;
        padding-top: 0;
        margin-top: 0;
        order: -1; /* Move text above image on mobile if desired, or keep below */
    }

    /* About Section Mobile */
    .about-hero-image,
    .detail-description {
        height: auto;
        margin-bottom: 1rem;
        padding: 0.8rem;
    }

    .house-preview-img {
        height: 350px;
    }

    /* House Section Mobile */
    .house-media .carousel {
        width: 100%;
    }

    .house-media img {
        height: 260px;
        border-radius: 0;
    }

    .house-media-grid {
        grid-template-columns: 1fr;
    }

    .house-description h3 {
        font-size: 1.5rem;
    }
    
    .house-description p {
        font-size: 0.95rem;
    }
}


/* =========================================
   9. Footer
   ========================================= */
footer {
    background: var(--bg-main);
    color: var(--text-color);
    text-align: center;
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

footer a {
    color: #ccc;
    text-decoration: none;
    margin-left: 10px;
}

footer a:hover {
    color: white;
    text-decoration: underline;
}





/* =========================================
   7. Gallery Section
   ========================================= */
#gallery {
    padding: 0.5rem 2rem;
    background-color: var(--bg-main);
}

#gallery h2 {
    text-align: center;
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--brand-color);
    white-space: nowrap;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 250px);
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.gallery-item a {
    display: block;
    height: 100%;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease, opacity 1s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    z-index: 2;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Bento Grid Layout */
.item-1 {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
}

.item-2 {
    grid-column: 3 / 5;
    grid-row: 1 / 2;
}

.item-3 {
    grid-column: 3 / 4;
    grid-row: 2 / 3;
}

.item-4 {
    grid-column: 4 / 5;
    grid-row: 2 / 3;
}

.item-5 {
    display: none; /* Hidden on desktop for clean bento, visible on mobile */
}

@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        grid-auto-rows: 200px;
    }

    .item-1 { grid-column: 1 / 3; grid-row: auto; height: 300px; }
    .item-2 { grid-column: 1 / 2; grid-row: auto; }
    .item-3 { grid-column: 2 / 3; grid-row: auto; }
    .item-4 { grid-column: 1 / 2; grid-row: auto; }
    .item-5 { grid-column: 2 / 3; grid-row: auto; display: block; }
}

/* =========================================
   Instagram Feed Grid (3x3)
   ========================================= */
.instagram-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    max-width: 900px;
    margin: 0 auto;
}

.instagram-grid .gallery-item {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
}

.instagram-grid .gallery-item a {
    display: block;
    height: 100%;
}

.instagram-grid .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.instagram-grid .gallery-item:hover img {
    transform: scale(1.05);
    filter: brightness(0.85);
}

.instagram-follow {
    text-align: center;
    margin-top: 2rem;
}

.instagram-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 2rem;
    background: var(--card-bg);
    color: var(--card-text) !important;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.instagram-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

@media (max-width: 700px) {
    .instagram-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2px;
        max-width: 100%;
    }
}

/* =========================================
   8. Contact Section
   ========================================= */
#contact {
    background: transparent;
    padding: 1rem 0;
}

#contact .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

#contact h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    color: var(--brand-color);
}

.contact-cards {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding-bottom: 20px;
}

.contact-card {
    background: var(--card-bg);
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 20px;
    text-align: center;
    width: 100%;
    max-width: 300px;
    flex-shrink: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: var(--card-text);
    box-sizing: border-box;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.contact-icon {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    color: var(--card-text);
}

.contact-icon svg {
    color: inherit;
}

.contact-card h3 {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: var(--card-text);
}

.contact-card p, .contact-card ul {
    margin: 10px 0;
    color: var(--card-text);
}

.contact-card a {
    color: var(--card-text);
    text-decoration: none;
    font-weight: bold;
}

.contact-card a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.contact-card ul {
    list-style: none;
    padding: 0;
}

.contact-card li {
    margin: 5px 0;
}

/* =========================================
   10. Modal (Cookie Policy)
   ========================================= */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    bottom: 20px;
    right: 20px;
    width: auto;
    max-width: 400px;
    background-color: white;
    border-radius: 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    padding: 20px;
}

.modal-content {
    text-align: left;
}

.modal-content h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2em;
}

.modal-content p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #666;
    font-size: 0.9em;
}

#accept-cookies {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 0;
    cursor: pointer;
    font-size: 0.9em;
}

#accept-cookies:hover {
    background-color: #0056b3;
}

/* --- House Preview Grid (Home View) --- */
.house-preview-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1rem;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.house-preview-card {
    background-color: transparent;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: none;
    transition: transform 0.3s ease;
    cursor: pointer;
    text-align: center;
    padding-bottom: 0;
    display: block; /* For anchor tag */
    text-decoration: none !important;
    color: var(--text-color);
    position: relative;
    margin-bottom: 1rem;
}

.house-preview-card:hover {
    transform: translateY(-5px);
    box-shadow: none;
    text-decoration: none;
}

.house-preview-img {
    width: 100%;
    height: 500px;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: box-shadow 0.3s ease;
}

.house-preview-card:hover .house-preview-img {
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
}

.house-preview-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.house-preview-card:hover .house-preview-img img {
    transform: scale(1.05);
}

.house-preview-card h3 {
    font-family: 'CMU Serif', serif;
    font-size: 0.85rem;
    margin: 0;
    color: #333; /* Dark grey for better readability */
    text-decoration: none;
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--card-bg);
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: background-color 0.3s, color 0.3s, transform 0.3s, box-shadow 0.3s;
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.house-preview-card h3::after {
    content: none; /* Removed arrow */
}

.house-preview-card:hover h3 {
    background-color: white;
    transform: translateX(-50%) translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.house-preview-card:hover h3::after {
    transform: translateX(5px);
}

.house-preview-card .btn,
.house-preview-card .house-location {
    display: none;
}

/* --- Page Header (Sub-pages) --- */
.page-header {
    background-color: var(--bg-main);
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.page-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.back-link {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: color 0.3s;
    z-index: 2;
}

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

.header-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
    z-index: 1;
}

.header-logo img {
    height: 90px;
    width: auto;
    max-width: 100%;
    display: block;
}

.header-lang {
    z-index: 2;
}

.header-sup {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.3rem;
    opacity: 0.8;
}

.header-main {
    display: block;
    font-family: 'CMU Serif', serif;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.1rem;
}

/* --- House Detail Section (Sub-pages) --- */
.house-detail-section {
    padding: 2rem 2rem;
    background-color: var(--bg-main);
    min-height: 80vh;
}

.detail-title {
    font-family: 'CMU Serif', serif;
    font-size: 3.5rem;
    color: var(--brand-color);
    margin-bottom: 2rem;
    text-align: center;
}

.detail-description {
    width: 100%;
    max-width: 800px;
    height: auto;
    margin: 1rem auto 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-color);
    white-space: pre-line;
    text-align: center;
    position: relative;
    overflow: visible;
    padding: 1.5rem;
    box-sizing: border-box;
}

.detail-description::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px solid white;
    z-index: 0;
    transition: transform 0.5s ease;
    pointer-events: none;
}

.detail-description::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    width: 100%;
    height: 100%;
    border: 1px solid white;
    opacity: 0.5;
    z-index: 0;
    transition: transform 0.5s ease;
    pointer-events: none;
}

.detail-description:hover::before {
    transform: translate(-10px, -10px);
}

.detail-description:hover::after {
    transform: translate(10px, 10px);
}

.detail-description h3,
.detail-description p {
    position: relative;
    z-index: 1;
}

.house-location {
    font-family: 'Mulish', sans-serif;
    font-size: 0.9rem;
    color: #666;
    margin: 0.5rem 0 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .detail-title {
        font-size: 2rem;
    }
    
    .page-header .container {
        flex-direction: column-reverse;
        gap: 1rem;
    }
    
    .header-logo {
        position: static;
        transform: none;
        text-align: center;
        margin-right: 0;
    }
}

/* --- Salento Theme --- */
.salento-page .house-detail-section {
    background-color: var(--bg-salento) !important;
    color: #333 !important;
}

.salento-page .detail-title {
    color: #2E4A3D; /* Darker contrast for title on light blue */
}

.salento-page .detail-description {
    color: #333;
}

.salento-page .house-card-details {
    background-color: rgba(255, 255, 255, 0.5) !important;
    color: #333;
}

.salento-page .house-card {
    background-color: white;
    color: #333;
}

.salento-page .house-card-title {
    background-color: var(--brand-color);
    color: white;
}

.salento-page .house-card-description p {
    color: #333;
}

.salento-page .house-location {
    color: #444;
}

/* --- Salento Card Preview --- */
.house-preview-card.salento-card {
    /* Reset specific Salento styles as we are unifying the card design */
    background-color: transparent;
    color: var(--text-color);
    border-color: transparent;
}

.house-preview-card.salento-card h3 {
    /* Keep the button style consistent with others */
    color: #333;
    background-color: var(--card-bg);
    border: none;
}

.house-preview-card.salento-card:hover {
    box-shadow: none;
    border-color: transparent;
}

.house-preview-card.salento-card:hover h3 {
    background-color: white;
}


/* =========================================
   11. Custom Cursor
   ========================================= */
/* Hide cursor immediately on devices with fine pointer to prevent flash */
@media (pointer: fine) {
    html, body, * {
        cursor: none !important;
    }
}

html.custom-cursor-enabled,
html.custom-cursor-enabled *,
body.custom-cursor-enabled,
body.custom-cursor-enabled * {
    cursor: none !important;
}

.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 12px;
    height: 12px;
    border: 1.5px solid white;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2147483647; /* Max z-index to ensure visibility */
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
    opacity: 0;
    will-change: transform, width, height;
}

.custom-cursor.hovered {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
}


/* =========================================
   Lightbox
   ========================================= */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    border-radius: 4px;
    object-fit: contain;
}

.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    padding: 1rem;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.lightbox-arrow::after {
    content: '';
    display: block;
    width: 16px;
    height: 16px;
    border-top: 2px solid rgba(255, 255, 255, 0.75);
    border-right: 2px solid rgba(255, 255, 255, 0.75);
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.35));
}

.lightbox-arrow:hover {
    transform: translateY(-50%) scale(1.05);
    opacity: 1;
}

.lightbox-arrow-left {
    left: 10px;
}

.lightbox-arrow-left::after {
    transform: rotate(-135deg);
    margin-left: 5px;
}

.lightbox-arrow-right {
    right: 10px;
}

.lightbox-arrow-right::after {
    transform: rotate(45deg);
    margin-right: 5px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    background: none;
    border: none;
    font-size: 0;
    cursor: pointer;
    padding: 10px;
    width: 40px;
    height: 40px;
}

.lightbox-close::before, .lightbox-close::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: white;
    top: 50%;
    left: 0;
}

.lightbox-close::before {
    transform: rotate(45deg);
}

.lightbox-close::after {
    transform: rotate(-45deg);
}

.lightbox-close:hover {
    transform: scale(1.1);
}

.house-card-img {
    cursor: zoom-in;
}
