/* ==========================================================================
   Pinneh — /ads (business directory) page.

   Deliberately NOT shared with browse-page.css (/needs). That reference
   design has a right sidebar and a denser, ad-listing-oriented layout; this
   page's reference is a full-width business directory with a featured-
   businesses strip and no sidebar. Sharing one stylesheet between the two
   caused the /ads redesign to visually clone /needs, which is what this
   file corrects. Every rule lives under .pn-directory.
   ========================================================================== */

.pn-directory {
    --pd-bg: #fafafa;
    --pd-surface: var(--bg-color2);
    --pd-surface-soft: #f5f5f5;
    --pd-border: #ededed;
    --pd-border-strong: #e2e2e2;
    --pd-media-bg: #ececec;
    --pd-promo-bg: #fff5f6;
    --pd-promo-title: #2b2b2b;
    --pd-promo-muted: #777;

    --pd-text: var(--text-color);
    --pd-muted: var(--text2-color);

    --pd-red: var(--header-color2);
    --pd-red-soft: rgba(210, 0, 0, 0.08);

    --pd-radius: 10px;
    --pd-radius-sm: 8px;
    --pd-radius-lg: 14px;

    --pd-gap-xs: 6px;
    --pd-gap-sm: 10px;
    --pd-gap: 16px;
    --pd-gap-md: 20px;
    --pd-gap-lg: 26px;

    background: var(--pd-bg);
    font-family: "vazirmatn", sans-serif;
    padding-bottom: var(--pd-gap-lg);
}

[data-theme="dark"] .pn-directory {
    --pd-bg: #232323;
    --pd-surface-soft: #2e2e2e;
    --pd-border: #343434;
    --pd-border-strong: #3d3d3d;
    --pd-media-bg: #383838;
    --pd-promo-bg: #241f20;
    --pd-promo-title: #f5f5f5;
    --pd-promo-muted: #cacaca;
    --pd-red-soft: rgba(136, 57, 57, 0.22);
}

.pn-directory .pd-container {
    width: 100%;
    max-width: 1680px;
    margin-inline: auto;
    padding-inline: 32px;
    box-sizing: border-box;
}

@media (max-width: 991px) {
    .pn-directory .pd-container {
        padding-inline: 20px;
    }
}

@media (max-width: 575px) {
    .pn-directory .pd-container {
        padding-inline: 14px;
    }
}

.pn-directory .pd-section {
    margin-top: var(--pd-gap-md);
}

/* ==========================================================================
   1. Hero — ~30% title/description/stat, ~70% TOP commercial banner
   ========================================================================== */

.pn-directory .pd-hero {
    margin-top: var(--pd-gap);
    display: flex;
    align-items: stretch;
    gap: 16px;
}

.pn-directory .pd-hero__content {
    flex: 0 0 30%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pn-directory .pd-hero__summary,
.pn-directory .pd-hero__about {
    background: var(--pd-surface);
    border: 1px solid var(--pd-border);
    border-radius: var(--pd-radius-lg);
    padding: 20px 22px;
}

.pn-directory .pd-hero__summary {
    text-align: right;
}

.pn-directory .pd-hero__title {
    font-size: 23px;
    font-weight: 800;
    line-height: 1.4;
    color: var(--pd-red) !important;
    margin: 0 0 10px;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 6px;
}

.pn-directory .pd-hero__desc {
    font-size: 12.5px;
    line-height: 1.9;
    color: var(--pd-muted);
    margin: 0 0 12px;
}

.pn-directory .pd-hero__desc * {
    font-size: inherit !important;
    color: inherit !important;
    margin-bottom: 0 !important;
}

.pn-directory .pd-hero__stat {
    display: inline-flex;
    align-items: center;
    gap: var(--pd-gap-xs);
    font-size: 12px;
    color: var(--pd-muted);
}

.pn-directory .pd-hero__stat i {
    color: var(--pd-red);
    font-size: 11px;
}

.pn-directory .pd-hero__about {
    position: relative;
    flex: 0 0 auto;
    min-height: 0;
    overflow: hidden;
    text-align: right;
}

.pn-directory .pd-hero__about-title {
    position: relative;
    margin: 0 0 10px;
    padding-right: 12px;
    color: var(--pd-red);
    font-size: 16px;
    font-weight: 800;
}

.pn-directory .pd-hero__about-title::before {
    content: "";
    position: absolute;
    inset: 1px 0 1px auto;
    width: 3px;
    border-radius: 2px;
    background: var(--pd-red);
}

.pn-directory .pd-hero__about-excerpt {
    max-height: 4.6em;
    overflow: hidden;
    color: var(--pd-muted);
    font-size: 12.5px;
    line-height: 2.3;
}

.pn-directory .pd-hero__about-excerpt :where(p, ul, ol) {
    margin-top: 0;
    margin-bottom: 0;
}

.pn-directory .pd-hero__more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--pd-muted);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.pn-directory .pd-hero__more:hover,
.pn-directory .pd-hero__more:focus-visible {
    color: var(--pd-red);
}

