/* ================================================================
   Ruqyah Blog Widgets – Stylesheet v1.1
   ================================================================ */

/* ── Search & Filter Widget ──────────────────────────────────── */

.ruqyah-sf-wrapper {
    width: 100%;
    direction: rtl;
}

/* Search Row */
.ruqyah-search-row {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.ruqyah-search-wrap {
    position: relative;
    width: 100%;
    max-width: 640px;
    background: #ffffff;
    border: 1.5px solid #e0ddd6;
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ruqyah-search-wrap:focus-within {
    border-color: #3a5c2e;
    box-shadow: 0 2px 16px rgba(58,92,46,0.12);
}

.ruqyah-search-icon {
    color: #888;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: 10px;
    pointer-events: none;
    transition: color 0.2s;
}

.ruqyah-search-wrap:focus-within .ruqyah-search-icon {
    color: #3a5c2e;
}

.ruqyah-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    color: #333;
    padding: 14px 0;
    text-align: right;
    font-family: inherit;
    direction: rtl;
}

.ruqyah-search-input::placeholder {
    color: #aaa;
}

/* Filter Row */
.ruqyah-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
    direction: rtl;
}

.ruqyah-filter-btn {
    display: inline-flex;
    align-items: center;
    padding: 9px 22px;
    border-radius: 50px;
    background: #f0ede6;
    color: #444;
    font-size: 14px;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, transform 0.12s, box-shadow 0.18s;
    white-space: nowrap;
    letter-spacing: 0.01em;
    direction: rtl;
    user-select: none;
}

.ruqyah-filter-btn:hover {
    background: #e2ddd3;
    transform: translateY(-1px);
}

.ruqyah-filter-btn:active {
    transform: translateY(0);
}

.ruqyah-filter-btn.active {
    background: #3a5c2e;
    color: #ffffff;
    box-shadow: 0 3px 12px rgba(58,92,46,0.22);
}

/* ── Blog Grid Widget ─────────────────────────────────────────── */

.ruqyah-grid-wrapper {
    position: relative;
    width: 100%;
    direction: rtl;
    /* min-height keeps grid from collapsing while loading */
    min-height: 60px;
}

/* ── Spinner Overlay — NO background, just a centered spinner ── */
.ruqyah-loading-overlay {
    position: absolute;
    inset: 0;
    /* fully transparent bg */
    background: transparent;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 32px;
    z-index: 10;
    pointer-events: none; /* allow clicks through during fade */
}

/* ── Enhanced Spinner ── */
.ruqyah-spinner-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Arc spinner */
.ruqyah-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(58,92,46,0.15);
    border-top-color:  #3a5c2e;
    border-right-color: #3a5c2e;
    border-radius: 50%;
    animation: ruqyah-spin 0.6s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
    box-shadow: 0 2px 8px rgba(58,92,46,0.18);
}

@keyframes ruqyah-spin {
    to { transform: rotate(360deg); }
}

/* Dot pulse row */
.ruqyah-spinner-dots {
    display: flex;
    gap: 5px;
    align-items: center;
}

.ruqyah-spinner-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #3a5c2e;
    opacity: 0.3;
    animation: ruqyah-pulse 0.8s ease-in-out infinite;
}

.ruqyah-spinner-dot:nth-child(1) { animation-delay: 0s; }
.ruqyah-spinner-dot:nth-child(2) { animation-delay: 0.16s; }
.ruqyah-spinner-dot:nth-child(3) { animation-delay: 0.32s; }

@keyframes ruqyah-pulse {
    0%, 80%, 100% { opacity: 0.2; transform: scale(0.85); }
    40%            { opacity: 1;   transform: scale(1.15); }
}

/* Grid */
.ruqyah-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    transition: opacity 0.18s ease;
}

/* Staggered fade-in for new cards */
.ruqyah-grid > * {
    animation: ruqyah-fadeIn 0.3s ease both;
}
.ruqyah-grid > *:nth-child(1)  { animation-delay: 0.00s; }
.ruqyah-grid > *:nth-child(2)  { animation-delay: 0.04s; }
.ruqyah-grid > *:nth-child(3)  { animation-delay: 0.08s; }
.ruqyah-grid > *:nth-child(4)  { animation-delay: 0.12s; }
.ruqyah-grid > *:nth-child(5)  { animation-delay: 0.16s; }
.ruqyah-grid > *:nth-child(6)  { animation-delay: 0.20s; }

@keyframes ruqyah-fadeIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Blog Card ────────────────────────────────────────────────── */

