/* ================================================================
   BAYTORIA FRONTEND — UI COMPONENTS
   ─────────────────────────────────────────────────────────────────
   Design tokens → fonts.css
   هنا: عناوين · أقسام · بطاقات · أزرار · فيلدز · هيرو
   ================================================================ */


/* ----------------------------------------------------------------
   TYPOGRAPHY SCALE — نظام العناوين الموحّد
   ----------------------------------------------------------------

   الاستخدام الصحيح لكل صفحة:
     <h1 class="bt-h1">…</h1>          ← Hero الرئيسي فقط
     <h2 class="bt-h2">…</h2>          ← عنوان القسم (مع خط ذهبي)
     <h3 class="bt-h3">…</h3>          ← عناوين البطاقات / الفرعية
     <p  class="bt-lead">…</p>         ← نص تمهيدي تحت H1
     <p  class="bt-body">…</p>         ← نص عادي
     <span class="bt-tag">…</span>     ← تاغ صغير فوق H2
     <p  class="bt-subtitle">…</p>     ← وصف ذهبي تحت H2
   ---------------------------------------------------------------- */

/* H1 — Hero */
.bt-h1 {
    font-size: clamp(2rem, 6vw, 3.75rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: inherit;
}

/* H2 — عنوان القسم + شرطة ذهبية */
.bt-h2 {
    display: inline-block;
    position: relative;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 700;
    line-height: 1.25;
    color: var(--bt-primary);
    padding-bottom: 0.75rem;
}
.bt-h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    inset-inline-start: 0;
    width: 3rem;
    height: 3px;
    border-radius: var(--bt-radius-pill);
    background: linear-gradient(to right, var(--bt-gold), var(--bt-gold-soft));
    transition: width var(--bt-transition-base);
}
.bt-h2:hover::after,
.bt-h2.active::after { width: 5rem; }

/* H2 محاذاة وسط */
.bt-h2--center { display: block; text-align: center; }
.bt-h2--center::after {
    inset-inline-start: 50%;
    transform: translateX(-50%);
}
[dir="rtl"] .bt-h2--center::after { transform: translateX(50%); }

/* H2 على خلفية داكنة */
.bt-h2--light { color: #fff; }
.bt-h2--light::after { background: linear-gradient(to right, var(--bt-gold), rgba(212,178,101,.5)); }

/* H3 — عناوين البطاقات */
.bt-h3 {
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 700;
    line-height: 1.4;
    color: var(--bt-primary);
}

/* النص التمهيدي تحت H1 */
.bt-lead {
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.8;
    color: rgba(255,255,255,.85);
    max-width: 42ch;
}

/* نص الجسم */
.bt-body {
    font-size: var(--bt-text-base);
    line-height: 1.8;
    color: var(--bt-text-soft);
}

/* تاغ صغير فوق العنوان */
.bt-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3rem 0.875rem;
    border-radius: var(--bt-radius-pill);
    background: var(--bt-gold-light);
    color: var(--bt-gold);
    font-size: var(--bt-text-sm);
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 0.875rem;
}
.bt-tag--teal {
    background: var(--bt-mint);
    color: var(--bt-teal);
}
.bt-tag--primary {
    background: var(--bt-primary-light);
    color: var(--bt-primary);
}

/* وصف ذهبي تحت العنوان */
.bt-subtitle {
    color: var(--bt-gold);
    font-size: clamp(0.95rem, 1.5vw, 1.125rem);
    line-height: 1.7;
    margin-top: 0.625rem;
}
.bt-subtitle--muted {
    color: var(--bt-text-soft);
}

/* backward-compat مع bt-heading القديم */
.bt-heading { composes: bt-h2 if supported; }
.bt-heading {
    display: inline-block;
    position: relative;
    color: var(--bt-primary);
    font-weight: 700;
    line-height: 1.25;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    padding-bottom: 0.75rem;
}
.bt-heading::after {
    content: "";
    position: absolute;
    bottom: 0;
    inset-inline-start: 50%;
    transform: translateX(-50%);
    width: 3rem;
    height: 3px;
    border-radius: var(--bt-radius-pill);
    background: linear-gradient(to right, var(--bt-gold), var(--bt-gold-soft));
}
.bt-heading--start::after {
    inset-inline-start: 0;
    transform: none;
}
[dir="rtl"] .bt-heading--start::after { transform: none; }

