/* معرض الابتسامات — الصفحة الرئيسية */
.smiles-gallery {
    position: relative;
    padding: clamp(2.5rem, 5vw, 4rem) 1.25rem;
    background: transparent;
}

.smiles-gallery__inner {
    width: min(1100px, 100%);
    margin: 0 auto;
}

.smiles-gallery__head {
    text-align: center;
    margin-bottom: 1.75rem;
}

.smiles-gallery__eyebrow {
    margin: 0 0 0.4rem;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    color: var(--accent-color, #d4af37);
    font-weight: 700;
}

.smiles-gallery__title {
    margin-bottom: 0.55rem !important;
}

.smiles-gallery__sub {
    margin: 0 auto;
    max-width: 36rem;
    color: var(--text-muted, #cbbba8);
    font-size: clamp(0.92rem, 1.5vw, 1.05rem);
    line-height: 1.65;
}

.smiles-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem;
    margin-bottom: 1.5rem;
}

.smiles-filter {
    appearance: none;
    border: 1px solid rgba(212, 175, 55, 0.35);
    background: color-mix(in srgb, var(--bg-card, #2d221c) 88%, transparent);
    color: var(--text-main, #f5efe6);
    border-radius: 999px;
    padding: 0.45rem 0.95rem;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.smiles-filter:hover {
    border-color: var(--accent-color, #d4af37);
    transform: translateY(-1px);
}

.smiles-filter.is-active {
    background: linear-gradient(135deg, #d4af37, #c9a227);
    border-color: transparent;
    color: #1c1613;
}

.smiles-stage {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.15rem;
}

@media (max-width: 820px) {
    .smiles-stage {
        grid-template-columns: 1fr;
    }
}

.smiles-card {
    position: relative;
    isolation: isolate;
    border-radius: 16px;
    border: 1px solid rgba(212, 175, 55, 0.32);
    overflow: hidden;
    background: transparent;
    box-shadow:
        inset 0 1px 0 rgba(232, 197, 71, 0.12),
        0 10px 28px rgba(0, 0, 0, 0.28);
}

.smiles-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
        linear-gradient(165deg, #3a2d24 0%, #2d221c 52%, #241a15 100%);
    opacity: 0.95;
}

.smiles-card > * {
    position: relative;
    z-index: 1;
}

.ba-slider {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #120e0c;
    touch-action: none;
    user-select: none;
}

.ba-slider__after,
.ba-slider__before {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.ba-slider__before {
    z-index: 2;
    border-inline-end: 2px solid rgba(212, 175, 55, 0.85);
}

.ba-slider__after img,
.ba-slider__before img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-width: none;
}

.ba-slider__before img {
    /* keep full-frame crop while clip width changes */
    width: var(--ba-full-w, 100%);
    max-width: none;
}

.ba-label {
    position: absolute;
    top: 0.65rem;
    z-index: 3;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: rgba(28, 22, 19, 0.72);
    color: #f5efe6;
    border: 1px solid rgba(212, 175, 55, 0.45);
}

.ba-label--before {
    inset-inline-start: 0.65rem;
}

.ba-label--after {
    inset-inline-end: 0.65rem;
}

.ba-slider__range {
    position: absolute;
    inset: 0;
    z-index: 5;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: ew-resize;
    appearance: none;
    background: transparent;
}

.ba-slider__handle {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 4;
    width: 2px;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #e8c547, #d4af37 45%, #a8872a);
    pointer-events: none;
}

.ba-slider__handle span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2.1rem;
    height: 2.1rem;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid #e8c547;
    background: radial-gradient(circle at 35% 30%, #3a2d24, #1c1613 70%);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.ba-slider__handle span::before,
.ba-slider__handle span::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 0;
    height: 0;
    border-style: solid;
    transform: translateY(-50%);
}

.ba-slider__handle span::before {
    inset-inline-start: 0.35rem;
    border-width: 5px 6px 5px 0;
    border-color: transparent #e8c547 transparent transparent;
}

.ba-slider__handle span::after {
    inset-inline-end: 0.35rem;
    border-width: 5px 0 5px 6px;
    border-color: transparent transparent transparent #e8c547;
}

.smiles-card__meta {
    padding: 0.95rem 1rem 1.1rem;
}

.smiles-card__title {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
    color: var(--text-main, #f5efe6);
    line-height: 1.35;
}

.smiles-card__cat {
    margin: 0 0 0.55rem;
    color: var(--text-muted, #cbbba8);
    font-size: 0.86rem;
}

.smiles-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 0 0.7rem;
}

.smiles-tag {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-color, #d4af37);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 999px;
    padding: 0.18rem 0.5rem;
}

.smiles-card__link {
    color: var(--accent-color, #d4af37);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
}

.smiles-card__link:hover {
    text-decoration: underline;
}

.smiles-empty {
    text-align: center;
    color: var(--text-muted, #cbbba8);
    margin: 1rem 0 0;
}

.smiles-gallery__cta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

html[data-theme-id="dark_wood_gold"] .smiles-card {
    border-color: rgba(212, 175, 55, 0.38) !important;
}

html[data-theme-id="dark_wood_gold"] .smiles-card::before {
    background:
        var(--wood-grain-dense, none),
        linear-gradient(165deg, #3a2d24 0%, #2d221c 52%, #241a15 100%) !important;
    background-size: auto, cover !important;
}
