/**
 * Classified cards (modern look, keep existing header colors)
 * Used by taxonomy-classifieds.php and "template-certified-*.php" pages.
 */

.classifieds-grid {
    align-items: stretch;
}

.modern-panel--classifieds a,
.modern-panel--classifieds a:hover,
.modern-panel--classifieds a:focus,
.modern-panel--classifieds a:active {
    text-decoration: none !important;
}

.modern-panel--classifieds .grid > div > a *,
.modern-panel--classifieds h2 {
    text-decoration: none !important;
}

/* Classified archive/taxonomy breadcrumbs: remove underline even if other CSS is missing/overrides */
.ij-classified-breadcrumbs a,
.ij-classified-breadcrumbs a:hover,
.ij-classified-breadcrumbs a:focus,
.ij-classified-breadcrumbs a:active,
.ij-classified-breadcrumbs a:visited {
    text-decoration: none !important;
}

.classified-card {
    --classified-accent: #3b82f6;
    --classified-accent-ink: #ffffff;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 260px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 14px 30px rgba(15, 23, 42, 0.09);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

@media (hover: hover) {
    .classified-card:hover {
        transform: translateY(-4px);
        border-color: rgba(15, 23, 42, 0.12);
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08), 0 22px 52px rgba(15, 23, 42, 0.14);
    }
}

.classified-card:focus-within {
    outline: 2px solid rgba(59, 130, 246, 0.45);
    outline: 2px solid color-mix(in srgb, var(--classified-accent, #3b82f6) 45%, transparent);
    outline-offset: 3px;
}

.classified-card__header {
    padding: 0.85rem 1.1rem;
    text-align: center;
    line-height: 1.2;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.12));
}

.classified-card__header a {
    color: inherit;
    text-decoration: none;
}

.classified-card__header a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.classified-card__header a:focus-visible {
    outline: none;
}

.classified-card__title {
    margin: 0;
    font-weight: 800;
    font-size: 1.125rem;
    letter-spacing: 0.2px;
}

.classified-card__body {
    padding: 1rem 1.25rem 1.25rem;
    flex: 1 1 auto;
    background: #ffffff;
}

.classified-card__content {
    text-align: start;
    color: #334155;
    font-size: 1rem;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

.classified-card__content p {
    margin: 0 0 0.75rem;
}

.classified-card__content p:last-child {
    margin-bottom: 0;
}

.classified-card__content :where(ul, ol) {
    margin: 0.25rem 0 0.75rem;
    padding-inline-start: 1.1rem;
}

.classified-card__content :where(li) {
    margin: 0.25rem 0;
}

.classified-card__content a {
    text-decoration: none;
}

.classified-card__content a:hover {
    text-decoration: none;
}

.classified-card__content :where(a[href^="tel:"], a[href^="mailto:"]) {
    direction: ltr;
    unicode-bidi: isolate;
    font-family: inherit;
}

.classified-card__media {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    margin-bottom: 0.85rem;
    display: block;
}

.classified-card__media img {
    width: 100%;
    height: auto;
    max-height: 340px;
    object-fit: contain;
    object-position: center;
    display: block;
}

.classified-card__media img.ij-lightbox__trigger {
    cursor: zoom-in;
}

/* Single classified navigation */
.single-classified .ij-classified-nav__group {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 0.75rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.25rem 0;
}

.single-classified .ij-classified-nav__group::-webkit-scrollbar {
    display: none;
}

.single-classified .ij-classified-nav__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 0.95rem;
    border-radius: 9999px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
    text-decoration: none;
    box-shadow: 0 10px 26px rgba(2, 6, 23, 0.08);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
    min-height: 44px;
    white-space: nowrap;
}

.single-classified .ij-classified-nav__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.single-classified .ij-classified-nav__label {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1;
    white-space: nowrap;
}

@media (max-width: 420px) {
    .single-classified .ij-classified-nav__group {
        gap: 0.5rem;
    }

    .single-classified .ij-classified-nav__btn {
        padding: 0.55rem 0.75rem;
    }

    .single-classified .ij-classified-nav__label {
        font-size: 0.9rem;
    }
}

