/* ============================================================
   TOP LIVING INMOBILIARIA — Strict 3-color system
   Inspired by Zillow's grid + Muppy's restraint.
   Palette: white, near-black, single red accent (+ neutrals).
   ============================================================ */

:root {
    --bg:          #FFFFFF;
    --surface:     #F8F7F4;
    --surface-2:   #F1EFEA;
    --text:        #141414;
    --text-muted:  #6B6B6B;
    --border:      #E5E2DC;
    --accent:      #C8102E;
    --accent-dark: #8B0A1F;
    --shadow:      0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
    --radius:      10px;
    --radius-sm:   6px;
    --maxw:        1240px;
    --font-sans:   "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --font-serif:  "Playfair Display", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0 0 0.5em;
    line-height: 1.15;
}
h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 2.5vw, 2.1rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; color: var(--text); }
.muted { color: var(--text-muted); }

.container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Header / Nav ---------- */
.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 50;
}
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}
.logo {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo-mark {
    display: inline-block;
    width: 28px;
    height: 28px;
    background: var(--accent);
    position: relative;
}
.logo-mark::after {
    content: "";
    position: absolute;
    inset: 6px;
    background: var(--bg);
}
.nav-links {
    display: flex;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-links a {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: border-color .15s ease;
}
.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}
.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform .08s ease, background .15s ease, color .15s ease, border-color .15s ease;
    font-family: inherit;
    text-align: center;
    line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--text); color: var(--text); }
.btn-dark {
    background: var(--text);
    color: #fff;
}
.btn-dark:hover { background: #000; color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }

/* ---------- Hero ---------- */
.hero {
    padding: 64px 0 80px;
    background: var(--bg);
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 56px;
    align-items: center;
}
.hero h1 .accent {
    color: var(--accent);
    font-style: italic;
}
.hero p.lead {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 50ch;
    margin-bottom: 28px;
}
.hero-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.hero-image {
    aspect-ratio: 4 / 5;
    background-size: cover;
    background-position: center;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ---------- Search bar ---------- */
.search-bar {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr auto;
    gap: 10px;
    box-shadow: var(--shadow);
    margin-top: 28px;
}
.search-bar input,
.search-bar select {
    border: none;
    background: transparent;
    padding: 12px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
    outline: none;
    width: 100%;
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar > *:not(:last-child) {
    border-right: 1px solid var(--border);
}

/* ---------- Section base ---------- */
section { padding: 72px 0; }
section.tight { padding: 48px 0; }
.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 36px;
    gap: 20px;
    flex-wrap: wrap;
}
.section-head .eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 10px;
}
.section-head p { color: var(--text-muted); max-width: 60ch; }

/* ---------- Property cards ---------- */
.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
    display: flex;
    flex-direction: column;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.card-img {
    aspect-ratio: 4 / 3;
    background-size: cover;
    background-position: center;
    background-color: var(--surface-2);
    position: relative;
}
.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--text);
    color: #fff;
    font-size: 0.72rem;
    padding: 5px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}
