:root {
  --primary-color: #0d47a1;   
  --accent-color: #607d8b;    
  --Background: #eef5fde0;   
  --card-bg: #f5f5f5;        
  --text: #212121;
}

body {
  font-family: 'Vazirmatn', sans-serif;
  background: var(--Background);
  margin: 0;
  padding: 0;
  direction: rtl;
  color: var(--text);
}

nav {
  text-align: center;
  padding: 20px;
}
nav a {
  text-decoration: none;
  color: var(--primary-color);
  font-weight: bold;
  position: relative;
  display: inline-block;
  transition: color 0.3s ease;
}
nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}
nav a:hover::after {
  width: 100%;
}

h1 {
  text-align: center;
  color: var(--primary-color);
  font-size: 2rem;
  margin-top: 10px;
}
p.intro {
  text-align: center;
  color: var(--text);
  max-width: 600px;
  margin: 10px auto 30px;
}

/* ظرف کارت‌ها دسکتاپ */
.courses {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 20px;
  padding: 0 20px 40px;
  overflow-x: auto;          /* اسکرول افقی */
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  justify-content: center;
}

.course-container {
  flex-shrink: 0;
  scroll-snap-align: start;
}

.card {
  background: var(--card-bg);
  color: var(--text);
  border-radius: 12px;
  padding: 20px;
  width: 280px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.card:hover {
  transform: translateY(-8px);
}

.title-line {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 12px;
  color: var(--primary-color);
}

.btn {
  margin-top: 15px;
  background-color: var(--primary-color);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  align-self: flex-end;
}
.btn:hover {
  background-color: #a1b1b9;
  color: #0d47a1;
  transform: scale(1.05);
}

@media (max-width: 600px) {
  h1 {
    font-size: 1.6rem;
  }
  p.intro {
    font-size: 14px;
    line-height: 1.7;
    padding: 0 10px;
  }

  .courses {
    display: grid;                        
    grid-template-columns: repeat(2, 1fr); 
    gap: 12px;                            
    padding: 0 10px 24px;
    padding: 20px;
  }

  .course-container {
    width: 100%;                        
  }

  .card {
    width: 100%;                       
    font-size: 0.9em;
    border-radius: 12px;
    padding: 12px;
    box-sizing: border-box;
  }

  .btn {
    font-size: 0.85em;
    padding: 8px 14px;
  }
}