
:root {
  --fs-300: 0.9375rem;
  --fs-400: 1.0625rem;
  --fs-500: 1.375rem;
  --fs-600: 1.875rem;
  --fs-700: 2rem;

  --ff-body:  "SF Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --ff-heading: "SF Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

  --fw-400: 400;
  --fw-700: 700;
  --fw-900: 900;

  --clr-primary-200: hsla(192, 70%, 95%, 1);
  --clr-primary-300: hsla(192, 100%, 39%, 1);
  --clr-primary-400: hsla(192, 100%, 26%, 1);
  --clr-primary-500: hsla(192, 70%, 36%, 1);

  --clr-neutral-100: hsla(0, 0%, 100%, 1);
  --clr-neutral-300: hsla(0, 0%, 50%, 1);
  --clr-neutral-400: hsla(0, 0%, 40%, 1);
  --clr-neutral-500: hsla(0, 0%, 60%, 1);
  --clr-neutral-900: hsla(0, 0%, 10%, 1);
}

@media (min-width: 35em) {
  :root {
    --fs-300: 1rem;
    --fs-400: 1.125rem;
    --fs-500: 1.5rem;
    --fs-600: 2.25rem;
    --fs-700: 3rem;
  }
}

/* //////////////////////
  RESET - source: https://piccalil.li/blog/a-modern-css-reset
  /////////////////////// */

/* Box sizing rules */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul:where([role="list"]),
ol:where([role="list"]) {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Set core root defaults */
html:focus-within {
  scroll-behavior: smooth;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  text-rendering: optimizeSpeed;
  line-height: 1.5;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
}

/* Make images easier to work with */
img,
picture {
  max-width: 100%;
  display: block;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font: inherit;
}

/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* //////////////////////
  General styling
  /////////////////////// */

body {
  font-family: var(--ff-body);
  font-size: var(--fs-400);
  color: var(--clr-neutral-900);
}

h1,
h2,
h3 {
  font-family: var(--ff-heading);
  font-weight: var(--fw-900);
  line-height: 1.1;
}

strong {
  font-weight: var(--fw-700);
}

section,
.section {
  padding: min(10vh, 10em) 0;
}



/* //////////////////////
  Utility Classes
  /////////////////////// */

/* select all direct childen of .flow
   and add margin to the top for proper
   spacing */

.flow > *:where(:not(:first-child)) {
  margin-top: var(--flow-spacer, 1em);
}

.container {
  margin-inline: auto;
  padding-inline: 1.5em;
  max-width: 72rem;
}

.container--narrow {
  max-width: 65rem;
}

.flex-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap, 1em);
}

.text-center {
  text-align: center;
}

/* typgraphy */

.article-title,
.section-title {
  color: var(--clr-primary-500);
}

.article-title {
  font-size: var(--fs-700);
}

.section-title {
  font-size: var(--fs-600);
}


/* //////////////////////
  Header
  /////////////////////// */

.page-header {
  padding: 2em 0;
}

.page-header__content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-list {
  margin: 0;
  padding: 0;
}

.nav-list a {
  color: var(--clr-neutral-900);
  text-decoration: none;
}

.nav-list a:focus,
.nav-list a:hover {
  color: var(--clr-primary-400);
  text-decoration: underline;
}

/* //////////////////////
  Footer
  /////////////////////// */

.site-footer {
  --logo-color: currentColor;
  padding: 2em 0;
  color: var(--clr-neutral-100);
  background-color: var(--clr-primary-500);
  text-align: center;
}

/* //////////////////////
  Homepage
  /////////////////////// */

.hero > div {
  display: grid;
  grid-auto-flow: row;
  grid-auto-columns: 1fr;
  align-items: center;
  gap: 3em;
}

.hero__image {
  width: 100%;
  /* max-height: max(15rem, 40vh); */
  object-fit: cover;
}

@media (min-width: 45em) {
  .hero > div {
    grid-auto-flow: column;
  }
}

.featured-articles {
  background-color: var(--clr-primary-200);
}

.articles__list {
  --flow-spacer: 3rem;
  margin: 6rem 0;
}

/* //////////////////////
  Individual article page
  /////////////////////// */

  .main-article {
    margin-bottom: 3rem;
  }

  .main-article__figure figcaption {
    margin: 1rem 0;
    font-size: var(--fs-300);
    opacity: .9;
  }

/* //////////////////////
  Article snippets
  /////////////////////// */

.snippet {
  display: grid;
  gap: 1em;
  grid-template-areas:
    "image"
    "title"
    "meta"
    "body"
    "button";
}