.pn-directory .pd-hero__more i {
    font-size: 9px;
}

.pn-directory .pd-hero__banner {
    flex: 1 1 70%;
    min-width: 0;
    border-radius: var(--pd-radius-lg);
    overflow: hidden;
}

.pn-directory .pd-hero__banner :where(.image-banner) {
    display: block;
    width: 100%;
    border-radius: var(--pd-radius-lg);
    overflow: hidden;
    aspect-ratio: 2.8 / 1;
}

.pn-directory .pd-hero__banner :where(.image-banner) img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    background: var(--pd-surface-soft);
}

.pn-directory .pd-list-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.pn-directory .pd-btn--map { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; border: 1px solid var(--pd-border-strong); background: var(--pd-surface); color: var(--pd-text); }

.pn-directory .pd-hero__banner-empty {
    width: 100%;
    height: auto;
    aspect-ratio: 2.8 / 1;
    border-radius: var(--pd-radius-lg);
    border: 1px dashed var(--pd-border-strong);
    background: var(--pd-surface-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pd-border-strong);
    font-size: 24px;
    overflow: hidden;
}

.pn-directory .pd-hero__banner-empty img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* TOP slider (admin fallback, >1 banner) — same carousel infra /ads
   originally used (public/js/owl.js auto-inits ".banner-style-one"), just
   re-skinned to this page's own tokens. */
.pn-directory .pd-hero__slider {
    position: relative;
    width: 100%;
}

.pn-directory .pd-hero__slider .banner-style-one .slide {
    height: 250px;
    display: flex;
    align-items: center;
}

.pn-directory .pd-hero__slider .carousel-btn-block {
    top: 50%;
    bottom: auto;
}

.pn-directory .pd-hero__slider .carousel-btn {
    width: 30px;
    height: 30px;
    line-height: 30px;
    font-size: 12px;
    background: var(--pd-surface);
    color: var(--pd-muted);
    border: 1px solid var(--pd-border-strong);
    box-shadow: none;
}

.pn-directory .pd-hero__slider .carousel-btn:hover {
    color: var(--pd-red);
    border-color: var(--pd-red);
    background: var(--pd-surface);
}

.pn-directory .pd-hero__slider .carousel-btn.left-btn {
    left: 10px;
}

.pn-directory .pd-hero__slider .carousel-btn.right-btn {
    right: 10px;
}

/* Tablet/mobile banners use their own art-directed image sources. Let those
   images define the box height; keeping the desktop 2.8:1 frame crops them. */
@media (max-width: 1199.98px) {
    .pn-directory .pd-hero__banner :where(.image-banner) {
        aspect-ratio: auto;
    }

    .pn-directory .pd-hero__banner :where(.image-banner) picture {
        display: block;
    }

    .pn-directory .pd-hero__banner :where(.image-banner) img {
        display: block;
        height: auto !important;
        object-fit: contain;
    }

    .pn-directory .pd-hero__slider .banner-style-one .slide {
        height: auto;
        align-items: stretch;
    }
}

/* While the hero is side by side, the two content cards define its height.
   The banner fills that exact height instead of enlarging the row itself. */
