/* ============================================================
   FastLocations — Properties Explorer
   Shared page styles + Properties Explorer component styles
   ============================================================ */

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; }

/* ── DESIGN TOKENS ── */
:root {
    --navy:       #1a5c2e;   /* dark forest green  */
    --navy-mid:   #1e6b35;
    --navy-light: #247a3d;
    --teal:       #2d9e52;   /* mid green accent   */
    --teal-light: #6cc48a;
    --teal-pale:  #e4f5eb;   /* pale green         */
    --cream:      #f4faf6;
    --text:       #0a1f10;
    --text-muted: #3d6b4a;
    --border:     #c2deca;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--cream);
}

/* ── HEADER ── */
.fl-header {
    background: var(--navy);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--navy-light);
}

.fl-header-inner {
    max-width: 1152px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fl-logo-area {
    display: flex;
    align-items: center;
    gap: 14px;
}

.fl-logo-area img {
    height: 44px;
    width: auto;
    filter: brightness(0) invert(1);
}

.fl-header-badge {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--teal-light);
    border: 1px solid rgba(125,196,234,0.35);
    padding: 3px 10px;
    border-radius: 20px;
    font-family: 'DM Sans', sans-serif;
}

.fl-header-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Force every nav li to participate in the same vertical alignment */
.fl-header-nav > li {
    display: flex;
    align-items: center;
    height: 100%;
}

.fl-header-nav a {
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    transition: color 0.2s;
    line-height: 1;
}
.fl-header-nav a:hover { color: #fff; }

/* ── NAV DROPDOWN ── */
.fl-nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.fl-nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.fl-nav-caret {
    font-size: 10px;
    opacity: 0.7;
    transition: transform 0.2s;
    display: inline-block;
}
.fl-nav-dropdown.open .fl-nav-caret { transform: rotate(180deg); }

.fl-nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 200px;
    list-style: none;
    margin: 0;
    padding: 0.4rem 0;
    z-index: 200;
    white-space: nowrap;
}
.fl-nav-dropdown.open .fl-nav-dropdown-menu { display: block; }

.fl-nav-dropdown-menu li a {
    display: block;
    padding: 0.55rem 1.1rem;
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    color: var(--text) !important;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    border-radius: 6px;
    margin: 0 0.3rem;
}
.fl-nav-dropdown-menu li a:hover {
    background: var(--teal-pale);
    color: var(--navy) !important;
}

/* Mobile: dropdown becomes inline list */
@media (max-width: 640px) {
    .fl-nav-dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: transparent;
        padding: 0;
        display: none;
    }
    .fl-nav-dropdown.open .fl-nav-dropdown-menu { display: block; }
    .fl-nav-dropdown-menu li a {
        padding: 0.55rem 1.5rem;
        color: rgba(255,255,255,0.6) !important;
        font-size: 13px;
        margin: 0;
        border-radius: 0;
    }
    .fl-nav-dropdown-menu li a:hover {
        background: transparent;
        color: #fff !important;
    }
}

/* ── HERO ── */
.fl-hero {
    background: var(--navy);
    padding: 5rem 2rem 4.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.fl-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 60% at 50% 100%, rgba(58,159,214,0.18) 0%, transparent 70%);
    pointer-events: none;
}

.fl-hero-eyebrow {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--teal-light);
    margin-bottom: 1.25rem;
    font-family: 'DM Sans', sans-serif;
}

.fl-hero h1 {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    font-weight: 400;
    color: #fff;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    letter-spacing: -0.01em;
}

.fl-hero h1 em {
    font-style: italic;
    color: var(--teal-light);
}

.fl-hero-sub {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.55);
    max-width: 560px;
    margin: 0 auto;
    font-weight: 300;
    line-height: 1.65;
    font-family: 'DM Sans', sans-serif;
}

/* ── TOC STRIP ── */
.fl-toc-strip {
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.fl-toc-inner {
    max-width: 1152px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
}
.fl-toc-inner::-webkit-scrollbar { display: none; }

.fl-toc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 1rem 1.5rem 1rem 0;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    white-space: nowrap;
    transition: color 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.fl-toc-item:hover { color: var(--navy); border-bottom-color: var(--navy); }

.fl-toc-num {
    font-size: 10px;
    font-weight: 500;
    color: var(--teal);
    background: var(--teal-pale);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── SECTION HEADERS ── */
.section-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-top: 3rem;
    border-top: 1px solid #e5e7eb;
}

.section-header.no-border {
    border-top: none;
    padding-top: 0;
}

.section-num {
    font-family: 'DM Serif Display', serif;
    font-size: 3rem;
    color: #d8e4ea;
    line-height: 1;
    flex-shrink: 0;
    user-select: none;
}

.section-meta { flex: 1; }

.section-tag {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 0.4rem;
    font-family: 'DM Sans', sans-serif;
}

.section-meta h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.9rem;
    font-weight: 400;
    color: var(--navy);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

/* ── PRINT ── */
@media print {
    body { background-color: white !important; }
    .no-print { display: none !important; }
    main { margin-top: 0 !important; padding-top: 0 !important; }
    .fl-header, .fl-hero, .fl-toc-strip { display: none !important; }
}

.article-content a:hover {
    color: #1a5c2e;
    text-decoration-color: #1a5c2e;
}

/* ── HAMBURGER ── */
.fl-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}
.fl-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: rgba(255,255,255,0.8);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