.snippet__image {
  grid-area: image;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.snippet__title {
  grid-area: title;
}
.snippet__meta {
  grid-area: meta;
  color: var(--clr-neutral-300);
}

.snippet__meta span {
  color: var(--clr-neutral-900);
}

.snippet .btn {
  grid-area: button;
}

.snippet__title {
  color: var(--clr-neutral-900);
  font-size: var(--fs-500);
}

.snippet__title a {
  color: inherit;
  text-decoration: none;
}

.snippet__title a:hover,
.snippet__title a:focus {
  color: var(--clr-primary-500);
} 

@media (min-width: 45em) {
  .snippet {
    grid-template-areas:
      "title image"
      "meta image"
      "body image"
      "button image";
    grid-column-gap: 4em;
    grid-template-columns: 1fr 40%;
    grid-template-rows: min-content min-content min-content 1fr;
  }
}

.btn {
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  line-height: 1;
  padding: 0.75em 1.75em;
  border-radius: 0.25em;
  align-self: start;
  justify-self: start;
}

.btn:focus {
  outline: 0.125em solid var(--clr-primary-400);
  outline-offset: 0.25em;
}

.btn--primary {
  background: var(--clr-primary-400);
  color: var(--clr-neutral-100);
  font-weight: var(--fw-700);
  border: 2px solid var(--clr-primary-400);
}
.btn--primary:hover,
.btn--primary:focus {
  background: var(--clr-primary-500);
  border-color: var(--clr-primary-500); 
}

.btn--neutral {
  background-color: var(--clr-neutral-100);
  color: var(--clr-neutral-900);
  font-weight: var(--fw-700);
  border: 2px solid var(--clr-neutral-900);
}

.btn--neutral:hover,
.btn--neutral:focus {
  color: var(--clr-neutral-100);
  background-color: var(--clr-neutral-900);
}

/* 1) تفعيل RTL عام */
html[dir="rtl"] { direction: rtl; }
body { text-align: right; }

/* 2) خصائص منطقية بدل left/right (تشتغل صح مع RTL/LTR) */
.container { padding-inline: 1rem; }
h1, h2, h3, p { 
  margin-block: 0.75rem;
  margin-inline: 0; /* يلغي أي هوامش يمين/يسار قديمة */
}

/* 3) القوائم والتنقل */
.nav-list {
  display: flex;
  gap: 1rem;
  flex-direction: row-reverse;   /* يبدأ من اليمين */
  padding-inline-start: 0;       /* يشيل مسافة بداية القوائم */
  list-style: none;              /* حسب تصميمك */
}

/* 4) بطاقات/سطر فيه صورة + نص (اختياري) */
.featured, .card-row {
  display: flex;
  gap: 1.25rem;
  flex-direction: row-reverse;   /* الصورة يسار، النص يمين في RTL */
}

/* 5) الجداول والقوائم المرقمة (تحسين بسيط) */
ol, ul { padding-inline-start: 1.25rem; }
table { text-align: start; } /* يراعي الاتجاه تلقائيًا */

/* 6) استثناءات للنص الإنجليزي */
[lang="en"], .ltr {
  direction: ltr;
  text-align: left;
}

.pdf-viewer {
  width: 100%;
  height: 100vh; /* يغطي ارتفاع الشاشة بالكامل */
  margin: 0;
  padding: 0;
}

.pdf-viewer iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.footer-logo {
  filter: brightness(0) invert(1); /* يحول اللون إلى أبيض */
  max-width: 120px; /* عشان حجم مناسب */
}

.footer-logo {
  display: block;
  margin: 0 auto; /* يوسّط اللوقو أفقيًا */
}

.site-footer {
  text-align: center;
}

.social-links {
  margin-top: 10px;
}

.social-links a {
  display: flex;
  align-items: center;
  gap: 8px; /* مسافة بين الأيقونة والنص */
  color: white; /* لون النص */
  text-decoration: none;
}

.social-icon {
  width: 24px; /* حجم أصغر */
  height: 24px;
  filter: brightness(0) invert(1); /* يحول الأيقونة للون الأبيض */
}

.site-footer {
  display: flex;
  flex-direction: column; /* يخلي العناصر فوق بعض */
  align-items: center; /* يوسّطها أفقياً */
  justify-content: center; /* يوسّطها عمودياً إذا فيه ارتفاع */
  text-align: center; /* يوسّط النصوص */
  padding: 20px;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.social-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  text-decoration: none;
}

.social-icon {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
}

.author-text {
  color: #888; /* رمادي متوسط */
}


header img {
  width: 80px;   /* العرض */
  height: auto;  /* يحافظ على النسبة */
}

body, main { background: #fff; }

.hero {
  background: #EDEBE4;
  padding-block: 32px;   /* مسافة فوق وتحت الشريط */
}
/* عرض PDF متجاوب */
.pdf-container {
  width: 100%;
  max-width: 100%;
  height: 80svh;
  overflow: auto;
}

.pdf-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* تابلت */
@media (max-width: 1024px) {
  .pdf-container { height: 75svh; }
}

/* جوالات متوسطة */
@media (max-width: 768px) {
  .pdf-container { height: 70svh; }
}

/* جوالات صغيرة */
@media (max-width: 600px) {
  .pdf-container { height: 70svh; }
}
