﻿/* ============================================
    COURSES · دوره‌های آموزشی شنا
    Arman Swim Club — Homepage Section
    Deep navy + cyan palette · RTL · Persian
    ============================================ */

/* -------- Theme Variables -------- */
.ae-courses {
  --navy: #0A2A4A;
  --navy-2: #082A3A;
  --cyan: #42C0F8;
  --ink: #1A3A5C;
  --sub: #1A3A5C;
  --line: #E8F5FC;
  --bg: #FFFFFF;
}

/* -------- Section -------- */
.ae-courses {
  position: relative;
  direction: rtl;
  background: var(--bg);
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.9s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.9s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.ae-courses.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* -------- Frame: 2-column grid ------- */
.ae-courses__frame {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
}

/* ------- پنل چپ: دوره‌ی اصلی ------- */
.ae-courses__feature {
  position: relative;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
  padding: 64px 52px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 520px;
  overflow: hidden;
}

/* Prevent layout shift during content transition */
.ae-courses__feature>div:not(.ae-courses__feature-bottom) {
  min-height: 200px;
  position: relative;
  z-index: 1;
}

/* ------- پس‌زمینه‌ی تصویر دوره (کراس‌فیلد) ------- */
.ae-courses__feature-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  overflow: hidden;
  pointer-events: none;
}

.ae-courses__feature-bg-layer {
  position: absolute;
  inset: 0;
  display: block;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 0.5s ease, transform 1.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.ae-courses__feature-bg-layer.is-active {
  opacity: 1;
  transform: scale(1);
}

.ae-courses__feature-bg.has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(160deg, rgba(10, 42, 74, 0.78) 0%, rgba(6, 30, 50, 0.9) 100%);
}

/* Feature content elements — smooth fade transitions */
.ae-courses__feature h3,
.ae-courses__feature p,
.ae-courses__feature-bottom,
.ae-courses__feature-eyebrow,
.ae-courses__feature-num {
  transition: opacity 0.22s ease;
}

.ae-courses__feature h3,
.ae-courses__feature p {
  transition: opacity 0.22s ease;
}

.ae-courses__feature-num {
  position: absolute;
  left: -30px;
  bottom: -70px;
  z-index: 1;
  font-size: 320px;
  font-weight: 900;
  line-height: 1;
  color: #ffffff2e;
  opacity: 0.05;
  letter-spacing: -10px;
  pointer-events: none;
  user-select: none;
  font-family: "Vazirmatn", Tahoma, sans-serif;
}

.ae-courses__feature-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 34px;
}

.ae-courses__feature-eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  flex-shrink: 0;
}

.ae-courses__feature-eyebrow span {
  font-size: 13px;
  color: #9FD3DE;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.ae-courses__feature h3 {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.55;
  color: #fff;
  margin: 0 0 20px;
  max-width: 11ch;
  position: relative;
  z-index: 1;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  letter-spacing: -0.3px;
}

.ae-courses__feature p {
  font-size: 15px;
  color: #B7CBD3;
  line-height: 2;
  max-width: 32ch;
  margin: 0;
  position: relative;
  z-index: 1;
  font-family: "Vazirmatn", Tahoma, sans-serif;
}

.ae-courses__feature-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.ae-courses__feature-price {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ae-courses__feature-price b {
  font-size: 23px;
  font-weight: 800;
  color: #fff;
  font-family: "Vazirmatn", Tahoma, sans-serif;
}

.ae-courses__feature-price small {
  font-size: 12px;
  color: #9FD3DE;
  font-weight: 500;
  font-family: "Vazirmatn", Tahoma, sans-serif;
}

.ae-courses__feature-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 11px;
  background: var(--cyan);
  color: #052733;
  font-weight: 800;
  font-size: 14.5px;
  text-decoration: none;
  transition: filter 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
  font-family: "Vazirmatn", Tahoma, sans-serif;
}

.ae-courses__feature-cta:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  text-decoration: none;
}

/* ------- پنل راست: فهرست ادیتوریال ------- */
.ae-courses__list-panel {
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.ae-courses__list-head {
  margin-bottom: 38px;
}

.ae-courses__list-head h2 {
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 8px;
  letter-spacing: -0.3px;
  font-family: "Vazirmatn", Tahoma, sans-serif;
}

.ae-courses__list-head p {
  margin: 0;
  font-size: 14.5px;
  color: var(--sub);
  line-height: 1.9;
  font-family: "Vazirmatn", Tahoma, sans-serif;
}

.ae-courses__rows {
  flex: 1;
}

.ae-courses__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 10px;
  border-top: 1px solid var(--line);
  opacity: 0;
  transform: translateY(10px);
  animation: ae-rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  cursor: pointer;
  outline: none;
  border-radius: 15px !important;
  transition: 0.2s;
}

.ae-courses__row:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: -2px;
  border-radius: 4px;
  transition: 0.2s;
}

.ae-courses__row:nth-child(1) {
  animation-delay: 0.05s;
}

.ae-courses__row:nth-child(2) {
  animation-delay: 0.12s;
}

.ae-courses__row:nth-child(3) {
  animation-delay: 0.19s;
}

.ae-courses__row:nth-child(4) {
  animation-delay: 0.26s;
}

.ae-courses__row:nth-child(5) {
  animation-delay: 0.33s;
}

.ae-courses__row:last-of-type {
  border-bottom: 1px solid var(--line);
}

/* Active row indicator — subtle background + cyan right border */
.ae-courses__row--active {
  background: rgba(66, 192, 248, 0.06);
  border-right: 3px solid var(--cyan);
  margin-right: -1px;
  padding-right: calc(26px - 2px);
}