.fl-hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.fl-hamburger.active span:nth-child(2) { opacity: 0; }
.fl-hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 640px) {
    .fl-hero { padding: 3.5rem 1.5rem 3rem; }
    .fl-header-inner { height: auto; padding: 0.8rem 1.25rem; flex-wrap: wrap; }
    .fl-hamburger { display: flex; }

    .fl-header-nav {
        display: none;
        flex-direction: column;
        gap: 0;
        width: 100%;
        padding: 0.5rem 0 0.25rem;
        margin-top: 0.6rem;
        border-top: 1px solid rgba(255,255,255,0.1);
        list-style: none;
    }
    .fl-header-nav.open { display: flex; }
    .fl-header-nav li a {
        display: block;
        padding: 0.65rem 0;
        font-size: 14px;
        color: rgba(255,255,255,0.75);
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    .fl-header-nav li:last-child a { border-bottom: none; }
}

/* ── FOOTER ── */
.fl-footer {
    background: var(--navy);
    padding: 2rem;
    text-align: center;
    margin-top: 3rem;
}

.fl-footer p {
    font-size: 12px;
    color: rgba(255,255,255,0.3);
    font-family: 'DM Sans', sans-serif;
}

.fl-footer a {
    color: var(--teal-light);
    text-decoration: none;
}

.fl-footer a:hover { color: #fff; }

/* ============================================================
   Properties Explorer component styles
   ============================================================ */

.prop-search-bar {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem 1rem;
    margin-bottom: 1.25rem;
}
.prop-search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}
.prop-search-field { display: flex; flex-direction: column; flex: 1 1 160px; }
.prop-search-wide  { flex: 2 1 220px; }
.prop-search-narrow{ flex: 0 0 auto; }
.prop-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 0.3rem;
    font-family: 'DM Sans', sans-serif;
}
.prop-input {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    background: #f8fafc;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}
.prop-input:focus { border-color: var(--navy); background: #fff; }
.prop-reset-btn {
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    padding: 0.5rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.prop-reset-btn:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.prop-count {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0.6rem 0 0;
    font-family: 'DM Sans', sans-serif;
}
.prop-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.prop-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    table-layout: fixed;
}

/* Column widths — must add to 100% */
.prop-table th:nth-child(1), .prop-table td:nth-child(1) { width: 16%; }  /* Name    */
.prop-table th:nth-child(2), .prop-table td:nth-child(2) { width: 16%; }  /* Address */
.prop-table th:nth-child(3), .prop-table td:nth-child(3) { width: 10%; }  /* City    */
.prop-table th:nth-child(4), .prop-table td:nth-child(4) { width: 20%; }  /* Type    */
.prop-table th:nth-child(5), .prop-table td:nth-child(5) { width: 9%;  }  /* Min     */
.prop-table th:nth-child(6), .prop-table td:nth-child(6) { width: 9%;  }  /* Max     */
.prop-table th:nth-child(7), .prop-table td:nth-child(7) { width: 12%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }  /* Source  */
.prop-table th:nth-child(8), .prop-table td:nth-child(8) { width: 8%;  }  /* Link    */
.prop-th {
    background: var(--navy);
    color: rgba(255,255,255,0.85);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.7rem 0.9rem;
    text-align: left;
    white-space: nowrap;
    font-family: 'DM Sans', sans-serif;
}
.prop-th.sortable { cursor: pointer; user-select: none; }
.prop-th.sortable:hover { background: var(--navy-light); }
.sort-icon { font-size: 10px; opacity: 0.7; margin-left: 3px; }
.prop-table tbody tr { border-bottom: 1px solid #f0f4f8; transition: background 0.1s; }
.prop-table tbody tr:last-child { border-bottom: none; }
.prop-table tbody tr:hover { background: var(--teal-pale); }
.prop-table td { padding: 0.6rem 0.9rem; vertical-align: middle; color: var(--text); }
.prop-name { font-weight: 500; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prop-addr { color: var(--text-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Type cell: wraps badges, clips overflow */
.prop-type-cell { line-height: 1.8; overflow: hidden; }
.prop-type-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: 20px;
    background: var(--teal-pale);
    color: var(--navy);
    white-space: nowrap;
    text-transform: uppercase;
    margin: 1px 1px;
}
.prop-source-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 20px;
    background: #f0f4f8;
    color: var(--text-muted);
    white-space: nowrap;
}
.prop-num { text-align: right; color: var(--text-muted); font-size: 12px; overflow: hidden; }
.prop-link a {
    font-size: 11px;
    font-weight: 500;
    color: var(--teal);
    text-decoration: none;
    border: 1px solid var(--teal-light);
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.prop-link a:hover { background: var(--teal); color: #fff; border-color: var(--teal); }
.prop-pager {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1rem;
}
.prop-pager button {
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}
.prop-pager button:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.prop-pager button.active { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 600; }
.prop-pager button:disabled { opacity: 0.35; cursor: default; }
.prop-pager button:disabled:hover { background: #fff; color: var(--text-muted); border-color: var(--border); }
.prop-pager-info {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: var(--text-muted);
    padding: 0 0.5rem;
    align-self: center;
}
.prop-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 13px;
    color: #b91c1c;
    margin-bottom: 0.75rem;
}
.prop-empty { padding: 2rem; text-align: center; color: var(--text-muted); font-size: 14px; }

/* ============================================================
   Mobile — card layout for property table (≤767px)
   ============================================================ */
@media (max-width: 767px) {

    /* Filters: single column, full width */
    .prop-search-field  { flex: 1 1 100%; }
    .prop-search-wide   { flex: 1 1 100%; }
    .prop-search-narrow { flex: 1 1 100%; }
    .prop-reset-btn     { width: 100%; text-align: center; padding: 0.6rem 1rem; }

    /* Hide table header */
    .prop-table thead { display: none; }

    /* Flatten table structure */
    .prop-table,
    .prop-table tbody,
    .prop-table tr { display: block; width: 100%; }

    /* Remove table wrapper styling */
    .prop-table-wrap {
        border: none;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
        overflow: visible;
    }

    /* Each row = a card */
    .prop-table tbody tr {
        border: 1px solid var(--border);
        border-radius: 12px;
        margin-bottom: 0.85rem;
        padding: 0.85rem 1rem 0.75rem;
        background: #fff;
        box-shadow: 0 1px 4px rgba(0,0,0,0.05);
        overflow: visible;
    }
    .prop-table tbody tr:hover { background: var(--teal-pale); }
    .prop-table tbody tr:last-child { border-bottom: 1px solid var(--border); }

    /* ── Title: full-width card header ── */
    .prop-table td:nth-child(1) {
        display: block;
        width: 100%;
        box-sizing: border-box;
        font-size: 14px;
        font-weight: 600;
        color: var(--navy);
        white-space: normal;
        overflow: visible;
        padding: 0 0 0.6rem 0;
        margin-bottom: 0.6rem;
        border-bottom: 1px solid #eef2f7;
    }
    .prop-table td:nth-child(1)::before { display: none; }

    /* ── Hide Address and Size (Max) ── */
    .prop-table td:nth-child(2),
    .prop-table td:nth-child(6) { display: none; }

    /* ── Each field: absolute label + padded value ──
       padding-left creates the label column; ::before sits in it.
       This guarantees the value always gets (100% - label_width). */
    .prop-table td {
        display: block;
        position: relative;
        width: 100% !important; /* <--- ADDED !important to fix desktop percentage override */
        box-sizing: border-box;
        padding: 0.25rem 0 0.25rem 88px;
        border: none;
        overflow: visible;
        white-space: normal;
        min-height: 1.6em;
    }

    /* Label — absolutely positioned in the left padding area */
    .prop-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        top: 0.3rem;
        width: 80px;
        font-size: 9px;
        font-weight: 700;
        letter-spacing: 0.07em;
        text-transform: uppercase;
        color: var(--teal);
        font-family: 'DM Sans', sans-serif;
        line-height: 1.3;
    }

    /* Value area — always gets full remaining width */
    .prop-type-cell { overflow: visible; line-height: 1.8; }
    .prop-name { white-space: normal; overflow: visible; }
    .prop-addr { white-space: normal; overflow: visible; }
    .prop-num  { text-align: left; overflow: visible; white-space: normal; }

    /* Link */
    .prop-link a { display: inline-block; padding: 5px 16px; font-size: 12px; }

    /* Pager */
    .prop-pager button { padding: 6px 14px; font-size: 13px; }
}