@media (min-width: 768px) {
    .pn-directory .pd-hero__banner {
        position: relative;
    }

    .pn-directory .pd-hero__banner > :where(.image-banner, .pd-hero__banner-empty, .pd-hero__slider) {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        aspect-ratio: auto;
    }

    .pn-directory .pd-hero__banner :where(.image-banner, picture, img) {
        height: 100% !important;
    }

    .pn-directory .pd-hero__banner :where(.image-banner) img {
        object-fit: cover;
    }

    .pn-directory .pd-hero__slider :where(.banner-style-one, .owl-stage-outer, .owl-stage, .owl-item, .slide) {
        height: 100% !important;
    }
}

@media (max-width: 991px) {
    .pn-directory .pd-hero__content {
        flex-basis: 36%;
    }
}

@media (max-width: 767px) {
    .pn-directory .pd-hero {
        flex-direction: column;
        align-items: stretch;
        gap: var(--pd-gap-sm);
    }

    .pn-directory .pd-hero__content {
        flex-basis: auto;
    }

    .pn-directory .pd-hero__stat {
        justify-content: flex-start;
    }

    .pn-directory .pd-hero__title {
        font-size: 19px;
    }
}

/* ==========================================================================
   2. Category navigation — single white rounded strip, circular icons
   ========================================================================== */

body.pd-modal-open {
    overflow: hidden;
}

.pd-description-modal[hidden] {
    display: none;
}

.pd-description-modal {
    position: fixed;
    z-index: 10050;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pd-description-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(2px);
}

.pd-description-modal__dialog {
    position: relative;
    width: min(680px, 100%);
    max-height: min(78vh, 720px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--pd-border);
    border-radius: 16px;
    background: var(--pd-surface);
    color: var(--pd-text);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
    outline: none;
}

.pd-description-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--pd-border);
    padding-top: 0;
}

.pd-description-modal__header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
}

.pd-description-modal__close {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--pd-surface-soft);
    color: var(--pd-muted);
    cursor: pointer;
}

.pd-description-modal__close:hover {
    color: var(--pd-red);
}

.pd-description-modal__content {
    padding: 20px 22px 24px;
    overflow-y: auto;
    color: var(--pd-muted);
    font-size: 14px;
    line-height: 2.15;
}

.pd-description-modal__content > :last-child {
    margin-bottom: 0;
}

.pn-directory .pd-catnav {
    position: relative;
    background: var(--pd-surface);
    border: 1px solid var(--pd-border);
    border-radius: var(--pd-radius-lg);
    padding: 14px 46px;
}

.pn-directory .pd-catnav__track {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 4px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.pn-directory .pd-catnav__track::-webkit-scrollbar {
    display: none;
}

.pn-directory .pd-catnav__item {
    flex: 1 0 auto;
    min-width: 84px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--pd-gap-xs);
    text-decoration: none;
}

