:root{
  /* فرض بر وجود این متغیرها در style.css */
}

.courses{
  padding: 3rem 0 4rem;
  background: var(--color-bg);
  color: var(--color-text);
  overflow-x: hidden;
}
.courses-container{
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}
.courses .section-title .text-gold{background:var(--gradient-accent);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;}

.courses-grid{
  display:grid;
  gap:1.25rem;
  grid-template-columns: repeat(1,1fr);
}
@media(min-width:720px){
  .courses-grid{grid-template-columns: repeat(2,1fr);} 
}
@media(min-width:1100px){
  .courses-grid{grid-template-columns: repeat(4,1fr);} 
}

.course-card{
  position:relative;
  border-radius: var(--radius-lg);
  overflow:hidden;
  box-shadow: var(--shadow-md);
  cursor:pointer;
  transform: translateZ(0);
  transition: transform .28s var(--ease), box-shadow .28s var(--ease);
  will-change: transform;
  min-height: 280px;
  display:flex;
  align-items:flex-end;
}
.course-card:focus,.course-card:hover{transform: translateY(-6px) scale(1.02);box-shadow:0 18px 46px rgba(31,27,23,0.12);}
.card-media{
  position:absolute;
  inset:0;
  background-size:cover;
  background-position:center center;
  filter:brightness(.76) contrast(1.02) saturate(1.05);
}
.course-card::before{
  content:"";
  position:absolute;
  left:0;right:0;bottom:0;
  height:55%;
  background: linear-gradient(to top, rgba(20,15,10,0.88) 0%, rgba(20,15,10,0.55) 45%, rgba(20,15,10,0.05) 75%);
  pointer-events:none;
  z-index:1;
}
.card-body{position:relative;padding:1.5rem;z-index:2}
.card-title{font-size:clamp(1.05rem, 2.6vw, 1.25rem);margin:0 0 .65rem;color:#fff;text-shadow:0 1px 4px rgba(0,0,0,0.6)}
.card-desc{margin:0 0 1rem;color:#fff;opacity:.98;font-size:clamp(0.85rem, 2.2vw, 1rem);line-height:1.7;letter-spacing:0.01em;max-width:28ch;text-shadow:0 1px 4px rgba(0,0,0,0.6)}
.card-action{background:rgba(255,255,255,0.14);border:1px solid rgba(255,255,255,0.22);color:#fff;padding:.6rem 1rem;border-radius:999px;font-size:.95rem;transition:transform .2s ease, background .2s ease;}
.card-action:hover{transform:translateY(-2px);background:rgba(255,255,255,0.24);}

/* پنل جزئیات */
.course-panel{position:fixed;inset:0;display:none;align-items:flex-end;justify-content:center;z-index:1200}
.course-panel.active{display:flex}
.course-panel .panel-backdrop{position:absolute;inset:0;background:rgba(0,0,0,0.45);backdrop-filter: blur(5px)}
.course-panel .panel-content{position:relative;background:var(--color-bg);width:100%;max-width:1040px;border-radius:calc(var(--radius-lg) + 4px);margin:1.5rem;box-shadow:var(--shadow-md);overflow:auto;max-height:88vh;transform:translateY(18px) scale(.98);opacity:0;transition:opacity .28s ease, transform .28s ease;}
.course-panel.active .panel-content{transform:translateY(0) scale(1);opacity:1}
.course-panel .panel-close{align-self:flex-end;margin:0.85rem 0.85rem 0 0;background:rgba(255,255,255,0.92);backdrop-filter: blur(10px);-webkit-backdrop-filter: blur(10px);border:0;border-radius:50%;width:42px;height:42px;display:flex;align-items:center;justify-content:center;font-size:1.4rem;color:var(--color-text);box-shadow:0 12px 24px rgba(0,0,0,0.12);cursor:pointer;}
.course-panel.active .panel-close{position:fixed;top:1rem;left:1rem;z-index:10;}
.course-panel .panel-close:hover{background:rgba(255,255,255,1)}
.panel-header{padding:2rem 1.75rem 1rem;border-bottom:1px solid rgba(0,0,0,0.08)}
.panel-header h3{margin:0 0 .5rem;font-size:clamp(1.8rem,3vw,2.5rem);color:var(--color-text)}
.panel-desc{
  margin:0;
  padding:1rem 1.1rem;
  border:1px solid var(--color-border);
  border-radius:var(--radius-md);
  background:var(--color-bg-alt);
  color:var(--color-text);
  opacity:1;
  line-height:1.9;
  font-size:clamp(0.95rem, 2.2vw, 1.05rem);
  text-align:justify;
  white-space:pre-line;
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.45);
}
.panel-section{padding:1.25rem 1.75rem}
.chips{display:flex;flex-wrap:wrap;gap:.55rem}
.chip{background:var(--gradient-accent);color:#2f2412;padding:.45rem .85rem;border-radius:999px;font-size:.95rem;font-weight:600}

.teachers-grid{display:grid;grid-template-columns:repeat(1,1fr);gap:1rem;align-items:stretch}
@media(min-width:720px){.teachers-grid{grid-template-columns:repeat(2,1fr)}}
@media(min-width:1000px){.teachers-grid{grid-template-columns:repeat(3,1fr)}}
.teacher-card{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:0.75rem;
  height:100%;
  padding:0.9rem;
  border-radius:var(--radius-md);
  background:var(--color-bg-alt);
  cursor:default;
  box-shadow:var(--shadow-sm);
  transition:transform .14s ease, box-shadow .14s ease, background-color .14s ease;
  position:relative;
  overflow:hidden;
}
.teacher-card:hover{transform:translateY(-2px);box-shadow:0 10px 24px rgba(31,27,23,0.08)}
.teacher-photo{
  width:100%;
  aspect-ratio:3 / 4;
  border-radius:14px;
  overflow:hidden;
  flex:0 0 auto;
  box-shadow:0 10px 24px rgba(0,0,0,0.08);
}
.teacher-photo img{width:100%;height:100%;object-fit:cover;object-position:center 15%;display:block}
.teacher-info{flex:1;display:flex;flex-direction:column;gap:.3rem;justify-content:flex-start;min-height:0}
.teacher-info h4{margin:0;font-size:1.02rem;color:var(--color-text)}
.teacher-info p{margin:0;color:var(--color-text-muted);font-size:0.94rem;line-height:1.5}
.teacher-info .btn-sm{align-self:flex-start;margin-top:.25rem}

/* نمای سریع استاد */
/* teacher quickview removed - styles cleaned */

@keyframes pop{from{opacity:0;transform:translate(-50%,-48%) scale(.96)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}

/* دسترسی و رفتار موبایل */
@media(max-width:600px){
  .courses{padding:2rem 0 3rem}
  .courses-container{padding:0 0.75rem}
  .courses .section-title{font-size:clamp(1.25rem, 4vw, 1.9rem);margin-bottom:1.25rem;padding-bottom:0.75rem}
  .courses .section-tag{margin-bottom:0.7rem}
  .course-card{min-height:220px;border-radius:12px}
  .card-body{padding:0.9rem;max-width:100%;}
  .card-title{font-size:clamp(1.05rem, 2.8vw, 1.15rem);margin-bottom:0.5rem}
  .card-desc{font-size:clamp(0.85rem, 2.2vw, 1rem);line-height:1.7;letter-spacing:0.01em;max-width:100%;margin:0;}
  .card-action{padding:.45rem .8rem;font-size:.88rem}
  .course-panel .panel-content{margin:0;border-radius:0;height:100vh;max-height:100vh;padding:1rem}
  .course-panel.active .panel-close{top:0.6rem;left:0.6rem}
  .panel-header{padding:1rem 1rem 0.75rem}
  .panel-section{padding:0.85rem}
  .teachers-grid{grid-template-columns:repeat(2,1fr);gap:0.75rem}
  .teacher-card{gap:0.6rem;padding:0.8rem;border-radius:12px}
  .teacher-info h4{font-size:0.98rem}
  .teacher-info p{font-size:.86rem}
}
@media(max-width:480px){
  .courses-grid{gap:1rem}
  .course-card{min-height:200px;border-radius:10px}
  .card-body{padding:0.75rem}
  .card-title{font-size:clamp(1rem, 3.2vw, 1.1rem);margin-bottom:0.45rem}
  .card-desc{font-size:clamp(0.85rem, 2.4vw, 0.98rem);line-height:1.7;letter-spacing:0.01em;max-width:100%;margin:0;}
  .course-panel .panel-content{padding:0.75rem}
  .course-panel.active .panel-close{top:.6rem;left:.6rem}
  .teachers-grid{grid-template-columns:repeat(2,1fr);gap:0.6rem}
  .teacher-card{padding:0.7rem;border-radius:10px}
  .teacher-photo{aspect-ratio:4 / 5;border-radius:10px}
  .teacher-info{width:100%}
}

/* Fix: center course headings to match site-wide style */
.courses .courses-container{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
}
.courses .section-tag{
  display:inline-flex;
  justify-content:center;
  margin:0 0 0.8rem;
}
.courses .section-title{
  display:block;
  margin:0 0 1.55rem;
  width:100%;
}
.courses .section-title::after{
  left:50%;
  transform:translateX(-50%);
}
