/* ============================================
   Platform Template — Base Styles
   Bootstrap 5 + minimal custom CSS
   ============================================ */

:root {
    --site-bg: #f5f7fa;
    --site-surface: #ffffff;
    --site-border: #dde2e8;
    --site-text: #1e2a38;
    --site-muted: #5e6a78;

    /* Brand primary — change these 3 to re-theme */
    --site-primary: #f57c00;
    --site-primary-dark: #c94300;
    --site-accent-bg: #fff3e0;

    /* Link color — always blue (user habit) */
    --site-link: #0b5ed7;
    --site-link-dark: #0a58ca;

    --site-radius: 0.5rem;
    --site-radius-sm: 0.35rem;
    --site-ring: 0 0 0 1px rgba(0, 0, 0, 0.06);
    --site-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.06), 0 6px 16px rgba(0, 0, 0, 0.04);
    --section-py: 2.5rem;
}

/* --- Global --- */

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    background-color: var(--site-bg);
    color: var(--site-text);
    line-height: 1.6;
    overflow-x: hidden;
}

::selection {
    background-color: rgba(245, 124, 0, 0.15);
    color: inherit;
}

a { color: var(--site-link); }
a:hover { color: var(--site-link-dark); }

h1, h2, h3, .h1, .h2, .h3 {
    letter-spacing: -0.025em;
    text-wrap: balance;
}

h4, h5, h6, .h4, .h5, .h6 {
    letter-spacing: -0.01em;
}

p {
    text-wrap: pretty;
}

/* --- Buttons (polished) --- */

.btn {
    transition: all 0.2s ease;
    border-radius: 9999px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--site-primary-dark) 0%, #a83c00 100%);
    border-color: transparent;
    box-shadow: 0 2px 6px rgba(245, 124, 0, 0.3);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #a83c00 0%, #903200 100%);
    box-shadow: 0 4px 12px rgba(245, 124, 0, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(245, 124, 0, 0.3);
}

.btn-outline-secondary {
    transition: all 0.2s ease;
}

.btn-outline-secondary:hover {
    background-color: var(--site-text);
    border-color: var(--site-text);
    color: #fff;
}

.btn-icon {
    transition: color 0.15s ease, transform 0.15s ease;
}

.btn-icon:hover {
    transform: scale(1.15);
}

/* --- Section spacing (consistent py) --- */

.section-spacing {
    padding-top: var(--section-py);
    padding-bottom: var(--section-py);
}

.section-spacing.bg-white {
    background-color: var(--site-surface);
}

/* --- Section headings --- */

.section-kicker {
    display: inline-block;
    margin-bottom: 0.35rem;
    font-family: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", monospace;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--site-muted);
}