.bt-subheading {
    color: var(--bt-gold);
    margin-top: 0.75rem;
    font-size: clamp(0.95rem, 1.5vw, 1.125rem);
}


/* ----------------------------------------------------------------
   SECTIONS — أقسام الصفحة
   ---------------------------------------------------------------- */

.bt-section {
    padding-block: 3rem;
    padding-inline: 1rem;
}
@media (min-width: 640px)  { .bt-section { padding-block: 4rem; } }
@media (min-width: 768px)  { .bt-section { padding-block: 5rem; } }
@media (min-width: 1024px) { .bt-section { padding-block: 6rem; } }

.bt-section--sm { padding-block: 2rem; }
@media (min-width: 768px) { .bt-section--sm { padding-block: 3rem; } }

.bt-section--alt   { background: var(--bt-surface-alt); }
.bt-section--brand { background: var(--bt-mint); }
.bt-section--dark  { background: #18333A; color: #fff; }

/* رأس القسم — مجموعة العنوان + التاغ + الوصف */
.bt-section-header {
    margin-bottom: 2.5rem;
}
@media (min-width: 768px) { .bt-section-header { margin-bottom: 3.5rem; } }

.bt-section-header--center { text-align: center; }
.bt-section-header--center .bt-lead,
.bt-section-header--center .bt-subtitle,
.bt-section-header--center .bt-body { margin-inline: auto; }

/* الحاوية */
.bt-container {
    width: 100%;
    max-width: var(--bt-container);
    margin-inline: auto;
    padding-inline: 1rem;
}
@media (min-width: 640px)  { .bt-container { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .bt-container { padding-inline: 2rem; } }


/* ----------------------------------------------------------------
   CARDS — بطاقات
   ---------------------------------------------------------------- */

.bt-card {
    background: var(--bt-surface);
    border-radius: var(--bt-radius-xl);
    padding: 1.5rem;
    box-shadow: 0 0 0 1px rgba(0,0,0,.05), var(--bt-shadow-sm);
    transition: transform var(--bt-transition-base), box-shadow var(--bt-transition-base);
    height: 100%;
}
.bt-card:hover {
    box-shadow: 0 0 0 1px rgba(0,0,0,.05), var(--bt-shadow-lg);
    transform: translateY(-5px);
}

.bt-card--bordered {
    border: 1px solid var(--bt-border);
    box-shadow: none;
}
.bt-card--bordered:hover {
    box-shadow: var(--bt-shadow-md);
    border-color: rgba(212,178,101,.4);
    transform: translateY(-3px);
}

.bt-card--flat { box-shadow: none; border: 1px solid var(--bt-border); }
.bt-card--flat:hover { box-shadow: var(--bt-shadow-sm); transform: none; }

/* أيقونة البطاقة */
.bt-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: var(--bt-radius-md);
    background: var(--bt-mint);
    color: var(--bt-teal);
    font-size: 1.25rem;
    flex-shrink: 0;
    transition: background var(--bt-transition-fast), transform var(--bt-transition-fast);
}
@media (min-width: 640px) { .bt-card-icon { width: 3.5rem; height: 3.5rem; font-size: 1.375rem; } }
.bt-card:hover .bt-card-icon { background: var(--bt-teal); color: #fff; transform: scale(1.08); }


/* ----------------------------------------------------------------
   BUTTONS — أزرار
   ---------------------------------------------------------------- */

.bt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--bt-radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    transition: background-color var(--bt-transition-fast),
                color var(--bt-transition-fast),
                transform var(--bt-transition-fast),
                box-shadow var(--bt-transition-fast);
    cursor: pointer;
    text-decoration: none;
    border: 0;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}
.bt-btn:focus-visible {
    outline: 2px solid var(--bt-gold);
    outline-offset: 2px;
}
.bt-btn:active { transform: scale(.97); }

.bt-btn--primary {
    background: var(--bt-primary);
    color: #fff;
}
.bt-btn--primary:hover {
    background: var(--bt-primary-hover);
    box-shadow: 0 4px 14px rgba(27,59,90,.3);
    transform: translateY(-1px);
}

.bt-btn--accent {
    background: var(--bt-teal);
    color: #fff;
    border-radius: var(--bt-radius-pill);
    padding-inline: 1.5rem;
}
.bt-btn--accent:hover {
    background: var(--bt-teal-hover);
    box-shadow: 0 4px 14px rgba(15,107,102,.3);
    transform: translateY(-1px);
}

.bt-btn--gold {
    background: var(--bt-gold);
    color: #1B2A1A;
    border-radius: var(--bt-radius-pill);
}
.bt-btn--gold:hover {
    background: #c9a74f;
    box-shadow: 0 4px 14px rgba(212,178,101,.4);
    transform: translateY(-1px);
}

.bt-btn--ghost {
    background: transparent;
    color: var(--bt-primary);
    border: 1.5px solid var(--bt-border);
}
.bt-btn--ghost:hover {
    background: var(--bt-surface-alt);
    border-color: var(--bt-primary);
}

.bt-btn--outline-light {
    background: transparent;
    color: #fff;
    border: 1.5px solid rgba(255,255,255,.5);
    border-radius: var(--bt-radius-pill);
}
.bt-btn--outline-light:hover {
    background: rgba(255,255,255,.1);
    border-color: #fff;
}

.bt-btn--block { width: 100%; }
.bt-btn--sm { padding: 0.5rem 1rem; font-size: var(--bt-text-sm); }
.bt-btn--lg { padding: 1rem 2rem; font-size: 1.0625rem; }


/* ----------------------------------------------------------------
   FORM FIELDS — حقول النماذج
   ---------------------------------------------------------------- */

.bt-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--bt-radius-sm);
    border: 1.5px solid var(--bt-border);
    background: #fff;
    color: var(--bt-text);
    font-size: 0.95rem;
    transition: border-color var(--bt-transition-fast), box-shadow var(--bt-transition-fast);
}
.bt-field:focus {
    outline: none;
    border-color: var(--bt-primary);
    box-shadow: 0 0 0 3px rgba(27,59,90,.1);
}
.bt-field::placeholder { color: var(--bt-text-muted); }