.pn-directory .pd-catnav__icon {
    width: 54px;
    height: 54px;
    border-radius: 20%;
    background: var(--pd-surface-soft);
    border: 1px solid var(--pd-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.pn-directory .pd-catnav__icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pn-directory .pd-catnav__icon i {
    font-size: 20px;
    color: var(--pd-muted);
}

.pn-directory .pd-catnav__label {
    font-size: 11.5px;
    line-height: 1.5;
    text-align: center;
    color: var(--pd-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pn-directory .pd-catnav__item.is-active .pd-catnav__icon {
    background: var(--pd-red-soft);
    border-color: var(--pd-red);
}

.pn-directory .pd-catnav__item.is-active .pd-catnav__icon i {
    color: var(--pd-red);
}

.pn-directory .pd-catnav__item.is-active .pd-catnav__label {
    color: var(--pd-red);
    font-weight: 700;
}

.pn-directory .pd-catnav__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--pd-surface);
    border: 1px solid var(--pd-border-strong);
    color: var(--pd-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    z-index: 2;
    transition: color 0.18s ease, border-color 0.18s ease;
}

.pn-directory .pd-catnav__arrow:hover {
    color: var(--pd-red);
    border-color: var(--pd-red);
}

.pn-directory .pd-catnav__arrow--prev {
    right: 10px;
}

.pn-directory .pd-catnav__arrow--next {
    left: 10px;
}

@media (max-width: 767px) {
    .pn-directory .pd-catnav {
        padding: 12px 14px;
    }

    .pn-directory .pd-catnav__arrow {
        display: none;
    }

    .pn-directory .pd-catnav__track {
        justify-content: flex-start;
    }

    .pn-directory .pd-catnav__item {
        min-width: 72px;
    }

    .pn-directory .pd-catnav__icon {
        width: 46px;
        height: 46px;
    }
}

/* ==========================================================================
   3. Filter bar — one shallow row
   ========================================================================== */

.pn-directory .pd-filter {
    background: var(--pd-surface);
    border: 1px solid var(--pd-border);
    border-radius: var(--pd-radius);
    padding: 12px 16px;
    display: flex;
    align-items: flex-end;
    gap: var(--pd-gap-sm);
    flex-wrap: wrap;
}

.pn-directory .pd-filter__form {
    display: flex;
    align-items: flex-end;
    gap: var(--pd-gap-sm);
    flex-wrap: wrap;
    flex: 1 1 auto;
    min-width: 0;
}

.pn-directory .pd-filter__field {
    flex: 1 1 160px;
    min-width: 0;
}

.pn-directory .pd-filter__field--auto {
    flex: 0 0 auto;
}

.pn-directory .pd-filter__label {
    display: block;
    font-size: 11px;
    color: var(--pd-muted);
    margin-bottom: 5px;
}

.pn-directory .pd-filter__control,
.pn-directory .pd-filter select.filter-select {
    width: 100%;
    height: 40px;
    border: 1px solid var(--pd-border-strong);
    border-radius: var(--pd-radius-sm);
    background: var(--pd-surface);
    color: var(--pd-text);
    font-size: 12.5px;
    font-family: inherit;
    padding: 0 10px;
    outline: none;
    transition: border-color 0.18s ease;
}

.pn-directory .pd-filter__control:focus,
.pn-directory .pd-filter select.filter-select:focus {
    border-color: var(--pd-red);
}

.pn-directory button.pd-filter__control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--pd-gap-xs);
    text-align: start;
    cursor: pointer;
}

.pn-directory .pd-filter__control .pd-filter__chev {
    font-size: 9px;
    color: var(--pd-muted);
    flex: none;
}

.pn-directory .pd-filter__actions {
    display: flex;
    align-items: center;
    gap: var(--pd-gap-sm);
    flex: 0 0 auto;
}

.pn-directory .pd-btn {
    height: 40px;
    padding: 0 20px;
    border-radius: var(--pd-radius-sm);
    font-size: 12.5px;
    font-family: inherit;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--pd-gap-xs);
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.18s ease, background 0.18s ease;
}

.pn-directory .pd-btn--primary {
    background: var(--pd-red);
    color: #fff;
}

.pn-directory .pd-btn--primary:hover {
    opacity: 0.9;
    color: #fff;
}

.pn-directory .pd-filter__reset {
    height: 40px;
    display: inline-flex;
    align-items: center;
    gap: var(--pd-gap-xs);
    background: none;
    border: none;
    padding: 0 4px;
    font-size: 12px;
    color: var(--pd-muted);
    cursor: pointer;
    white-space: nowrap;
}

.pn-directory .pd-filter__reset:hover {
    color: var(--pd-red);
}

.pn-directory .pd-filter .select2-container {
    width: 100% !important;
}

.pn-directory .pd-filter .select2-container--default .select2-selection--single {
    height: 40px;
    border: 1px solid var(--pd-border-strong);
    border-radius: var(--pd-radius-sm);
    background: var(--pd-surface);
    display: flex;
    align-items: center;
    padding: 0 10px;
}

.pn-directory
    .pd-filter
    .select2-container--default
    .select2-selection--single
    .select2-selection__rendered {
    line-height: normal;
    color: var(--pd-text);
    font-size: 12.5px;
    padding: 0;
}

.pn-directory
    .pd-filter
    .select2-container--default
    .select2-selection--single
    .select2-selection__arrow {
    height: 38px;
    left: 6px;
    right: auto;
}

