/**
 * USInfoHub Classifieds Stylesheet
 * High-Contrast, WCAG AA Compliant, Responsive Design
 */

:root {
    --us-cl-primary: #0284c7;
    --us-cl-primary-hover: #0369a1;
    --us-cl-primary-dark: #0f172a;
    --us-cl-accent: #059669;
    --us-cl-accent-hover: #047857;
    --us-cl-bg-light: #f8fafc;
    --us-cl-card-bg: #ffffff;
    --us-cl-border: #e2e8f0;
    --us-cl-text: #0f172a;
    --us-cl-text-muted: #64748b;
    --us-cl-radius: 8px;
    --us-cl-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --us-cl-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --us-cl-font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ==========================================================================
   Archive & Hero Banner
   ========================================================================== */
.usinfohub-archive-classifieds-wrapper {
    background-color: var(--us-cl-bg-light);
    min-height: 80vh;
    padding-bottom: 60px;
    font-family: var(--us-cl-font);
}

.usinfohub-classifieds-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0369a1 100%) !important;
    color: #ffffff !important;
    padding: 48px 24px;
    text-align: center;
    margin-bottom: 32px;
    border-bottom: 3px solid var(--us-cl-primary);
}

.classifieds-hero-container {
    max-width: 960px;
    margin: 0 auto;
}

body.post-type-archive-us_classified .usinfohub-classifieds-hero .hero-title,
body.archive .usinfohub-classifieds-hero .hero-title,
.usinfohub-archive-classifieds-wrapper .usinfohub-classifieds-hero .hero-title,
.usinfohub-classifieds-hero .hero-title,
.usinfohub-classifieds-hero h1 {
    font-size: 2.3rem !important;
    font-weight: 700 !important;
    margin: 0 0 12px !important;
    color: #ffffff !important;
    font-family: var(--us-cl-font) !important;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5) !important;
    letter-spacing: -0.02em;
}

body.post-type-archive-us_classified .usinfohub-classifieds-hero .hero-subtitle,
body.archive .usinfohub-classifieds-hero .hero-subtitle,
.usinfohub-archive-classifieds-wrapper .usinfohub-classifieds-hero .hero-subtitle,
.usinfohub-classifieds-hero .hero-subtitle,
.usinfohub-classifieds-hero p {
    font-size: 1.05rem !important;
    opacity: 0.95 !important;
    max-width: 760px !important;
    margin: 0 auto !important;
    line-height: 1.6 !important;
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
}

.usinfohub-classifieds-content-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   Filter Bar
   ========================================================================== */
.usinfohub-classifieds-filter-bar {
    background: #ffffff;
    border: 1px solid var(--us-cl-border);
    border-radius: var(--us-cl-radius);
    padding: 22px;
    box-shadow: var(--us-cl-shadow);
    margin-bottom: 28px;
}

.filter-row-primary {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1.2fr auto;
    gap: 16px;
    align-items: flex-end;
}

.filter-col label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #0f172a !important;
}

.filter-col input[type="text"],
.filter-col select {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: var(--us-cl-font);
    color: #0f172a !important;
    background-color: #ffffff !important;
    box-sizing: border-box;
}

.filter-col input[type="text"]:focus,
.filter-col select:focus {
    outline: none;
    border-color: var(--us-cl-primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.btn-filter-submit {
    height: 46px;
    background-color: var(--us-cl-primary);
    color: #ffffff !important;
    border: none;
    border-radius: 6px;
    padding: 0 22px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.btn-filter-submit:hover {
    background-color: var(--us-cl-primary-hover);
}

.filter-row-secondary {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--us-cl-border);
}

.deal-type-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.deal-pill {
    padding: 6px 14px;
    background: #f1f5f9;
    color: #334155 !important;
    border-radius: 20px;
    font-size: 0.825rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.15s ease;
}

.deal-pill:hover,
.deal-pill.active {
    background: var(--us-cl-primary) !important;
    color: #ffffff !important;
}

.price-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569 !important;
}

.price-input {
    width: 80px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #0f172a !important;
}

.price-sep {
    color: #94a3b8;
}

.btn-price-apply {
    height: 36px;
    padding: 0 12px;
    background: #e2e8f0;
    color: #1e293b !important;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-price-apply:hover {
    background: #cbd5e1;
}

.filter-clear-link {
    font-size: 0.825rem;
    color: #dc2626 !important;
    text-decoration: none !important;
    font-weight: 600;
}

.filter-clear-link:hover {
    text-decoration: underline !important;
}

/* Header results bar */
.classifieds-meta-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-count {
    font-size: 0.95rem;
    color: #475569;
}

.btn-post-classified-link {
    display: inline-block;
    background-color: var(--us-cl-accent);
    color: #ffffff !important;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: background-color 0.2s ease;
}

.btn-post-classified-link:hover {
    background-color: var(--us-cl-accent-hover);
}

/* ==========================================================================
   Classifieds Card Grid
   ========================================================================== */
.usinfohub-classifieds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.usinfohub-classified-card {
    background: var(--us-cl-card-bg);
    border: 1px solid var(--us-cl-border);
    border-radius: var(--us-cl-radius);
    overflow: hidden;
    box-shadow: var(--us-cl-shadow);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.usinfohub-classified-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--us-cl-shadow-hover);
}