.ruqyah-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 20px rgba(0,0,0,0.07);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    display: flex;
    flex-direction: column;
    direction: rtl;
    border: 1px solid #E7E2DA;
}

.ruqyah-card:hover {
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    transform: translateY(-4px);
    border: 1px solid #D7AD4280;

}

/* ── Card Image ── */
.ruqyah-card-image-link {
    display: block;
    text-decoration: none;
}

.ruqyah-card-image {
    position: relative;
    aspect-ratio: 16 / 10;
    max-height: 250px;
    width: 100%;
    overflow: hidden;
    background: #e8e4dc;
}

.ruqyah-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.ruqyah-card:hover .ruqyah-card-image img {
    transform: scale(1.05);
}

.ruqyah-card-no-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #c8b99a 0%, #e8e2d6 100%);
}

/* ── Category Badge ── */
.ruqyah-card-cat {
    position: absolute;
    top: 14px;
    right: 14px;
    background: #c8a84b;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 30px;
    direction: rtl;
    letter-spacing: 0.02em;
    pointer-events: none;
}

/* ── Card Body ── */
.ruqyah-card-body {
    padding: 22px 24px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Title ── */
.ruqyah-card-title {
    font-size: 20px;
    font-weight: 400;
    color: #1F2815;
    margin: 0;
    line-height: 28px;
    text-align: right;
}

.ruqyah-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.ruqyah-card-title a:hover {
    color: #3a5c2e;
}

/* ── Excerpt ── */
.ruqyah-card-excerpt {
    font-size: 14px;
    color: #66705C;
    line-height: 20px;
    margin: 0;
    text-align: right;
    flex: 1;
}

/* ── Meta row (date + read time) ── */
.ruqyah-card-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #888;
    direction: rtl;
    align-items: center;
    padding-top: 2px;
}

.ruqyah-meta-date,
.ruqyah-meta-time {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ruqyah-meta-date svg,
.ruqyah-meta-time svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* ── Footer row ── */
.ruqyah-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid #f0ede6;
    direction: rtl;
    margin-top: auto;
}

/* ── Author ── */
.ruqyah-card-author {
    font-size: 13px;
    color: #888;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ruqyah-card-author svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* ── Read More Link ── */
.ruqyah-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 600;
    color: #3a5c2e;
    text-decoration: none;
    transition: color 0.2s, gap 0.2s;
}

.ruqyah-card-link:hover {
    color: #2a4420;
    gap: 9px;
}

.ruqyah-card-link svg {
    flex-shrink: 0;
    transition: transform 0.2s;
}

.ruqyah-card-link:hover svg {
    transform: translateX(-3px);
}

/* No results */
.ruqyah-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #888;
    font-size: 16px;
    direction: rtl;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .ruqyah-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .ruqyah-grid { grid-template-columns: 1fr; }
    .ruqyah-filter-row { justify-content: flex-start; }
    .ruqyah-filter-btn { font-size: 13px; padding: 8px 16px; }
}

/* ================================================================
   v2.0 Additions: Blog Section + Pagination
   ================================================================ */

/* ── Pagination ───────────────────────────────────────────────── */

.ruqyah-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    direction: rtl;
}

.ruqyah-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border: 1.5px solid #e0ddd6;
    border-radius: 10px;
    background: #ffffff;
    color: #444;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.12s, box-shadow 0.18s;
    user-select: none;
}

.ruqyah-page-btn:hover:not(:disabled):not(.active) {
    background: #f0ede6;
    border-color: #c8b99a;
    transform: translateY(-1px);
}

.ruqyah-page-btn.active {
    background: #3a5c2e;
    color: #ffffff;
    border-color: #3a5c2e;
    box-shadow: 0 3px 12px rgba(58,92,46,0.22);
    cursor: default;
}

.ruqyah-page-btn:disabled,
.ruqyah-page-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.ruqyah-page-btn.ruqyah-page-prev,
.ruqyah-page-btn.ruqyah-page-next {
    font-size: 18px;
    font-weight: 700;
    min-width: 44px;
}

/* ── Blog Section Widget ──────────────────────────────────────── */

.ruqyah-bs-wrapper {
    position: relative;
    width: 100%;
    direction: rtl;
}

/* Filter row */
.ruqyah-bs-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    direction: rtl;
    margin-bottom: 32px;
}

