/* Paraguay Geodata — shared site CSS
   Loaded by every page.  Defines tokens, layout, tabs, mobile, components.
   Note: this is a SCALABLE design system — it does NOT replace the inline
   styles in index.html (those are tied to legacy map JS).  This is for new
   pages + the property/compare/saved/FAQ/contact/use-case pages.
*/
:root {
    --bg:        #0a0a14;
    --bg-elev:   #14141f;
    --bg-elev-2: #1c1c2c;
    --fg:        #e8e8ee;
    --fg-dim:    #88889a;
    --line:      #2a2a3a;
    --accent:    #fbbf24;
    --accent-dim:#8a6e0e;
    --link:      #fbbf24;
    --good:      #34d399;
    --warn:      #fb923c;
    --bad:       #ef4444;
    --info:      #38bdf8;
    --radius:    6px;
    --shadow:    0 4px 12px rgba(0,0,0,.4);
    --font:      ui-sans-serif, system-ui, -apple-system, "Inter", "Helvetica Neue", sans-serif;
    --mono:      ui-monospace, SFMono-Regular, "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    background: var(--bg); color: var(--fg);
    font-family: var(--font); font-size: 14px; line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

/* Skip link for accessibility */
.skip-link {
    position: absolute; top: -40px; left: 8px;
    background: var(--accent); color: #000; padding: 8px 12px;
    border-radius: 4px; font-weight: 600;
    z-index: 100000;
}
.skip-link:focus { top: 8px; }

/* ===== Header ===== */
header.site-header {
    display: flex; align-items: center; gap: 16px;
    padding: 12px 16px;
    background: var(--bg-elev); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 100;
}
header.site-header h1 {
    margin: 0; font-size: 18px; font-weight: 600;
}
header.site-header h1 .accent { color: var(--accent); }
header.site-header h1 .live {
    background: var(--good); color: #000; font-size: 9px;
    padding: 1px 5px; border-radius: 3px; vertical-align: middle; margin-left: 4px;
}
header.site-header nav.primary {
    display: flex; gap: 4px; margin-left: auto;
    flex-wrap: wrap;
}
header.site-header nav.primary a {
    padding: 6px 10px; border-radius: 4px;
    color: var(--fg); font-size: 13px;
}
header.site-header nav.primary a:hover { background: var(--bg-elev-2); text-decoration: none; }
header.site-header nav.primary a.active { background: var(--bg-elev-2); color: var(--accent); }

/* Mobile nav */
@media (max-width: 768px) {
    header.site-header {
        flex-wrap: wrap;
    }
    header.site-header h1 { font-size: 16px; }
    header.site-header nav.primary {
        display: none;  /* hide by default on mobile, toggled by .open */
    }
    header.site-header nav.primary.open {
        display: flex;
        flex-direction: column;
        width: 100%;
        margin-top: 8px;
    }
    .menu-toggle {
        display: block !important;
        margin-left: auto;
    }
}
.menu-toggle {
    display: none;
    background: none; border: 1px solid var(--line);
    color: var(--fg); padding: 4px 8px; border-radius: 4px;
    cursor: pointer;
}

/* ===== Main layout ===== */
main {
    max-width: 1200px; margin: 0 auto; padding: 24px 16px;
}

/* ===== Hero / pitch ===== */
.hero {
    text-align: center; padding: 48px 16px;
    background: linear-gradient(180deg, var(--bg-elev) 0%, var(--bg) 100%);
    border-radius: 12px; margin-bottom: 32px;
}
.hero h1 {
    font-size: clamp(28px, 5vw, 48px);
    margin: 0 0 12px;
}
.hero h1 .accent { color: var(--accent); }
.hero p.lead {
    font-size: clamp(14px, 2vw, 18px);
    color: var(--fg-dim); max-width: 720px; margin: 0 auto 24px;
}
.hero .search-row {
    display: flex; max-width: 560px; margin: 0 auto 16px;
    gap: 8px;
}
.hero .search-row input {
    flex: 1; padding: 10px 14px; border-radius: var(--radius);
    border: 1px solid var(--line); background: var(--bg-elev-2);
    color: var(--fg); font-size: 15px;
}
.hero .search-row button {
    padding: 10px 16px; border-radius: var(--radius);
    background: var(--accent); color: #000; border: none;
    font-weight: 600; cursor: pointer;
}

/* ===== Metric strip ===== */
.metrics {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
    margin: 24px 0;
}
@media (max-width: 768px) {
    .metrics { grid-template-columns: repeat(2, 1fr); }
}
.metric {
    background: var(--bg-elev); border: 1px solid var(--line);
    border-radius: 8px; padding: 16px; text-align: center;
}
.metric .num {
    font-size: 28px; font-weight: 700; color: var(--accent);
    line-height: 1;
}
.metric .lbl {
    font-size: 11px; color: var(--fg-dim); margin-top: 4px;
}

/* ===== Card grid (use cases) ===== */
.card-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
    margin: 24px 0;
}
@media (max-width: 768px) {
    .card-grid { grid-template-columns: 1fr; }
}
.card {
    background: var(--bg-elev); border: 1px solid var(--line);
    border-radius: 8px; padding: 20px; transition: transform .15s;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0 0 16px; color: var(--fg-dim); font-size: 13px; line-height: 1.6; }