.card-media-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
    background-color: #0f172a;
    overflow: hidden;
}

.card-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.card-media-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.usinfohub-classified-card:hover .card-media-wrapper img {
    transform: scale(1.04);
}

.card-price-tag {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(15, 23, 42, 0.9);
    color: #ffffff !important;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 1.15rem;
    font-weight: 700;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.card-price-tag.is-free {
    background: #059669;
}

.card-featured-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #f59e0b;
    color: #000000 !important;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.card-deal-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(2, 132, 199, 0.9);
    color: #ffffff !important;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-meta-top {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.75rem;
}

.card-category-label {
    background: #f1f5f9;
    color: #0284c7 !important;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.card-condition-label {
    background: #f8fafc;
    color: #64748b !important;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.4;
}

.card-title a {
    color: #0f172a !important;
    text-decoration: none !important;
}

.card-title a:hover {
    color: var(--us-cl-primary) !important;
}

.card-excerpt {
    font-size: 0.9rem;
    color: #475569 !important;
    line-height: 1.5;
    margin: 0 0 16px;
    flex-grow: 1;
}

.card-location-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #64748b !important;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.card-footer-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-card-contact {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 9px 10px;
    border-radius: 6px;
    font-size: 0.825rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.15s ease;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-card-contact.btn-phone {
    background: #0284c7;
    color: #ffffff !important;
}

.btn-card-contact.btn-phone:hover {
    background: #0369a1;
}

.btn-card-contact.btn-email {
    background: #0f172a;
    color: #ffffff !important;
}

.btn-card-contact.btn-email:hover {
    background: #1e293b;
}

.btn-card-contact.btn-source {
    background: #f1f5f9;
    color: #0284c7 !important;
    border: 1px solid #cbd5e1;
}

.btn-card-contact.btn-source:hover {
    background: #e2e8f0;
}

.btn-card-contact.btn-view {
    flex: 0 0 auto;
    min-width: 80px;
    background: #f8fafc;
    color: #0f172a !important;
    border: 1px solid #cbd5e1;
}

.btn-card-contact.btn-view:hover {
    background: #e2e8f0;
}

/* ==========================================================================
   Single Classified Layout (Sidebar on Left)
   ========================================================================== */
.usinfohub-single-classified-wrapper {
    background-color: var(--us-cl-bg-light);
    padding: 30px 0 60px;
    font-family: var(--us-cl-font);
}

.classified-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Breadcrumbs */
.classified-breadcrumb-bar {
    margin-bottom: 20px;
}

.usinfohub-classified-breadcrumbs {
    font-size: 0.85rem;
    color: #64748b;
}

.usinfohub-classified-breadcrumbs a {
    color: #0284c7 !important;
    text-decoration: none !important;
}

.usinfohub-classified-breadcrumbs .sep {
    margin: 0 6px;
    color: #94a3b8;
}

.usinfohub-classified-breadcrumbs .current {
    color: #0f172a;
    font-weight: 500;
}

/* Top Item Header */
.classified-item-header {
    background: #ffffff;
    border: 1px solid var(--us-cl-border);
    border-radius: var(--us-cl-radius);
    padding: 24px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    box-shadow: var(--us-cl-shadow);
}

