/* Custom Labels Plugin Styles
   Color is injected from settings (default site color #f7941d)
   Fonts inherit from the site (Peyda)
*/

:root {
    --cl-primary: #f7941d;
    --cl-primary-dark: #d67a10;
    --cl-bg: rgba(247, 148, 29, 0.12);
    --cl-card: #FFFFFF;
    --cl-foreground: #1f2937;
    --cl-muted: #4b5563;
    --cl-border: rgba(247, 148, 29, 0.35);
    --cl-radius: 12px;
    --cl-shadow: 0 4px 12px rgba(247, 148, 29, 0.12);
    --cl-shadow-hover: 0 12px 28px rgba(247, 148, 29, 0.22);
    --cl-font-heading: Peyda, inherit;
    --cl-font-body: Peyda, inherit;
}

/* ========== Labels Box (Single page) ========== */
.cl-labels-box {
    margin: 24px 0;
    padding: 20px;
    background: var(--cl-bg);
    border-radius: var(--cl-radius);
    border: 1px solid var(--cl-border);
}

.cl-labels-title {
    font-family: var(--cl-font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--cl-foreground);
    margin: 0 0 12px 0;
}

.cl-labels-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cl-label-pill {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 6px 14px;
    border: 1.5px solid var(--cl-primary);
    border-radius: 999px;
    color: var(--cl-primary);
    text-decoration: none;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    background: transparent;
}

.cl-hash {
    font-weight: 700;
    margin-inline-end: 1px;
}

.cl-label-pill:hover,
.cl-label-pill:focus {
    background: var(--cl-primary);
    color: #fff;
    outline: 2px solid var(--cl-primary);
    outline-offset: 2px;
}

/* ========== Archive Grid ========== */
.cl-archive-wrapper {
    margin: 24px 0;
}

.cl-archive-grid {
    display: grid;
    grid-template-columns: repeat(var(--cl-columns, 3), 1fr);
    gap: 24px;
}

@media (max-width: 1024px) {
    .cl-archive-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .cl-archive-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ========== Cards ========== */
.cl-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--cl-card);
    border-radius: var(--cl-radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--cl-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid rgba(167, 243, 208, 0.5);
}

.cl-card:hover,
.cl-card:focus {
    transform: translateY(-6px);
    box-shadow: var(--cl-shadow-hover);
    outline: 2px solid var(--cl-primary);
    outline-offset: 2px;
}

.cl-card-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: #f1f5f9;
}

.cl-placeholder {
    width: 100%;
    height: 100%;
}

.cl-card:hover .cl-card-image {
    transform: scale(1.04);
}

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

.cl-card-title {
    font-family: var(--cl-font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--cl-foreground);
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Product meta */
.cl-product-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
    font-family: inherit;
    font-size: 0.8125rem;
    direction: rtl;
    text-align: right;
}

.cl-meta-pair {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: baseline;
    gap: 6px;
    padding: 4px 0;
    border-bottom: 1px dashed var(--cl-border);
    direction: rtl;
}

.cl-meta-pair:last-child {
    border-bottom: none;
}

.cl-meta-label {
    color: var(--cl-muted);
    font-weight: 500;
    flex-shrink: 0;
    direction: rtl;
}

.cl-meta-value {
    color: var(--cl-foreground);
    font-weight: 600;
    text-align: right;
    direction: rtl;
    unicode-bidi: isolate;
}

/* Post excerpt */
.cl-post-excerpt {
    font-family: var(--cl-font-body);
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--cl-muted);
    margin-top: auto;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Pagination */
.cl-pagination {
    margin-top: 32px;
    text-align: center;
}

.cl-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    margin: 0 4px;
    padding: 0 8px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--cl-border);
    color: var(--cl-foreground);
    text-decoration: none;
    font-family: var(--cl-font-body);
    transition: all 0.2s;
}

.cl-pagination .page-numbers.current,
.cl-pagination .page-numbers:hover {
    background: var(--cl-primary);
    color: #fff;
    border-color: var(--cl-primary);
}

.cl-no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--cl-muted);
    font-family: inherit;
}

.cl-term-description {
    margin-top: 40px;
    padding: 24px;
    background: var(--cl-bg);
    border: 1px solid var(--cl-border);
    border-radius: var(--cl-radius);
}

.cl-term-description-title {
    margin: 0 0 12px;
    font-family: inherit;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--cl-foreground);
}

.cl-term-description-body {
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--cl-foreground);
}

.cl-term-description-body p:last-child {
    margin-bottom: 0;
}

.cl-lang-en,
.cl-lang-en .cl-product-meta,
.cl-lang-en .cl-meta-pair,
.cl-lang-en .cl-meta-label,
.cl-lang-en .cl-meta-value,
.cl-lang-en .cl-labels-title,
.cl-lang-en .cl-card-title,
.cl-lang-en .cl-post-excerpt,
.cl-lang-en .cl-term-description,
.cl-lang-en .cl-term-description-title,
.cl-lang-en .cl-term-description-body {
    direction: ltr;
    text-align: left;
}

.cl-lang-en .cl-meta-pair {
    flex-direction: row;
    justify-content: flex-start;
}

.cl-lang-en .cl-labels-list {
    justify-content: flex-start;
}
@media (prefers-reduced-motion: reduce) {
    .cl-card,
    .cl-card-image,
    .cl-label-pill {
        transition: none !important;
    }
    .cl-card:hover {
        transform: none;
    }
}
