/*
Theme Name: Tricahue Real Estate
Theme URI: https://tricahuepropiedades.cl/
Description: Mini-Theme ultra-liviano optimizado para SEO, SGE y sincronización con Python.
Author: Antigravity
Version: 1.0.0
Text Domain: tricahue
*/

/* 1. Design Tokens & Variables */
:root {
    --primary: #007bff;
    --primary-hover: #0056b3;
    --bg-light: #f8f9fa;
    --text-dark: #333333;
    --text-muted: #6c757d;
    --white: #ffffff;
    --container-max: 1200px;
    --gap: 20px;
    --radius: 8px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* 2. Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: 0.3s;
}

a:hover {
    color: var(--primary-hover);
}

/* 3. Layout System */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 15px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
}

@media (max-width: 768px) {
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* 4. Header & Navigation */
.site-header {
    background: rgba(30, 30, 30, 0.4);
    /* Gris oscuro glass más transparente al inicio */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: background 0.3s, padding 0.3s;
}

.site-header.scrolled {
    background: rgba(30, 30, 30, 0.85);
    /* Gris oscuro glass más denso al desplazar */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.logo h1 {
    color: var(--white) !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.site-header.scrolled .logo h1 {
    color: var(--white) !important;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
}

.main-nav ul li a {
    color: var(--white);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.site-header.scrolled .main-nav ul li a {
    color: var(--white);
    text-shadow: none;
}

/* Mobile Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle .bar {
    width: 100%;
    height: 3px;
    background-color: var(--white);
    border-radius: 10px;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: rgba(30, 30, 30, 0.95);
        backdrop-filter: blur(10px);
        padding-top: 100px;
        transition: right 0.4s ease;
        z-index: 1000;
    }

    .main-nav.active {
        right: 0;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }

    .main-nav ul li a {
        font-size: 1.2rem;
    }

    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}

/* 5. Hero / Slider */
.hero-slider {
    height: 480px;
    /* Altura estática unificada */
    background: #111;
    position: relative;
    overflow: hidden;
}

/* 5.1 Internal Hero Banner */
.internal-hero {
    height: 300px;
    /* Altura estática unificada */
    position: relative;
    background-image: url('assets/images/banner.png') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
}

.internal-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
}

.internal-hero .container {
    position: relative;
    z-index: 10;
    text-align: center;
    color: var(--white);
}

.hero-slider .slide {
    height: 100%;
    width: 100%;
    position: absolute;
    /* Changed (was flex/relative implicit) */
    top: 0;
    left: 0;
    opacity: 0;
    z-index: 1;
    transition: opacity 2s ease-in-out;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 30px;
}

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

.hero-content {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 15px 25px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    max-width: 450px;
    text-align: right;
    transition: transform 0.3s ease;

    /* Posicionamiento Blindado (Absolute) */
    position: absolute;
    bottom: 20%;
    right: 30px;
    z-index: 10;
}

@media (max-width: 768px) {
    .hero-content {
        max-width: 90%;
        bottom: 20%;
        /* Mantiene el 20% desde abajo perfectamente */
        right: 5%;
        left: 5%;
        text-align: center;
    }
}

.hero-content h1 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    background: transparent;
    padding: 0;
    border-radius: 0;
    backdrop-filter: none;
    display: block;
}

.hero-content h1 a {
    color: var(--white) !important;
    text-decoration: none;
}

/* Slider Navigation Arrows */
.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 100;
    /* Above slides */
    transition: background 0.3s;
    border-radius: 5px;
}

.slider-nav:hover {
    background: var(--primary);
}

.slider-nav.prev {
    left: 20px;
}

.slider-nav.next {
    right: 20px;
}

/* 6. Search Bar / Buscador */
.property-search-box {
    background: var(--white);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-top: -40px;
    border: 1px solid #eee;
    position: relative;
    z-index: 100;
}

@media (max-width: 768px) {
    .property-search-box {
        margin-top: -20px;
        padding: 20px;
    }

    .property-card {
        margin-left: 5%;
        margin-right: 5%;
    }
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    align-items: flex-end;
}

.btn-search {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: bold;
}

/* 7. Cards Simplification & Refinement */
.property-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(0, 0, 0, 0.1);
    /* Slightly more visible border */
    display: flex;
    flex-direction: column;
}

