@font-face {
  font-family: "Alyamama Regular";
  src: url("../assets/fonts/alfont_com_Alyamama-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-navy: #0b1f3a;
  --color-navy-soft: #14345c;
  --color-white: #ffffff;
  --color-orange: #f97316;
  --color-text: #142033;
  --color-muted: #667085;
  --color-border: #d8e0ea;
  --shadow-soft: 0 18px 50px rgba(11, 31, 58, 0.14);
  --radius-lg: 18px;
  --radius-xl: 28px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--color-text);
  background: var(--color-white);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
}

html[lang="ar"] body,
html[lang="ar"] button,
html[lang="ar"] input,
html[lang="ar"] select,
html[lang="ar"] textarea {
  font-family: "Alyamama Regular", "Segoe UI", Tahoma, Arial, sans-serif;
}

html[lang="ar"] body * {
  font-family: "Alyamama Regular", "Segoe UI", Tahoma, Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 3px solid rgba(249, 115, 22, 0.8);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  transform: translateY(-160%);
  padding: 0.7rem 0.9rem;
  border-radius: 999px;
  background: var(--color-navy);
  color: var(--color-white);
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}

.skip-link:focus {
  transform: translateY(0);
}

main,
footer {
  scroll-margin-top: 88px;
}

body.nav-open {
  overflow: hidden;
}

