/* article-detail.css — Cover Hero, Markdown Typography, Related Articles */



/* Cover Hero */
.detail-cover {
    position: relative;
    width: 100%;
    height: 420px;
    overflow: hidden;
    background: var(--color-bg-deep);
    animation: detailCoverIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes detailCoverIn {
    from {
        opacity: 0;
        transform: scale(1.02);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.detail-cover:hover img {
    transform: scale(1.03);
}

/* No-image cover fallback — a styled dark gradient with a gold icon
   (added by article-detail.js when article.cover_image_url is missing). */
.detail-cover.no-image {
    background:
        radial-gradient(ellipse at top, rgba(229, 184, 105, 0.06) 0%, transparent 60%),
        linear-gradient(135deg, #0A0A0C 0%, #14141A 100%);
}
.detail-cover.no-image img {
    display: none;
}
.detail-cover.no-image .detail-cover-overlay {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.05) 0%,
        rgba(0, 0, 0, 0.30) 50%,
        rgba(0, 0, 0, 0.85) 100%
    );
}
html.light-mode .detail-cover.no-image {
    background:
        radial-gradient(ellipse at top, rgba(184, 134, 11, 0.08) 0%, transparent 60%),
        linear-gradient(135deg, #F5F5F0 0%, #FAFAFA 100%);
}

.detail-cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.15) 0%,
        rgba(0, 0, 0, 0.45) 50%,
        rgba(0, 0, 0, 0.85) 100%
    );
}

.detail-cover-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 24px;
    max-width: 900px;
    margin: 0 auto;
    animation: detailContentIn 0.6s 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes detailContentIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.detail-cover-content h1 {
    font-family: var(--font-headers);
    font-size: clamp(1.6rem, 3.5vw, 2.6rem);
    color: #F5F5F7;
    line-height: 1.3;
    margin-bottom: 12px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.detail-cover-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    font-size: 0.85rem;
    color: rgba(245, 245, 247, 0.8);
}

.detail-cover-meta i {
    color: var(--color-gold);
    margin-inline-end: 5px;
}

.meta-sep {
    opacity: 0.3;
}

.detail-cover-tags {
    display: none;
}

/* ── Article Body Container ─────────────────────────────────────────── */
.detail-body {
    max-width: 900px;
    margin: 0 auto;
    padding: 50px 24px 30px;
    animation: detailBodyIn 0.6s 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes detailBodyIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Markdown Typography ────────────────────────────────────────────── */
.article-content {
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--color-text-secondary);
    /* Wrap long URLs/code tokens so they never force horizontal scroll on narrow phones */
    overflow-wrap: anywhere;
    word-wrap: break-word;
}

/* ── Images within content ──────────────────────────────────────────── */
.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 30px auto;
    border: 1px solid var(--color-border-grey);
    cursor: pointer;
    transition: opacity 0.3s ease;
}
.article-content img:hover { opacity: 0.92; }

/* ── Tables ─────────────────────────────────────────────────────────── */
.article-content .table-wrap {
    overflow-x: auto;
    margin: 30px 0;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.article-content th,
.article-content td {
    padding: 12px 16px;
    border: 1px solid var(--color-border-grey);
    text-align: right;
}

html[dir="ltr"] .article-content th,
html[dir="ltr"] .article-content td {
    text-align: left;
}

.article-content th {
    background: rgba(229, 184, 105, 0.08);
    color: var(--color-text-primary);
    font-weight: 700;
}

.article-content td {
    color: var(--color-text-secondary);
}

.article-content tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}



/* ── Keywords (محتوى تقني — نص عادي بدون تنسيق) ──────────────────── */
.detail-keywords {
    margin: 40px 0 0;
}

.detail-keywords-title {
    font-family: var(--font-headers);
    font-size: 1.15rem;
    color: var(--color-text-primary);
    margin: 0 0 8px;
    padding: 0;
    border: none;
    line-height: 1.3;
}

