:root {
    --maule-blue: #006bbd;
    --maule-dark: #014286;
}

body {
    background-color: #f5f7fa;
    min-height: 100vh;
}

/* Hero Section */
.custom-hero {
    background-color: #032a66;
    background-image: url('/assets/cordillera-sola.png');
    background-repeat: no-repeat;
    background-position: top center;
    background-size: 100%;
    padding-top: 3rem;
    padding-bottom: 8rem; /* Space for the overlap */
    position: relative;
}

@media screen and (min-width: 768px) {
    .custom-hero {
        background-size: 60%;
        background-position: top right;
    }
}


.custom-hero .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    max-width: 1200px;
    padding: 0 2rem;
}

.custom-hero-text {
    flex: 3; /* 60% width */
    text-align: left;
    z-index: 1;
}

.custom-hero-image {
    flex: 2; /* 40% width */
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.custom-hero-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.hero-logo {
    max-width: 140px;
    margin-bottom: 1.5rem;
    display: inline-block;
    margin-top: -3rem; /* move logo to the top */
}

@media screen and (max-width: 768px) {
    .custom-hero .container {
        flex-direction: column;
        gap: 0;
    }
    .custom-hero-text {
        text-align: center;
        margin-bottom: 1rem;
    }
    .custom-hero-image {
        width: 70%;
    }
}

/* Floating Search Box */
.search-card {
    margin-top: -4rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    background: white;
    padding: 2rem;
    z-index: 10;
    position: relative;
}

/* Custom Input Styles */
.input {
    box-shadow: none;
    border: 2px solid #eee;
    transition: all 0.3s ease;
}
.input:focus {
    border-color: var(--maule-blue);
    box-shadow: 0 0 0 3px rgba(0, 159, 223, 0.1);
}

/* Results Grid */
.card {
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.card-content {
    flex-grow: 1;
}

/* HTMX Loading */
.htmx-indicator {
    display: none;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    display: inline;
}

/* Autocomplete Box */
.autocomplete-container {
    position: relative;
}
.suggestions-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #dbdbdb;
    border-radius: 4px;
    box-shadow: 0 8px 16px rgba(10,10,10,0.1);
    max-height: 200px;
    overflow-y: auto;
    display: none;
}
.suggestions-box:not(:empty) {
    display: block;
}
.dropdown-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
}
.dropdown-item:hover, .dropdown-item:focus {
    background-color: #f5f5f5;
    color: var(--maule-blue);
    outline: none;
}
.h-100 { height: 100%; }

/* Map Modal */
#map { height: 400px; width: 100%; border-radius: 6px; }

.custom-results-table tr.result-primary td {
    border-bottom: none;
    padding-bottom: 0.25rem;
}
.custom-results-table tr.result-details td {
    border-top: none;
    padding-top: 0;
    color: #666;
    font-size: 0.9em;
    border-bottom: 1px solid #dbdbdb;
}
.custom-results-table tr.result-primary td[rowspan] {
    border-bottom: 1px solid #dbdbdb;
}

/* grow main column (name) */
#results-body .result-primary td:first-child {
    width: 50%;
}
#results-body .result-primary td:not(:first-child) {
    white-space: nowrap;
}