.section-title {
    font-size: clamp(1.1rem, 1.5vw, 1.35rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    position: relative;
    padding-left: 0.75rem;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.15em;
    bottom: 0.15em;
    width: 3px;
    background: linear-gradient(180deg, var(--site-primary) 0%, #ffb74d 100%);
    border-radius: 2px;
}

/* --- Navbar (moderate height) --- */

.site-header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
}

.navbar {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.navbar-brand {
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

.navbar .nav-link {
    color: var(--site-text);
    font-weight: 500;
    font-size: 0.82rem;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

.navbar .nav-link.active,
.navbar .nav-link:hover {
    color: var(--site-primary-dark);
    border-bottom: 2px solid var(--site-primary);
    margin-bottom: -2px;
}

/* --- Nav actions (Login + Post) --- */

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .navbar .nav-link {
        font-size: 0.85rem;
        padding-top: 0.3rem;
        padding-bottom: 0.3rem;
    }

    .navbar-nav {
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
        border-bottom: 1px solid var(--site-border);
    }

    .nav-search {
        width: 100%;
        margin-bottom: 0.5rem;
        display: flex;
        gap: 0.4rem;
    }

    .nav-search .form-control-sm {
        flex: 1;
        width: auto !important;
    }

    .nav-search-btn {
        display: none;
    }

    .nav-search-text-btn {
        display: inline-flex !important;
    }

    .nav-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        width: 100%;
        padding-top: 0.5rem;
        border-top: 1px solid var(--site-border);
    }

    .nav-actions .btn {
        text-align: center;
    }
}

/* --- Nav search (desktop inline) --- */

.nav-search {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-search .form-control-sm {
    width: 160px;
    padding-right: 2rem;
    font-size: 0.8rem;
    transition: width 0.2s ease;
}

.nav-search .form-control-sm:focus {
    width: 220px;
}

.nav-search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    color: var(--site-muted);
    cursor: pointer;
    line-height: 1;
}

.nav-search-btn:hover {
    color: var(--site-primary);
}

.nav-search-text-btn {
    display: none;
    flex-shrink: 0;
}

/* --- Hero --- */

.hero-section {
    background: linear-gradient(135deg, #fff8f0 0%, #fff3e0 40%, #f5f7fa 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(245, 124, 0, 0.07) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: 10%;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(245, 124, 0, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* --- Hero Feed (homepage activity panel) --- */

.hero-feed {
    background-color: var(--site-surface);
    border-radius: var(--site-radius);
    box-shadow: var(--site-shadow);
    overflow: hidden;
    min-width: 0;
}

.hero-feed-list li {
    padding: 0.45rem 0;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--site-border);
}

.hero-feed-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.hero-feed-list li a:hover .text-dark {
    color: var(--site-primary) !important;
}

/* --- Blog thumbnail (square, consistent) --- */

.blog-thumb {
    aspect-ratio: 1;
    min-height: 100px;
    overflow: hidden;
}

@media (min-width: 768px) {
    .blog-thumb {
        aspect-ratio: 4 / 3;
        min-height: 120px;
    }
}

/* --- Cards (shared base) --- */

.stat-card,
.category-card,
.listing-card,
.feature-card {
    border-radius: var(--site-radius);
    box-shadow: var(--site-shadow);
    background-color: var(--site-surface);
}

.category-card,
.listing-card,
.feature-card,
.vendor-card,
.request-card,
.detail-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover,
.listing-card:hover,
.feature-card:hover,
.vendor-card:hover,
.request-card:hover,
.detail-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* --- Request card --- */

.request-card h3 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.request-card .request-card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Vendor card --- */

.vendor-card {
    transition: box-shadow 0.15s ease;
}

.vendor-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--site-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--site-muted);
}

.vendor-listing-preview li {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--site-border);
}

.vendor-listing-preview li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.vendor-listing-preview li:first-child {
    padding-top: 0;
}

.vendor-listing-preview a:hover {
    color: var(--site-primary) !important;
}

.vendor-avatar-lg {
    width: 72px;
    height: 72px;
}

.vendor-card h3 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Listing card link: no underline, underline on hover --- */

.listing-card a:hover {
    color: #F57C00 !important;
    text-decoration: underline !important;
}

/* --- Listing card text clamp --- */

.listing-card h3 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.listing-card .listing-card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Listing card image --- */

.listing-card-img {
    position: relative;
    overflow: hidden;
    background-color: var(--site-bg);
    border-radius: var(--site-radius) var(--site-radius) 0 0;
    aspect-ratio: 16 / 10;
}

.listing-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.listing-card-img .listing-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fff8f0 0%, #fff3e0 50%, #fef0e7 100%);
    color: var(--site-primary);
    opacity: 0.6;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.listing-card-img .badge {
    position: absolute;
    top: 0.4rem;
    left: 0.4rem;
}

/* --- Listing card price --- */

.listing-card-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--site-text);
}

/* --- Listing card: mobile horizontal list layout --- */

@media (max-width: 767.98px) {
    .listing-card {
        flex-direction: row;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
        border-radius: var(--site-radius);
        border-bottom: none;
        background-color: var(--site-surface);
        margin-bottom: 0.15rem;
        height: auto !important;
    }

    .listing-card-img {
        width: 115px;
        min-width: 115px;
        height: 115px;
        max-height: 115px;
        border-radius: var(--site-radius-sm);
        flex-shrink: 0;
        margin: 0.5rem 0 0.5rem 0.5rem;
        align-self: flex-start;
    }

    .listing-card-img .badge {
        top: 0.25rem;
        left: 0.25rem;
        font-size: 0.55rem;
        padding: 0.15em 0.4em;
    }

    .listing-card > .card-body {
        padding: 0.65rem 0.5rem 0.65rem 0.75rem;
        display: flex;
        flex-direction: column;
        min-width: 0;
        overflow: hidden;
    }

    .listing-card > .card-body .listing-card-meta {
        margin-bottom: 0.1rem;
    }

    .listing-card > .card-body h3 {
        font-size: 0.85rem;
        font-weight: 600;
        line-height: 1.35;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 0.25rem;
    }

    .listing-card > .card-body .listing-card-desc {
        display: none;
    }

    .listing-card-price {
        font-size: 1.05rem;
        font-weight: 700;
        color: var(--site-text);
        line-height: 1.2;
    }

    .listing-card-price-original {
        font-size: 0.7rem;
        color: var(--site-muted);
        text-decoration: line-through;
        margin-left: 0.3rem;
    }

    .listing-card > .card-body .listing-card-tags {
        margin-bottom: 0.25rem;
    }

    .listing-card > .card-body .listing-card-footer {
        padding-top: 0;
        border-top: none;
        margin-top: auto;
    }

    .listing-card-actions {
        display: flex;
        gap: 0.6rem;
    }

    .listing-card-actions .btn-icon {
        color: var(--site-muted);
        padding: 0;
        background: none;
        border: none;
        cursor: pointer;
        line-height: 1;
    }

    .listing-card-actions .btn-icon:hover {
        color: var(--site-primary);
    }
}

