/**
 * AMQ Law Firm - Blog Archive & Single Post Stylesheet
 * موقع مكتب المحاماة amqlawfirm.sa
 * تصميم راقٍ وسريع متوافق تماماً مع الخط الرسمي Noto Kufi Arabic وتجربة قراءة مريحة
 */

@import url('https://fonts.googleapis.com/css2?family=Noto+Kufi+Arabic:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --amq-navy: #0b1f3a;
    --amq-navy-dark: #061121;
    --amq-navy-light: #162f52;
    --amq-gold: #c5a880;
    --amq-gold-dark: #9e7f53;
    --amq-gold-light: #f7f3ec;
    --amq-emerald: #14532d;
    --amq-wa-green: #25d366;
    --amq-wa-green-hover: #1eb956;
    --amq-text-title: #0f172a;
    --amq-text-body: #1e293b;
    --amq-text-muted: #64748b;
    --amq-border: #e2e8f0;
    --amq-bg-page: #f8fafc;
    --amq-bg-card: #ffffff;
    --amq-radius-card: 16px;
    --amq-shadow: 0 4px 20px rgba(11, 31, 58, 0.07);
    --amq-shadow-hover: 0 10px 30px rgba(11, 31, 58, 0.12);
}

/* شريط تقدم القراءة في أعلى الصفحة */
.amq-reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    width: 0%;
    background: linear-gradient(90deg, var(--amq-gold), #dfc6a3);
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* الحاوية العامة */
.amq-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.amq-container-reading {
    max-width: 820px;
    margin: 0 auto;
    padding: 24px 16px 80px;
}

/* 1. البانر العلوي للمدونة (Hero Section) */
.amq-blog-hero {
    background: linear-gradient(135deg, var(--amq-navy) 0%, #112644 100%);
    color: #ffffff;
    padding: 48px 0 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.amq-blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 20%, rgba(197, 168, 128, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.amq-hero-content {
    max-width: 720px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.amq-hero-badge {
    display: inline-block;
    background-color: rgba(197, 168, 128, 0.2);
    color: var(--amq-gold);
    border: 1px solid rgba(197, 168, 128, 0.4);
    font-size: 13px;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 99px;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

.amq-hero-title {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 12px;
    color: #ffffff;
}

@media (min-width: 768px) {
    .amq-hero-title {
        font-size: 38px;
    }
}

.amq-hero-subtitle {
    font-size: 14px;
    line-height: 1.7;
    color: #cbd5e1;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .amq-hero-subtitle {
        font-size: 16px;
    }
}

/* شريط البحث في المدونة */
.amq-blog-search-form {
    max-width: 520px;
    margin: 0 auto;
}

.amq-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background-color: #ffffff;
    border-radius: 99px;
    padding: 6px 8px 6px 18px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.amq-search-icon {
    font-size: 16px;
    margin-left: 8px;
    color: var(--amq-text-muted);
}

.amq-blog-search-field {
    flex: 1;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    color: var(--amq-text-body);
}

.amq-blog-search-submit {
    background-color: var(--amq-navy);
    color: #ffffff;
    border: none;
    border-radius: 99px;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}

.amq-blog-search-submit:hover {
    background-color: var(--amq-navy-light);
}

/* 2. شريط تصنيفات المدونة (Pills Scrollable) */
.amq-categories-bar-section {
    background-color: #ffffff;
    border-bottom: 1px solid var(--amq-border);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.amq-categories-scroll {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.amq-categories-scroll::-webkit-scrollbar {
    display: none;
}

.amq-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background-color: #f1f5f9;
    color: var(--amq-text-body);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border-radius: 99px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.amq-cat-pill .count {
    background-color: #e2e8f0;
    color: var(--amq-text-muted);
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 99px;
}

.amq-cat-pill:hover, .amq-cat-pill.active {
    background-color: var(--amq-navy);
    color: #ffffff;
}

.amq-cat-pill.active .count {
    background-color: var(--amq-gold);
    color: var(--amq-navy);
}

/* 3. شبكة بطاقات المدونة المتجاوبة (Cards Grid) */
.amq-blog-grid-section {
    padding: 32px 0 60px;
    background-color: var(--amq-bg-page);
}

.amq-posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 640px) {
    .amq-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (min-width: 1024px) {
    .amq-posts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 28px;
    }
}

/* بطاقة المقال الفردية */
.amq-post-card {
    background-color: var(--amq-bg-card);
    border: 1px solid var(--amq-border);
    border-radius: var(--amq-radius-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--amq-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.amq-post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--amq-shadow-hover);
}

.amq-card-image-box {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: #f1f5f9;
}

.amq-card-img-link {
    display: block;
    width: 100%;
    height: 100%;
}

.amq-card-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.amq-post-card:hover .amq-card-image-box img {
    transform: scale(1.04);
}

.amq-card-placeholder-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    background: linear-gradient(135deg, #0b1f3a, #162f52);
    color: var(--amq-gold);
}

.amq-card-cat-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(11, 31, 58, 0.88);
    backdrop-filter: blur(4px);
    color: var(--amq-gold);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid rgba(197, 168, 128, 0.3);
}

.amq-card-body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.amq-card-meta-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--amq-text-muted);
    margin-bottom: 10px;
}

.amq-card-heading {
    font-size: 17px;
    font-weight: 800;
    line-height: 1.45;
    margin-bottom: 10px;
}

.amq-card-heading a {
    color: var(--amq-text-title);
    text-decoration: none;
    transition: color 0.2s;
}

.amq-card-heading a:hover {
    color: var(--amq-gold-dark);
}

.amq-card-snippet {
    font-size: 13.5px;
    color: var(--amq-text-body);
    line-height: 1.65;
    margin-bottom: 16px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.amq-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f1f5f9;
    padding-top: 14px;
    margin-top: auto;
}

.amq-card-author {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--amq-text-muted);
    font-weight: 600;
}

.amq-read-more-link {
    color: var(--amq-navy);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.2s;
}

.amq-read-more-link:hover {
    color: var(--amq-gold-dark);
    gap: 8px;
}

/* ترقيم الصفحات */
.amq-pagination-container {
    margin-top: 40px;
    text-align: center;
}

.amq-pagination-container .nav-links {
    display: inline-flex;
    gap: 6px;
}

.amq-pagination-container a, 
.amq-pagination-container span.current {
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid var(--amq-border);
    background-color: #ffffff;
    color: var(--amq-text-body);
}

.amq-pagination-container span.current {
    background-color: var(--amq-navy);
    color: #ffffff;
    border-color: var(--amq-navy);
}

/* 4. صفحة قراءة المقال الفردي (Single Post View) */
.amq-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--amq-text-muted);
    margin-bottom: 20px;
}