@media (max-width: 767px) {
    .pn-directory .pd-filter {
        flex-direction: column;
        align-items: stretch;
    }

    .pn-directory .pd-filter__form {
        flex-direction: column;
        align-items: stretch;
    }

    .pn-directory .pd-filter__field,
    .pn-directory .pd-filter__field--auto {
        flex-basis: auto;
    }

    .pn-directory .pd-btn--primary {
        width: 100%;
    }

    .pn-directory .pd-filter__reset {
        align-self: flex-end;
    }
}

/* ==========================================================================
   4–5. Results composition — pinned users on the left, cards on the right
   ========================================================================== */

.pn-directory .pd-results-layout {
    display: flex;
    align-items: flex-start;
    gap: var(--pd-gap);
    direction: ltr;
}

.pn-directory .pd-results-layout--without-sidebar .pd-results-main {
    width: 100%;
}

.pn-directory .pd-results-main {
    flex: 1 1 auto;
    min-width: 0;
    direction: rtl;
}

.pn-directory .pd-featured {
    /* One sidebar card + three result cards, all with exactly equal widths. */
    flex: 0 0 calc(25% - 12px);
    min-width: 0;
    direction: rtl;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
}

.pn-directory .pd-featured__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--pd-gap-sm);
    margin-bottom: 12px;
}

.pn-directory .pd-featured__title {
    position: relative;
    font-size: 13.5px;
    font-weight: 800;
    color: var(--pd-text);
    margin: 0;
    padding-right: 11px;
}

.pn-directory .pd-featured__title::before {
    content: "";
    position: absolute;
    inset: 1px 0 1px auto;
    width: 3px;
    border-radius: 3px;
    background: var(--pd-red);
}

.pn-directory .pd-featured__viewport {
    overflow: visible;
}

.pn-directory .pd-featured__track {
    display: flex;
    flex-direction: column;
    gap: var(--pd-gap);
}

.pn-directory .pd-featured__card {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
}

.pn-directory .pd-featured__item {
    position: relative;
    flex: 0 0 auto;
    min-width: 0;
    display: flex;
    align-items: stretch;
    gap: 12px;
    min-height: 126px;
    padding: 8px;
    border: 1px solid rgba(230, 0, 0, 0.32);
    border-radius: var(--pd-radius-sm);
    background: var(--pd-surface);
    background: color-mix(in srgb, var(--pd-surface) 95%, var(--pd-red) 5%);
    text-decoration: none;
    overflow: hidden;
    transition: border-color 0.18s ease, transform 0.18s ease;
}

.pn-directory .pd-featured__item:hover {
    border-color: var(--pd-red);
    transform: translateY(-1px);
}

.pn-directory .pd-featured__logo {
    position: relative;
    flex: none;
    width: 40%;
    min-width: 88px;
    min-height: 108px;
    border-radius: var(--pd-radius-sm);
    overflow: hidden;
    background: var(--pd-surface-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pd-border-strong);
    font-size: 15px;
}

.pn-directory .pd-featured__logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pn-directory .pd-featured__logo > img:not(.pd-featured__pin) {
    border-radius: inherit;
}

.pn-directory .pd-featured__content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-block: 2px;
}

.pn-directory .pd-featured__badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--pd-red);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 10px;
}

.pn-directory .pd-featured__badge img {
    width: 12px;
    height: 12px;
    object-fit: contain;
}

.pn-directory .pd-featured__name {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--pd-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.pn-directory .pd-featured__name i {
    color: var(--pd-red);
    font-size: 10px;
    flex: none;
}

.pn-directory .pd-featured__meta {
    font-size: 10.5px;
    color: var(--pd-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 6px;
    max-width: 100%;
}

.pn-directory .pd-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--pd-gap);
}

@media (max-width: 991.98px) {
    .pn-directory .pd-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .pn-directory .pd-results-layout {
        flex-direction: column;
    }

    .pn-directory .pd-featured,
    .pn-directory .pd-results-main {
        width: 100%;
        flex-basis: auto;
    }

    .pn-directory .pd-featured__viewport {
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: thin;
        overscroll-behavior-inline: contain;
        padding-bottom: 5px;
    }

    .pn-directory .pd-featured__track {
        flex-direction: row;
        width: max-content;
    }

    .pn-directory .pd-featured__card {
        width: min(290px, calc(100vw - 72px));
    }
}