/* Desktop: hide mobile-only elements */
@media (min-width: 768px) {
    .listing-card-price-original {
        font-size: 0.7rem;
        color: var(--site-muted);
        text-decoration: line-through;
        margin-left: 0.25rem;
    }

    .listing-card-actions {
        display: none;
    }
}

/* --- Stat card --- */

.stat-card {
    padding: 1rem 0.75rem;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--site-primary) 0%, #ffb74d 100%);
    border-radius: 0 0 2px 2px;
}

.stat-icon {
    color: var(--site-primary);
}

.stat-number {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--site-text) 0%, #3a4a5e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Category icon / Feature step --- */

.category-icon,
.feature-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--site-radius-sm);
    background-color: var(--site-accent-bg);
    color: var(--site-primary-dark);
    font-weight: 700;
    font-size: 0.75rem;
}

/* --- Badges / Tags (compact) --- */

.badge-tag {
    background-color: #f0f1f3;
    color: var(--site-text);
    font-weight: 600;
    font-size: 0.675rem;
    padding: 0.25em 0.6em;
    border-radius: 9999px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    letter-spacing: 0.01em;
}

.badge-soft {
    background-color: var(--site-accent-bg);
    color: #b33b00;
    font-weight: 600;
    font-size: 0.65rem;
    padding: 0.2em 0.55em;
    border-radius: 9999px;
    border: 1px solid rgba(199, 68, 0, 0.15);
}

/* --- Results bar --- */

.results-bar {
    background-color: var(--site-surface);
    box-shadow: var(--site-shadow);
    border-radius: var(--site-radius-sm);
    padding: 0.6rem 0.85rem;
}

.results-bar-count {
    font-size: 0.78rem;
    color: var(--site-muted);
    white-space: nowrap;
}

.results-bar-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--site-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background-color: var(--site-accent-bg);
    color: #b33b00;
    font-weight: 600;
    font-size: 0.7rem;
    padding: 0.25em 0.6em;
    border-radius: 9999px;
    border: 1px solid rgba(199, 68, 0, 0.15);
}

.btn-close-sm {
    width: 0.5rem;
    height: 0.5rem;
    padding: 0;
    background-size: 0.5rem;
    opacity: 0.5;
}

.btn-close-sm:hover {
    opacity: 1;
}

/* --- CTA block (visible but not over the top) --- */

.cta-block {
    background: linear-gradient(135deg, rgba(245, 124, 0, 0.06), rgba(255, 255, 255, 0.95));
    box-shadow: inset 0 0 0 1px rgba(245, 124, 0, 0.1);
    border-radius: var(--site-radius);
    padding: 2rem;
}

/* --- Buttons (pill shape, modern feel) --- */

.btn {
    font-weight: 600;
    border-radius: 9999px;
}

.card,
.form-control,
.form-select {
    border-radius: var(--site-radius-sm);
}

.form-control,
.form-select {
    border-color: var(--site-border);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(245, 124, 0, 0.45);
    box-shadow: 0 0 0 0.2rem rgba(245, 124, 0, 0.1);
}

/* --- Footer (professional) --- */

.site-footer {
    border-top: 1px solid var(--site-border);
}

.footer-main {
    background-color: var(--site-surface);
}

.footer-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--site-primary) 0%, #ffb74d 100%);
    color: #fff;
    border-radius: var(--site-radius-sm);
}

.footer-heading {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--site-text);
    margin-bottom: 0.6rem;
}

.footer-links li + li {
    margin-top: 0.3rem;
}

