/*
Theme Name: Ghaith (غيث)
Theme URI: https://ghaithedu.com/
Description: قالب عربي من اليمين إلى اليسار (RTL) لمنصّة تعليمية: صفحة رئيسية بخطوات التسجيل والمزايا والمقررات، وصفحة تفاصيل لكل مقرّر.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: ghaith
Domain Path: /languages
License: GPL-2.0-or-later
*/

:root {
  --primary: #1D7A5F;
  --primary-soft: #E8F3EF;
  --ink: #1E2B26;
  --muted: #5B6B65;
  --bg: #F7F8F6;
  --surface: #FFFFFF;
  --border: #E3E8E5;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(20, 40, 32, .07);
  --container: 1160px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .5rem; }
p { margin: 0 0 1rem; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

.container { width: min(100% - 2rem, var(--container)); margin-inline: auto; }
.section { padding: 4.5rem 0; }
.section__head { text-align: center; max-width: 640px; margin: 0 auto 2.5rem; }
.section__head p { color: var(--muted); }
.section__title { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; }

.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden; position: absolute; word-wrap: normal !important;
}
.skip-link:focus {
  clip: auto; clip-path: none; height: auto; width: auto; margin: 0;
  background: var(--surface); padding: .6rem 1rem; z-index: 100; top: 0; inset-inline-start: 0;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.4rem; border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; transition: .2s ease;
  white-space: nowrap;
}
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { filter: brightness(.92); }
.btn--ghost { background: var(--surface); border-color: var(--border); color: var(--ink); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn--lg { padding: .9rem 2rem; font-size: 1.125rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 72px; }
.site-brand { display: inline-flex; align-items: center; gap: .4rem; font-weight: 800; }
.site-brand img { max-height: 48px; width: auto; }
.brand-name { font-size: 1.6rem; color: var(--primary); }
.brand-sub { color: var(--muted); font-weight: 500; }

.primary-nav { position: relative; }
.menu { list-style: none; display: flex; gap: 1.75rem; margin: 0; padding: 0; }
.menu a { color: var(--muted); font-weight: 500; transition: color .2s; }
.menu a:hover { color: var(--primary); }

.header-actions { display: flex; gap: .6rem; margin-inline-start: auto; }
.nav-toggle {
  display: none; margin-inline-start: auto; width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; padding: 0;
  align-items: center; justify-content: center;
}
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; position: relative;
}
.nav-toggle__bars::before,
.nav-toggle__bars::after { content: ""; position: absolute; inset-inline-start: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }

/* Hero */
.hero { padding: 5rem 0 3.5rem; text-align: center; }
.hero__title {
  font-size: clamp(2.2rem, 5.5vw, 3.8rem); font-weight: 800; margin-bottom: 1rem;
}
.hero__subtitle {
  max-width: 680px; margin: 0 auto 2rem; color: var(--muted); font-size: 1.2rem;
}
.hero__actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

/* Steps */
.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem;
}
.step {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.4rem 1.1rem; text-align: center; box-shadow: var(--shadow);
}
.step__num {
  width: 42px; height: 42px; margin: 0 auto .9rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 800;
}
.step h3 { font-size: 1.1rem; }
.step p { color: var(--muted); font-size: .95rem; margin: 0; }

/* Features */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.75rem; box-shadow: var(--shadow);
}
.feature__mark { width: 12px; height: 12px; border-radius: 4px; background: var(--primary); margin-bottom: 1rem; }
.feature h3 { font-size: 1.15rem; }
.feature p { color: var(--muted); font-size: .97rem; margin: 0; }