.amq-breadcrumb a {
    color: var(--amq-text-muted);
    text-decoration: none;
}

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

.amq-breadcrumb .sep {
    color: #cbd5e1;
}

.amq-article-header {
    margin-bottom: 24px;
}

.amq-article-category {
    margin-bottom: 12px;
}

.amq-badge-cat {
    display: inline-block;
    background-color: var(--amq-gold-light);
    color: var(--amq-gold-dark);
    border: 1px solid #ebd9c2;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 99px;
    text-decoration: none;
}

.amq-article-title {
    font-size: 24px;
    font-weight: 900;
    color: var(--amq-navy);
    line-height: 1.45;
    margin-bottom: 16px;
}

@media (min-width: 768px) {
    .amq-article-title {
        font-size: 34px;
    }
}

.amq-article-meta-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--amq-border);
    border-bottom: 1px solid var(--amq-border);
    font-size: 13px;
    color: var(--amq-text-muted);
}

.amq-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.amq-article-featured-image {
    margin: 24px 0 28px;
    border-radius: var(--amq-radius-card);
    overflow: hidden;
    box-shadow: var(--amq-shadow);
}

.amq-hero-img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* بانر استشارة سريع مدمج للمحمول */
.amq-article-consult-banner {
    background: linear-gradient(135deg, #f7f3ec 0%, #fff9f0 100%);
    border: 1.5px solid #dfc6a3;
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (min-width: 640px) {
    .amq-article-consult-banner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.banner-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 800;
    color: var(--amq-navy);
    margin-bottom: 4px;
}

.amq-consult-banner-content p {
    font-size: 14px;
    color: var(--amq-navy);
    font-weight: 600;
    margin: 0;
}

.amq-btn-consult-now {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--amq-navy);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.amq-btn-consult-now:hover {
    background-color: var(--amq-navy-light);
}

/* محتوى المقال والطباعة القانونية الراقية */
.amq-article-entry-content {
    font-size: 17px;
    line-height: 1.95;
    color: var(--amq-text-body);
}

@media (min-width: 768px) {
    .amq-article-entry-content {
        font-size: 18.5px;
    }
}

.amq-article-entry-content p {
    margin-bottom: 22px;
}

.amq-article-entry-content h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--amq-navy);
    margin: 36px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--amq-gold-light);
    position: relative;
}