.footer-links a {
    color: var(--site-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.15s ease;
}

.footer-links a:hover {
    color: var(--site-primary);
    padding-left: 2px;
}

.footer-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--site-bg);
    color: var(--site-muted);
    text-decoration: none;
    transition: all 0.2s ease;
}

.footer-social:hover {
    background-color: var(--site-primary);
    color: #fff;
}

.footer-bottom {
    background-color: var(--site-bg);
    font-size: 0.78rem;
    color: var(--site-muted);
}

.footer-bottom a {
    color: var(--site-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer-bottom a:hover {
    color: var(--site-text);
}

/* --- Dashboard Nav (sidebar) --- */

.dashboard-nav {
    display: flex;
    flex-direction: column;
}

.dashboard-nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--site-muted);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.dashboard-nav-item:hover {
    color: var(--site-text);
    background-color: var(--site-bg);
}

.dashboard-nav-item.active {
    color: var(--site-primary);
    border-left-color: var(--site-primary);
    background-color: var(--site-accent-bg);
    font-weight: 600;
}

@media (max-width: 991.98px) {
    .dashboard-nav {
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .dashboard-nav-item {
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .dashboard-nav-item.active {
        border-bottom-color: var(--site-primary);
        border-left-color: transparent;
    }
}

/* --- Page Header (inner pages) --- */

.page-header {
    padding-bottom: 0;
}

.page-header-compact {
    padding: 0;
}

.page-title {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* --- Filter bar (compact inline) --- */

.filter-bar {
    flex-shrink: 0;
    width: 100%;
}

.filter-bar-inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.filter-bar-field {
    font-size: 0.8rem !important;
    flex: 1 1 0;
    min-width: 0;
}

.filter-bar-search {
    position: relative;
    flex: 1.5 1 0;
    min-width: 0;
}

.filter-bar-search .form-control-sm {
    padding-left: 2rem;
    width: 100%;
}

.filter-bar-icon {
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--site-muted);
    pointer-events: none;
}

.filter-bar .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .filter-bar-inner {
        flex-wrap: wrap;
    }

    .filter-bar-field,
    .filter-bar-search {
        flex: 1 1 calc(50% - 0.25rem);
    }

    .filter-bar .btn {
        flex: 1 1 100%;
    }
}

@media (min-width: 768px) {
    .filter-bar {
        width: auto;
    }
}

.breadcrumb {
    font-size: 0.8rem;
}

.breadcrumb-item a {
    color: var(--site-muted);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--site-primary);
}

/* --- Detail page --- */

.detail-card {
    border-radius: var(--site-radius);
    box-shadow: var(--site-shadow);
    background-color: var(--site-surface);
}

.detail-image-placeholder,
.detail-map-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.02);
    border: none;
    border-radius: var(--site-radius-sm);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.detail-image-placeholder {
    height: 220px;
}

.detail-map-placeholder {
    height: 160px;
}

.detail-attr {
    padding: 0.75rem;
    background-color: var(--site-bg);
    border-radius: var(--site-radius-sm);
}

.detail-attr-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--site-muted);
    margin-bottom: 0.15rem;
}

.detail-attr-value {
    font-weight: 600;
    font-size: 0.9rem;
}

.detail-content ul {
    padding-left: 1.25rem;
}

.detail-content li {
    margin-bottom: 0.25rem;
}

/* --- Member avatar --- */

.member-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--site-radius-sm);
    background-color: var(--site-accent-bg);
    color: var(--site-primary-dark);
    font-weight: 700;
    font-size: 0.85rem;
}

.member-avatar-lg {
    width: 4rem;
    height: 4rem;
    font-size: 1.25rem;
    border-radius: var(--site-radius);
}

/* --- Doc page --- */

.doc-sidebar {
    border-radius: var(--site-radius);
    box-shadow: var(--site-shadow);
    background-color: var(--site-surface);
}

.doc-nav li + li {
    margin-top: 0.2rem;
}

.doc-nav-link {
    display: block;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    color: var(--site-muted);
    text-decoration: none;
    border-radius: var(--site-radius-sm);
    transition: background-color 0.1s ease;
}

.doc-nav-link:hover,
.doc-nav-link.active {
    color: var(--site-primary);
    background-color: var(--site-accent-bg);
}

.doc-article {
    border-radius: var(--site-radius);
    box-shadow: var(--site-shadow);
    background-color: var(--site-surface);
}

.doc-article h2 {
    scroll-margin-top: 5rem;
}