/* Courses */
.courses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.course-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
.course-card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(20, 40, 32, .11); }
.course-card__thumb {
  aspect-ratio: 16 / 9; background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-size: 3.5rem; font-weight: 800; overflow: hidden;
}
.course-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.course-card__body { padding: 1.25rem 1.4rem 1.4rem; display: flex; flex-direction: column; flex: 1; }
.course-card__tags { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .6rem; }
.course-card__title { font-size: 1.25rem; font-weight: 800; }
.course-card__title a:hover { color: var(--primary); }
.course-card__meta { color: var(--muted); font-size: .95rem; margin: 0 0 .25rem; }
.course-card__meta strong { color: var(--ink); }
.course-card__actions { margin-top: auto; padding-top: 1rem; }
.course-card__actions .btn { width: 100%; }
.course-card__stats {
  list-style: none; margin: 1.1rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(3, 1fr); text-align: center;
}
.course-card__stats li { display: flex; flex-direction: column; }
.course-card__stats strong { font-size: 1.1rem; color: var(--primary); line-height: 1.2; }
.course-card__stats span { color: var(--muted); font-size: .85rem; }

.tag {
  display: inline-block; padding: .2rem .75rem; border-radius: 999px;
  background: #F1F3F2; color: var(--muted); font-size: .85rem; font-weight: 500;
}
.tag--primary { background: var(--primary-soft); color: var(--primary); font-weight: 700; }

.empty-state {
  text-align: center; padding: 2.5rem 1rem; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
}

/* About + CTA */
.about {
  background: var(--surface); border: 1px solid var(--border); border-radius: 24px;
  padding: clamp(2rem, 5vw, 3.5rem); text-align: center; box-shadow: var(--shadow);
}
.about p { max-width: 720px; margin: 0 auto; color: var(--muted); font-size: 1.12rem; }

.cta {
  margin: 0 0 4.5rem; padding: clamp(2.5rem, 6vw, 4rem) 1.5rem; text-align: center;
  background: var(--primary); color: #fff; border-radius: 24px;
}
.cta .section__title { color: #fff; }
.cta p { color: rgba(255, 255, 255, .88); }
.cta .btn--primary { background: #fff; color: var(--primary); }
.cta .btn--primary:hover { filter: none; background: var(--primary-soft); }

/* Generic content */
.entry {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(1.25rem, 4vw, 2.5rem); box-shadow: var(--shadow);
}
.entry__title { font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 800; }
.entry__content > * + * { margin-top: 1rem; }
.entry__content img { border-radius: 12px; }
.entry__meta { color: var(--muted); font-size: .95rem; }
.page-header { margin-bottom: 2rem; }
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.posts-grid .entry { padding: 1.5rem; }
.posts-grid .entry__title { font-size: 1.35rem; }
.pagination, .nav-links { margin-top: 2.5rem; text-align: center; }
.pagination .page-numbers { display: inline-block; padding: .4rem .9rem; margin: 0 .15rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Single course */
.course-single__tags { display: flex; gap: .4rem; margin-bottom: .75rem; }
.course-single__image { border-radius: 14px; margin: 1.5rem 0; width: 100%; }
.course-facts {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem;
  margin: 1.5rem 0 0; padding: 0;
}
.course-facts > div {
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: .9rem 1rem;
}
.course-facts dt { color: var(--muted); font-size: .85rem; }
.course-facts dd { margin: 0; font-weight: 700; }
.course-single__cta { margin-top: 2rem; }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 3rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; align-items: start; }
.footer-tagline { color: var(--muted); margin-top: .5rem; max-width: 380px; }
.footer-links .menu { flex-direction: column; gap: .6rem; }
.footer-actions { display: flex; flex-direction: column; gap: .6rem; }
.footer-bottom {
  margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border);
  color: var(--muted); font-size: .9rem; text-align: center;
}
.footer-bottom p { margin: 0; }

/* Responsive */
@media (max-width: 1100px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .features { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .header-actions .btn--ghost { display: none; }
  .primary-nav {
    display: none; position: absolute; inset-inline: 0; top: 100%;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 1rem 0;
    box-shadow: var(--shadow);
  }
  .primary-nav.is-open { display: block; }
  .menu { flex-direction: column; gap: 0; }
  .menu li a { display: block; padding: .8rem 1.25rem; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .section { padding: 3rem 0; }
  .steps { grid-template-columns: 1fr 1fr; }
  .features { grid-template-columns: 1fr; }
  .hero { padding-top: 3rem; }
  .header-actions .btn--primary { padding: .55rem 1rem; font-size: .95rem; }
  .brand-sub { display: none; }
}
