/* ==========================================================================
   عالم الأطفال | Kids World — Official Arabic Educational Website Stylesheet
   RTL-First, Mobile-First, Accessible, Lightweight & High-Performance
   ========================================================================== */

:root {
  --bg-page: #f8fafc;
  --bg-warm: #fffbeb;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --text-main: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --brand-primary: #0f766e;
  --brand-primary-dark: #115e59;
  --brand-primary-light: #ccfbf1;
  --brand-secondary: #0369a1;
  --brand-accent: #d97706;
  --brand-accent-light: #fef3c7;
  --border-color: #e2e8f0;
  --border-strong: #cbd5e1;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  direction: rtl;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg-page);
  color: var(--text-body);
  font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
  line-height: 1.85;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

a:hover {
  color: var(--brand-primary-dark);
}

button,
input,
select,
textarea {
  font: inherit;
}

/* Skip to content for accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  right: 16px;
  background: var(--brand-primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  z-index: 999;
  font-weight: bold;
}
.skip-link:focus {
  top: 12px;
}

/* Main container shell */
.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 18px 64px;
}

/* Top staging / parent notice bar */
.top-notice-bar {
  background: linear-gradient(90deg, #0f766e, #0369a1);
  color: #ffffff;
  font-size: 13px;
  padding: 8px 16px;
  text-align: center;
}
.top-notice-bar a {
  color: #fef08a;
  font-weight: bold;
  text-decoration: underline;
}

/* Header & Navigation */
.site-header {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-main);
  text-decoration: none;
}

.brand img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.12);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.main-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.main-nav a {
  color: var(--text-body);
  font-weight: 700;
  font-size: 14px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--brand-primary-light);
  color: var(--brand-primary-dark);
}

.main-nav a.nav-cta {
  background: var(--brand-primary);
  color: #ffffff !important;
}

.main-nav a.nav-cta:hover {
  background: var(--brand-primary-dark);
}

/* Breadcrumbs */
.breadcrumbs {
  margin: 18px 0;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.breadcrumbs a {
  color: var(--brand-secondary);
  font-weight: 600;
}

/* Hero Banner */
.hero {
  background: linear-gradient(135deg, #f0fdfa 0%, #eff6ff 55%, #fffbeb 100%);
  border: 1px solid #ccfbf1;
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  margin: 22px 0 30px;
  box-shadow: var(--shadow-sm);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  align-items: center;
}

.hero-kicker {
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  color: var(--brand-primary-dark);
  background: #ccfbf1;
  padding: 4px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.hero h1 {
  margin: 0 0 14px;
  color: var(--text-main);
  font-size: clamp(24px, 3.5vw, 36px);
  line-height: 1.35;
}

.hero p {
  margin: 0 0 18px;
  font-size: 16px;
  color: var(--text-body);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-md);
}

/* Buttons */
.btn,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-primary,
.button {
  background: var(--brand-primary);
  color: #ffffff !important;
}

.btn-primary:hover,
.button:hover {
  background: var(--brand-primary-dark);
}

.btn-secondary,
.button.alt {
  background: #ffffff;
  color: var(--brand-primary-dark) !important;
  border-color: var(--border-strong);
}

.btn-secondary:hover,
.button.alt:hover {
  background: var(--bg-subtle);
}

.btn-accent {
  background: var(--brand-accent);
  color: #ffffff !important;
}

/* Section Headers */
.section-block {
  margin: 38px 0;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 12px;
}

.section-header h2 {
  margin: 0;
  font-size: clamp(20px, 2.6vw, 26px);
  color: var(--text-main);
}

.section-header p {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--text-muted);
}

/* Grids */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 22px;
}

.grid-4,
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 22px;
}

/* Cards */
.card,
.content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 26px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.card h2,
.content h2 {
  color: var(--text-main);
  margin-top: 0;
}

/* Category Cards */
.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #99f6e4;
}

.category-card h3 {
  margin: 8px 0 10px;
  font-size: 19px;
  color: var(--text-main);
}

.category-card p {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--text-body);
}

.category-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--bg-subtle);
}

/* Video Cards */
.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.video-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.poster-wrap {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: #e2e8f0;
  overflow: hidden;
}

.poster {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.video-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.video-body h2,
.video-body h3 {
  font-size: 17px;
  line-height: 1.5;
  margin: 0 0 8px;
  color: var(--text-main);
}

.video-body p {
  font-size: 14px;
  color: var(--text-body);
  margin: 0 0 14px;
  flex: 1;
}

.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-primary-dark);
  background: var(--brand-primary-light);
  border-radius: 6px;
  padding: 2px 10px;
  margin-bottom: 8px;
  align-self: flex-start;
}

.tag.featured-tag {
  background: var(--brand-accent-light);
  color: #92400e;
}

.video-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--bg-subtle);
}

/* Article Cards */
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.article-card h3 {
  margin: 8px 0 10px;
  font-size: 19px;
  line-height: 1.45;
  color: var(--text-main);
}

.article-card p {
  font-size: 14.5px;
  color: var(--text-body);
  margin: 0 0 16px;
}

.article-meta {
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--bg-subtle);
}

/* Controls & Search Bar */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0;
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.controls input,
.controls select {
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  min-height: 44px;
  color: var(--text-main);
}

.controls input {
  flex: 1;
  min-width: 220px;
}

.controls select {
  min-width: 190px;
}

/* Video Detail Page & Embed */
.video-player-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 18px 0 24px;
  box-shadow: var(--shadow-md);
}

.video-player-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.editorial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.editorial-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-right: 5px solid var(--brand-primary);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.editorial-box.objectives {
  border-right-color: var(--brand-secondary);
  background: #f8fafc;
}

.editorial-box.parent-guide {
  border-right-color: var(--brand-primary);
  background: #f0fdfa;
}

.editorial-box.home-activity {
  border-right-color: var(--brand-accent);
  background: #fffbeb;
}

.editorial-box h2,
.editorial-box h3 {
  margin-top: 0;
  font-size: 18px;
  color: var(--text-main);
}

/* App Showcase Box */
.app-showcase {
  background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
  border: 1px solid #bae6fd;
  border-radius: var(--radius-lg);
  padding: 30px;
  margin: 30px 0;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: 18px 0;
}

.feature-list li {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-main);
}

/* Empty & Notice States */
.empty {
  padding: 44px 24px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  text-align: center;
  border: 1px dashed var(--border-strong);
}

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

.notice {
  font-size: 13.5px;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
}

/* Footer */
.site-footer,
.footer {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  margin-top: 56px;
  color: var(--text-body);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
  text-align: right;
}

.footer-col h3 {
  font-size: 16px;
  color: var(--text-main);
  margin: 0 0 12px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 18px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-muted);
}

/* Responsive adjustments */
@media (max-width: 820px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .site-header {
    flex-direction: column;
    align-items: stretch;
  }
  .main-nav {
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .shell {
    padding: 14px 12px 48px;
  }
  .hero {
    padding: 24px 18px;
  }
  .card,
  .content {
    padding: 18px;
  }
}