.doc-code-block {
    background-color: #1e2a38;
    color: #e2e8f0;
    border-radius: var(--site-radius-sm);
    padding: 1rem 1.25rem;
    font-size: 0.8rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.doc-code-block code {
    color: inherit;
}

/* --- Auth page --- */

.auth-card {
    border-radius: var(--site-radius);
    box-shadow: var(--site-shadow);
    background-color: var(--site-surface);
}

/* --- Form card (submit listing) --- */

.form-card {
    border-radius: var(--site-radius);
    box-shadow: var(--site-shadow);
    background-color: var(--site-surface);
}

/* --- Pagination --- */

.page-link {
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--site-text);
    border-color: var(--site-border);
    margin: 0 0.15rem;
}

.page-item.active .page-link {
    background-color: var(--site-primary);
    border-color: var(--site-primary);
}

.page-link:hover {
    color: var(--site-primary);
    background-color: var(--site-accent-bg);
    border-color: var(--site-border);
}

/* --- Empty state --- */

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background-color: var(--site-bg);
    color: var(--site-muted);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.empty-state-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: var(--site-muted);
    max-width: 36ch;
    margin: 0 auto 1rem;
}

/* --- Back to top --- */

.back-to-top {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 50%;
    background-color: var(--site-surface);
    color: var(--site-muted);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    cursor: pointer;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    color: var(--site-primary);
    box-shadow: 0 0 0 1px rgba(245, 124, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (min-width: 992px) {
    .back-to-top {
        display: none;
    }
}

/* --- Mobile Sticky CTA (listing detail) --- */

.mobile-sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: var(--site-surface);
    border-top: 1px solid var(--site-border);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    padding: 0.6rem 0;
}

/* --- Custom scrollbar (Webkit) --- */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* --- Canvas grid: subtle section separators --- */

main > section + section {
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

main > section.border-bottom + section {
    border-top: none;
}

/* --- Responsive --- */

@media (max-width: 575.98px) {
    :root {
        --section-py: 2rem;
    }

    .cta-block {
        padding: 1.5rem;
    }

    .detail-image-placeholder {
        height: 160px;
    }

    .detail-map-placeholder {
        height: 120px;
    }

    .hero-feed .p-3 {
        padding: 0.75rem !important;
    }

    .hero-feed-list li {
        font-size: 0.8rem;
    }

    .listing-card .card-body.p-3,
    .request-card .card-body.p-3,
    .vendor-card .card-body.p-3,
    .category-card .card-body.p-3 {
        padding: 0.5rem !important;
    }

    .row.g-3 {
        --bs-gutter-y: 0.65rem;
        --bs-gutter-x: 0.65rem;
    }
}

/* --- Radio Pill Buttons --- */
.radio-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.radio-pill-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.radio-pill-label {
    display: inline-block;
    padding: 6px 16px;
    border: 1.5px solid #ccc;
    border-radius: 999px;
    background: #fff;
    color: #444;
    font-size: 0.875rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}
.radio-pill-input:checked + .radio-pill-label {
    background-color: #F57C00;
    border-color: #F57C00;
    color: #fff;
    font-weight: 600;
}
.radio-pill-label:hover {
    border-color: #F57C00;
    color: #F57C00;
}
.radio-pill-input:checked + .radio-pill-label:hover {
    color: #fff;
}
.radio-pill-error {
    color: #dc3545;
    font-size: 0.875em;
    margin-top: 4px;
}
.radio-pill-group.is-invalid .radio-pill-label {
    border-color: #dc3545;
}

/* --- Match Form Mobile Tweaks --- */
@media (max-width: 575.98px) {
    #matchForm .form-label {
        font-size: 0.9rem;
    }
}

/* --- Match Flow Step Dots --- */
.step-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}
.step-dot-active {
    background-color: #F57C00;
    color: #fff;
}
.step-dot-done {
    background-color: #2E7D32;
    color: #fff;
}
.step-dot-pending {
    background-color: #e0e0e0;
    color: #888;
}
.step-dot-line {
    flex: 1;
    height: 2px;
    background-color: #e0e0e0;
    max-width: 48px;
}
.step-dot-line-done {
    background-color: #2E7D32;
}
.step-item {
    min-width: 70px;
}
.step-label {
    font-size: 0.72rem;
    margin-top: 4px;
    color: #999;
}
.step-label-active {
    color: #F57C00;
    font-weight: 600;
}
.step-label-done {
    color: #2E7D32;
    font-weight: 600;
}
