/* =========================================================
   Rawi — صفحة العمل (single-webtoon)
   ========================================================= */

.wt-page { position: relative; padding-bottom: 60px; }

/* ---------- الخلفية الضبابية ---------- */
.wt-backdrop {
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 460px;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.wt-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(42px) saturate(150%) brightness(0.5);
    transform: scale(1.25);
    opacity: 0.55;
}

.wt-backdrop-fade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(120% 90% at 50% 0%, transparent 0%, var(--bg) 78%),
        linear-gradient(to bottom, transparent 20%, var(--bg) 92%);
}

.wt-shell {
    position: relative;
    z-index: 1;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 18px;
}

/* ---------- مسار التنقل ---------- */
.wt-crumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 20px 0 14px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text3);
}

.wt-crumbs a { color: var(--text3); transition: color var(--t-fast); }
.wt-crumbs a:hover { color: var(--primary-400); }

/* ---------- تخطيط الرأس ---------- */
.wt-head {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 34px;
    align-items: start;
    padding-bottom: 34px;
}

/* ---------- الغلاف ---------- */
.wt-side { position: sticky; top: calc(var(--header-h) + 16px); }

.wt-cover {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border2);
    box-shadow: var(--shadow-lg);
    background: var(--surface2);
}

.wt-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.wt-cover-ph {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: var(--text3);
    font-size: 40px;
}

.wt-cover-adult {
    position: absolute;
    top: 10px;
    inset-inline-start: 10px;
    padding: 4px 9px;
    border-radius: var(--radius-xs);
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

/* ---------- أزرار العمود الجانبي ---------- */
.wt-side-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.wt-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 18px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--grad-primary);
    color: #fff;
    font-family: inherit;
    font-size: 15.5px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow-primary);
    transition: transform var(--t-fast), filter var(--t-fast);
}

.wt-cta:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.07); }
.wt-cta:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.wt-btn-row { display: flex; gap: 8px; }

.wt-ghost {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 14px;
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    background: var(--surface2);
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--t-fast);
}

.wt-ghost:hover { background: var(--surface3); border-color: var(--border3); }
.wt-ghost--icon { flex: 0 0 46px; padding: 11px 0; color: var(--accent); }

.wt-save { position: relative; flex: 1; }
.wt-save .save-arrow { font-size: 10px; opacity: 0.6; margin-inline-start: auto; }

.wt-save-menu {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 6px);
    z-index: 40;
    display: none;
    flex-direction: column;
    padding: 6px;
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

.wt-save.open .wt-save-menu { display: flex; }

.wt-save-menu .save-option {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border: 0;
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--text2);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    text-align: start;
    cursor: pointer;
    transition: all var(--t-fast);
}

.wt-save-menu .save-option:hover { background: var(--surface3); color: var(--text); }
.wt-save-menu .save-option.active { color: var(--primary-400); background: var(--primary-soft); }
.wt-save-menu .remove-option { color: #ef4444; }

/* نجوم سريعة */
.wt-quickstars {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 10px 0;
    cursor: pointer;
    color: var(--text3);
    font-size: 17px;
}

.wt-quickstars i.is-on { color: var(--accent); }
.wt-quickstars:hover i { color: var(--accent); }

.wt-side-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 6px;
    border-top: 1px solid var(--border);
}

.wt-side-links a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 4px;
    color: var(--text3);
    font-size: 13px;
    font-weight: 600;
    transition: color var(--t-fast);
}

.wt-side-links a:hover { color: var(--text); }

/* ---------- العمود الرئيسي ---------- */
.wt-main { min-width: 0; padding-top: 6px; }

.wt-title {
    margin: 0 0 10px;
    font-size: clamp(26px, 3.4vw, 42px);
    font-weight: 900;
    line-height: 1.2;
    color: var(--text);
}

.wt-alt {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    margin-bottom: 16px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text2);
    font-family: inherit;
    font-size: 14px;
    text-align: start;
    cursor: pointer;
    transition: color var(--t-fast);
}

.wt-alt:hover { color: var(--text); }
.wt-alt i:first-child { font-size: 12px; color: var(--text3); }
.wt-alt-arrow { font-size: 10px; transition: transform var(--t-fast); }
.wt-alt.is-open .wt-alt-arrow { transform: rotate(180deg); }

/* شارات */
.wt-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 16px;
}

.wt-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border: 1px solid var(--border2);
    border-radius: var(--radius-xs);
    background: var(--surface2);
    color: var(--text2);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: all var(--t-fast);
}