.card .cta {
    display: inline-block; padding: 8px 14px;
    background: var(--accent); color: #000; border-radius: 4px;
    font-weight: 600; font-size: 13px;
}
.card .cta:hover { text-decoration: none; background: #fcd34d; }

/* ===== Sidebar tabs (right panel of home page) ===== */
.tabs {
    display: flex; gap: 4px; border-bottom: 1px solid var(--line);
    margin-bottom: 12px;
}
.tabs .tab {
    padding: 8px 12px; background: none; border: none;
    color: var(--fg-dim); cursor: pointer; font-size: 13px;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs .tab:hover { color: var(--fg); }
.tabs .tab.active {
    color: var(--accent); border-bottom-color: var(--accent);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== Buttons ===== */
.btn {
    display: inline-block; padding: 8px 14px;
    background: var(--accent); color: #000; border: none;
    border-radius: var(--radius); cursor: pointer;
    font-weight: 600; font-size: 13px; text-decoration: none;
}
.btn:hover { background: #fcd34d; text-decoration: none; }
.btn-secondary { background: var(--bg-elev-2); color: var(--fg); border: 1px solid var(--line); }
.btn-secondary:hover { background: var(--bg-elev); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-sm { padding: 4px 8px; font-size: 11px; }

/* ===== Property listing cards ===== */
.listing-card {
    background: var(--bg-elev); border: 1px solid var(--line);
    border-radius: 8px; padding: 16px; margin-bottom: 12px;
    transition: border-color .15s;
}
.listing-card:hover { border-color: var(--accent); }
.listing-card .row1 {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 12px;
}
.listing-card .row1 .title {
    font-size: 16px; font-weight: 600; flex: 1;
}
.listing-card .row1 .save-btn {
    background: none; border: 1px solid var(--line);
    color: var(--fg-dim); width: 32px; height: 32px;
    border-radius: 4px; cursor: pointer;
    font-size: 16px;
}
.listing-card .row1 .save-btn.saved { background: var(--accent); color: #000; border-color: var(--accent); }
.listing-card .row2 {
    display: flex; gap: 16px; margin: 8px 0;
    color: var(--fg-dim); font-size: 12px;
}
.listing-card .price {
    font-size: 22px; font-weight: 700; color: var(--accent);
}
.listing-card .price-secondary {
    color: var(--fg-dim); font-size: 11px;
}
.listing-card .row4 {
    display: flex; gap: 8px; margin-top: 12px;
    flex-wrap: wrap;
}

/* ===== Compare table ===== */
.compare-table {
    width: 100%; border-collapse: collapse;
    background: var(--bg-elev); border: 1px solid var(--line);
    border-radius: 8px; overflow: hidden;
}
.compare-table th, .compare-table td {
    padding: 12px 16px; text-align: left;
    border-bottom: 1px solid var(--line);
}
.compare-table th {
    background: var(--bg-elev-2); font-size: 12px;
    text-transform: uppercase; letter-spacing: .04em;
    color: var(--fg-dim);
}
.compare-table td.num { text-align: right; font-family: var(--mono); }
.compare-table tr:last-child td { border-bottom: none; }
.compare-table .winner {
    background: rgba(251, 191, 36, .08);
    font-weight: 700;
}
.compare-table .winner-marker {
    display: inline-block; margin-left: 6px;
    background: var(--accent); color: #000;
    font-size: 9px; padding: 1px 5px; border-radius: 3px;
}

/* ===== Saved listings ===== */
.saved-empty {
    text-align: center; padding: 64px 16px;
    color: var(--fg-dim); border: 1px dashed var(--line);
    border-radius: 8px;
}
.saved-empty .icon {
    font-size: 48px; margin-bottom: 16px;
}

/* ===== Onboarding overlay ===== */
.onboarding-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.75);
    display: none; align-items: center; justify-content: center;
    z-index: 99999;
}
.onboarding-overlay.open { display: flex; }
.onboarding-card {
    background: var(--bg-elev); border: 1px solid var(--accent);
    border-radius: 12px; max-width: 480px; padding: 32px;
    margin: 16px;
}
.onboarding-card h2 { margin: 0 0 12px; color: var(--accent); }
.onboarding-card p { color: var(--fg-dim); margin: 0 0 24px; }
.onboarding-card .nav-row {
    display: flex; justify-content: space-between; align-items: center;
}
.onboarding-card .nav-row .progress {
    color: var(--fg-dim); font-size: 12px;
}
.onboarding-card .nav-row button {
    background: var(--accent); color: #000;
    border: none; padding: 8px 16px; border-radius: 4px;
    font-weight: 600; cursor: pointer;
}
.onboarding-card .nav-row button.skip {
    background: none; color: var(--fg-dim); border: 1px solid var(--line);
}

/* ===== Cookie banner ===== */
.cookie-banner {
    position: fixed; bottom: 16px; left: 16px; right: 16px;
    background: var(--bg-elev); border: 1px solid var(--accent);
    border-radius: 8px; padding: 16px;
    display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
    box-shadow: var(--shadow);
    z-index: 99998; max-width: 720px; margin: 0 auto;
}
.cookie-banner p { margin: 0; flex: 1; font-size: 13px; }
.cookie-banner button {
    background: var(--accent); color: #000; border: none;
    padding: 8px 14px; border-radius: 4px; font-weight: 600;
    cursor: pointer; font-size: 12px;
}
.cookie-banner button.decline {
    background: none; color: var(--fg); border: 1px solid var(--line);
}

/* ===== Feedback widget ===== */
.feedback-btn {
    position: fixed; bottom: 16px; right: 16px;
    background: var(--accent); color: #000;
    border: none; padding: 10px 16px; border-radius: 24px;
    font-weight: 600; cursor: pointer;
    box-shadow: var(--shadow); z-index: 99997;
}
.feedback-modal {
    position: fixed; bottom: 80px; right: 16px;
    background: var(--bg-elev); border: 1px solid var(--accent);
    border-radius: 8px; padding: 16px; width: 320px;
    box-shadow: var(--shadow); z-index: 99997;
    display: none;
}
.feedback-modal.open { display: block; }
.feedback-modal textarea {
    width: 100%; min-height: 80px; padding: 8px; border-radius: 4px;
    background: var(--bg-elev-2); color: var(--fg);
    border: 1px solid var(--line); resize: vertical;
    font-family: var(--font); font-size: 13px;
}

/* ===== Map controls (cartographic) ===== */
.map-scale {
    background: rgba(255,255,255,.85); color: #000;
    padding: 2px 6px; border-radius: 3px; font-size: 10px;
    font-family: var(--mono);
}
.map-north {
    background: rgba(255,255,255,.9); color: #000;
    padding: 4px; border-radius: 50%;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
    box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.map-legend {
    background: var(--bg-elev); color: var(--fg);
    border: 1px solid var(--line); border-radius: 6px;
    padding: 8px 12px; font-size: 12px;
    box-shadow: var(--shadow);
    max-width: 200px;
}

/* ===== Footer ===== */
footer.site-footer {
    border-top: 1px solid var(--line); padding: 24px 16px;
    margin-top: 64px;
    display: flex; gap: 16px; flex-wrap: wrap;
    color: var(--fg-dim); font-size: 12px;
    justify-content: center;
    text-align: center;
}
footer.site-footer a { color: var(--fg-dim); }
footer.site-footer a:hover { color: var(--accent); }

/* ===== Article styles (FAQ + Privacy + Use case pages) ===== */
article.prose {
    max-width: 800px; margin: 0 auto;
}
article.prose h1 { font-size: 32px; margin: 0 0 16px; }
article.prose h2 { font-size: 22px; margin: 32px 0 12px; color: var(--accent); }
article.prose h3 { font-size: 17px; margin: 24px 0 8px; }
article.prose p { margin: 0 0 16px; line-height: 1.7; }
article.prose ul, article.prose ol { margin: 0 0 16px; padding-left: 24px; }
article.prose li { margin-bottom: 8px; line-height: 1.6; }
article.prose code { background: var(--bg-elev-2); padding: 1px 5px; border-radius: 3px; font-family: var(--mono); font-size: 12px; }
article.prose pre { background: var(--bg-elev-2); padding: 12px; border-radius: 6px; overflow-x: auto; font-size: 12px; }
article.prose blockquote { border-left: 3px solid var(--accent); margin: 16px 0; padding: 8px 16px; color: var(--fg-dim); }

/* ===== Breadcrumbs ===== */
.breadcrumb {
    font-size: 12px; color: var(--fg-dim);
    margin-bottom: 16px;
}
.breadcrumb a { color: var(--fg-dim); }
.breadcrumb .sep { margin: 0 4px; }

/* ===== Print ===== */
@media print {
    header.site-header, footer.site-footer, .feedback-btn, .cookie-banner {
        display: none !important;
    }
    body { background: #fff; color: #000; }
}