.detail-keywords-note {
    margin: 0 0 10px;
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.detail-keywords-list {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ── H2: Cohesive gold accent bar (replaces subtle ::after) ─────────── */
.article-content h2 {
    font-family: var(--font-headers);
    font-size: 1.65rem;
    color: var(--color-text-primary);
    margin: 56px 0 22px;
    padding: 0 0 14px 0;
    position: relative;
    line-height: 1.35;
}
.article-content h2::before {
    content: '';
    position: absolute;
    bottom: -1px;
    inset-inline-start: 0;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-gold), var(--color-gold-bright));
}
/* Replaces the previous ::after to avoid stacking two pseudo-elements. */
.article-content h2::after { content: none; }

/* ── H3: Subtle inline-start bar ───────────────────────────────────── */
.article-content h3 {
    font-family: var(--font-headers);
    font-size: 1.28rem;
    color: var(--color-text-primary);
    margin: 40px 0 16px;
    padding-inline-start: 14px;
    border-inline-start: 3px solid rgba(229, 184, 105, 0.5);
    line-height: 1.4;
}

/* ── H4: Gold-tinted subhead ───────────────────────────────────────── */
.article-content h4 {
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--color-gold-bright);
    margin: 30px 0 14px;
    letter-spacing: 0.2px;
}

/* ── Paragraphs: refined Arabic readability ─────────────────────────── */
.article-content p {
    margin-bottom: 22px;
    line-height: 1.95;
    letter-spacing: -0.005em;
}

/* ── Lists: airy bullets with hover lift ───────────────────────────── */
.article-content ul,
.article-content ol {
    margin: 4px 0 26px;
    padding-inline-start: 28px;
    line-height: 1.9;
}
.article-content ul { list-style: none; }
.article-content ul li {
    position: relative;
    padding-inline-start: 22px;
    margin-bottom: 10px;
    transition: transform 0.2s ease, color 0.2s ease;
}
.article-content ul li::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 0.7em;
    width: 8px;
    height: 8px;
    background: var(--color-gold);
    transform: rotate(45deg);
    transition: background 0.2s ease;
}
.article-content ul li:hover {
    color: var(--color-text-primary);
    transform: translateX(3px);
}
html[dir="ltr"] .article-content ul li:hover { transform: translateX(-3px); }
.article-content ul li:hover::before {
    background: var(--color-gold-bright);
}
.article-content ol li {
    margin-bottom: 10px;
    padding-inline-start: 4px;
}
.article-content ol li::marker {
    color: var(--color-gold);
    font-weight: 700;
}

/* ── Blockquote: elegant callout ────────────────────────────────────── */
.article-content blockquote {
    border: 1px solid rgba(229, 184, 105, 0.20);
    border-inline-start: 4px solid var(--color-gold);
    padding: 20px 26px;
    margin: 36px 0;
    background: linear-gradient(135deg, rgba(229, 184, 105, 0.04), rgba(229, 184, 105, 0.01));
    color: var(--color-text-secondary);
    font-style: italic;
    font-size: 1.02rem;
    line-height: 1.85;
    border-radius: 0;
}
html[dir="ltr"] .article-content blockquote {
    border-radius: 0;
}
.article-content blockquote p { margin-bottom: 0; }

