/**
 * Category Guide Plugin Styles
 * RTL & Responsive Native
 */

.category-guide-wrapper {
    margin-top: 45px;
    margin-bottom: 35px;
    clear: both;
    width: 100%;
    display: block;
    box-sizing: border-box;
}

.category-guide-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 26px 30px;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04);
    position: relative;
    box-sizing: border-box;
    direction: rtl;
    text-align: right;
}

.category-guide-content-wrapper {
    position: relative;
    max-height: 290px;
    overflow: hidden;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-guide-content-wrapper.is-expanded {
    max-height: none !important;
}

.category-guide-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 95px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.85) 65%, #ffffff 100%);
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.category-guide-content-wrapper.is-expanded .category-guide-overlay {
    opacity: 0;
    display: none;
}

.category-guide-actions {
    text-align: center;
    margin-top: 14px;
    position: relative;
    z-index: 2;
}

.category-guide-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    font-size: 0.92rem;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 9999px;
    cursor: pointer;
    outline: none;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.category-guide-toggle-btn:hover {
    background: #4361ee;
    color: #ffffff;
    border-color: #4361ee;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(67, 97, 238, 0.25);
}

.category-guide-toggle-btn .toggle-icon {
    display: inline-flex;
    transition: transform 0.3s ease;
}

.category-guide-toggle-btn:hover .toggle-icon svg {
    stroke: #ffffff;
}

/* Typography Inside Guide Body */
.category-guide-body {
    font-size: 0.95rem;
    line-height: 1.85;
    color: #334155;
}

.category-guide-body h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    margin-top: 10px;
    margin-bottom: 14px;
    line-height: 1.4;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 8px;
}

.category-guide-body h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    margin-top: 18px;
    margin-bottom: 10px;
}

.category-guide-body h4 {
    font-size: 1.02rem;
    font-weight: 700;
    color: #334155;
    margin-top: 14px;
    margin-bottom: 8px;
}

.category-guide-body p {
    margin-bottom: 14px;
    text-align: justify;
}

.category-guide-body ul,
.category-guide-body ol {
    padding-right: 24px;
    margin-bottom: 16px;
}

.category-guide-body li {
    margin-bottom: 6px;
    line-height: 1.75;
}

.category-guide-body strong,
.category-guide-body b {
    color: #0f172a;
    font-weight: 700;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .category-guide-card {
        padding: 18px 18px;
        border-radius: 12px;
    }

    .category-guide-body h2 {
        font-size: 1.18rem;
    }

    .category-guide-toggle-btn {
        width: 100%;
        font-size: 0.85rem;
        padding: 9px 16px;
    }
}

/* Category Portfolio Gallery Section */
.kdc-cat-portfolio {
    margin: 36px 0 28px;
    clear: both;
    width: 100%;
    display: block;
    box-sizing: border-box;
}

.kdc-cat-portfolio__card {
    background: #ffffff;
    border: 1px solid #d7dfeb;
    border-radius: 16px;
    padding: 26px 30px;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
    direction: rtl;
    text-align: right;
}

.kdc-cat-portfolio__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 14px;
    margin-bottom: 10px;
}

.kdc-cat-portfolio__title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.45;
}

.kdc-cat-portfolio__badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 9999px;
    background: #eef8f5;
    border: 1px solid #a5d8c5;
    color: #145745;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.4;
}

.kdc-cat-portfolio__desc {
    margin: 0 0 18px;
    color: #334155;
    font-size: 0.95rem;
    line-height: 1.85;
}

.kdc-cat-portfolio__grid.is-collapsed .gallery-col:nth-child(n+7) {
    display: none;
}

.kdc-cat-portfolio .gallery-col > .col-inner {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kdc-cat-portfolio .gallery-col > .col-inner:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.kdc-cat-portfolio__actions {
    text-align: center;
    margin-top: 18px;
}

.kdc-cat-portfolio__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 24px;
    border-radius: 9999px;
    border: 1px solid #a9b8ce;
    background: #f6f8fb;
    color: #273f64;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.kdc-cat-portfolio__toggle:hover {
    background: #273f64;
    border-color: #273f64;
    color: #ffffff;
}

.kdc-cat-portfolio__toggle:focus-visible,
.category-guide-toggle-btn:focus-visible,
.kdc-cat-portfolio a:focus-visible {
    outline: 2px solid #273f64;
    outline-offset: 2px;
}

.kdc-cat-portfolio__toggle .toggle-icon {
    display: inline-flex;
    transition: transform 0.25s ease;
}

@media (max-width: 768px) {
    .kdc-cat-portfolio__card {
        padding: 18px;
        border-radius: 12px;
    }

    .kdc-cat-portfolio__title {
        font-size: 1.18rem;
    }

    .kdc-cat-portfolio__toggle {
        width: 100%;
        font-size: 0.88rem;
        padding: 10px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kdc-cat-portfolio *,
    .category-guide-wrapper * {
        transition: none !important;
    }
    .kdc-cat-portfolio .gallery-col > .col-inner:hover {
        transform: none;
    }
}
