/* ==========================================================================
   style.css - الاتحاد العربي للإعلام السياحي
   الأنماط الموحدة: متغيرات CSS، ريست، خطوط، نسب الصور
   ========================================================================== */

/* --------------------------------------------------------------------------
   Google Fonts - Rubik
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700&display=swap');

/* --------------------------------------------------------------------------
   CSS Variables - المتغيرات الموحدة
   -------------------------------------------------------------------------- */
:root {
    /* الألوان الأساسية */
    --color-primary: #00913C;
    --color-primary-hover: #007A32;
    --color-primary-light: rgba(0, 145, 60, 0.1);
    --color-primary-rgb: 0, 145, 60;

    --color-secondary: #CC621E;
    --color-secondary-hover: #B5561A;
    --color-secondary-light: rgba(204, 98, 30, 0.1);
    --color-secondary-rgb: 204, 98, 30;

    --color-accent: #0F3086;
    --color-accent-hover: #0A2468;
    --color-accent-light: rgba(20, 52, 136, 0.1);
    --color-accent-rgb: 20, 52, 136;

    /* ألوان السطح */
    --color-bg: #F5F6F8;
    --color-surface: #FFFFFF;
    --color-text-primary: #1A1A2E;
    --color-text-secondary: #6B7280;
    --color-text-muted: #9CA3AF;
    --color-border: #E5E7EB;
    --color-border-light: #F3F4F6;

    /* ألوان الحالة */
    --color-success: #10B981;
    --color-error: #EF4444;
    --color-warning: #F59E0B;
    --color-info: #3B82F6;

    /* الخطوط */
    --font-family: 'Rubik', Arial, sans-serif;
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* أحجام الخطوط */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;

    /* ارتفاعات الأسطر */
    --line-height-tight: 1.3;
    --line-height-normal: 1.6;
    --line-height-relaxed: 1.8;

    /* التباعد */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    --spacing-3xl: 64px;

    /* الحدود */
    --radius-sm: 2px;
    --radius-md: 3px;
    --radius-lg: 4px;
    --radius-xl: 6px;
    --radius-full: 9999px;

    /* الظلال */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.12);

    /* نقاط التوقف (للمرجع في JS) */
    --bp-mobile: 480px;
    --bp-tablet: 768px;
    --bp-laptop: 1024px;
    --bp-desktop: 1200px;
    --bp-wide: 1400px;

    /* الانتقالات */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* z-index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 300;
    --z-modal: 400;
    --z-toast: 500;
}

/* --------------------------------------------------------------------------
   CSS Reset - إعادة تعيين الأنماط
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
    background-color: var(--color-bg);
    direction: rtl;
    text-align: right;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* الروابط */
a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-base);
}

a:hover {
    color: var(--color-primary);
}

/* الصور */
img,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* القوائم */
ul,
ol {
    list-style: none;
}

/* العناوين */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--color-text-primary);
}

h1 {
    font-size: var(--font-size-4xl);
}

h2 {
    font-size: var(--font-size-3xl);
}

h3 {
    font-size: var(--font-size-2xl);
}

h4 {
    font-size: var(--font-size-xl);
}

h5 {
    font-size: var(--font-size-lg);
}

h6 {
    font-size: var(--font-size-base);
}

/* الجداول */
table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
}

/* النماذج */
button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    border: none;
    outline: none;
    background: none;
}

button {
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   الحاوية (Container)
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: 1280px;
    margin-inline: auto;
    padding-inline: var(--spacing-md);
}

@media (min-width: 768px) {
    .container {
        padding-inline: var(--spacing-lg);
    }
}

@media (min-width: 1200px) {
    .container {
        padding-inline: var(--spacing-xl);
    }
}

/* --------------------------------------------------------------------------
   نسب الصور الموحدة
   -------------------------------------------------------------------------- */
.ratio-16-9 {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    position: relative;
}

.ratio-3-2 {
    aspect-ratio: 3 / 2;
    overflow: hidden;
    position: relative;
}

.ratio-4-3 {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    position: relative;
}

.ratio-1-1 {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    position: relative;
}

.ratio-16-9 img,
.ratio-3-2 img,
.ratio-4-3 img,
.ratio-1-1 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.circle {
    border-radius: 50%;
}

/* --------------------------------------------------------------------------
   أدوات مساعدة (Utilities)
   -------------------------------------------------------------------------- */

/* إخفاء بصرياً مع إبقاءه لقارئات الشاشة */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* نص مقطوع بثلاث نقاط */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* نص مقطوع لعدد أسطر محدد */
.text-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ألوان النص */
.text-primary {
    color: var(--color-primary);
}

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

.text-accent {
    color: var(--color-accent);
}

.text-muted {
    color: var(--color-text-secondary);
}

/* أوزان الخطوط */
.fw-light {
    font-weight: var(--font-weight-light);
}

.fw-regular {
    font-weight: var(--font-weight-regular);
}

.fw-medium {
    font-weight: var(--font-weight-medium);
}

.fw-semibold {
    font-weight: var(--font-weight-semibold);
}

.fw-bold {
    font-weight: var(--font-weight-bold);
}

/* التباعد */
.section-spacing {
    padding-block: var(--spacing-2xl);
}

@media (min-width: 768px) {
    .section-spacing {
        padding-block: var(--spacing-lg);
    }
}

/* الفاصل */
.divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin-block: var(--spacing-lg);
}

/* --------------------------------------------------------------------------
   تخطيط الصفحة الرئيسي (محتوى + سايدبار)
   -------------------------------------------------------------------------- */
.page-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
}

@media (min-width: 1024px) {
    .page-layout {
        grid-template-columns: 1fr 320px;
        gap: var(--spacing-2xl);
    }
}

@media (min-width: 1200px) {
    .page-layout {
        grid-template-columns: 1fr 350px;
    }
}

/* المحتوى الرئيسي */
.main-content {
    min-width: 0;
}

/* قسم عرض كامل (بدون سايدبار) */
.full-width-section {
    grid-column: 1 / -1;
}

/* --------------------------------------------------------------------------
   شبكات الأخبار
   -------------------------------------------------------------------------- */
.news-grid {
    display: grid;
    gap: var(--spacing-lg);
}

.news-grid--2 {
    grid-template-columns: 1fr;
}

.news-grid--3 {
    grid-template-columns: 1fr;
}

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

    .news-grid--3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* فاصل الأقسام */
.section-divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: var(--spacing-2xl) 0;
}

/* --------------------------------------------------------------------------
   عنوان الأقسام (مكون عام قابل لإعادة الاستخدام)
   -------------------------------------------------------------------------- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
}

.section-header__title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    position: relative;
    padding-right: var(--spacing-md);
}

/* شريط أخضر عمودي يمين العنوان */
.section-header__title::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 70%;
    min-height: 18px;
    background-color: var(--color-primary);
    border-radius: 2px;
}

.section-header__title .ph {
    color: var(--color-secondary);
    font-size: 20px;
}

/* رابط "عرض الكل" */
.section-header__more {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    transition: all 0.25s ease;
}

.section-header__more:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    gap: 7px;
    background-color: var(--color-primary-light);
}

.section-header__more .ph {
    font-size: 12px;
    transition: transform 0.25s ease;
}

.section-header__more:hover .ph {
    transform: translateX(-2px);
}

/* --------------------------------------------------------------------------
   أحجام الخطوط المتجاوبة
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
    h1 {
        font-size: var(--font-size-2xl);
    }

    h2 {
        font-size: var(--font-size-xl);
    }

    h3 {
        font-size: var(--font-size-lg);
    }

    .section-header__title {
        font-size: var(--font-size-base);
    }
}