.wt-badge:hover { color: var(--text); border-color: var(--border3); }
.wt-badge--type { color: var(--text); border-color: var(--border3); }
.wt-badge--safe { color: #22c55e; border-color: rgba(34, 197, 94, 0.35); background: rgba(34, 197, 94, 0.1); }
.wt-badge--adult { color: #ef4444; border-color: rgba(239, 68, 68, 0.35); background: rgba(239, 68, 68, 0.1); }
.wt-flag { font-size: 13px; }

.wt-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent);
}

.wt-badge--status.status-ongoing   { color: var(--status-ongoing); }
.wt-badge--status.status-completed { color: var(--status-completed); }
.wt-badge--status.status-upcoming  { color: var(--status-upcoming); }
.wt-badge--status.status-stopped   { color: var(--status-stopped); }

/* إحصاءات */
.wt-stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text2);
}

.wt-stat { display: inline-flex; align-items: center; gap: 7px; }
.wt-stat strong { color: var(--text); font-size: 16px; font-weight: 800; }
.wt-stat-icon { color: var(--text3); font-size: 13px; }
.wt-stat-icon--gold { color: var(--accent); }
.wt-stat-sep { width: 1px; height: 16px; background: var(--border2); }

/* القصة */
.wt-synopsis { margin-bottom: 22px; }

.wt-synopsis-body {
    position: relative;
    max-height: 108px;
    overflow: hidden;
    color: var(--text2);
    font-size: 15px;
    line-height: 1.85;
    transition: max-height var(--t);
}

.wt-synopsis-body::after {
    content: '';
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 52px;
    background: linear-gradient(to top, var(--bg), transparent);
    pointer-events: none;
    transition: opacity var(--t-fast);
}

.wt-synopsis.is-open .wt-synopsis-body { max-height: 2400px; }
.wt-synopsis.is-open .wt-synopsis-body::after { opacity: 0; }
.wt-synopsis-body p { margin: 0 0 10px; }

.wt-more-btn {
    margin-top: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary-400);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
}

.wt-more-btn:hover { text-decoration: underline; }

/* التفاصيل */
.wt-details {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.wt-detail-row { display: flex; gap: 16px; align-items: flex-start; }

.wt-detail-key {
    flex: 0 0 88px;
    padding-top: 5px;
    color: var(--text3);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.wt-detail-val { display: flex; flex-wrap: wrap; gap: 6px; }

.wt-tag {
    display: inline-flex;
    padding: 5px 11px;
    border: 1px solid var(--border2);
    border-radius: var(--radius-xs);
    background: var(--surface2);
    color: var(--text2);
    font-size: 12.5px;
    font-weight: 600;
    transition: all var(--t-fast);
}

.wt-tag:hover {
    color: #fff;
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.wt-tag--person { border-style: dashed; }

/* المشاركة */
.wt-share {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 18px;
}

.wt-share-label {
    margin-inline-end: 4px;
    color: var(--text3);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.wt-share-btn {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border2);
    border-radius: 50%;
    background: var(--surface2);
    color: var(--text2);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--t-fast);
}

.wt-share-btn:hover { color: #fff; transform: translateY(-2px); }
.wt-share--facebook:hover { background: #1877f2; border-color: #1877f2; }
.wt-share--twitter:hover  { background: #000; border-color: #000; }
.wt-share--whatsapp:hover { background: #25d366; border-color: #25d366; }
.wt-share--telegram:hover { background: #229ed9; border-color: #229ed9; }
.wt-share--reddit:hover   { background: #ff4500; border-color: #ff4500; }
.wt-share--copy:hover     { background: var(--primary-color); border-color: var(--primary-color); }

/* ---------- الفصول + المقترحات ---------- */
.wt-body {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 28px;
    align-items: start;
    margin-top: 28px;
}

.wt-chapters { min-width: 0; }

.wt-chapters-head,
.wt-reco-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.wt-chapters-head h2,
.wt-reco-head h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
}

.wt-chapters-head h2 i,
.wt-reco-head h2 i { color: var(--primary-400); font-size: 16px; }

.wt-chapters-count { color: var(--text3); font-size: 13px; font-weight: 600; }

/* أدوات الفصول */
.wt-chapters-tools {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.wt-search-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 15px;
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    transition: border-color var(--t-fast);
}

.wt-search-box:focus-within { border-color: var(--primary-color); }
.wt-search-box i { color: var(--text3); font-size: 13px; }

.wt-search-box input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
}

.wt-search-box input::placeholder { color: var(--text3); }

.wt-sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text2);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--t-fast);
}

.wt-sort-btn:hover { color: var(--text); border-color: var(--border3); background: var(--surface2); }

/* قائمة الفصول */
.wt-chapters-list .chapter-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wt-chapters-list .chapter-item { margin: 0; }

.wt-chapters-list .chapter-link {
    display: block;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition: all var(--t-fast);
}

.wt-chapters-list .chapter-link:hover {
    border-color: var(--primary-color);
    background: var(--surface2);
    transform: translateX(-3px);
}

.wt-chapters-list .chapter-list-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
}

.wt-chapters-list .chapter-thumbnail {
    flex: 0 0 44px;
    height: 44px;
    border-radius: var(--radius-xs);
    overflow: hidden;
}

.wt-chapters-list .chapter-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wt-chapters-list .chapter-left { flex: 1; min-width: 0; }

.wt-chapters-list .chapter-number {
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
}

.wt-chapters-list .chapter-type {
    margin-top: 3px;
    color: var(--primary-400);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.wt-chapters-list .chapter-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.wt-chapters-list .chapter-date {
    color: var(--text3);
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}

.wt-chapters-list .chapter-icons {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text3);
    font-size: 12px;
}

.wt-chapters-list .profit-icon::before {
    content: '\f023';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--accent);
}

.wt-chapters-list .read-marker { color: var(--text3); opacity: 0.7; }

.wt-chapters-list .chapter-link.read-chapter { opacity: 0.55; }
.wt-chapters-list .chapter-link.read-chapter .chapter-number { color: var(--text2); font-weight: 600; }

/* المجلدات */
.wt-chapters-list .volume-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 16px 0 8px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface2);
    cursor: pointer;
}

