/* ============================================ */
/* Font                                        */
/* ============================================ */
@font-face {
    font-family: 'ThamanyahSans';
    src: url('ThamanyahSans-Medium.woff2') format('woff2'),
         url('ThamanyahSans-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

html, body, * {
    font-family: 'ThamanyahSans', 'Cairo', sans-serif !important;
}

/* English pages: Latin-first font stack */
html[dir="ltr"] body,
html[dir="ltr"] body * {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif !important;
}

/* English pages: Latin glyphs read larger than Cairo — trim text size only */
html[dir="ltr"] { font-size: 15px; }
html[dir="ltr"] body { font-size-adjust: 0.47; }
html[dir="ltr"] input,
html[dir="ltr"] textarea,
html[dir="ltr"] select,
html[dir="ltr"] button { font-size-adjust: 0.47; }

/* ============================================ */
/* Color scheme (light / dark)                 */
/* ============================================ */
:root { color-scheme: light; }
:root.dark, :root[data-theme="dark"] { color-scheme: dark; }

html { background-color: #ffffff; }
html.dark { background-color: #0c0f14; }

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================ */
/* Scrollbar styling                           */
/* ============================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(173, 31, 36, 0.45);
    border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(173, 31, 36, 0.75); }

html {
    scrollbar-color: rgba(173, 31, 36, 0.55) transparent;
    scrollbar-width: thin;
}

/* ============================================ */
/* Utility classes                             */
/* ============================================ */
.scrollbar-none::-webkit-scrollbar { display: none; }
.scrollbar-none { -ms-overflow-style: none; scrollbar-width: none; }

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

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

/* ============================================ */
/* Animations                                  */
/* ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.animate-fade-in { animation: fadeIn .2s ease both; }

@keyframes slideFromLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}
html[dir="rtl"] .animate-slide-from-left {
    animation: slideFromLeft .25s ease both;
}
html[dir="ltr"] .animate-slide-from-left {
    animation: slideFromLeft .25s ease both;
}

@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.animate-spin-slow { animation: spinSlow 4s linear infinite; }

.active-scale-98:active { transform: scale(0.98); }

/* ============================================ */
/* Mobile drawer                               */
/* ============================================ */
#mobile-drawer-overlay.hidden { display: none !important; }
#mobile-drawer-overlay:not(.hidden) { display: flex !important; }
body.drawer-open { overflow: hidden !important; }

/* ============================================ */
/* Prevent iOS auto-zoom on input focus        */
/* (requires font-size >= 16px)                */
/* ============================================ */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    input, select, textarea {
        font-size: 16px !important;
    }
}
@media (max-width: 767px) {
    footer {
        display: none;
    }
}

/* ============================================ */
/* Back link (account sub-pages)               */
/* ============================================ */
.valo-back-link {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    padding: 7px 13px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #e7e5e4;
    color: #57534e;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.valo-back-link:hover {
    color: #AD1F24;
    border-color: #AD1F24;
    background: #fffafa;
}

.valo-back-link i {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

html.dark .valo-back-link {
    background: #131820;
    border-color: #1f2937;
    color: #d6d3d1;
}

html.dark .valo-back-link:hover {
    color: #ffffff;
    border-color: #AD1F24;
    background: #1a2130;
}