/* ── Inline code + pre: refined ────────────────────────────────────── */
.article-content code {
    background: rgba(229, 184, 105, 0.10);
    padding: 2px 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.88rem;
    color: var(--color-gold-bright);
    direction: ltr;
    text-align: left;
    border-radius: 0;
    border: 1px solid rgba(229, 184, 105, 0.12);
}
.article-content pre {
    background: linear-gradient(135deg, #0A0A0C, #14141A);
    border: 1px solid var(--color-border-grey);
    border-inline-start: 3px solid var(--color-gold);
    padding: 22px 24px;
    overflow-x: auto;
    margin: 28px 0;
    direction: ltr;
    text-align: left;
    border-radius: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
html.light-mode .article-content pre {
    background: linear-gradient(135deg, #F5F5F5, #FAFAFA);
}
.article-content pre code {
    background: none;
    padding: 0;
    border: none;
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
}

/* ── Horizontal Rule ────────────────────────────────────────────────── */
.article-content hr {
    border: none;
    height: 1px;
    background: var(--color-border-grey);
    margin: 40px 0;
}



/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .detail-cover { height: 300px; }
    .detail-cover-content { padding: 24px 20px; }
    .detail-body { padding: 30px 20px 20px; }
    .article-content { font-size: 0.95rem; }
    .detail-related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .detail-cover { height: 240px; }
    .detail-cover-content h1 { font-size: 1.3rem; }
    .article-content h2 { font-size: 1.3rem; }
}



/* ==========================================================================
   Static Article Layout Styles (Sharp Corners visual identity)
   ========================================================================== */

.article-page {
    color: var(--color-text-primary);
    padding-bottom: 80px;
}

.article-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-gold);
    text-decoration: none;
    font-size: 0.95rem;
    margin-bottom: 32px;
    transition: gap 0.2s ease;
}

.article-back:hover {
    gap: 12px;
}

/* FAQ Section */
.article-faq {
    margin-top: 60px;
    padding-top: 32px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    align-items: start;
}

.article-faq h2 {
    grid-column: 1 / -1;
    font-size: 1.5rem;
    color: var(--color-gold);
    margin: 0 0 16px;
    font-family: var(--font-headers);
}

.faq-item {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-grey);
    border-radius: 0; /* SHARP CORNERS */
    margin-bottom: 0;
    overflow: hidden;
    position: relative;
    transition: transform 0.4s var(--transition-ease), border-color 0.4s var(--transition-ease), box-shadow 0.4s var(--transition-ease);
}

.faq-item::after {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    width: 3px;
    height: 0;
    background-color: var(--color-gold);
    transition: height 0.4s var(--transition-ease);
}

.faq-item:hover {
    border-color: var(--color-gold);
    transform: translateY(-4px);
    box-shadow: 0 20px 50px rgba(229, 184, 105, 0.12);
}

.faq-item:hover::after {
    height: 100%;
}

.faq-q {
    padding: 24px 20px;
    font-weight: 700;
    color: var(--color-text-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.05rem;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.faq-q::-webkit-details-marker { display: none; }
.faq-q::after { 
    content: '+'; 
    color: var(--color-gold); 
    font-size: 1.4rem; 
    line-height: 1; 
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-inline-start: 12px;
}
.faq-item[open] .faq-q {
    color: var(--color-gold);
}
.faq-item[open] .faq-q::after { 
    content: '−'; 
    transform: rotate(180deg);
}

.faq-a {
    padding: 0 20px 24px;
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin: 0;
    font-size: 0.95rem;
    animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .article-faq {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .faq-q {
        font-size: 1rem;
        padding: 20px 16px;
    }
    .faq-a {
        padding: 0 16px 20px;
    }
    .faq-item:hover {
        transform: none; /* Disable transform on mobile */
    }
}

/* WhatsApp/Share Section */
.article-share {
    margin-top: 48px;
    padding-top: 32px;
    text-align: center;
}

.article-share a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #25D366;
    color: #fff;
    padding: 12px 24px;
    border-radius: 0; /* SHARP CORNERS */
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.article-share a:hover {
    opacity: 0.95;
    transform: translateY(-2px);
}

/* Tags in Hero */
.article-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.article-tag {
    background: rgba(229, 184, 105, 0.1);
    color: var(--color-gold);
    border: 1px solid var(--color-gold-dim);
    padding: 4px 14px;
    border-radius: 0; /* SHARP CORNERS */
    font-size: 0.78rem;
    font-weight: 600;
}

/* Keywords Section */
.detail-keywords {
    margin: 40px auto 0;
    padding-top: 32px;
    max-width: 900px;
}

.detail-keywords-title {
    font-family: var(--font-headers);
    font-size: 1.15rem;
    color: var(--color-text-primary);
    margin: 0 0 8px;
    padding: 0;
    border: none;
    line-height: 1.3;
}

.detail-keywords-list {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