.header-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.header-badges .badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge.deal-badge { background: #e0f2fe; color: #0369a1 !important; }
.badge.condition-badge { background: #f1f5f9; color: #334155 !important; }
.badge.category-badge { background: #fef3c7; color: #92400e !important; }
.badge.location-badge { background: #f8fafc; color: #475569 !important; border: 1px solid #e2e8f0; }
.badge.time-badge { background: #f8fafc; color: #64748b !important; }

.classified-item-title {
    font-size: 1.85rem;
    font-weight: 700;
    margin: 0;
    color: #0f172a !important;
    line-height: 1.3;
}

.header-price-box .price-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: #059669 !important;
    white-space: nowrap;
}

.header-price-box .price-value.is-free {
    color: #059669 !important;
}

.header-price-box .price-value.price-contact {
    font-size: 1.4rem;
    color: #0284c7 !important;
}

/* Grid Layout (Left Sidebar on Desktop) */
.usinfohub-classified-grid {
    display: grid;
    grid-template-columns: 1fr 2.2fr;
    gap: 30px;
    align-items: start;
}

html,
body.single-us_classified {
    overflow-x: clip !important;
    overflow-y: visible !important;
}

.classified-sidebar-column {
    order: 1;
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 30px !important;
    align-self: start !important;
    height: fit-content !important;
}

.classified-contact-card {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 30px !important;
    z-index: 10 !important;
}

.classified-main-column {
    order: 2;
}

/* Sidebar Cards */
.classified-contact-card,
.classified-summary-card,
.classified-safety-card,
.classified-post-ad-card {
    background: #ffffff;
    border: 1px solid var(--us-cl-border);
    border-radius: var(--us-cl-radius);
    padding: 24px;
    margin-bottom: 22px;
    box-shadow: var(--us-cl-shadow);
}

.classified-contact-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 14px;
    color: #0f172a !important;
    border-bottom: 2px solid var(--us-cl-border);
    padding-bottom: 10px;
}

.seller-identity {
    font-size: 0.9rem;
    margin-bottom: 16px;
    color: #334155;
}

.seller-label {
    display: block;
    font-size: 0.775rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
}

.contact-actions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-primary-contact {
    display: block;
    text-align: center;
    padding: 13px 18px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none !important;
    transition: transform 0.1s ease, background-color 0.2s ease;
}

.btn-primary-contact.btn-call-now {
    background-color: var(--us-cl-primary);
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(2, 132, 199, 0.25);
}

.btn-primary-contact.btn-call-now:hover {
    background-color: var(--us-cl-primary-hover);
    transform: translateY(-1px);
}

.btn-primary-contact.btn-email-now {
    background-color: #0f172a;
    color: #ffffff !important;
}

.btn-primary-contact.btn-email-now:hover {
    background-color: #1e293b;
    transform: translateY(-1px);
}

.btn-secondary-source {
    display: block;
    text-align: center;
    padding: 11px 16px;
    background-color: #f1f5f9;
    color: #0284c7 !important;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.925rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: background-color 0.15s ease;
}

.btn-secondary-source:hover {
    background-color: #e2e8f0;
}

.source-subtext {
    font-size: 0.75rem;
    color: #64748b;
    text-align: center;
    display: block;
}

.contact-tip {
    font-size: 0.8rem;
    color: #64748b;
    margin: 14px 0 0;
    line-height: 1.4;
}

/* Summary Card */
.classified-summary-card h4,
.classified-safety-card h4,
.classified-post-ad-card h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 14px;
    color: #0f172a !important;
}

.summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.summary-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
}

.summary-list li .label {
    color: #64748b;
}

.summary-list li .value {
    color: #0f172a;
    text-align: right;
}

.safety-points {
    margin: 0;
    padding-left: 18px;
    font-size: 0.825rem;
    color: #475569;
    line-height: 1.6;
}

.safety-points li {
    margin-bottom: 8px;
}

.btn-sidebar-post-classified {
    display: block;
    text-align: center;
    background-color: var(--us-cl-accent);
    color: #ffffff !important;
    padding: 11px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none !important;
    margin-top: 10px;
}

.btn-sidebar-post-classified:hover {
    background-color: var(--us-cl-accent-hover);
}

/* Main Content: Gallery */
.classified-gallery-box {
    background: #ffffff;
    border: 1px solid var(--us-cl-border);
    border-radius: var(--us-cl-radius);
    padding: 20px;
    box-shadow: var(--us-cl-shadow);
    margin-bottom: 26px;
}

.main-photo-stage {
    width: 100%;
    min-height: 420px;
    height: 480px;
    background: #0f172a;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-photo-stage img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumbs-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.thumb-btn {
    border: 2px solid transparent;
    padding: 0;
    background: none;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    width: 80px;
    height: 60px;
}

.thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-btn.active,
.thumb-btn:hover {
    border-color: var(--us-cl-primary);
}

/* Main Content: Description */
.classified-description-box {
    background: #ffffff;
    border: 1px solid var(--us-cl-border);
    border-radius: var(--us-cl-radius);
    padding: 32px;
    box-shadow: var(--us-cl-shadow);
    margin-bottom: 26px;
}

.classified-description-box h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--us-cl-border);
    color: #0f172a !important;
}

.classified-content-body {
    font-size: 1rem !important;
    line-height: 1.7 !important;
    color: #1e293b !important;
}

.classified-content-body * {
    font-family: inherit !important;
}

.classified-content-body p {
    margin-bottom: 16px;
}

/* Detailed Inquiry Box */
.classified-contact-details-box {
    background: #f8fafc;
    border: 1px solid var(--us-cl-border);
    border-radius: var(--us-cl-radius);
    padding: 28px;
    margin-bottom: 26px;
}

.box-header {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 20px;
}

.box-icon {
    font-size: 2rem;
}

.box-header h3 {
    margin: 0 0 4px;
    font-size: 1.2rem;
    color: #0f172a !important;
}

.box-header p {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
}

.box-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.contact-method-tile {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tile-icon {
    font-size: 1.6rem;
}

.contact-method-tile strong {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
}

.contact-method-tile p {
    margin: 2px 0 0;
}

.phone-link {
    color: #0284c7 !important;
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none !important;
}

.email-link {
    color: #0f172a !important;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none !important;
}

.source-link {
    color: #0284c7 !important;
    font-weight: 600;
    text-decoration: none !important;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 900px) {
    .filter-row-primary {
        grid-template-columns: 1fr;
    }

    .classified-item-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .usinfohub-classified-grid {
        grid-template-columns: 1fr;
    }

    .classified-main-column {
        order: 1;
    }

    .classified-sidebar-column {
        order: 2;
        position: static;
    }

    .header-price-box {
        margin-top: 10px;
    }
}