.ae-courses__row--active .ae-courses__row-level .dot {
  background: var(--cyan);
  box-shadow: 0 0 6px rgba(66, 192, 248, 0.4);
}

.ae-courses__row--active h4 {
  color: var(--navy);
}

@keyframes ae-rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ae-courses__row-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ae-courses__row-level {
  display: flex;
  align-items: center;
  gap: 7px;
}

.ae-courses__row-level .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  flex-shrink: 0;
}

.ae-courses__row-level span {
  font-size: 12px;
  color: var(--sub);
  font-weight: 600;
  font-family: "Vazirmatn", Tahoma, sans-serif;
}

.ae-courses__row h4 {
  margin: 0;
  font-size: 17.5px;
  font-weight: 700;
  color: var(--ink);
  font-family: "Vazirmatn", Tahoma, sans-serif;
}

.ae-courses__row-meta {
  font-size: 13px;
  color: var(--sub);
  font-weight: 500;
  font-family: "Vazirmatn", Tahoma, sans-serif;
}

.ae-courses__row-right {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-shrink: 0;
}

.ae-courses__row-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  font-family: "Vazirmatn", Tahoma, sans-serif;
}

.ae-courses__row-go {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
  flex-shrink: 0;
}

.ae-courses__row-go svg {
  width: 15px;
  height: 15px;
  stroke: var(--navy);
  transition: transform 0.25s ease;
}

.ae-courses__row-go:hover {
  background: var(--navy);
  border-color: var(--navy);
  transform: translateY(-1px);
}

.ae-courses__row-go:hover svg {
  stroke: #fff;
  transform: translateX(-2px);
}

.ae-courses__list-more {
  margin-top: auto;
  padding-top: 30px;
  text-align: center;
}

.ae-courses__list-more a {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  text-decoration: none;
  border-bottom: 1px solid var(--navy);
  padding-bottom: 2px;
  font-family: "Vazirmatn", Tahoma, sans-serif;
}

.ae-courses__list-more a:hover {
  text-decoration: none;
}

/* Touch device handling — disable hover interaction on mobile */
@media (hover: none) and (pointer: coarse) {
  .ae-courses__row {
    cursor: default;
  }

  .ae-courses__row--active {
    background: rgba(34, 184, 207, 0.04);
    border-right: 2px solid var(--cyan);
  }

  .ae-courses__feature>div {
    min-height: 280px;
  }
}

@media (max-width: 860px) {
  .ae-courses__feature>div {
    min-height: 280px;
  }

  .ae-courses__feature {
    grid-template-columns: 1fr;
  }

  .ae-courses__feature {
    padding: 48px 30px 44px;
    min-height: auto;
  }

  .ae-courses__feature h3 {
    font-size: 30px;
  }

  .ae-courses__feature-num {
    font-size: 220px;
    bottom: -40px;
  }

  .ae-courses__list-panel {
    padding: 44px 28px;
  }
}

/* ============================================
    RESPONSIVE — feature above rows on mobile
    ============================================ */
@media (max-width: 860px) {
  .ae-courses__frame {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .ae-courses__feature {
    order: 1;
    padding: 48px 28px 40px;
    min-height: auto;
  }

  .ae-courses__feature>div {
    min-height: 240px;
  }

  .ae-courses__feature h3 {
    font-size: 28px;
    max-width: 100%;
  }

  .ae-courses__feature p {
    font-size: 14px;
    max-width: 100%;
  }

  .ae-courses__feature-num {
    font-size: 200px;
    bottom: -30px;
    left: -15px;
  }

  .ae-courses__feature-bottom {
    flex-wrap: wrap;
    gap: 12px;
  }

  .ae-courses__feature-cta {
    padding: 12px 18px;
    font-size: 13px;
  }

  .ae-courses__list-panel {
    order: 2;
    padding: 36px 28px;
  }

  .ae-courses__list-head {
    margin-bottom: 28px;
  }

  .ae-courses__list-head h2 {
    font-size: 22px;
  }

  .ae-courses__row {
    padding: 26px 10px;
  }

  .ae-courses__row h4 {
    font-size: 16px;
  }

  .ae-courses__row-meta {
    font-size: 12px;
  }

  .ae-courses__row-price {
    font-size: 14px;
  }

  .ae-courses__row-go {
    width: 32px;
    height: 32px;
  }

  .ae-courses__list-more {
    padding-top: 24px;
  }
}

/* Touch devices — click instead of hover */
@media (hover: none) and (pointer: coarse) {
  .ae-courses__row {
    cursor: default;
  }

  .ae-courses__row--active {
    background: rgba(34, 184, 207, 0.04);
    border-right: 2px solid var(--cyan);
  }

  .ae-courses__feature>div {
    min-height: 240px;
  }
}

@media (max-width: 860px) and (hover: none) and (pointer: coarse) {
  .ae-courses__feature>div {
    min-height: 260px;
  }
}

/* ============================================
    REDUCED MOTION
    ============================================ */
@media (prefers-reduced-motion: reduce) {
  .ae-courses {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .ae-courses__feature h3,
  .ae-courses__feature p,
  .ae-courses__feature-bottom,
  .ae-courses__feature-eyebrow,
  .ae-courses__feature-num {
    transition: none !important;
  }

  .ae-courses__feature-bg-layer {
    transition: none !important;
    transform: none !important;
  }

  .ae-courses__row {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    cursor: default;
  }
}