@media (max-width: 767px) {
    .pn-directory .pd-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--pd-gap-sm);
    }
}

@media (max-width: 479px) {
    .pn-directory .pd-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.pn-directory .pd-grid__full {
    grid-column: 1 / -1;
}

/*
 * MIDDLE banner breakpoint slots — own thresholds, matching .pd-grid's
 * column counts exactly.
 *   <480px -> 1 col, 480-991px -> 2 col, >=992px -> 3 col.
 */
.pn-directory .middle-banner-slot {
    display: none;
}

.pn-directory .middle-banner-slot--c1 {
    display: block;
}

.pn-directory .middle-banner-slot .image-banner {
    display: block;
    width: 100%;
    border-radius: var(--pd-radius);
    overflow: hidden;
}

.pn-directory .middle-banner-slot .image-banner img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: contain;
    margin-inline: auto;
}

@media (min-width: 480px) {
    .pn-directory .middle-banner-slot--c1 {
        display: none;
    }

    .pn-directory .middle-banner-slot--c2 {
        display: block;
    }
}

@media (min-width: 992px) {
    .pn-directory .middle-banner-slot--c2 {
        display: none;
    }

    .pn-directory .middle-banner-slot--c3 {
        display: block;
    }
}

/* ==========================================================================
   6. Empty state, pagination
   ========================================================================== */

.pn-directory .pd-empty {
    grid-column: 1 / -1;
    background: var(--pd-surface);
    border: 1px solid var(--pd-border);
    border-radius: var(--pd-radius);
    padding: 56px 20px;
    text-align: center;
}

.pn-directory .pd-empty i {
    font-size: 40px;
    color: var(--pd-border-strong);
    margin-bottom: 14px;
}

.pn-directory .pd-empty h4 {
    font-size: 16px;
    color: var(--pd-text);
    margin: 0 0 6px;
}

.pn-directory .pd-empty p {
    font-size: 12.5px;
    color: var(--pd-muted);
    margin: 0;
}

.pn-directory .pd-pager {
    margin-top: var(--pd-gap-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--pd-gap-sm);
}

.pn-directory .pd-pager__count {
    font-size: 12px;
    color: var(--pd-muted);
    margin: 0;
}

.pn-directory #load-more-btn {
    height: 42px;
    padding: 0 32px;
    border-radius: var(--pd-radius-sm);
    border: 1px solid var(--pd-border-strong);
    background: var(--pd-surface);
    color: var(--pd-text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.18s ease, color 0.18s ease;
}

/* ==========================================================================
   Directory user card — shared verbatim by the pinned sidebar and main grid
   ========================================================================== */

.pn-directory .pd-grid > .ad-item {
    min-width: 0;
}

.pn-directory .pd-user-card {
    width: 100%;
    height: 176px;
    display: flex;
    align-items: stretch;
    direction: ltr;
    overflow: hidden;
    border: 1px solid rgba(230, 0, 0, 0.12);
    border-radius: 11px;
    background: var(--pd-surface-soft);
    box-shadow: 0 1px 4px rgba(35, 21, 21, 0.04);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.pn-directory .pd-user-card:hover {
    border-color: rgba(230, 0, 0, 0.34);
    box-shadow: 0 6px 16px rgba(83, 23, 23, 0.08);
    transform: translateY(-1px);
}

.pn-directory .pd-user-card.ad-card.is-pinned,
.pn-directory .pd-user-card.ad-card.is-pinned:hover {
    border-color: var(--pd-red);
    background: linear-gradient(rgba(230, 0, 0, 0.15), rgba(230, 0, 0, 0.15)), var(--pd-surface);
}

.pn-directory .pd-user-card.ad-card.is-laddered,
.pn-directory .pd-user-card.ad-card.is-laddered:hover {
    border-color: var(--pd-red);
}

.pn-directory .pd-user-card__media {
    flex: 0 0 39%;
    min-width: 0;
    height: 100%;
    overflow: hidden;
    background: var(--pd-media-bg);
    text-decoration: none;
}

.pn-directory .pd-user-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.pn-directory .pd-user-card:hover .pd-user-card__media img {
    transform: scale(1.025);
}

.pn-directory .pd-user-card__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    direction: rtl;
    text-align: right;
    padding: 10px 11px 9px;
}