.property-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--primary);
    color: var(--white);
    padding: 8px 15px;
    border-radius: 0 0 12px 0;
    /* Ribbon style */
    font-size: 0.7rem;
    font-weight: 800;
    z-index: 10;
    text-transform: uppercase;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
}


.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.property-card:hover .card-img {
    transform: scale(1.08);
}

.card-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #e9ecef;
    color: var(--text-muted);
    font-size: 3rem;
    text-decoration: none;
}

.card-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: var(--white);
    /* White background for cohesion */
}

.card-price {
    color: var(--primary);
    font-weight: 800;
    font-size: 1.4rem;
    margin-top: auto;
    /* Push to bottom */
    order: 3;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}


.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.card-title a {
    color: var(--text-dark);
    text-decoration: none;
}

.card-title a:hover {
    color: var(--primary);
}

.card-location {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Pagination Style */
.pagination-wrapper .page-numbers {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 4px;
    border-radius: 6px;
    background: var(--white);
    color: var(--text-dark);
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.pagination-wrapper .page-numbers.current {
    background: var(--primary);
    color: var(--white);
}

.pagination-wrapper .page-numbers:hover:not(.current) {
    background: #f1f3f5;
    color: var(--primary);
}


/* 8. Single Property Layout */
.single-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--gap);
    width: 100%;
}

.single-grid .property-main-content {
    flex: none !important;
    max-width: 100% !important;
    width: 100% !important;
}

.description-box .entry-content {
    text-align: justify;
    hyphens: auto;
    width: 100%;
}

.description-box .entry-content p {
    width: 100% !important;
    max-width: none !important;
    display: block;
}

@media (max-width: 768px) {
    .single-grid {
        grid-template-columns: 1fr;
    }
}

/* 9. Property List Layout (New) */
.property-list-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

@media (max-width: 992px) {
    .property-search-box {
        margin-top: -20px;
        padding: 20px;
    }
}

/* 9. Custom Property Archive Layout */
.property-archive-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 40px;
}

.property-main-content {
    flex: 0 0 calc(70% - 30px);
    max-width: calc(70% - 30px);
    min-width: 0;
}

.property-sidebar-content {
    flex: 0 0 300px;
    height: fit-content;
}

.property-archive-layout.no-sidebar .property-sidebar-content {
    display: none;
}

.property-archive-layout.no-sidebar .property-main-content {
    flex: 0 0 100%;
    max-width: 100%;
}

@media (max-width: 992px) {
    .property-archive-layout {
        flex-direction: column;
    }

    .property-sidebar-content {
        flex: 1 1 100%;
        order: 2;
    }
}

/* Custom Property Card System (Tricahue) */
.tricahue-property-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    transition: transform 0.3s ease;
}

.tricahue-property-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.tricahue-card-wrap {
    display: flex;
}

.tricahue-card-thumbnail {
    flex: 0 0 35%;
    max-width: 380px;
    /* NEW: Avoid giant image */
    position: relative;
    min-height: 250px;
    overflow: hidden;
}

.tricahue-card-thumbnail .post_thumbnail {
    width: 100%;
    height: 100%;
    background-position: center !important;
    background-size: cover !important;
}

.tricahue-card-details-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 25px;
}

.tricahue-card-details h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.tricahue-card-details h3 a {
    color: var(--text-dark);
    text-decoration: none;
}

.tricahue-card-excerpt {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}

.tricahue-card-meta-wrap {
    display: flex;
    gap: 20px;
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
}

.tricahue-card-meta h4 {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 5px;
    font-weight: 700;
}

.tricahue-card-meta .figure {
    font-size: 0.9rem;
    font-weight: 600;
    color: #444;
}

.tricahue-card-priceLabel {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 20px;
}

.tricahue-card-price .status {
    font-size: 0.75rem;
    color: var(--primary);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 5px;
}