.card-badge.accent { background: var(--accent); }
.card-body { padding: 18px 20px 22px; flex: 1; display: flex; flex-direction: column; }
.card-price {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.card-loc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 12px; }
.card-meta {
    display: flex;
    gap: 14px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-top: auto;
}
.card-meta span { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Filters bar ---------- */
.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 20px 0 28px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
}
.filters select,
.filters input {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text);
    outline: none;
}
.filters select:focus,
.filters input:focus { border-color: var(--text); }
.filters .count { margin-left: auto; color: var(--text-muted); font-size: 0.9rem; align-self: center; }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--text);
    color: #fff;
    padding: 64px 0 32px;
    margin-top: 80px;
}
.site-footer a { color: #fff; opacity: .8; }
.site-footer a:hover { opacity: 1; color: #fff; }
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-grid h4 {
    font-family: var(--font-sans);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-bottom: 16px;
    color: #fff;
    opacity: .6;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; font-size: 0.92rem; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.12);
    padding-top: 24px;
    font-size: 0.85rem;
    color: rgba(255,255,255,.6);
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

/* ---------- DevOps showcase ---------- */
.devops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.concept {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}
.concept .icon {
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 14px;
    letter-spacing: 0.04em;
}
.concept h3 {
    font-family: var(--font-sans);
    font-size: 1.05rem;
    margin-bottom: 6px;
}
.concept p { font-size: 0.93rem; color: var(--text-muted); margin: 0 0 12px; }
.concept a.more { font-size: 0.85rem; color: var(--accent); font-weight: 600; }

/* ---------- Code blocks ---------- */
pre, code {
    font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.85rem;
}
pre {
    background: #0F0F0F;
    color: #EDEDED;
    padding: 22px;
    border-radius: var(--radius);
    overflow-x: auto;
    line-height: 1.55;
    margin: 16px 0;
}
code.inline {
    background: var(--surface-2);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text);
    font-size: 0.85em;
}

/* ---------- Pipeline visualization ---------- */
.pipeline {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 20px 0 8px;
}
.stage {
    flex: 1;
    min-width: 110px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 12px;
    text-align: center;
    font-size: 0.88rem;
    position: relative;
}
.stage .step-num {
    display: block;
    font-size: 0.7rem;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.stage.ok { background: #F1F8F2; border-color: #C8E6CD; }
.stage.fail { background: #FDF1F2; border-color: #F2C8CB; }

/* ---------- Health dashboard ---------- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.metric {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
}
.metric .label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
}
.metric .value {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
}
.metric .delta { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }
.delta.up { color: #1B7F3A; }
.delta.down { color: var(--accent); }

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #F1F8F2;
    color: #1B7F3A;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid #C8E6CD;
}
.status-pill .dot {
    width: 8px; height: 8px; background: #1B7F3A; border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%,100% { opacity: 1; }
    50%     { opacity: .3; }
}

/* ---------- Property detail ---------- */
.detail-hero {
    aspect-ratio: 16 / 8;
    background-size: cover;
    background-position: center;
    border-radius: var(--radius);
    margin-bottom: 24px;
}
.detail-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 48px;
}
.detail-info dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
    margin: 24px 0;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.detail-info dt { color: var(--text-muted); font-size: 0.85rem; }
.detail-info dd { margin: 0; font-weight: 600; }
.contact-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    position: sticky;
    top: 96px;
}
.contact-card .price {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.contact-card form { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.contact-card input, .contact-card textarea {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    font-family: inherit;
    font-size: 0.92rem;
    outline: none;
    resize: vertical;
}
.contact-card input:focus, .contact-card textarea:focus { border-color: var(--text); }

/* ---------- Banner / strip ---------- */
.strip {
    background: var(--text);
    color: #fff;
    padding: 60px 0;
}
.strip h2 { color: #fff; }
.strip p { color: rgba(255,255,255,.7); }
.strip .btn-primary { margin-top: 8px; }

/* ---------- Tables ---------- */
table.simple {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 20px;
    font-size: 0.92rem;
}
table.simple th, table.simple td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}
table.simple th { color: var(--text-muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- Mobile ---------- */
@media (max-width: 880px) {
    .hero-grid, .detail-grid { grid-template-columns: 1fr; gap: 32px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .search-bar { grid-template-columns: 1fr; }
    .search-bar > *:not(:last-child) { border-right: none; border-bottom: 1px solid var(--border); }
    .nav-links { display: none; }
    section { padding: 48px 0; }
}

/* ---------- Misc ---------- */
.hidden { display: none !important; }
.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}
.tag {
    display: inline-block;
    background: var(--surface-2);
    color: var(--text);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 500;
    margin-right: 6px;
}
.callout {
    background: var(--surface);
    border-left: 3px solid var(--accent);
    padding: 18px 22px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 20px 0;
}
.callout strong { color: var(--accent); }