.ruqyah-bs-filter-btn {
    display: inline-flex;
    align-items: center;
    padding: 9px 22px;
    border-radius: 50px;
    background: #f0ede6;
    color: #444;
    font-size: 14px;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, transform 0.12s, box-shadow 0.18s;
    white-space: nowrap;
    direction: rtl;
    user-select: none;
}

.ruqyah-bs-filter-btn:hover {
    background: #e2ddd3;
    transform: translateY(-1px);
}

.ruqyah-bs-filter-btn.active {
    background: #3a5c2e;
    color: #ffffff;
    box-shadow: 0 3px 12px rgba(58,92,46,0.22);
}

/* Vertical row */
/* ── Hero Row (3 vertical cards) ──────────────────────────────── */
.ruqyah-bs-hero-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.ruqyah-bs-hero-row > * {
    animation: ruqyah-fadeIn 0.3s ease both;
}
.ruqyah-bs-hero-row > *:nth-child(1) { animation-delay: 0.00s; }
.ruqyah-bs-hero-row > *:nth-child(2) { animation-delay: 0.05s; }
.ruqyah-bs-hero-row > *:nth-child(3) { animation-delay: 0.10s; }

/* ── List Card Row (3 horizontal cards) ───────────────────────── */
.ruqyah-bs-list-card {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.ruqyah-bs-list-card > * {
    animation: ruqyah-fadeIn 0.3s ease both;
}
.ruqyah-bs-list-card > *:nth-child(1) { animation-delay: 0.12s; }
.ruqyah-bs-list-card > *:nth-child(2) { animation-delay: 0.17s; }
.ruqyah-bs-list-card > *:nth-child(3) { animation-delay: 0.22s; }

/* ── Horizontal Card ──────────────────────────────────────────── */

.ruqyah-hcard {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 20px rgba(0,0,0,0.07);
    border: 1px solid #E7E2DA;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    direction: rtl;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    min-height: 160px;
}

.ruqyah-hcard:hover {
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    transform: translateY(-3px);
    border-color: #D7AD4280;
}

/* Image block — fixed width, full height */
.ruqyah-hcard-image-link {
    display: block;
    text-decoration: none;
    flex-shrink: 0;
}

.ruqyah-hcard-image {
    position: relative;
    width: 220px;
    min-width: 220px;
    height: 100%;
    overflow: hidden;
    background: #e8e4dc;
}

.ruqyah-hcard-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.ruqyah-hcard:hover .ruqyah-hcard-image img {
    transform: scale(1.06);
}

/* Body */
.ruqyah-hcard-body {
    flex: 1;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    text-align: right;
    direction: rtl;
}

/* Category label inside body (text-only, no badge) */
.ruqyah-hcard-cat-text {
    font-size: 11px;
    font-weight: 700;
    color: #c8a84b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ruqyah-hcard-body .ruqyah-card-title {
    font-size: 15px;
    line-height: 22px;
    margin: 0;
}

.ruqyah-hcard-body .ruqyah-card-excerpt {
    font-size: 13px;
    line-height: 19px;
    -webkit-line-clamp: 3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ruqyah-hcard-body .ruqyah-card-meta {
    margin-top: auto;
    padding-top: 6px;
    font-size: 12px;
}

.ruqyah-hcard-body .ruqyah-card-link {
    font-size: 12.5px;
    margin-top: 2px;
}

/* ── Blog Section responsive ──────────────────────────────────── */
@media (max-width: 1024px) {
    .ruqyah-bs-hero-row  { grid-template-columns: repeat(2, 1fr) !important; }
    .ruqyah-bs-list-card { grid-template-columns: repeat(2, 1fr) !important; }
    .ruqyah-hcard-image { width: 120px; min-width: 120px; }
}

@media (max-width: 640px) {
    .ruqyah-bs-hero-row  { grid-template-columns: 1fr !important; }
    .ruqyah-bs-list-card { grid-template-columns: 1fr !important; }
    .ruqyah-hcard { flex-direction: column; }
    .ruqyah-hcard-image { width: 100%; min-width: 100%; height: 180px; }
    .ruqyah-bs-filter-row { justify-content: flex-start; }
}

/* ── Pagination stagger ─────────────────────────────────────── */
.ruqyah-grid > *:nth-child(7)  { animation-delay: 0.24s; }
.ruqyah-grid > *:nth-child(8)  { animation-delay: 0.28s; }
.ruqyah-grid > *:nth-child(9)  { animation-delay: 0.32s; }
.ruqyah-grid > *:nth-child(10) { animation-delay: 0.36s; }
.ruqyah-grid > *:nth-child(11) { animation-delay: 0.40s; }
.ruqyah-grid > *:nth-child(12) { animation-delay: 0.44s; }


/* ================================================================
   Blog Post Navigation Widget (ruqyah_blog_nav)
   ================================================================ */

.ruqyah-nav-wrap {
    display: flex;
    flex-direction: row;
    gap: 16px;
    width: 100%;
    direction: rtl;
    flex-wrap: wrap;
}

.ruqyah-nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 0;
    min-width: 200px;
    padding: 14px 24px;
    border-radius: 12px;
    background: #3a5c2e;
    color: #ffffff;
    text-decoration: none !important;
    font-family: inherit;
    font-size: 14px;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    cursor: pointer;
    border: none;
    outline: none;
    box-shadow: 0 2px 10px rgba(58, 92, 46, 0.18);
    position: relative;
    overflow: hidden;
}

.ruqyah-nav-btn:not(.disabled):hover {
    background: #2e4a24;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(58, 92, 46, 0.28);
}

.ruqyah-nav-btn:not(.disabled):active {
    transform: translateY(0);
}

.ruqyah-nav-btn.disabled {
    background: #e8e4dc;
    color: #aaaaaa;
    cursor: not-allowed;
    box-shadow: none;
    pointer-events: none;
}

/* Arrow icon */
.ruqyah-nav-arrow {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    opacity: 0.85;
    transition: transform 0.2s;
}

.ruqyah-nav-btn:not(.disabled):hover .ruqyah-nav-prev .ruqyah-nav-arrow {
    transform: translateX(3px);
}

.ruqyah-nav-btn:not(.disabled):hover .ruqyah-nav-next .ruqyah-nav-arrow {
    transform: translateX(-3px);
}

/* Content: label + post title */
.ruqyah-nav-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.ruqyah-nav-label {
    font-size: 11px;
    opacity: 0.75;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 600;
}

.ruqyah-nav-post-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 1;
}