.tricahue-card-price .price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
}

@media (max-width: 768px) {
    .tricahue-card-wrap {
        flex-direction: column;
    }

    .tricahue-card-thumbnail {
        flex: 0 0 200px;
        min-height: 200px;
    }
}

.filter-tree-list {
    list-style: none;
}

.filter-tree-list li {
    margin-bottom: 10px;
}

.filter-tree-list a {
    color: var(--text-dark);
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 5px;
    transition: 0.2s;
}

.filter-tree-list a:hover {
    background: rgba(0, 123, 255, 0.05);
    color: var(--primary);
}

.filter-tree-list a .count {
    background: #eee;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Utilities */
.text-h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 20px;
}

/* Título de Propiedad Individual (Optimizado para SEO/User) */
.single-property-title {
    font-size: 1.4rem;
    /* Un poco más grande en desktop */
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-dark);
    line-height: 1.2;
}

.property-price {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
}

@media (max-width: 768px) {
    .single-property-title {
        font-size: 1.15rem;
        /* ~18px, reducción para mobile */
    }

    .property-price {
        font-size: 1.4rem;
        /* Reducir precio en mobile también */
    }
}

/* Galería Premium Interactiva */
.slider-stage img {
    max-width: 100%;
    max-height: 100%;
}

.slider-arrow {
    opacity: 0;
    transition: opacity 0.3s, background 0.3s;
}

.slider-stage:hover .slider-arrow {
    opacity: 1;
}

.slider-arrow:hover {
    background: var(--primary) !important;
}

.thumb-item:hover {
    opacity: 1 !important;
    transform: scale(1.05);
}

.thumb-item img {
    transition: transform 0.3s;
}

.modal-thumb-item:hover {
    opacity: 1 !important;
    border-color: var(--primary) !important;
}

.modal-thumbs::-webkit-scrollbar {
    height: 4px;
}

.modal-thumbs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

#galleryModal {
    transition: opacity 0.4s ease;
}

#modalMainImg {
    border: 5px solid white;
    border-radius: 4px;
}



.lazy-bg {
    background-size: cover;
    background-position: center;
}

/* 10. Navigation Chips (Tags) */
.tricahue-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.tricahue-chip {
    padding: 8px 18px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #444;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid #eee;
    font-weight: 500;
}

.tricahue-chip:hover,
.tricahue-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.tricahue-chip .count {
    margin-left: 5px;
    opacity: 0.6;
    font-size: 0.75rem;
}

/* 11. Single Post & Comments Styling */
.post-entry-content p {
    margin-bottom: 2em;
    /* Doble espaciado visual */
}

.comment-list {
    padding: 0;
}

.comment-body {
    background: #fdfdfd;
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid #eee;
    margin-bottom: 20px;
}

.comment-meta {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.comment-author .avatar {
    border-radius: 50%;
}

.comment-metadata {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.comment-content {
    font-size: 1rem;
    line-height: 1.6;
}

.reply {
    margin-top: 10px;
    font-size: 0.85rem;
    font-weight: bold;
}

#commentform p {
    margin-bottom: 15px;
}

#commentform label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

#commentform input[type="text"],
#commentform input[type="email"],
#commentform input[type="url"],
#commentform textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 
   GENERIC BLOCK OVERRIDES 
   Targeting common "Advanced Post" blocks to enforce the "No Read More" and "Linkable Card" style.
*/
.wp-block-uagb-post-grid .uagb-post__cta,
.wp-block-uagb-post-carousel .uagb-post__cta,
.wp-block-uagb-post-masonry .uagb-post__cta,
.kb-posts-read-more-wrap,
.eb-post-grid-read-more,
.eb-read-more-btn,
.wp-block-latest-posts__read-more,
.read-more-button,
.more-link,
.wp-block-button__link {
    display: none !important;
}

.wp-block-uagb-post-grid .uagb-post__inner-wrap,
.wp-block-post,
.wp-block-latest-posts__list-item,
.eb-post-grid-entry-wrapper,
.entry-content .wp-block-group {
    cursor: pointer;
}