/* ══════════════════════════════════════════════════════════════
   صفحهٔ جزیره
   ══════════════════════════════════════════════════════════════ */

.islehero {
  position: relative;
  min-height: clamp(330px, 52vh, 500px);
  overflow: hidden;
  display: grid;
  background: var(--sky, linear-gradient(180deg, var(--a1), var(--a2) 60%, var(--a3)));
}

.islehero__art {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  translate: -50% 0;
  aspect-ratio: 4 / 3;
  z-index: 0;
}

/* با تصویر واقعی، تمام عرض سرصفحه را پر می‌کند (دیگر ناحیهٔ امن SVG لازم نیست) */
.islehero__art.is-photo {
  inset: 0;
  left: 0;
  translate: 0 0;
  width: auto;
  aspect-ratio: auto;
}

.islehero__art .scene {
  width: 100%;
  height: 100%;
}

.islehero__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(5, 7, 13, 0.46) 0%, rgba(5, 7, 13, 0) 22%, rgba(5, 7, 13, 0.04) 50%, rgba(5, 7, 13, 0.48) 78%, rgba(5, 7, 13, 0.93) 100%),
    radial-gradient(70% 45% at 50% 100%, color-mix(in srgb, var(--a2) 26%, transparent), transparent 72%);
  pointer-events: none;
}

.islehero__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 30px;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px clamp(18px, 4vw, 30px) 52px;
}

.islehero__text .eyebrow {
  font-size: 0.8rem;
}

.islehero__text h1 {
  margin: 6px 0 6px;
  font-size: clamp(2rem, 9vw, 3.4rem);
  line-height: 1.3;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.65), 0 12px 50px rgba(0, 0, 0, 0.5);
}

.islehero__text p {
  max-width: 42ch;
  color: color-mix(in srgb, var(--ink) 88%, transparent);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
  font-size: 0.95rem;
  line-height: 1.9;
}

/* ───────── پنل محتوا ───────── */

.panel {
  position: relative;
  z-index: 3;
  max-width: 800px;
  margin: -18px auto 46px;
  padding: clamp(20px, 4.4vw, 32px);
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.018));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.panel__desc {
  color: color-mix(in srgb, var(--ink) 76%, transparent);
  font-size: 0.94rem;
  line-height: 2;
}

.island-badge {
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  font-size: 0.8rem;
  color: color-mix(in srgb, var(--accent) 92%, white);
}

.island-stats {
  display: flex;
  align-items: center;
  gap: clamp(14px, 4vw, 26px);
  margin: 22px 0 26px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}

.island-stats__rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  font-size: 0.8rem;
}

.island-stats__rows > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 7px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.island-stats__rows > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.island-stats__rows span {
  color: var(--muted);
}

.island-stats__rows b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--accent) 88%, white);
}

.panel__h {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

/* ───────── فهرست درس‌ها ───────── */

.lessons {
  display: flex;
  flex-direction: column;
}

.lesson + .lesson {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.lesson__link {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 13px;
  padding: 15px 8px;
  border-radius: 14px;
  transition: background 0.3s, padding-inline 0.3s var(--ease);
}

.lesson__link:hover {
  background: rgba(255, 255, 255, 0.045);
  padding-inline: 12px 6px;
}

.lesson__num {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  color: color-mix(in srgb, var(--accent) 88%, white);
  font-size: 0.8rem;
  font-weight: 700;
  transition: background 0.3s, border-color 0.3s;
}

.lesson__link:hover .lesson__num {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

.lesson__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.lesson__title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.7;
}

.lesson__summary {
  font-size: 0.79rem;
  color: var(--muted);
  line-height: 1.7;
}

.lesson__meta {
  font-size: 0.71rem;
  color: var(--faint);
  margin-top: 2px;
}

.lesson__state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 46px;
  padding: 5px 9px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  line-height: 1.5;
}

.lesson__state b {
  font-size: 0.78rem;
  color: color-mix(in srgb, var(--ok) 85%, white);
  font-variant-numeric: tabular-nums;
}

.lesson__state i {
  font-size: 0.66rem;
  font-style: normal;
  color: var(--faint);
}

.lesson__state.is-done {
  border-color: color-mix(in srgb, var(--ok) 34%, transparent);
  background: color-mix(in srgb, var(--ok) 7%, transparent);
}

.panel__note {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.13);
  font-size: 0.78rem;
  line-height: 1.85;
  color: var(--muted);
}

.panel__note span {
  color: var(--accent);
  opacity: 0.8;
}

@media (max-width: 460px) {
  .lesson__link {
    grid-template-columns: 30px 1fr auto;
    gap: 10px;
  }
  .lesson__num {
    width: 30px;
    height: 30px;
    font-size: 0.74rem;
  }
  .lesson__summary {
    display: none;
  }
}

/* ───────── سرصفحهٔ بخش‌ها (درس‌های دسته‌بندی‌شده) ───────── */

.lessonsec {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
}

.lessonsec:first-child {
  margin-top: 6px;
}

.lessonsec span {
  font-size: 0.82rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--accent) 92%, white);
}

.lessonsec span::before {
  content: '◆';
  margin-inline-end: 6px;
  font-size: 0.62em;
  opacity: 0.7;
}

.lessonsec i {
  margin-inline-start: auto;
  font-size: 0.68rem;
  font-style: normal;
  color: var(--faint);
}

.panel__basis {
  display: block;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 14px;
  border-inline-start: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  font-size: 0.78rem;
  line-height: 1.95;
  color: var(--muted);
}

.panel__basis b {
  display: inline-block;
  margin-inline-end: 6px;
  padding: 1px 7px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: color-mix(in srgb, var(--accent) 92%, white);
  font-size: 0.7rem;
  font-weight: 700;
}

/* ───────── فهرست پرش سریع بخش‌ها ───────── */

.island-toc {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 4px -4px 18px;
  padding: 4px;
  scrollbar-width: none;
}

.island-toc::-webkit-scrollbar {
  display: none;
}

.island-toc button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: color-mix(in srgb, var(--ink) 82%, transparent);
  font-size: 0.76rem;
  font-weight: 600;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}

.island-toc button:hover {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: color-mix(in srgb, var(--accent) 90%, white);
}

.island-toc i {
  font-style: normal;
  font-size: 0.66rem;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--faint);
}

.lessonsec {
  scroll-margin-top: 18px;
}

/* ───────── مرحله‌های قفل در فهرست جزیره ───────── */

.lesson.is-locked .lesson__link {
  opacity: 0.55;
}

.lesson.is-locked .lesson__num {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: var(--faint);
  font-size: 0.8rem;
}

.lesson__state.is-locked {
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--faint);
}
