/*
 * Resources library (public pages). Uses the theme colour variables and logical properties so
 * the same rules work for English (LTR) and Urdu (RTL).
 */
.rl-page {
    --rl-primary: var(--primary-color, #066168);
    --rl-primary-rgb: var(--primary-color-rgb, 6, 97, 104);
    --rl-accent: var(--secondary-color, #ffaa0d);
    --rl-heading: var(--heading-color, #443935);
    --rl-text: var(--text-color, #346065);
    --rl-border: rgba(var(--rl-primary-rgb), 0.14);
    --rl-soft: rgba(var(--rl-primary-rgb), 0.06);
    color: var(--rl-text);
}

.rl-intro-text {
    max-width: 720px;
    margin-inline: auto;
    font-size: 1.05rem;
}

/* Filters */
.rl-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.rl-type-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rl-pill {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 18px;
    border: 1px solid var(--rl-border);
    border-radius: 999px;
    color: var(--rl-heading);
    background: #fff;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.rl-pill:hover,
.rl-pill:focus-visible {
    border-color: var(--rl-primary);
    color: var(--rl-primary);
}

.rl-pill.active {
    background: var(--rl-primary);
    border-color: var(--rl-primary);
    color: #fff;
}

.rl-filters > * {
    min-width: 0;
    max-width: 100%;
}

.rl-language-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.rl-pill--sm {
    min-height: 40px;
    padding: 6px 14px;
    font-size: 0.9rem;
}

.rl-language-label {
    margin: 0;
    font-weight: 600;
    white-space: nowrap;
}

/* Cards */
.rl-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--rl-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.rl-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.rl-card-media {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, rgba(var(--rl-primary-rgb), 0.12), rgba(var(--rl-primary-rgb), 0.03));
    overflow: hidden;
}

.rl-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rl-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: #fff;
    color: var(--rl-primary);
    box-shadow: 0 6px 18px rgba(var(--rl-primary-rgb), 0.18);
}

.rl-card-icon svg {
    width: 36px;
    height: 36px;
}

.rl-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
}

.rl-card-title {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.4;
}

.rl-card-title a {
    color: var(--rl-heading);
    text-decoration: none;
}

.rl-card-title a:hover {
    color: var(--rl-primary);
}

.rl-card-text {
    margin: 0;
    font-size: 0.95rem;
}

.rl-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    min-height: 44px;
    color: var(--rl-primary);
    font-weight: 700;
    text-decoration: none;
}

.rl-card-link svg,
.rl-back-link svg {
    width: 18px;
    height: 18px;
}

[dir='rtl'] .rl-arrow {
    transform: scaleX(-1);
}

/* Badges */
.rl-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rl-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.6;
}

.rl-badge svg {
    width: 14px;
    height: 14px;
}

.rl-badge--type {
    background: rgba(var(--rl-primary-rgb), 0.1);
    color: var(--rl-primary);
}

.rl-badge--lang {
    background: #f3f1ec;
    color: var(--rl-heading);
}

.rl-badge--sample {
    background: #fff4dc;
    color: #8a5a00;
}

.rl-empty svg {
    width: 48px;
    height: 48px;
    color: var(--rl-primary);
}

/* Detail page */
.rl-detail-title {
    margin: 10px 0;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    line-height: 1.3;
}

.rl-detail-lead {
    font-size: 1.1rem;
}

.rl-sample-notice {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 24px;
    padding: 12px 16px;
    border-inline-start: 4px solid var(--rl-accent);
    border-radius: 8px;
    background: #fff8e8;
    color: #6b4a00;
    font-size: 0.95rem;
}

