/* =========================================================
   DOCUMENTS PAGE
========================================================= */

.documents-page {
      padding: 0 0 60px;

}

.documents-container {
    width: min(
        var(--site-max-width),
        calc(100% - (var(--site-side-space) * 2))
    );

    max-width: none;
    margin: 0 auto;
    box-sizing: border-box;
}


/* =========================================================
   DOCUMENTS HERO
========================================================= */

.documents-hero {
    position: relative;

    width: 100vw;
    margin-right: calc(50% - 50vw);
    margin-left: calc(50% - 50vw);

   
    min-height: 157px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    background-image: url('../images/documents-hero.png');
    background-size: cover;
       background-position: center 75%;
    background-repeat: no-repeat;
}

.documents-hero__overlay {
    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, 0.42);
}

.documents-hero__content {
    position: relative;
    z-index: 2;

    width: 100%;

    text-align: center;
}

.documents-hero__content h1 {
    margin: 0;

    color: #fff;

    font-size: 42px;
    font-weight: 700;
    line-height: 1.4;
}

/* الهاتف */
@media (max-width: 768px) {
  .documents-hero {
        min-height: 100px;
    }

   .documents-hero__content h1 {

    font-size: 30px;
    font-weight: 700;
}
}

/* =========================================================
   FILTERS
========================================================= */

.documents-filters {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr))
        auto;

    align-items: end;
    gap: 12px;

    padding: 18px;
margin: 35px auto 0;
    margin-bottom: 28px;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 16px;

   
}


/* كل فلتر */

.documents-filter {
    min-width: 0;
}

.documents-filter label {
    display: block;

    margin-bottom: 7px;

    font-size: 13px;
    font-weight: 600;

    color: #374151;
}

.documents-filter select {
    width: 100%;
    height: 44px;

    padding: 0 14px;

    background-color: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 10px;

    appearance: none;
    -webkit-appearance: none;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");

    background-repeat: no-repeat;
    background-position: left 14px center;
    background-size: 12px 12px;

    color: #111827;

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;

    outline: none;
    cursor: pointer;

    box-sizing: border-box;
}

.documents-filter select:hover {
    border-color: #9ca3af;
}

.documents-filter select:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, .10);
}


/* =========================================================
   FILTER ACTIONS
========================================================= */

.documents-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;

    height: 42px;
}


/* زر التصفية */