.pn-directory .pd-user-card__promotions {
    width: 100%;
    min-height: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-bottom: 5px;
}

.pn-directory .pd-user-card__promotion {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--pd-red);
    font-size: 9.5px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.pn-directory .pd-user-card__promotion img {
    width: 12px;
    height: 12px;
    object-fit: contain;
}

.pn-directory .pd-user-card__details {
    width: 100%;
    color: inherit;
    text-decoration: none;
}

.pn-directory .pd-user-card__title {
    width: 100%;
    margin: 0 0 4px;
    overflow: hidden;
    color: var(--pd-text);
    font-size: 12.5px;
    font-weight: 800;
    line-height: 1.55;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pn-directory .pd-user-card__category {
    width: 100%;
    margin: 0;
    overflow: hidden;
    color: var(--pd-muted);
    font-size: 10.5px;
    line-height: 1.5;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pn-directory .pd-user-card__activity {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    margin-top: 7px;
    padding: 2px 9px;
    border: 1px solid rgba(230, 0, 0, 0.48);
    border-radius: 999px;
    color: var(--pd-red);
    background: transparent;
    font-size: 9.5px;
    font-weight: 600;
    line-height: 1;
}

.pn-directory .pd-user-card__people {
    width: 100%;
    display: grid;
    gap: 3px;
    margin-top: auto;
}

.pn-directory .pd-user-card__person {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    color: var(--pd-muted);
    font-size: 9.5px;
    line-height: 1.4;
    text-decoration: none;
}

.pn-directory .pd-user-card__person:hover {
    color: var(--pd-red);
}

.pn-directory .pd-user-card__person > i {
    width: 15px;
    flex: 0 0 15px;
    color: var(--pd-muted);
    font-size: 12px;
    text-align: center;
}

.pn-directory .pd-user-card__person > span {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pn-directory .pd-user-card__avatar,
.pn-directory .pd-user-card__tier {
    flex: 0 0 auto;
    object-fit: cover;
}

.pn-directory .pd-user-card__avatar {
    width: 17px;
    height: 17px;
    border-radius: 50%;
}

.pn-directory .pd-user-card__tier {
    width: 13px;
    height: 13px;
    margin-right: auto;
    object-fit: contain;
}

[data-theme="dark"] .pn-directory .pd-user-card {
    border-color: rgba(255, 80, 80, 0.18);
}

[data-theme="dark"] .pn-directory .pd-user-card.ad-card.is-pinned {
    border-color: var(--pd-red);
    background: linear-gradient(rgba(230, 0, 0, 0.15), rgba(230, 0, 0, 0.15)), var(--pd-surface-soft);
}

@media (max-width: 1199.98px) {
    .pn-directory .pd-user-card {
        height: 170px;
    }
}

@media (max-width: 575px) {
    .pn-directory .pd-user-card {
        height: 164px;
    }

    .pn-directory .pd-user-card__media {
        flex-basis: 38%;
    }

    .pn-directory .pd-user-card__body {
        padding-inline: 9px;
    }

}

.pn-directory #load-more-btn:hover:not(:disabled) {
    border-color: var(--pd-red);
    color: var(--pd-red);
}

.pn-directory #load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pn-directory .pd-story:empty {
    display: none;
}

.pn-directory .category-long-description {
    margin-top: var(--pd-gap-lg);
    padding: 24px;
    background: var(--pd-surface);
    border: 1px solid var(--pd-border);
    border-radius: var(--pd-radius);
    color: var(--pd-text);
}

.pn-directory .category-long-description__title {
    margin: 0 0 16px;
    font-size: 19px;
    font-weight: 700;
}

.pn-directory .category-long-description__content {
    color: var(--pd-muted);
    font-size: 14px;
    line-height: 2;
}

.pn-directory .category-long-description__content > :last-child {
    margin-bottom: 0;
}
