/* Import Arabic Fonts - إصلاح الخطوط */
@import url("https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Cairo:wght@300;400;600;700&display=swap");

@font-face {
    font-family: "HelveticaArabi";
    src: url("fonts/alfont_com_هلفيتيكا-عربي-.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Palestine";
    src: url("fonts/alfont_com_Palestine-Regular.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Elgharib-Lifta-Black-Line";
    src: url("fonts/alfont_com_Elgharib-Lifta-Black-Line.otf")
        format("opentype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
/* —— Tight spacing mode —— */
:root{
  --sp-1: 6px;
  --sp-2: 10px;
  --sp-3: 14px;
}

/* تقليل المسافات العلوية والسفلية للسكاشن */
.article-detail,
.authors-section,
.related-articles,
#hashtags.hashtags-section{
  padding-block: var(--sp-3) !important;
}

/* العناوين أقرب شوي */
.article-detail h1{ margin-bottom: var(--sp-1) !important; }
.article-detail h4,
.article-detail h6{ margin-bottom: var(--sp-2) !important; }

/* صورة الرئيسية ومسافات النص */
.main-image{ margin-bottom: var(--sp-2) !important; }
.post-content{ line-height: 1.8; }
.post-content p{ margin-bottom: var(--sp-2) !important; }

/* الفاصل */
hr{ margin: var(--sp-2) auto !important; }

/* كروت المؤلفين والمقالات المشابهة: تقليل الهوامش والحشوات */
.authors-section .card,
.related-articles .card{ margin-bottom: var(--sp-2) !important; }
.related-articles .card-body{ padding: 14px !important; }

/* تقليل مسافات شبكة البوتستراب داخل هالقسمين فقط */
.related-articles .row.g-4,
.authors-section .row.g-4{
  --bs-gutter-x: 1rem;
  --bs-gutter-y: 1rem;
}

/* أزرار/شرائح الوسوم */
.hashtags-section .tags-wrap{ gap: 8px; }
.copy-shortlink-btn{ margin-bottom: 8px; }

/* إزالة تأثير py-5/mb-5 الكبيرين في أماكن محددة */
.article-detail.container.py-5,
.related-articles.container,
.authors-section{ padding-block: 18px !important; }
.main-image.mb-5{ margin-bottom: 14px !important; }
.post-content.lead.mb-5{ margin-bottom: 14px !important; }

/* لو في عناصر فيها .mb-4 عامة داخل التفاصيل، نقللها */
.article-detail .mb-4{ margin-bottom: 12px !important; }

/* General Body Styling for Consistency */
body {
    direction: rtl; /* Ensure right-to-left for Arabic */
    font-family: "Cairo", sans-serif; /* Default font */
    color: #222;
    line-height: 1.8;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevent horizontal scroll for the entire page */
}

/* Base Container for Centering - Applied to relevant sections */
/* This will ensure content within these sections is centered and has balanced side margins */
/* تنسيق عام للحاويات */

/* ---------- Article Detail Section: عرّاب السينما الكورية ---------- */

/* The .article-detail already has max-width and margin: auto from the base container style */
.article-detail {
    padding-top: 50px;
    padding-bottom: 50px;
}

/* Main Title */
.article-detail h1 {
    font-family: "Palestine", serif;
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    color: #0a2c38;
    margin-bottom: clamp(10px, 2vw, 15px);
    line-height: 1.2;
    text-align: center; /* Center the title */
    word-wrap: break-word;
}

/* Subtitle/Description under the main title */
.article-detail h6 {
    font-family: "HelveticaArabi", sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    color: #6c757d;
    margin-bottom: clamp(15px, 3vw, 20px);
    line-height: 1.6;
    text-align: center; /* Center the subtitle */
}

/* Author and Date Information */
.article-detail .d-flex {
    justify-content: center; /* Center the author/date block */
    margin-bottom: 1.5rem;
}

/* Paragraph text */
.article-detail p.lead {
    font-family: "HelveticaArabi", sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    line-height: 1.9;
    color: #333;
    margin-bottom: clamp(15px, 3vw, 25px);
    text-align: justify; /* Justify text for better readability */
}

/* Author's Signature */
.article-detail .fw-bold {
    font-family: "Palestine", sans-serif; /* Keep consistent font */
      font-weight: 200 !important; /* تأكيد إزالة البولد */

    text-align: center; /* Align signature to the right */
    margin-top: 2rem;
}

/* Main Image */
.main-image {
    margin-bottom: 50px; /* Add some space below the main image */
    text-align: center; /* Ensure image is centered if it's smaller than its container */
}

.main-image img {
    width: 100%;
    height: auto;
    max-height: 400px; /* Fixed max height for consistency */
    object-fit: cover;
    border-radius: 16px; /* A bit larger for a softer look */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: block; /* Ensures margin auto works if needed */
    margin-left: auto;
    margin-right: auto; /* Centering the image if it doesn't take full width */
}

/* General Description after Main Image */
.article-detail .lead.text-justify {
    margin-bottom: 30px; /* Space after general description */
}

/* Gallery and Descriptive Sections (Image + Text) */
.gallery-description {
    margin-bottom: 40px; /* Space between gallery sections */
}

.gallery-description .col-md-6 {
    display: flex; /* Use flexbox for vertical centering within columns if content varies */
    flex-direction: column;
    justify-content: center;
}

.small-image {
    width: 100%;
    max-width: 550px; /* Max width for consistency */
    height: auto;
    min-height: 250px; /* Ensure a minimum height */
    object-fit: cover;
    border-radius: 12px; /* Slightly smaller border-radius */
    display: block;
    margin: 0 auto 20px auto; /* Center with bottom margin for responsiveness */
}

@media (min-width: 768px) {
    .small-image {
        margin: 0; /* Remove auto margin on larger screens when in a column */
    }

    .gallery-description.row.align-items-center > div {
        /* Adjust padding for the text column next to the image on larger screens */
        padding: 0 15px;
    }
}

/* Horizontal Rule for separation */
hr {
    margin-top: 2rem;
    margin-bottom: 2rem;
    border-top: 1px solid #eee;
    max-width: 600px; /* Limit the width of the HR for a cleaner look */
    margin-left: auto;
    margin-right: auto;
}

/* ---------- Authors Section ---------- */
.authors-section {
    padding-top: 60px;
    padding-bottom: 60px;
    text-align: center; /* Center the entire section's content */
}

.authors-section h4 {
    font-family: "Cairo", sans-serif;
    font-size: clamp(1.5rem, 4vw, 1.8rem);
    font-weight: bold;
    color: #0a2c38;
    margin-bottom: 30px; /* Space below the heading */
    display: inline-block; /* Allows text-align center on its parent to center the heading itself */
    position: relative;
    line-height: 1.3;
}

/* Underline effect for the heading */
.authors-section h4::after {
    content: "";
    display: block;
    width: 60px; /* Width of the underline */
    height: 3px;
    background-color: #d35400; /* Color of the underline */
    margin: 10px auto 0; /* Center the underline */
    border-radius: 2px;
}

.authors-section .card {
    border: none;
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
    padding: 20px;
    margin-bottom: 25px;
    height: 100%; /* Ensure cards in a row have equal height */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Distribute space within the card */
}

.authors-section .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.author-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #ccc;
    display: block;
    margin: 0 auto 15px auto; /* Centered with bottom margin */
}

.authors-section .card-title {
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    font-weight: bold;
    margin-top: 10px;
    color: #0a2c38;
    line-height: 1.4;
    word-wrap: break-word;
}

.authors-section .card-text {
    font-family: "HelveticaArabi", sans-serif;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    color: #666;
    line-height: 1.5;
    margin-top: 10px;
    word-wrap: break-word;
    flex-grow: 1; /* Allow text to take available space */
}

/* ---------- Related Articles Section ---------- */
.related-articles {
    padding-top: 60px;
    padding-bottom: 60px;
    background-color: #ffffff; /* Light background for separation */
    text-align: center; /* Center the heading */
}

.related-articles h4 {
    font-family: "Cairo", sans-serif;
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: #0a2c38;
    margin-bottom: 40px;
    position: relative;
    font-weight: bold;
    line-height: 1.3;
    display: inline-block; /* Allows text-align center on its parent to center the heading itself */
}

/* Underline effect for the heading */
.related-articles h4::after {
    content: "";
    display: block;
    width: 60px; /* Width of the underline */
    height: 3px;
    background-color: #d35400; /* Color of the underline */
    margin: 10px auto 0; /* Center the underline */
    border-radius: 2px;
}

.related-articles .card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 30px;
}

.related-articles .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.related-articles .card-img-top {
    height: 200px;
    width: 100%;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.related-articles .card-body {
    padding: 20px;
    flex-grow: 1; /* Allows card body to grow and push buttons to bottom */
    display: flex;
    flex-direction: column;
}

.related-articles .card-title {
    font-family: "Palestine", serif;
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    color: #0a2c38;
    margin-bottom: 10px;
    line-height: 1.4;
    word-wrap: break-word;
}

.related-articles .card-text {
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    color: #666;
    font-family: "HelveticaArabi", sans-serif;
    line-height: 1.6;
    margin-bottom: 15px;
    word-wrap: break-word;
    flex-grow: 1; /* Important for equal height cards */
}

/* Responsive Adjustments */
@media (max-width: 767px) {
    /* Adjust row gutters for smaller screens */
    .row {
        margin-left: -8px;
        margin-right: -8px;
    }

    .row > [class*="col-"] {
        padding-left: 8px;
        padding-right: 8px;
    }

    .article-detail,
    .related-articles,
    .authors-section {
        padding-left: 10px;
        padding-right: 10px;
    }

    .small-image {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (min-width: 1200px) {
    /* Adjust max-width for very large screens for better readability */
    .article-detail,
    .related-articles,
    .authors-section {
        max-width: 1100px; /* Slightly wider for large screens */
    }
}

/* General image styling to prevent overflow */
img {
    max-width: 100%;
    height: auto;
    display: block; /* Helps with alignment and margin application */
}
/* Hashtags Bar – Front Only */
.hashtags-section {
    direction: rtl;
}
.hashtags-section .tags-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.tag-chip {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 10px;
    background: #ffffff;
    color: #333;
    text-decoration: none;
    border: 1px solid #eee;
    font-family: "Cairo", sans-serif;
    font-size: 0.95rem;
}
.tag-chip:hover {
    background: #d3deef;
    border-color: #e3e6ea;
}

.copy-shortlink-btn {
    padding: 12px 18px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: #6f59ff;
    color: #fff;
    font-weight: 700;
    font-family: "Cairo", sans-serif;
    box-shadow: 0 4px 12px rgba(111, 89, 255, 0.25);
    transition: transform 0.08s ease, box-shadow 0.2s ease;
    float: inline-end;
    margin-bottom: 12px;
}
.copy-shortlink-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(111, 89, 255, 0.32);
}

/* توست بسيط للتنبيه */
.copy-toast {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #000;
    color: #fff;
    padding: 8px 12px;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 9999;
    font-size: 0.95rem;
}
.copy-toast.show {
    opacity: 1;
}
 /* انزلاق للفورم */
  .slide-toggle{max-height:0; overflow:hidden; opacity:0; transition:max-height .4s ease, opacity .3s ease; border:1px dashed #e5e7eb; border-radius:14px; padding:0 16px; background:#fafafa;}
  .slide-toggle.open{max-height:300px; opacity:1; padding:16px;}

  /* كاروسيل */
  .comments-carousel{position:relative; display:flex; align-items:center; gap:8px;}
  .comments-carousel .viewport{overflow:hidden; width:100%;}
  .comments-carousel .track{display:flex; transition:transform .35s ease;}
  .comments-carousel .page{min-width:100%; padding:4px;}
  .comments-carousel .nav-btn{
    flex:0 0 auto; width:38px; height:38px; border:none; border-radius:50%;
    background:#0a2c38; color:#fff; font-size:20px; line-height:38px; text-align:center; cursor:pointer;
    box-shadow:0 6px 16px rgba(10,44,56,.18); opacity:.9; transition:transform .15s ease, opacity .2s;
  }
  .comments-carousel .nav-btn:hover{transform:translateY(-1px); opacity:1;}
  .comments-carousel .nav-btn:disabled{opacity:.3; cursor:not-allowed; transform:none;}

  /* شبكة 5 بطاقات داخل كل صفحة */
  .page-grid{
    display:grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap:12px;
  }
  /* موبايل/تابلت: عدد أقل تلقائيًا */
  @media (max-width: 991.98px){ .page-grid{grid-template-columns: repeat(2, minmax(0,1fr));} }
  @media (min-width: 992px) and (max-width: 1199.98px){ .page-grid{grid-template-columns: repeat(3, minmax(0,1fr));} }

  /* بطاقة التعليق */
/* تنسيق عام لسكشن التعليقات */
.comments-carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  background: #fff;
  padding: 15px;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

/* منطقة العرض */
.comments-carousel .viewport {
  overflow: hidden;
  width: 100%;
}

/* المسار */
.comments-carousel .track {
  display: flex;
  transition: transform .4s ease;
}

/* كل صفحة */
.page {
  min-width: 100%;
  display: flex;
  justify-content: center; /* التعليقات في المنتصف */
}

/* شبكة التعليقات (5 أعمدة متساوية) */
.page-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px;
  width: 100%;
  max-width: 1100px; /* تحديد عرض ثابت جميل */
}

/* موبايل/تابلت */
@media (max-width: 991px) {
  .page-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 992px) and (max-width: 1199px) {
  .page-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* البطاقات */
.comment-card {
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  box-shadow: 0 2px 8px rgba(10,44,56,.04);
  transition: 0.2s;
}
.comment-card:hover {
  box-shadow: 0 6px 18px rgba(10,44,56,.08);
  transform: translateY(-2px);
}

/* الهيدر داخل البطاقة */
.comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.comment-name {
  font-weight: 800;
  color: #0A2C38;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.comment-time {
  color: #6c757d;
  font-size: 0.85rem;
}

/* النص */
.comment-text {
  flex: 1;
  color: #2b2b2b;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* الصورة الرمزية */
.comment-avatar {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: .5px;
}

/* أزرار التنقل */
.comments-carousel .nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: #0a2c38;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(10,44,56,.18);
  opacity: .9;
  z-index: 2;
}
.comments-carousel .nav-btn:hover {
  opacity: 1;
}
.comments-carousel .nav-btn.prev {
  left: -20px;
}
.comments-carousel .nav-btn.next {
  right: -20px;
}
.comments-carousel .nav-btn:disabled {
  opacity: .3;
  cursor: not-allowed;
}
 :root {
            --ring: #e5e7eb;
            --muted: #6b7280;
            --ink: #0f172a;
            --brand: #3b82f6;
            --shadow: 0 10px 28px rgba(2, 6, 23, .10);
        }

        /* فورم أنيق */
        .c-form {
            display: none;
        }

        .c-form.active {
            display: block;
            animation: fadeIn .28s ease;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(-6px)
            }

            to {
                opacity: 1;
                transform: translateY(0)
            }
        }

        .c-input {
            display: block;
            width: 100%;
            background: #fff;
            border: 1px solid var(--ring);
            border-radius: 14px;
            padding: 12px 14px;
            box-shadow: 0 8px 20px rgba(2, 6, 23, .05) inset, 0 2px 10px rgba(2, 6, 23, .03);
            transition: border-color .15s ease, box-shadow .15s ease;
        }

        .c-input:focus {
            outline: none;
            border-color: #cbd5e1;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, .12), 0 8px 20px rgba(2, 6, 23, .05) inset;
        }

        /* شريط التعليقات: شفاف تمامًا */
        .c-strip {
            position: relative;
            display: flex;
            align-items: center;
            gap: .5rem;
            background: transparent;
            /* بدون خلفية */
            padding: 8px 0;
            /* مسافة بسيطة للأسهم */
        }

        .c-strip .viewport {
            overflow: hidden;
            flex: 1;
        }

        .c-track {
            display: flex;
            gap: 14px;
            padding: 6px 2px;
            scroll-behavior: smooth;
        }

        /* بطاقة التعليق */
        .comment-card {
            min-width: 280px;
            max-width: 360px;
            border: 1px solid var(--ring);
            border-radius: 16px;
            padding: 14px;
            transition: transform .18s ease, box-shadow .18s ease;
        }

        .comment-card:hover {
            transform: translateY(-3px);
        }

        .c-meta {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 8px
        }

        .c-avatar {
            width: 38px;
            height: 38px;
            border-radius: 50%;
            display: grid;
            place-items: center;
            color: #fff;
            font-weight: 800;
            background: var(--brand)
        }

        .c-name {
            color: var(--ink);
            font-weight: 700
        }

        .c-time {
            color: var(--muted);
            font-size: 12px
        }

        .c-text {
            color: #111827;
            line-height: 1.7
        }

        .empty-state {
            color: var(--muted)
        }

        /* أسهم التنقل (فوق الشريط) */
        .arrow-btn {
            position: relative;
            border: 0;
            width: 38px;
            height: 38px;
            border-radius: 50%;
            background: #f1f5f9;
            box-shadow: 0 10px 20px rgba(2, 6, 23, .08);
            display: grid;
            place-items: center;
            font-size: 22px;
            line-height: 1;
            cursor: pointer;
        }

        .arrow-btn:disabled {
            opacity: .35;
            cursor: not-allowed
        }