.wt-chapters-list .volume-title { margin: 0; font-size: 15px; font-weight: 800; color: var(--text); }
.wt-chapters-list .volume-toggle { color: var(--text3); font-size: 12px; }
.wt-chapters-list .chapter-list.collapsed { display: none; }

.wt-chapters-list .empty-chapters,
.wt-no-match {
    padding: 34px 20px;
    border: 1px dashed var(--border2);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text3);
    text-align: center;
    font-size: 14px;
}

/* ---------- المقترحات ---------- */
.wt-reco {
    position: sticky;
    top: calc(var(--header-h) + 16px);
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    background-image: var(--grad-surface);
}

.wt-reco-head h2 { font-size: 17px; }
.wt-reco-list { display: flex; flex-direction: column; gap: 4px; }

.wt-reco-item {
    display: flex;
    gap: 11px;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: background var(--t-fast);
}

.wt-reco-item:hover { background: var(--surface3); }

.wt-reco-cover {
    flex: 0 0 46px;
    height: 62px;
    border-radius: var(--radius-xs);
    overflow: hidden;
    background: var(--surface3);
}

.wt-reco-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.wt-reco-info { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 5px; }

.wt-reco-info h3 {
    margin: 0;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wt-reco-meta {
    display: flex;
    gap: 10px;
    color: var(--text3);
    font-size: 11.5px;
    font-weight: 600;
}

.wt-reco-meta i { color: var(--accent); }

/* ---------- استجابة ---------- */
@media (max-width: 1024px) {
    .wt-body { grid-template-columns: 1fr; }
    .wt-reco { position: static; }
    .wt-reco-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
        gap: 6px;
    }
}

@media (max-width: 860px) {
    /* تخطيط الجوال: غلاف متمركز فوق الخلفية */
    .wt-backdrop { height: 380px; }

    .wt-head {
        grid-template-columns: 1fr;
        gap: 0;
        text-align: center;
    }

    .wt-crumbs { justify-content: center; order: 2; padding: 12px 0 8px; }

    .wt-side { position: static; display: contents; }

    .wt-cover {
        width: 168px;
        margin: 18px auto 0;
        order: 1;
    }

    .wt-side-actions { order: 4; margin-top: 18px; }

    .wt-main { order: 3; padding-top: 12px; }

    .wt-title { font-size: 26px; }
    .wt-alt { justify-content: center; width: 100%; }
    .wt-badges, .wt-stats, .wt-share { justify-content: center; }

    .wt-synopsis { text-align: start; margin-top: 18px; }
    .wt-details { text-align: start; }
    .wt-detail-row { flex-direction: column; gap: 7px; }
    .wt-detail-key { flex: none; padding: 0; }

    .wt-quickstars { order: -1; }
    .wt-side-links { flex-direction: row; justify-content: center; gap: 18px; }
}

@media (max-width: 520px) {
    .wt-chapters-tools { flex-direction: column; }
    .wt-sort-btn { justify-content: center; }
    .wt-reco-list { grid-template-columns: 1fr; }
    .wt-stats { gap: 10px; font-size: 13px; }
    .wt-stat strong { font-size: 14px; }
}
