/**
 * News View Page Styles - صفحة عرض الخبر
 * جميع ستايلات صفحة عرض الخبر المفرد
 */

/* العنوان الرئيسي */
.news-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--hashd-primary);
    margin: 1.5rem 0;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    max-width: 100%;
    display: block;
}

/* حاوية صورة الخبر */
.news-image-container {
    width: 100%;
    margin: 2rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.news-main-image {
    width: 100%;
    height: auto;
    display: block;
    max-height: 600px;
    object-fit: cover;
}

/* قسم معرض الصور */
.news-gallery-section {
    margin: 3rem 0;
    padding: 2.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px;
    border: 1px solid #e1e5e9;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.gallery-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--hashd-primary);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--hashd-gold);
}

.gallery-title i {
    color: var(--hashd-gold);
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--hashd-gold), #E2C66B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gallery-count {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
    margin-right: 0.5rem;
}

/* Grid معرض الصور */
.news-gallery-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 1.5rem !important;
    margin-top: 1.5rem !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* عناصر المعرض داخل صفحة الخبر فقط - لا تؤثر على صفحة المعرض الرئيسية */
.news-gallery-grid .gallery-item {
    position: relative !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    aspect-ratio: 1 !important;
    cursor: pointer !important;
    background: #fff !important;
    border: 2px solid transparent !important;
    min-height: 220px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.news-gallery-grid .gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(11, 23, 59, 0.1), rgba(198, 164, 72, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.news-gallery-grid .gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
    border-color: var(--hashd-gold);
}

.news-gallery-grid .gallery-item:hover::before {
    opacity: 1;
}

.news-gallery-grid .gallery-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 220px;
    opacity: 1 !important;
    visibility: visible !important;
}