.rl-sample-notice svg {
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.rl-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.rl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 10px 22px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.rl-btn svg {
    width: 20px;
    height: 20px;
}

.rl-btn--primary {
    background: var(--rl-primary);
    color: #fff;
}

.rl-btn--primary:hover,
.rl-btn--primary:focus-visible {
    background: var(--primary-color-hover, #054c52);
    color: #fff;
}

.rl-btn--ghost {
    border-color: var(--rl-border);
    background: #fff;
    color: var(--rl-heading);
}

.rl-btn--ghost:hover {
    border-color: var(--rl-primary);
    color: var(--rl-primary);
}

.rl-btn--link {
    padding-inline: 8px;
    color: var(--rl-primary);
    text-decoration: underline;
}

.rl-btn[disabled] {
    opacity: 0.6;
    pointer-events: none;
}

.rl-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.rl-content h2,
.rl-content h3 {
    margin-top: 1.6em;
    color: var(--rl-heading);
}

/* Duas booklet */
.rl-duas .rl-dua,
.rl-duas section {
    margin-bottom: 24px;
    padding: 20px;
    border: 1px solid var(--rl-border);
    border-radius: 14px;
    background: #fff;
    break-inside: avoid;
}

.rl-duas .rl-arabic,
.rl-duas [lang='ar'] {
    margin: 12px 0;
    font-family: 'Amiri', 'Noto Naskh Arabic', 'Traditional Arabic', 'Scheherazade New', serif;
    font-size: clamp(1.45rem, 5vw, 1.9rem);
    line-height: 2.1;
    direction: rtl;
    text-align: right;
    color: var(--rl-heading);
}

.rl-duas .rl-transliteration {
    font-style: italic;
    color: #6c6c6c;
}

.rl-duas .rl-source {
    font-size: 0.85rem;
    color: #7a7a7a;
}

/* Packing checklist */
.rl-checklist ul,
.rl-checklist ol {
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.rl-checklist li ul {
    margin: 8px 0 0;
    padding-inline-start: 28px;
}

.rl-check-item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--rl-border);
}

.rl-check-item > ul {
    flex-basis: 100%;
}

.rl-check-input {
    flex: none;
    width: 24px;
    height: 24px;
    margin-top: 4px;
    accent-color: var(--rl-primary);
    cursor: pointer;
}

.rl-check-label {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.rl-check-item.is-checked > .rl-check-label {
    color: #8a8a8a;
    text-decoration: line-through;
}

.rl-checklist-progress {
    font-weight: 700;
    color: var(--rl-primary);
}

.rl-checklist-note {
    font-size: 0.85rem;
    color: #7a7a7a;
}

/* Video */
.rl-video {
    overflow: hidden;
    border-radius: 14px;
    background: #000;
}

.rl-video-placeholder {
    padding: 48px 16px;
    border: 2px dashed var(--rl-border);
    border-radius: 14px;
    text-align: center;
}

.rl-video-placeholder svg {
    width: 48px;
    height: 48px;
    color: var(--rl-primary);
}

/* Sidebar */
.rl-side {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rl-side-cover img {
    width: 100%;
    border-radius: 14px;
}

.rl-download-box {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--rl-border);
    border-radius: 14px;
    background: var(--rl-soft);
}

.rl-download-icon {
    width: 40px;
    height: 40px;
    color: #c0392b;
}

.rl-download-meta {
    display: flex;
    flex-direction: column;
    word-break: break-word;
}

.rl-download-meta span {
    font-size: 0.85rem;
}

.rl-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    color: var(--rl-primary);
    font-weight: 600;
    text-decoration: none;
}

.rl-related-title {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

/* Lead modal */
.rl-lead-modal .modal-title {
    margin: 0;
    font-size: 1.25rem;
}

.rl-lead-modal .form-control {
    min-height: 48px;
}

.rl-lead-modal .form-check-input {
    width: 1.3em;
    height: 1.3em;
}

[dir='rtl'] .rl-lead-modal .form-check {
    padding-left: 0;
    padding-right: 1.8em;
}

[dir='rtl'] .rl-lead-modal .form-check .form-check-input {
    float: right;
    margin-left: 0;
    margin-right: -1.8em;
}

[dir='rtl'] .rl-lead-modal .btn-close {
    margin: -0.5rem auto -0.5rem -0.5rem;
}

.rl-lead-modal .modal-footer {
    flex-wrap: wrap;
    gap: 8px;
}

.rl-form-alert {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.95rem;
}

.rl-form-alert--error {
    background: #fdecea;
    color: #8a1f11;
}

.rl-form-alert--success {
    background: #e7f6ee;
    color: #145a32;
}

@media (max-width: 575.98px) {
    .rl-filters {
        flex-direction: column;
        align-items: stretch;
    }

    /* Few types, so wrap onto a second line rather than scrolling sideways with the last pill cut off. */
    .rl-type-pills {
        flex-wrap: wrap;
    }

    .rl-language-label {
        flex-basis: 100%;
    }

    .rl-lead-modal .modal-footer .rl-btn {
        flex: 1 1 100%;
    }

    .rl-duas .rl-dua,
    .rl-duas section {
        padding: 14px;
    }
}

/* Print: only the booklet/checklist itself, black on white. */
@media print {
    header,
    footer,
    .no-print,
    .site-header,
    .site-footer,
    .trv-breadcrumbs,
    .breadcrumb,
    .scroltop,
    .loading-area,
    .trv-wa-float,
    #rl-lead-modal {
        display: none !important;
    }

    .rl-page {
        padding: 0 !important;
        color: #000;
    }

    .rl-page .col-lg-8 {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .rl-duas .rl-dua,
    .rl-duas section {
        border-color: #999;
        page-break-inside: avoid;
    }

    .rl-check-item {
        page-break-inside: avoid;
    }

    .rl-check-input {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    a[href]::after {
        content: none !important;
    }
}

.rl-lead-modal .form-control {
    border: 1px solid #cfd8da;
    border-radius: 8px;
    background: #fff;
}

.rl-lead-modal .form-control:focus {
    border-color: var(--primary-color, #066168);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb, 6, 97, 104), 0.15);
}

@media (max-width: 991.98px) {
    .rl-side {
        position: static;
    }

    .rl-side-cover {
        display: none;
    }
}