.section-shell,
.article-shell {
  width: min(980px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(216, 224, 234, 0.9);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}

.site-nav {
  width: min(1240px, calc(100% - 2rem));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-mark {
  color: var(--color-navy);
  font-weight: 850;
  letter-spacing: 0.08em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.nav-links a:not(.button):hover,
.nav-links a:not(.button):focus-visible {
  color: var(--color-navy);
}

.language-toggle {
  display: inline-flex;
  padding: 0.2rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: #f7f9fc;
}

.language-toggle button {
  border: 0;
  border-radius: 999px;
  padding: 0.32rem 0.55rem;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
}

.language-toggle button.is-active {
  background: var(--color-navy);
  color: var(--color-white);
}

.nav-menu-button {
  display: none;
  width: 2.7rem;
  height: 2.7rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-white);
  color: var(--color-navy);
  place-items: center;
  padding: 0.65rem;
  cursor: pointer;
}

.nav-menu-button span {
  display: block;
  width: 1.1rem;
  height: 2px;
  margin: 0.12rem auto;
  border-radius: 99px;
  background: currentColor;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0.76rem 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 750;
  cursor: pointer;
}

.button-primary {
  background: var(--color-orange);
  color: var(--color-white);
  box-shadow: 0 12px 26px rgba(249, 115, 22, 0.24);
}

.button-secondary {
  border-color: var(--color-border);
  background: var(--color-white);
  color: var(--color-navy);
}

.article-shell {
  padding: clamp(2rem, 5vw, 4rem) 0 clamp(4rem, 8vw, 6rem);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
  color: var(--color-muted);
  font-size: 0.94rem;
}

.breadcrumb a {
  color: var(--color-navy);
  font-weight: 750;
}

.article-detail {
  display: grid;
  gap: 1.3rem;
}

.eyebrow,
.article-labels span {
  color: var(--color-orange);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.article-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

h1,
h2 {
  margin: 0;
  color: var(--color-navy);
  line-height: 1.08;
}

h1 {
  max-width: 13ch;
  font-size: clamp(2.8rem, 7vw, 5.2rem);
}

h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.article-excerpt {
  max-width: 48rem;
  margin: 0;
  color: var(--color-muted);
  font-size: 1.16rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  color: var(--color-muted);
  font-weight: 720;
}

.article-cover {
  min-height: clamp(18rem, 42vw, 28rem);
  display: grid;
  place-items: center;
  border: 1px solid rgba(216, 224, 234, 0.9);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(11, 31, 58, 0.08), rgba(249, 115, 22, 0.12)),
    #f8fbff;
  color: var(--color-navy);
  box-shadow: var(--shadow-soft);
  font-size: clamp(1.5rem, 4vw, 3rem);
  font-weight: 850;
  text-align: center;
}

.article-body {
  display: grid;
  gap: 1rem;
  max-width: 760px;
}

.article-body p {
  margin: 0;
  color: var(--color-text);
  font-size: 1.08rem;
}

.article-not-found {
  padding: clamp(3rem, 8vw, 6rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: #f8fbff;
  text-align: center;
}

.related-articles {
  display: grid;
  gap: 1rem;
  margin-top: clamp(3rem, 8vw, 5rem);
}

.related-articles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.related-article-card {
  display: grid;
  gap: 0.75rem;
  padding: 1.2rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-white);
  box-shadow: var(--shadow-soft);
}

.related-article-card span {
  color: var(--color-orange);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.related-article-card h3,
.related-article-card p {
  margin: 0;
}

.related-article-card h3 {
  color: var(--color-navy);
  font-size: 1.08rem;
  line-height: 1.2;
}

.related-article-card p {
  color: var(--color-muted);
}

.related-article-card a {
  color: var(--color-navy);
  font-weight: 850;
}

.article-contact {
  display: grid;
  gap: 0.85rem;
  margin-top: clamp(3rem, 8vw, 6rem);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: var(--radius-xl);
  background: var(--color-navy);
  color: var(--color-white);
}

.article-contact h2,
.article-contact p {
  color: var(--color-white);
}

.article-contact p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

.article-contact .button {
  width: fit-content;
}

.article-contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.site-footer {
  background: #07172b;
  color: rgba(255, 255, 255, 0.74);
  padding: 4rem 0 1.2rem;
}

.site-footer .brand-mark,
.site-footer h2 {
  color: var(--color-white);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(2, 1fr);
  gap: 2rem;
}

.footer-grid h2 {
  margin: 0 0 0.8rem;
  font-size: 0.95rem;
}

.footer-grid a,
.footer-grid span {
  display: block;
  margin-top: 0.45rem;
}

.footer-bottom {
  width: min(980px, calc(100% - 2rem));
  margin: 2.5rem auto 0;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

html[dir="rtl"] body {
  text-align: right;
}

html[dir="rtl"] .site-nav,
html[dir="rtl"] .nav-links,
html[dir="rtl"] .breadcrumb,
html[dir="rtl"] .article-meta,
html[dir="rtl"] .article-labels,
html[dir="rtl"] .related-articles-grid,
html[dir="rtl"] .article-contact-actions,
html[dir="rtl"] .footer-grid,
html[dir="rtl"] .footer-bottom {
  direction: ltr;
}

html[dir="rtl"] .nav-links a:not(.button),
html[dir="rtl"] .breadcrumb > *,
html[dir="rtl"] .article-detail,
html[dir="rtl"] .related-article-card,
html[dir="rtl"] .article-contact,
html[dir="rtl"] .article-contact-actions > *,
html[dir="rtl"] .footer-grid > *,
html[dir="rtl"] .footer-bottom > * {
  direction: rtl;
  text-align: right;
}

@media (max-width: 980px) {
  .nav-menu-button {
    display: grid;
  }

  .nav-links {
    position: fixed;
    inset: 64px 1rem auto;
    display: none;
    grid-template-columns: 1fr;
    align-items: stretch;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-white);
    box-shadow: var(--shadow-soft);
  }

  .nav-links.is-open {
    display: grid;
  }

  .language-toggle,
  .nav-links .button {
    width: 100%;
  }

  .related-articles-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  html {
    font-size: 90%;
  }

  .section-shell,
  .article-shell,
  .site-nav,
  .footer-bottom {
    width: min(100% - 1rem, 980px);
  }

  h1 {
    max-width: 100%;
    font-size: clamp(2.25rem, 9.9vw, 3.96rem);
  }

  h2 {
    font-size: clamp(1.62rem, 3.6vw, 2.7rem);
  }

  .article-contact .button {
    width: 100%;
  }

  .article-contact-actions {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