.documents-filter-submit {
    height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    padding: 0 16px;

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;

    color: #ffffff;
    background: #00843d;

    border: 1px solid #00843d;
    border-radius: 10px;

    cursor: pointer;

    white-space: nowrap;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.documents-filter-submit:hover {
    background: #00552b;
}

.documents-filter-submit:active {
    transform: translateY(1px);
}

.documents-filter-submit .dashicons {
    font-size: 17px;
    width: 17px;
    height: 17px;
}


/* زر إعادة الضبط */

.documents-filter-reset {
    height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 12px;

    font-family: inherit;
    font-size: 13px;
    font-weight: 500;

    color: #6b7280;

    background: #f9fafb;

    border: 1px solid #e5e7eb;
    border-radius: 10px;

    text-decoration: none;

    white-space: nowrap;

    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.documents-filter-reset:hover {
    color: #111827;

    background: #ffffff;

    border-color: #d1d5db;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 900px) {

    .documents-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .documents-filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

}


@media (max-width: 600px) {

    .documents-page {
                padding: 0 0 45px;

    }

    .documents-container {
        width: min(100% - 24px, 1180px);
    }

    .documents-header {
        margin-bottom: 20px;
    }

    .documents-header__icon {
        width: 44px;
        height: 44px;

        border-radius: 12px;
    }

    .documents-header h1 {
        font-size: 21px;
    }

    .documents-header p {
        font-size: 13px;
    }


    .documents-filters {
        grid-template-columns: 1fr;

        gap: 13px;

        padding: 15px;

        margin-bottom: 22px;

        border-radius: 14px;
    }

    .documents-filter-actions {
        grid-column: auto;

        width: 100%;

        height: auto;

        padding-top: 2px;
    }

    .documents-filter-submit {
        flex: 1;
    }

    .documents-filter-reset {
        flex: 0 0 auto;
    }

}


/* =========================================================
   DOCUMENTS TABLE
========================================================= */

/* البطاقة الكبيرة */
.documents-table-card {
    width: 100%;
    overflow-x: auto;

    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;

    direction: rtl;
    box-sizing: border-box;
}

/* شبكة الأعمدة */
.documents-table-head,
.document-row {
    display: grid;

   grid-template-columns:
    minmax(280px, 2.5fr)
    minmax(115px, 1fr)
    minmax(100px, 0.8fr)
    minmax(130px, 1fr)
    minmax(125px, 1fr)
    minmax(125px, 1fr);

    align-items: center;
    column-gap: 20px;

    direction: rtl;
    text-align: right;
}

/* عناوين الأعمدة */
.documents-table-head {
    min-height: 58px;
    padding: 0 24px;

    background: #f8faf9;
    border-bottom: 1px solid #e5e7eb;

    color: #647067;
    font-size: 12px;
    font-weight: 700;

    white-space: nowrap;
}

/* صف الوثيقة */
.document-row {
    min-height: 88px;
    padding: 14px 24px;

    border-bottom: 1px solid #e5e7eb;

    color: #374151;
    font-size: 13px;

    transition: background-color 0.2s ease;
    box-sizing: border-box;
}

/* إزالة الخط من آخر صف */
.document-row:last-child {
    border-bottom: none;
}

/* تأثير بسيط عند المرور */
.document-row:hover {
    background: #f9fbf9;
}

/* منع خروج المحتوى عن الأعمدة */
.document-cell {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* اسم الملف */
.document-cell--name {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.document-name {
    display: flex;
    align-items: center;
    gap: 12px;

    min-width: 0;
    width: 100%;
}

/* أيقونة الملف */
.document-name__icon {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 10px;

    background: color-mix(
        in srgb,
        var(--document-type-color) 10%,
        #ffffff
    );

    color: var(--document-type-color);
}

.document-name__icon .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
}

/* عنوان الوثيقة */
.document-name__title {
    min-width: 0;
    margin: 0;

    color: #173b2a;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.7;

    overflow-wrap: anywhere;
}

/* أزرار القراءة والتحميل */
.document-row__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;

    padding-right: 50px;
}

/* التنسيق المشترك للأزرار */
.document-read,
.document-download {
    min-height: 30px;
    padding: 5px 10px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;

    border-radius: 7px;

    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;

    text-decoration: none;
    white-space: nowrap;

    box-sizing: border-box;
    transition: background-color 0.2s ease;
}

.document-read .dashicons,
.document-download .dashicons {
    width: 15px;
    height: 15px;
    font-size: 15px;
}

/* قراءة الوثيقة */
.document-read {
    background: #fff1f1;
    color: #c51f1f;
    border: 1px solid #fee2e2;
}

.document-read:hover {
    background: #fee2e2;
    color: #991b1b;
}

/* تحميل الوثيقة */
.document-download {
    background: #eaf6ef;
    color: #087443;
    border: 1px solid #d1eadb;
}

.document-download:hover {
    background: #d7efdf;
    color: #065f36;
}

/* التاريخ ورقم الملف */
.document-cell--date,
.document-cell--number {
    color: #4b5563;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

/* نوع الوثيقة */
.document-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    padding: 6px 10px;

    border-radius: 8px;

    background: color-mix(
        in srgb,
        var(--document-type-color) 9%,
        #ffffff
    );

    color: var(--document-type-color);

    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.document-type-badge .dashicons {
    width: 15px;
    height: 15px;
    font-size: 15px;
}

/* الموسم */
.document-cell--season {
    color: #374151;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}


/* =========================================================
   RESPONSIVE — DOCUMENTS TABLE
========================================================= */

/* التابلت */
@media (max-width: 1000px) {

    .documents-table-card {
        border-radius: 12px;
    }

    .documents-table-head,
    .document-row {
        min-width: 1000px;
    }

    .documents-table-head {
        padding: 0 18px;
        column-gap: 16px;
    }

    .document-row {
        padding: 14px 18px;
        column-gap: 16px;
    }

}

/* =========================================================
   MOBILE — COMPACT DOCUMENTS TABLE
========================================================= */

@media (max-width: 600px) {

    /* منع التمرير الأفقي */
    .documents-table-card {
        width: 100%;
        overflow-x: hidden;
        border-radius: 12px;
    }

    /* ثلاثة أعمدة فقط:
       اسم الملف - التاريخ - التحميل */
    .documents-table-head,
    .document-row {
        width: 100%;
        min-width: 0;
        grid-template-columns: minmax(0, 1fr) 85px 36px;
        column-gap: 8px;
        box-sizing: border-box;
    }

    /* إخفاء رقم الملف ونوع الوثيقة والموسم */
    .documents-table-head > :nth-child(3),
    .documents-table-head > :nth-child(4),
    .documents-table-head > :nth-child(5),

    .document-row > :nth-child(3),
    .document-row > :nth-child(4),
    .document-row > :nth-child(5) {
        display: none;
    }

    /* رأس الجدول */
    .documents-table-head {
        min-height: 46px;
        padding: 0 10px;
        font-size: 11px;
    }

    /* صف الوثيقة */
    .document-row {
        min-height: 72px;
        padding: 12px 10px;
        font-size: 12px;
    }

    /* اسم الملف */
    .document-cell--name {
        min-width: 0;
        gap: 0;
    }

    .document-name {
        width: 100%;
        min-width: 0;
        gap: 8px;
    }

    .document-name__icon {
        width: 30px;
        height: 30px;
        flex: 0 0 30px;
        border-radius: 8px;
    }

    .document-name__icon .dashicons {
        width: 16px;
        height: 16px;
        font-size: 16px;
    }

    .document-name__title {
        min-width: 0;
        font-size: 11px;
        line-height: 1.6;

        overflow-wrap: anywhere;
    }

    /* التاريخ */
    .document-cell--date {
        font-size: 10px;
        white-space: normal;
        line-height: 1.5;
    }

    /* أيقونة التحميل فقط */
    .document-cell--download {
        justify-content: center;
        align-items: center;
    }

    .document-cell--download .document-download {
        width: 34px;
        height: 34px;
        min-height: 34px;
        padding: 0;

        display: inline-flex;
        align-items: center;
        justify-content: center;

        border-radius: 9px;
    }

    /* إخفاء عبارة تحميل الوثيقة */
    .document-cell--download .document-download > span:not(.dashicons) {
        display: none;
    }

    .document-cell--download .document-download .dashicons {
        width: 17px;
        height: 17px;
        font-size: 17px;
    }

}

/* =========================================================
   DOCUMENT DOWNLOAD COLUMN
========================================================= */

.document-cell--download {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
}

.document-cell--download .document-download {
    cursor: pointer;
}

.document-no-download {
    color: #9ca3af;
    font-size: 13px;
}

/* =========================================================
   DOCUMENTS PAGE — FRENCH LTR
========================================================= */

.documents-page--fr {
    direction: ltr;
}


/* =========================================================
   HERO
========================================================= */

.documents-page--fr .documents-hero__content {
    direction: ltr;
}


/* =========================================================
   FILTERS
========================================================= */

.documents-page--fr .documents-filters {
    direction: ltr;
}

.documents-page--fr .documents-filter {
    direction: ltr;
    text-align: left;
}

.documents-page--fr .documents-filter label {
    direction: ltr;
    text-align: left;
}

.documents-page--fr .documents-filter select {
    direction: ltr;
    text-align: left;

    background-position: right 14px center;

    padding-left: 14px;
    padding-right: 38px;
}


/* أزرار الفلاتر */

.documents-page--fr .documents-filter-actions {
    direction: ltr;
    justify-content: flex-start;
}

.documents-page--fr .documents-filter-submit,
.documents-page--fr .documents-filter-reset {
    direction: ltr;
}


/* =========================================================
   DOCUMENTS TABLE
========================================================= */

.documents-page--fr .documents-table-card {
    direction: ltr;
}

.documents-page--fr .documents-table-head,
.documents-page--fr .document-row {
    direction: ltr;
    text-align: left;
}


/* =========================================================
   CELLS
========================================================= */

.documents-page--fr .document-cell {
    direction: ltr;
    text-align: left;
}


/* =========================================================
   DOCUMENT NAME
========================================================= */

.documents-page--fr .document-cell--name {
    align-items: flex-start;
    text-align: left;
}

.documents-page--fr .document-name {
    direction: ltr;
    justify-content: flex-start;
    text-align: left;
}

.documents-page--fr .document-name__title {
    direction: ltr;
    text-align: left;
}


/* =========================================================
   DOCUMENT TYPE
========================================================= */

.documents-page--fr .document-type-badge {
    direction: ltr;
}


/* =========================================================
   DATE / NUMBER / SEASON
========================================================= */

.documents-page--fr .document-cell--date,
.documents-page--fr .document-cell--number,
.documents-page--fr .document-cell--season {
    direction: ltr;
    text-align: left;
}


/* =========================================================
   DOWNLOAD
========================================================= */

.documents-page--fr .document-cell--download {
    direction: ltr;
    justify-content: flex-start;
}

.documents-page--fr .document-download {
    direction: ltr;
}


/* =========================================================
   PAGINATION
========================================================= */

.documents-page--fr .documents-pagination {
    direction: ltr;
}

.documents-page--fr .documents-pagination ul {
    direction: ltr;
}


/* =========================================================
   EMPTY STATE
========================================================= */

.documents-page--fr .documents-empty {
    direction: ltr;
    text-align: left;
}