.amq-article-entry-content h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 60px;
    height: 2px;
    background-color: var(--amq-gold);
}

.amq-article-entry-content h3 {
    font-size: 19px;
    font-weight: 700;
    color: var(--amq-navy);
    margin: 28px 0 14px;
}

.amq-article-entry-content blockquote {
    background: #fdfbf7;
    border-right: 4px solid var(--amq-gold);
    border-radius: 4px 12px 12px 4px;
    padding: 16px 22px;
    margin: 28px 0;
    font-size: 17px;
    color: #334155;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.amq-article-entry-content ul, 
.amq-article-entry-content ol {
    padding-right: 24px;
    margin-bottom: 24px;
}

.amq-article-entry-content li {
    margin-bottom: 8px;
}

/* بطاقة الكاتب والمستشار */
.amq-author-box {
    background-color: #ffffff;
    border: 1px solid var(--amq-border);
    border-radius: var(--amq-radius-card);
    padding: 24px;
    margin: 40px 0 32px;
    display: flex;
    gap: 18px;
    align-items: flex-start;
    box-shadow: var(--amq-shadow);
}

.amq-author-avatar img {
    border-radius: 50%;
    border: 2px solid var(--amq-gold);
}

.amq-author-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--amq-gold-dark);
    text-transform: uppercase;
}

.amq-author-name {
    font-size: 18px;
    font-weight: 800;
    color: var(--amq-navy);
    margin: 2px 0 8px;
}

.amq-author-bio {
    font-size: 13.5px;
    color: var(--amq-text-muted);
    line-height: 1.7;
    margin: 0;
}

/* أزرار المشاركة */
.amq-share-section {
    padding: 24px 0;
    border-top: 1px solid var(--amq-border);
    border-bottom: 1px solid var(--amq-border);
    margin-bottom: 40px;
}

.amq-share-heading {
    font-size: 14px;
    font-weight: 700;
    color: var(--amq-navy);
    margin-bottom: 12px;
}

.amq-share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.amq-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.amq-share-btn:hover {
    opacity: 0.9;
}

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

.share-x {
    background-color: #000000;
    color: #ffffff;
}

.share-linkedin {
    background-color: #0077b5;
    color: #ffffff;
}

.share-copy {
    background-color: #f1f5f9;
    color: var(--amq-text-body);
    border: 1px solid var(--amq-border);
}

.amq-copy-feedback {
    margin-top: 10px;
    font-size: 12px;
    color: var(--amq-emerald);
    font-weight: 700;
}

/* المقالات ذات الصلة */
.amq-related-posts-section {
    margin-top: 40px;
}

.amq-related-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--amq-navy);
    margin-bottom: 20px;
}

.amq-related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 640px) {
    .amq-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.amq-related-card {
    background-color: #ffffff;
    border: 1px solid var(--amq-border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.amq-related-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--amq-shadow);
}

.amq-related-card-link {
    display: flex;
    text-decoration: none;
    padding: 12px;
    gap: 12px;
}

.amq-related-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background-color: #f1f5f9;
}

.amq-related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.amq-related-thumb .placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background-color: var(--amq-navy);
    color: var(--amq-gold);
}

.amq-related-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.amq-related-heading {
    font-size: 14px;
    font-weight: 700;
    color: var(--amq-navy);
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.amq-related-date {
    font-size: 11px;
    color: var(--amq-text-muted);
}

/* 5. زر الواتساب العائم للاستشارات الفورية (Floating WhatsApp Button) */
.amq-floating-whatsapp {
    position: fixed;
    bottom: 24px;
    right: 20px;
    z-index: 999;
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
    gap: 10px;
    text-decoration: none;
    filter: drop-shadow(0 6px 18px rgba(37, 211, 102, 0.4));
    transition: transform 0.2s ease;
}

.amq-floating-whatsapp:hover {
    transform: scale(1.05);
}

.amq-whatsapp-icon-circle {
    width: 60px;
    height: 60px;
    background-color: var(--amq-wa-green);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: amqPulse 2s infinite;
}

.amq-whatsapp-bubble {
    background-color: #ffffff;
    color: var(--amq-navy);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--amq-border);
    white-space: nowrap;
    display: none;
}

@media (min-width: 480px) {
    .amq-whatsapp-bubble {
        display: block;
    }
}

@keyframes amqPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}
