/* ==========================================================================
   Base — reset and typography defaults.
   ========================================================================== */

/* Thmanyah Sans, served from assets/fonts. It has five weights and no 600,
   so the template uses 500 for emphasis and 700 for headings. */
@font-face {
  font-family: "Thmanyah Sans";
  src: url("../fonts/thmanyahsans-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Thmanyah Sans";
  src: url("../fonts/thmanyahsans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Thmanyah Sans";
  src: url("../fonts/thmanyahsans-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Thmanyah Sans";
  src: url("../fonts/thmanyahsans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Thmanyah Sans";
  src: url("../fonts/thmanyahsans-Black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

[hidden] {
  display: none !important;
}

html {
  font-family: var(--font-sans);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar-h) + 1.5rem);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  min-height: 100dvh;
  background: var(--background);
  color: var(--foreground);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  /* Arabic script must never be letter-spaced */
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
  line-height: var(--leading-heading);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

code,
pre,
kbd {
  font-family: var(--font-mono);
}

::selection {
  background: var(--primary);
  color: var(--primary-foreground);
}

/* Default keyboard focus; components refine it with the shadcn ring */
:where(a, button, input, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  inset-inline-start: 0.75rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: var(--text-sm);
  font-weight: 500;
  translate: 0 -200%;
}

.skip-link:focus-visible {
  translate: 0 0;
}

/* Icons are injected by icons.js; reserve their box so nothing shifts */
[data-icon],
.icon {
  display: inline-block;
  flex-shrink: 0;
  width: 1em;
  height: 1em;
}

.muted {
  color: var(--muted-foreground);
}

/* Latin fragments (prices, file names) inside Arabic text */
.ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
