/* Directory engine stylesheet. All colors come from CSS custom properties
   emitted by the header template from config.php — edit config, not this. */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-body, "Nunito Sans"), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--c-bg);
    color: var(--c-text);
    line-height: 1.6;
    font-size: 16px;
}
img { max-width: 100%; height: auto; }
a { color: var(--c-primary); }
h1, h2, h3 {
    font-family: var(--font-heading, "Poppins"), "Nunito Sans", -apple-system, sans-serif;
    line-height: 1.25; color: var(--c-primary); letter-spacing: -0.01em;
}
h1 { font-size: 1.7rem; }
h2 { font-size: 1.35rem; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---- top bar ---- */
.topbar {
    background: var(--c-topbar-bg); color: var(--c-topbar-text);
    box-shadow: 0 1px 0 rgba(0,0,0,0.06), 0 2px 12px rgba(17,56,97,0.06);
    position: relative; z-index: 5;
}
.topbar .wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 24px; padding-top: 12px; padding-bottom: 12px; }
.brand { font-family: var(--font-heading, "Poppins"), sans-serif; font-size: 1.2rem; font-weight: 700; color: var(--c-topbar-text); text-decoration: none; display: flex; align-items: center; }
.brand img { max-height: 48px; display: block; }
.nav { display: flex; gap: 6px 22px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.nav a { color: var(--c-topbar-text); text-decoration: none; font-size: 0.97rem; font-weight: 600; opacity: 0.85; }
.nav a:hover { opacity: 1; }
.nav a.nav-cta {
    background: var(--c-accent); color: #fff; opacity: 1;
    padding: 9px 18px; border-radius: 999px; font-weight: 700;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    transition: transform 0.15s ease;
}
.nav a.nav-cta:hover { transform: translateY(-1px); }

/* ---- hero ---- */
.hero {
    background:
        radial-gradient(circle at 15% 20%, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0) 40%),
        radial-gradient(circle at 85% 80%, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 45%),
        linear-gradient(135deg, var(--c-primary) 0%, rgba(var(--c-primary-rgb),0.82) 55%, var(--c-primary) 100%);
    color: #fff; padding: 56px 0 64px; text-align: center;
    position: relative; overflow: hidden;
}
.hero-photo {
    background-size: cover; background-position: center 65%;
    padding: 84px 0 92px;
}
.hero-photo::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(var(--c-primary-rgb),0.55) 0%, rgba(var(--c-primary-rgb),0.35) 45%, rgba(var(--c-primary-rgb),0.65) 100%);
}
.hero-inner { position: relative; }
.hero h1 {
    color: #fff; margin: 0 0 10px; font-size: 2.4rem; font-weight: 800;
    text-shadow: 0 2px 14px rgba(0,0,0,0.35);
}
.hero p { margin: 0 auto 26px; opacity: 0.95; font-size: 1.12rem; max-width: 640px; text-shadow: 0 1px 8px rgba(0,0,0,0.35); }
.searchbox {
    display: flex; max-width: 620px; margin: 0 auto; background: #fff;
    border-radius: 999px; padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.searchbox input {
    flex: 1; padding: 12px 20px; font-size: 1.02rem; border: 0; min-width: 0;
    border-radius: 999px; outline: none; font-family: inherit;
}
.searchbox button {
    padding: 12px 28px; font-size: 1rem; border: 0; cursor: pointer;
    background: var(--c-accent); color: #fff; border-radius: 999px; font-weight: 700;
    font-family: inherit; transition: filter 0.15s ease;
}
.searchbox button:hover { filter: brightness(1.08); }
.hero-quiz-cta { margin: 6px 0 10px; }
.btn-hero { font-size: 1.1rem; padding: 15px 34px; }
.hero-search-demoted { margin: 0 0 16px; font-size: 0.92rem; opacity: 0.85; }
.hero-search-demoted a { color: #fff; text-decoration: underline; }
.searchbox-secondary { max-width: 440px; opacity: 0.92; transform: scale(0.94); }
.hero-stats {
    display: flex; gap: 14px 34px; justify-content: center; flex-wrap: wrap;
    margin-top: 28px; font-size: 0.98rem; opacity: 0.95;
    text-shadow: 0 1px 6px rgba(0,0,0,0.4);
}
.hero-stats strong { font-size: 1.15rem; font-weight: 800; }
.hero-credit {
    position: absolute; right: 14px; bottom: 10px; margin: 0; z-index: 1;
    font-size: 0.72rem; opacity: 0.65; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.hero-credit a { color: #fff; text-decoration: underline; }

/* ---- welcome blurb ---- */
.welcome { text-align: center; padding: 36px 0 6px; }
.welcome h2 { font-size: 1.55rem; margin: 0 0 8px; }
.welcome p { max-width: 700px; margin: 0 auto; color: #52606f; font-size: 1.04rem; }

/* ---- sections / grids ---- */
.section { padding: 34px 0; }
.section-alt { background: var(--c-surface); }
.section-title { margin-top: 0; }
.more-link a { font-weight: 700; text-decoration: none; }
.more-link a:hover { text-decoration: underline; }
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 560px)  { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 860px)  { .grid { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 700px)  { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* ---- trust points (config 'trust_points') ---- */
.trust-points { padding-top: 40px; }
.trust-point { text-align: center; padding: 8px 14px; }
.trust-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 56px; height: 56px; border-radius: 16px; background: var(--c-surface);
    font-size: 1.6rem; margin-bottom: 14px;
}
.trust-point h3 { margin: 0 0 6px; font-size: 1.08rem; }
.trust-point p { margin: 0; color: #52606f; font-size: 0.94rem; }

.tile {
    display: flex; align-items: center; gap: 12px;
    background: var(--c-bg); border: 1px solid rgba(17,56,97,0.10);
    border-radius: 14px; padding: 14px 16px; text-decoration: none; color: var(--c-text);
    box-shadow: 0 1px 3px rgba(17,56,97,0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.section-alt .tile { background: var(--c-bg); }
.tile:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(17,56,97,0.12); border-color: rgba(17,56,97,0.25); }
.tile .t-icon {
    flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px;
    background: var(--c-surface); display: flex; align-items: center; justify-content: center;
    font-size: 1.35rem;
}
.tile .t-text { display: flex; flex-direction: column; min-width: 0; }
.tile .t-name { font-weight: 700; color: var(--c-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .t-count { font-size: 0.84rem; color: #6b7280; }

/* ---- listing cards ---- */
.card {
    background: var(--c-bg); border: 1px solid rgba(17,56,97,0.10); border-radius: 14px;
    padding: 16px; margin-bottom: 14px; height: 100%;
    box-shadow: 0 1px 3px rgba(17,56,97,0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(17,56,97,0.12); }
.card.tier-premium { border: 2px solid var(--c-accent); box-shadow: 0 4px 16px rgba(239,68,68,0.14); }
.card.tier-featured { border: 1.5px solid var(--c-primary); }
.card-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.avatar {
    flex: 0 0 auto; width: 46px; height: 46px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-heading, "Poppins"), sans-serif; font-weight: 700; font-size: 1.05rem;
    background: hsl(var(--hue, 210), 55%, 92%); color: hsl(var(--hue, 210), 45%, 32%);
}
.card-title { min-width: 0; }
.card h3 { margin: 0 0 4px; font-size: 1.08rem; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.chip {
    display: inline-block; font-size: 0.8rem; font-weight: 700; text-decoration: none;
    background: var(--c-surface); color: var(--c-primary);
    padding: 3px 10px; border-radius: 999px;
}
.chip:hover { background: rgba(17,56,97,0.12); }
.card .meta { font-size: 0.9rem; color: #4b5563; margin: 3px 0; display: flex; align-items: baseline; gap: 6px; }
.ico { width: 13px; height: 13px; fill: #9aa5b1; flex: 0 0 auto; position: relative; top: 1px; }
.badge {
    display: inline-block; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.05em;
    text-transform: uppercase; padding: 2px 9px; border-radius: 999px; margin-left: 8px;
    vertical-align: middle;
}
.badge-premium { background: var(--c-accent); color: #fff; }
.badge-featured { background: var(--c-primary); color: var(--c-primary-text); }
.stars { color: #eab308; font-weight: 700; font-size: 0.92rem; }
.stars-count { color: #6b7280; font-weight: 400; }

/* ---- two-column layout with sidebar ---- */
.cols { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .cols { grid-template-columns: minmax(0,1fr) 300px; } }
.sidebar .ad-slot { margin-bottom: 16px; }

/* ---- ad slots ---- */
.ad-slot {
    background: var(--c-surface); border: 1px dashed rgba(17,56,97,0.22); border-radius: 12px;
    padding: 12px 14px; text-align: center; font-size: 0.92rem; margin: 14px 0;
}
.ad-slot a { text-decoration: none; color: var(--c-text); display: block; }
.ad-slot img { display: block; margin: 0 auto; border-radius: 8px; }
.ad-header { margin: 0; border-radius: 0; border-left: 0; border-right: 0; border-top: 0; }

/* ---- buttons & forms ---- */
.btn {
    display: inline-block; background: var(--c-accent); color: #fff; text-decoration: none;
    font-weight: 700; padding: 11px 24px; border-radius: 999px; border: 0; cursor: pointer;
    font-size: 1rem; font-family: inherit;
    box-shadow: 0 3px 10px rgba(0,0,0,0.12); transition: transform 0.15s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--c-primary); border: 2px solid var(--c-primary); box-shadow: none; }
.form-grid { display: grid; gap: 12px; max-width: 520px; }
.form-grid label { font-weight: 700; font-size: 0.92rem; }
.form-grid input, .form-grid textarea, .form-grid select {
    width: 100%; padding: 11px 14px; font-size: 1rem; border: 1px solid #cbd5e1;
    border-radius: 10px; font-family: inherit;
}
.form-grid input:focus, .form-grid textarea:focus { outline: 2px solid var(--c-primary); border-color: transparent; }
.notice { background: #ecfdf5; border: 1px solid #10b981; color: #065f46; padding: 12px 16px; border-radius: 10px; margin: 14px 0; }
.error { background: #fef2f2; border: 1px solid var(--c-accent); color: #991b1b; padding: 12px 16px; border-radius: 10px; margin: 14px 0; }

/* ---- buyer-match quiz wizard ---- */
.quiz-wizard {
    max-width: 640px; background: var(--c-bg); border: 1px solid rgba(17,56,97,0.10);
    border-radius: 18px; padding: 30px 30px 26px; box-shadow: 0 6px 28px rgba(17,56,97,0.08);
    margin-top: 8px;
}
.quiz-progress { height: 8px; border-radius: 999px; background: var(--c-surface); overflow: hidden; }
.quiz-progress-fill { height: 100%; background: var(--c-accent); border-radius: 999px; transition: width 0.25s ease; }
.quiz-step-counter { margin: 10px 0 22px; font-size: 0.85rem; font-weight: 700; color: #6b7280; letter-spacing: 0.02em; }
.quiz-question { margin: 0 0 18px; font-size: 1.3rem; }
.quiz-options-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 520px) { .quiz-options-grid { grid-template-columns: repeat(2, 1fr); } }
.quiz-option-card {
    display: flex; align-items: center; gap: 10px; cursor: pointer;
    border: 2px solid #e2e8f0; border-radius: 12px; padding: 14px 16px;
    font-weight: 600; font-size: 0.98rem; transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.quiz-option-card:hover { border-color: var(--c-primary); transform: translateY(-1px); }
.quiz-option-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.quiz-option-card.selected { border-color: var(--c-accent); background: var(--c-surface); }
.quiz-option-card.selected::after { content: "✓"; margin-left: auto; color: var(--c-accent); font-weight: 800; }
.quiz-select, .quiz-text-input {
    width: 100%; padding: 12px 14px; font-size: 1.02rem; border: 1px solid #cbd5e1;
    border-radius: 10px; font-family: inherit; margin-bottom: 4px;
}
.quiz-contact-label { display: block; font-weight: 700; font-size: 0.92rem; margin-bottom: 14px; }
.quiz-contact-label input {
    display: block; width: 100%; margin-top: 6px; padding: 11px 14px; font-size: 1rem;
    border: 1px solid #cbd5e1; border-radius: 10px; font-family: inherit; font-weight: 400;
}
.quiz-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; gap: 10px; }
.quiz-step[hidden] { display: none; }
.match-card {
    background: var(--c-surface); border-radius: 12px; padding: 18px; height: 100%;
    display: flex; flex-direction: column; gap: 6px;
}
.match-card h3 { margin: 0; font-size: 1.1rem; }
.match-desc { color: #52606f; font-size: 0.92rem; margin: 0; flex-grow: 1; }
.match-range { font-weight: 700; color: var(--c-primary); margin: 0; }

/* ---- detail page ---- */
.detail-head { padding: 28px 0 8px; }
.detail-head h1 { margin-bottom: 4px; }
.detail-meta { color: #4b5563; }
.detail-actions { margin: 16px 0; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- owner panel: claim/upgrade demoted below the buyer-facing lead
   form, visually distinct so it doesn't compete with the primary CTA ---- */
.owner-panel {
    margin-top: 32px; padding: 20px 22px; border-radius: 14px;
    background: var(--c-surface); border: 1px solid rgba(17,56,97,0.08);
}
.owner-panel h2 { margin: 0 0 6px; font-size: 1.1rem; }
.owner-panel p { margin: 0 0 4px; color: #52606f; font-size: 0.92rem; }
.owner-panel .detail-actions { margin-bottom: 0; }
.info-table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.info-table th, .info-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid rgba(0,0,0,0.07); vertical-align: top; }
.info-table th { width: 140px; color: #6b7280; font-weight: 700; font-size: 0.9rem; }
.social-links a { margin-right: 12px; }

/* ---- range filter links (config range_filter) ---- */
.filter-links { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0 18px; font-size: 0.92rem; }
.filter-links a {
    padding: 6px 14px; border: 1px solid #cbd5e1; border-radius: 999px;
    text-decoration: none; color: var(--c-text); background: var(--c-bg); font-weight: 600;
}
.filter-links a:hover { border-color: var(--c-primary); }
.filter-links a.current { background: var(--c-primary); color: var(--c-primary-text); border-color: var(--c-primary); }

/* ---- pagination ---- */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin: 20px 0; }
.pagination a, .pagination span {
    padding: 7px 13px; border: 1px solid #cbd5e1; border-radius: 10px; text-decoration: none; font-size: 0.92rem; font-weight: 600;
}
.pagination .current { background: var(--c-primary); color: var(--c-primary-text); border-color: var(--c-primary); }

/* ---- packages ---- */
.pkg-grid { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 800px) { .pkg-grid { grid-template-columns: repeat(3, 1fr); } }
.pkg {
    border: 1px solid rgba(17,56,97,0.12); border-radius: 16px; padding: 24px; background: var(--c-bg);
    box-shadow: 0 2px 8px rgba(17,56,97,0.06);
}
.pkg.pkg-highlight { border: 2px solid var(--c-accent); box-shadow: 0 8px 24px rgba(239,68,68,0.14); }
.pkg h3 { margin-top: 0; }
.pkg .price { font-size: 1.8rem; font-weight: 800; color: var(--c-primary); font-family: var(--font-heading, "Poppins"), sans-serif; }
.pkg .price small { font-size: 0.9rem; color: #6b7280; font-weight: 400; }
.pkg ul { padding-left: 20px; margin: 12px 0; }
.pkg li { margin: 7px 0; font-size: 0.95rem; }

/* ---- breadcrumbs / footer ---- */
.crumbs { font-size: 0.85rem; color: #6b7280; padding-top: 16px; }
.crumbs a { color: #6b7280; }
.site-footer { background: var(--c-primary); color: var(--c-primary-text); margin-top: 44px; padding: 34px 0 28px; font-size: 0.92rem; }
.site-footer a { color: var(--c-primary-text); text-decoration: none; opacity: 0.9; font-weight: 600; }
.site-footer a:hover { opacity: 1; text-decoration: underline; }
.footer-brand { margin-bottom: 12px; display: flex; flex-direction: column; gap: 2px; }
.footer-name { font-family: var(--font-heading, "Poppins"), sans-serif; font-weight: 700; font-size: 1.1rem; }

/* ---- tag chips (generic 'tags' custom-field type) ---- */
.tag-chip {
    display: inline-block; font-size: 0.78rem; font-weight: 600;
    background: var(--c-surface); color: var(--c-primary);
    padding: 3px 10px; border-radius: 999px; margin: 0 4px 4px 0;
}
.footer-tag { opacity: 0.8; }
.cols-footer { display: flex; flex-wrap: wrap; gap: 12px 28px; padding: 10px 0 14px; border-bottom: 1px solid rgba(255,255,255,0.15); margin-bottom: 12px; }
.footer-legal { opacity: 0.75; font-size: 0.85rem; }
