/* =====================================================
   صفحة الموضوع (تفاصيل الايتم): ترويسة + مقال + شريط جانبي
   تُحمَّل من pages/item.blade.php فقط، وتستعمل متغيرات style.css و site.css
   ===================================================== */

/* ── الترويسة ── */
.wp-hero--topic {
    padding: 52px 0 96px;
    text-align: start;
}


.wp-hero--topic .wp-breadcrumb,
.wp-hero--topic .wp-meta {
    justify-content: flex-start;
}

.wp-hero--topic .wp-hero-title {
    max-width: 920px;
    font-size: clamp(1.5rem, 3vw, 2.35rem);
    line-height: 1.55;
}

.wp-topic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.wp-topic-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 14px;
    border: 1px solid var(--gold);
    border-radius: 999px;
    background: var(--gold);
    color: var(--navy);
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

a.wp-topic-chip:hover {
    background: transparent;
    color: var(--gold-light);
}

.wp-topic-chip--ghost {
    border-color: var(--gold-line);
    background: transparent;
    color: var(--gold-light);
    font-weight: 500;
}

/* ── الهيكل: مقال + شريط جانبي ── */
.wp-topic {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
    gap: 32px;

    margin-top: -64px;
}

.wp-topic-main {
    min-width: 0;
}

.wp-topic-full {
    grid-column: 1 / -1;
    margin-top: 24px;
}

/* ── المقال ── */
.wp-article--topic {
    max-width: none;
    margin: 0;
    padding: clamp(20px, 3.2vw, 40px);
    border: 1px solid rgba(7, 38, 50, 0.06);
    border-radius: 16px;
    box-shadow: 0 18px 40px -18px rgba(7, 38, 50, 0.28);
}

/* الغلاف يملأ عرض البطاقة من الأعلى */
.wp-article--topic > .wp-article-cover:first-child,
.wp-article--topic > .wp-video--main:first-child {
    margin: calc(-1 * clamp(20px, 3.2vw, 40px)) calc(-1 * clamp(20px, 3.2vw, 40px)) 28px;
    border-radius: 16px 16px 0 0;
}

.wp-article--topic > .wp-article-cover:first-child:not(.wp-article-cover--writer) {
    overflow: hidden;
    background: var(--navy-800);
}

.wp-article--topic > .wp-article-cover:first-child:not(.wp-article-cover--writer) img {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    border-radius: 0;
}

/* صورة العضو تبقى دائرية في الوسط */
.wp-article--topic > .wp-article-cover--writer:first-child {
    margin: 0 auto 26px;
    border-radius: 50%;
}