/* إخفاء الصور الفارغة - داخل معرض الخبر فقط */
.news-gallery-grid .gallery-item img[src=""],
.news-gallery-grid .gallery-item img:not([src]),
.news-gallery-grid .gallery-item img[src*="undefined"],
.news-gallery-grid .gallery-item img[src*="null"] {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* عرض رسالة عند عدم وجود صورة - معرض الخبر فقط */
.news-gallery-grid .gallery-item:has(img[src=""]):not(:has(img[src*="news-default"]))::after,
.news-gallery-grid .gallery-item:has(img:not([src])):not(:has(img[src*="news-default"]))::after {
    content: 'صورة غير متوفرة';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    font-size: 0.9rem;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    pointer-events: none;
}

.news-gallery-grid .gallery-item:hover img {
    transform: scale(1.1);
}

.news-gallery-grid .gallery-item::after {
    content: '\f00e';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: white;
    font-size: 2rem;
    z-index: 3;
    transition: transform 0.3s ease;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    opacity: 0;
}

.news-gallery-grid .gallery-item:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* ضمان ظهور الصور - معرض الخبر */
.news-gallery-grid .gallery-item img {
    position: relative;
    z-index: 2;
}

/* خلفية احتياطية عند عدم وجود صورة - معرض الخبر */
.news-gallery-grid .gallery-item:not(:has(img[src]))::before,
.news-gallery-grid .gallery-item:has(img[src=""])::before {
    opacity: 1;
    z-index: 1;
}

/* محتوى الخبر */
.news-content-wrapper {
    margin: 3rem 0;
    padding: 2.5rem;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #e1e5e9;
}

.news-content {
    line-height: 1.9;
    color: #2c3e50;
    font-size: 1.1rem;
}

.news-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.news-content h1,
.news-content h2,
.news-content h3,
.news-content h4,
.news-content h5,
.news-content h6 {
    color: var(--hashd-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.news-content h2 {
    font-size: 1.75rem;
    border-bottom: 2px solid var(--hashd-gold);
    padding-bottom: 0.5rem;
}

.news-content h3 {
    font-size: 1.5rem;
}

.news-content ul,
.news-content ol {
    margin: 1.5rem 0;
    padding-right: 2rem;
}

.news-content li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

.news-content blockquote {
    border-right: 4px solid var(--hashd-gold);
    padding: 1.5rem;
    margin: 2rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 8px;
    font-style: italic;
    color: #555;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.news-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.news-content a {
    color: var(--hashd-primary);
    text-decoration: none;
    border-bottom: 2px solid var(--hashd-gold);
    transition: all 0.3s ease;
}

.news-content a:hover {
    color: var(--hashd-gold);
    border-bottom-color: var(--hashd-primary);
}

/* Header الخبر */
.news-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e1e5e9;
}

.news-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
    font-size: 0.9rem;
    color: #666;
}

.news-category {
    background: var(--hashd-primary);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

.news-date,
.news-views {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
}

.news-views i {
    color: var(--hashd-gold);
}

.featured-badge {
    background: linear-gradient(135deg, var(--hashd-gold), #E2C66B);
    color: var(--hashd-primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.featured-badge i {
    color: var(--hashd-primary);
}

/* مشاركة الخبر */
.news-meta .news-author {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.news-meta .news-author i {
    color: var(--hashd-gold);
}

.news-share {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e1e5e9;
}

.news-share h3 {
    font-size: 1.5rem;
    color: var(--hashd-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.news-share h3 i {
    color: var(--hashd-gold);
}

.share-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    color: white;
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.whatsapp {
    background: #25d366;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* أزرار المشاركة - أيقونات فقط (فيسبوك، إكس، واتساب) */
.share-buttons-icons-only .share-btn {
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    font-size: 1.25rem;
}
.share-buttons-icons-only .share-btn i,
.share-buttons-icons-only .share-btn svg,
.share-buttons-icons-only .share-btn .icon-svg {
    margin: 0;
    color: inherit !important;
    fill: currentColor !important;
}
.share-btn svg,
.share-btn .icon-svg {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
    color: inherit !important;
    fill: currentColor !important;
}

/* أخبار ذات صلة */
.related-news {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 3px solid var(--hashd-gold);
}

.related-news h2 {
    font-size: 2rem;
    color: var(--hashd-primary);
    margin-bottom: 2rem;
    font-weight: 700;
}

.related-news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.related-news-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e1e5e9;
}

.related-news-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--hashd-gold);
}

.related-news-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.related-news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-news-item:hover .related-news-image img {
    transform: scale(1.1);
}

.related-news-content {
    padding: 1.5rem;
}

.related-news-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: #666;
}

.related-news-category {
    background: var(--hashd-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.related-news-title {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

.related-news-title a {
    color: var(--hashd-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.related-news-title a:hover {
    color: var(--hashd-gold);
}

.related-news-excerpt {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: 0.5rem;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.breadcrumb a {
    color: var(--hashd-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: var(--hashd-gold);
}

.breadcrumb .separator {
    color: #999;
}

.breadcrumb .current {
    color: var(--hashd-gold);
    font-weight: 600;
}

/* صفحة 404 */
.news-not-found {
    text-align: center;
    padding: 4rem 2rem;
}

.news-not-found i {
    font-size: 4rem;
    color: var(--hashd-gold);
    margin-bottom: 1rem;
}

.news-not-found h2 {
    font-size: 2rem;
    color: var(--hashd-primary);
    margin-bottom: 1rem;
}

.news-not-found p {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.back-to-news-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--hashd-primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-to-news-btn:hover {
    background: var(--hashd-gold);
    color: var(--hashd-primary);
    transform: translateX(-3px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .news-title {
        font-size: 1.75rem;
    }
    
    .news-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .gallery-title {
        font-size: 1.25rem;
    }
    
    .news-gallery-section {
        padding: 1.5rem;
        margin: 2rem 0;
    }
    
    .news-content-wrapper {
        padding: 1.5rem;
        margin: 2rem 0;
    }
    
    .news-content {
        font-size: 1rem;
    }
    
    .related-news-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .share-btn {
        width: 100%;
        justify-content: center;
    }
}