/* Thumbnail circle */
.ruqyah-nav-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    opacity: 0.9;
}

/* RTL arrangement */
.ruqyah-nav-prev {
    flex-direction: row; /* arrow → content → thumb */
}

.ruqyah-nav-next {
    flex-direction: row-reverse; /* thumb → content → arrow (mirrored) */
    text-align: left;
}

@media (max-width: 600px) {
    .ruqyah-nav-btn {
        min-width: 100%;
    }
}


/* ================================================================
   Popular Posts Widget (ruqyah_popular_posts)
   ================================================================ */

.ruqyah-pop-wrap {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    direction: rtl;
    width: 100%;
}

/* Widget heading */
.ruqyah-pop-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 20px;
    padding-right: 14px;
    position: relative;
    line-height: 1.3;
}

.ruqyah-pop-title::before {
    content: '';
    position: absolute;
    right: 0;
    top: 2px;
    bottom: 2px;
    width: 4px;
    border-radius: 4px;
    background: #3a5c2e;
}

/* List */
.ruqyah-pop-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.ruqyah-pop-item {
    border-bottom: 1px solid #f0ede6;
    transition: background 0.18s;
    border-radius: 8px;
}

.ruqyah-pop-item:last-child {
    border-bottom: none;
}

.ruqyah-pop-item:hover {
    background: #f9f7f3;
}

.ruqyah-pop-item-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 8px;
    text-decoration: none !important;
    color: inherit;
}

/* Rank badge */
.ruqyah-pop-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #3a5c2e;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
}

/* Top-3 special colours */
.ruqyah-pop-item:nth-child(1) .ruqyah-pop-rank { background: #c8a84b; }
.ruqyah-pop-item:nth-child(2) .ruqyah-pop-rank { background: #9ca3af; }
.ruqyah-pop-item:nth-child(3) .ruqyah-pop-rank { background: #b87333; }

/* Thumbnail */
.ruqyah-pop-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

/* Meta column */
.ruqyah-pop-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ruqyah-pop-post-title {
    font-size: 14px;
    font-weight: 600;
    color: #222222;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.15s;
}

.ruqyah-pop-item-link:hover .ruqyah-pop-post-title {
    color: #3a5c2e;
}

.ruqyah-pop-excerpt {
    font-size: 12px;
    color: #888;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Views badge */
.ruqyah-pop-views {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #555555;
    background: #f0ede6;
    border-radius: 20px;
    padding: 2px 8px;
    width: fit-content;
    line-height: 1.6;
}

.ruqyah-pop-views svg {
    flex-shrink: 0;
    opacity: 0.7;
}