.wp-article--topic .wp-article-lead {
    padding: 16px 20px;
    border-inline-start-width: 4px;
    border-radius: 0 12px 12px 0;
    background: var(--cream-100, #fcf9f1);
    font-size: 1.08rem;
}

[dir="rtl"] .wp-article--topic .wp-article-lead {
    border-radius: 12px 0 0 12px;
}

.wp-article--topic .wp-article-body {
    color: #2b3327;
    font-size: 1.07rem;
    line-height: 2.15;
}

.wp-article--topic .wp-article-body p {
    margin: 0 0 1.1em;
}

.wp-article--topic .wp-article-body blockquote {
    margin: 1.4em 0;
    padding: 14px 20px;
    border-inline-start: 4px solid var(--gold);
    background: var(--cream-100, #fcf9f1);
    color: var(--navy);
}

.wp-article--topic .wp-actions {
    align-items: center;
}

/* موضوع بلا محتوى: شريط الأزرار وحده دون فاصل */
.wp-article--topic > .wp-actions:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

/* ── السابق / التالي ── */
.wp-topic-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 24px;
}

.wp-topic-nav-link {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 20px;
    border: 1px solid rgba(7, 38, 50, 0.08);
    border-radius: 14px;
    background: var(--bg-card);
    color: var(--navy);
    text-decoration: none;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.wp-topic-nav-link--next {
    text-align: end;
}

a.wp-topic-nav-link:hover {
    border-color: var(--gold);
    box-shadow: 0 10px 24px -14px rgba(7, 38, 50, 0.35);
    transform: translateY(-2px);
}

.wp-topic-nav-link.is-empty {
    border-style: dashed;
    background: transparent;
}

.wp-topic-nav-label {
    color: var(--gold-700, #8e7120);
    font-size: 0.82rem;
    font-weight: 700;
}

.wp-topic-nav-title {
    display: -webkit-box;
    overflow: hidden;
    font-weight: 700;
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* ── الشريط الجانبي ── */
.wp-sidebar {
    position: sticky;
    top: var(--side-top, 104px);
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.wp-side-box {
    padding: 20px;
    border: 1px solid rgba(7, 38, 50, 0.06);
    border-radius: 16px;
    background: var(--bg-card);
    box-shadow: 0 14px 32px -20px rgba(7, 38, 50, 0.3);
}

.wp-side-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -20px -20px 14px;
    padding: 14px 20px;
    border-bottom: 2px solid var(--gold);
    border-radius: 16px 16px 0 0;
    background: var(--navy);
    color: var(--cream);
    font-size: 1.02rem;
    font-weight: 800;
}

.wp-side-title i {
    color: var(--gold);
}

/* البحث */
.wp-side-search {
    display: flex;
    gap: 8px;
    padding: 8px;
}

.wp-side-search input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid rgba(7, 38, 50, 0.12);
    border-radius: 10px;
    background: var(--cream-100, #fcf9f1);
    color: var(--navy);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
}

.wp-side-search input:focus {
    border-color: var(--gold);
}

.wp-side-search button {
    flex-shrink: 0;
    width: 44px;
    border: 0;
    border-radius: 10px;
    background: var(--navy);
    color: var(--gold);
    cursor: pointer;
    font-size: 1rem;
}

.wp-side-search button:hover {
    background: var(--navy-700);
}

/* قائمة المواضيع */
.wp-side-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.wp-side-list li + li {
    border-top: 1px dashed rgba(7, 38, 50, 0.12);
}

.wp-side-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    color: var(--navy);
    text-decoration: none;
}

.wp-side-thumb {
    position: relative;
    display: grid;
    flex-shrink: 0;
    overflow: hidden;
    width: 78px;
    height: 62px;
    border-radius: 10px;
    background: var(--cream-200, #efe8d6);
    color: var(--gold-600, #b9932b);
    font-size: 1.3rem;
    place-items: center;
}

.wp-side-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s;
}

.wp-side-play {
    position: absolute;
    display: grid;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(7, 38, 50, 0.75);
    color: var(--gold);
    font-size: 0.6rem;
    place-items: center;
}

.wp-side-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.wp-side-item-title {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.93rem;
    font-weight: 700;
    line-height: 1.6;
    transition: color 0.2s;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.wp-side-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    color: #6f7d84;
    font-size: 0.78rem;
}

.wp-side-item-meta i {
    color: var(--gold-600, #b9932b);
}

.wp-side-item:hover .wp-side-item-title {
    color: var(--gold-700, #8e7120);
}

.wp-side-item:hover .wp-side-thumb img {
    transform: scale(1.08);
}

/* أقسام القسم الرئيسي */
.wp-side-sections {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wp-side-sections a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--navy);
    font-size: 0.93rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, padding 0.2s;
}

.wp-side-sections a i {
    color: var(--gold-600, #b9932b);
    font-size: 0.85rem;
}

.wp-side-sections a:hover {
    background: var(--gold-a12, rgba(212, 175, 55, 0.12));
    padding-inline-start: 16px;
}

.wp-side-sections a.is-active {
    background: var(--navy);
    color: var(--gold-300, #e7d08a);
}

.wp-side-sections a.is-active i {
    color: var(--gold);
}

/* الأسهم تنعكس في الإنجليزية */
[dir="ltr"] .wp-side-sections a i,
[dir="ltr"] .wp-topic-nav-label i {
    transform: scaleX(-1);
}

/* ── الشاشات المتوسطة والصغيرة: الشريط الجانبي تحت المقال ── */
@media (max-width: 1024px) {
    .wp-topic {
        grid-template-columns: minmax(0, 1fr);
    }

    .wp-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .wp-side-search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .wp-hero--topic {
        padding: 36px 0 76px;
    }

    .wp-topic {
        gap: 24px;
        margin-top: -52px;
    }

    .wp-sidebar {
        grid-template-columns: minmax(0, 1fr);
    }

    .wp-topic-nav {
        grid-template-columns: 1fr;
    }

    .wp-topic-nav-link.is-empty {
        display: none;
    }
}