.single-classified .ij-classified-nav__btn:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.28);
    box-shadow: 0 16px 34px rgba(2, 6, 23, 0.12);
}

.single-classified .ij-classified-nav__btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.22), 0 16px 34px rgba(2, 6, 23, 0.12);
}

.single-classified .ij-classified-nav__btn.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.single-classified .ij-classified-nav__btn.is-disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(15, 23, 42, 0.14);
}

/* Classified image lightbox */
body.ij-lightbox-open {
    overflow: hidden;
}

.ij-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: center;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

.ij-lightbox[hidden] {
    display: none;
}

.ij-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.78);
}

.ij-lightbox__panel {
    position: relative;
    z-index: 1;
    width: min(980px, 96vw);
    max-height: 88vh;
    border-radius: 16px;
    background: #0b1220;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    display: grid;
    place-items: center;
}

.ij-lightbox__img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 88vh;
    object-fit: contain;
    background: #0b1220;
}

.ij-lightbox__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(15, 23, 42, 0.55);
    color: #ffffff;
    font-size: 28px;
    line-height: 1;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.ij-lightbox__close:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
    .ij-lightbox {
        opacity: 0;
        transition: opacity 150ms ease;
    }

    .ij-lightbox.is-open {
        opacity: 1;
    }

    .ij-lightbox__panel {
        transform: translateY(8px) scale(0.99);
        transition: transform 150ms ease;
    }

    .ij-lightbox.is-open .ij-lightbox__panel {
        transform: translateY(0) scale(1);
    }
}

.classified-card__footer {
    padding: 0.95rem 1rem 1.05rem;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    align-items: stretch;
}

.classified-card__footer > :only-child {
    grid-column: 1 / -1;
}

.classified-card__btn {
    flex: 1 1 160px;
    min-height: 44px;
    min-width: 0;
    width: 100%;
    border-radius: 12px;
    padding: 0.6rem 0.9rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.classified-card__btn:disabled {
    opacity: 0.75;
    cursor: default;
    transform: none;
}

.classified-card__btn:focus-visible {
    outline: 2px solid rgba(15, 23, 42, 0.22);
    outline-offset: 3px;
}

.classified-card__btn--primary,
.classified-card__btn--outline {
    background: #ffffff;
    background-image: none;
    border: 1px solid rgba(15, 23, 42, 0.14);
    color: #0f172a;
    box-shadow: none;
}

.classified-card__btn--primary:hover,
.classified-card__btn--outline:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 23, 42, 0.2);
    box-shadow: none;
}

.classified-card__btn-meta {
    direction: ltr;
    unicode-bidi: isolate;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.2px;
    opacity: 0.92;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Share modal (fallback when Web Share isn't available) */
body.classified-share-open {
    overflow: hidden;
}

.classified-share-overlay {
    position: fixed;
    inset: 0;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 9999;
}

.classified-share-panel {
    width: min(520px, 100%);
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
}

.classified-share-header {
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(15, 23, 42, 0.12);
}

.classified-share-title {
    font-weight: 900;
    letter-spacing: 0.2px;
    color: #0f172a;
}

.classified-share-close {
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #ffffff;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.classified-share-close:hover {
    background: #f8fafc;
}

.classified-share-grid {
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.classified-share-item {
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 14px;
    padding: 0.85rem 0.75rem;
    background: #ffffff;
    color: #0f172a;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 64px;
}

.classified-share-item i {
    font-size: 22px;
}

.classified-share-item span {
    font-weight: 800;
    font-size: 0.95rem;
}

.classified-share-item:hover {
    background: #f8fafc;
}

.classified-share-item--btn {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

@media (min-width: 640px) {
    .classified-share-overlay {
        align-items: center;
    }
}

/* Classifieds archive: keep icon tiles, remove the big panel background behind them */
.modern-panel--classifieds--bare {
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
}