.bt-label {
    display: block;
    font-size: var(--bt-text-sm);
    font-weight: 600;
    color: var(--bt-text-soft);
    margin-bottom: 0.375rem;
}

[dir="rtl"] .bt-field { text-align: right; }
[dir="ltr"] .bt-field { text-align: left; }


/* ----------------------------------------------------------------
   HERO — قسم الهيرو
   ---------------------------------------------------------------- */

.bt-hero {
    position: relative;
    overflow: hidden;
}
.bt-hero__bg {
    position: absolute;
    inset: 0;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    transition: transform 6s ease;
}
.bt-hero:hover .bt-hero__bg { transform: scale(1.03); }

.bt-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,.35) 0%,
        rgba(0,0,0,.55) 60%,
        rgba(0,0,0,.70) 100%
    );
}

.bt-hero__content {
    position: relative;
    z-index: 10;
    color: #fff;
    height: 100%;
    display: flex;
    align-items: center;
}


/* ----------------------------------------------------------------
   DIVIDER — فاصل ذهبي
   ---------------------------------------------------------------- */
.bt-divider {
    display: block;
    width: 4rem;
    height: 3px;
    border-radius: var(--bt-radius-pill);
    background: linear-gradient(to right, var(--bt-gold), var(--bt-gold-soft));
    margin-block: 1rem;
}
.bt-divider--center { margin-inline: auto; }
