/* =========================================================
   MÓDULO: TRILHA DO ALFABETO
   Tela de estudo com progresso local salvo no navegador.
========================================================= */

.pagina-alfabeto {
  background: #031016;
}

.pagina-alfabeto #header {
  background: linear-gradient(
    to bottom,
    rgba(2, 9, 13, 0.78),
    rgba(2, 9, 13, 0.22),
    transparent
  );
}

.pagina-alfabeto #header.scrolled {
  background: rgba(5, 14, 18, 0.84);
}

.pagina-alfabeto .menu-desktop ul {
  gap: clamp(24px, 2.5vw, 40px);
}

.pagina-alfabeto .menu-desktop a,
.pagina-alfabeto .theme-button,
.pagina-alfabeto .menu-toggle {
  color: var(--gold-light);
}

.alfabeto-page {
  --alfabeto-map-size: 100% auto;

  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(16, 84, 103, 0.12), transparent 36%),
    linear-gradient(to bottom, rgba(1, 8, 12, 0.10), rgba(1, 8, 12, 0.58)),
    url("imagens/fundotrilhas.png") center top / var(--alfabeto-map-size) no-repeat;
  background-color: #031016;
}

.alfabeto-page::before,
.alfabeto-page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.alfabeto-page::before {
  background:
    linear-gradient(to right, rgba(0, 0, 0, 0.54), transparent 24%, transparent 76%, rgba(0, 0, 0, 0.48)),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.10) 36%, rgba(0, 0, 0, 0.54));
}

.alfabeto-page::after {
  background: radial-gradient(circle at 50% 20%, rgba(216, 174, 95, 0.10), transparent 30%);
  mix-blend-mode: screen;
  opacity: 0.62;
}

.alfabeto-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom, transparent 36%, rgba(1, 8, 12, 0.22) 58%, rgba(1, 8, 12, 0.82)),
    radial-gradient(circle at 50% 56%, rgba(3, 15, 20, 0.30), transparent 45%);
}

.module-shell {
  width: min(100% - 48px, 1340px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(286px, 30vh, 312px) 0 54px;
}

.module-heading {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  max-width: 950px;
  margin-bottom: 18px;
}

.module-seal {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(216, 174, 95, 0.58);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 45%, rgba(216, 174, 95, 0.16), transparent 58%),
    rgba(5, 18, 24, 0.78);
  color: var(--gold);
  box-shadow:
    inset 0 0 22px rgba(0, 0, 0, 0.44),
    0 0 24px rgba(216, 174, 95, 0.12);
}

.module-seal span {
  font-family: "Noto Naskh Arabic", serif;
  font-size: 3.4rem;
  line-height: 1;
}

.module-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
  color: #f2bd69;
  font-size: 0.9rem;
  font-weight: 700;
}

.module-breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.module-breadcrumb a:hover {
  color: var(--gold-light);
}

.module-title-block h1 {
  font-family: "Cinzel", serif;
  font-size: clamp(3rem, 5.5vw, 5.6rem);
  line-height: 0.9;
  letter-spacing: 0;
  color: var(--gold-light);
  text-shadow:
    0 2px 0 rgba(69, 39, 14, 0.94),
    0 12px 32px rgba(0, 0, 0, 0.72),
    0 0 24px rgba(216, 174, 95, 0.28);
}

.module-title-block p {
  margin-top: 6px;
  color: rgba(255, 245, 218, 0.88);
  font-size: clamp(1rem, 1.8vw, 1.35rem);
}

.module-title-block p strong,
.module-title-block > span {
  color: #f2bd69;
}

.module-title-block > span {
  display: block;
  max-width: 680px;
  margin-top: 3px;
  font-size: 0.96rem;
}

.module-heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.back-to-trails,
.continue-inline {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  border: 1px solid rgba(216, 174, 95, 0.46);
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.back-to-trails {
  background: rgba(4, 13, 17, 0.54);
  color: rgba(255, 245, 218, 0.86);
}

.continue-inline {
  background: linear-gradient(135deg, #e1ac5f, #9a5d20);
  color: #180f08;
}

.back-to-trails:hover,
.continue-inline:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 22px rgba(216, 174, 95, 0.18);
}

.back-to-trails:hover {
  background: rgba(216, 174, 95, 0.12);
  color: var(--gold-light);
}

.module-overview {
  display: grid;
  grid-template-columns: 1.2fr 0.95fr 0.9fr;
  margin-bottom: 14px;
  border: 1px solid rgba(216, 174, 95, 0.42);
  border-radius: 10px;
  background:
    linear-gradient(115deg, rgba(6, 20, 27, 0.84), rgba(3, 13, 18, 0.64)),
    rgba(3, 13, 18, 0.74);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.30);
  backdrop-filter: blur(10px);
}

.module-overview article {
  min-height: 126px;
  padding: 18px 28px;
  border-right: 1px solid rgba(216, 174, 95, 0.16);
}

.module-overview article:last-child {
  border-right: 0;
}

.module-overview p,
.sidebar-card > p {
  margin-bottom: 12px;
  color: #f2bd69;
  font-weight: 700;
  font-size: 0.95rem;
}

.progress-summary,
.compact-progress-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.module-ring {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(4, 13, 17, 0.96) 56%, transparent 58%),
    conic-gradient(#d99a42 var(--progress-angle), rgba(255, 255, 255, 0.16) 0deg);
  box-shadow:
    inset 0 0 20px rgba(0, 0, 0, 0.58),
    0 0 20px rgba(216, 174, 95, 0.15);
}

.module-ring strong {
  color: var(--gold-light);
  font-family: "Cinzel", serif;
  font-size: 1.35rem;
}

.module-ring.small {
  width: 82px;
  height: 82px;
}

.module-ring.small strong {
  font-size: 1.38rem;
}

.module-progress-track {
  height: 7px;
  margin: 8px 0 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
}

.module-progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f4cd88, #c27a28);
  box-shadow: 0 0 16px rgba(216, 174, 95, 0.38);
  transition: width 0.25s ease;
}

.progress-summary strong,
.compact-progress-row strong {
  color: rgba(255, 245, 218, 0.94);
  font-size: 0.96rem;
}

.progress-summary small,
.compact-progress-row small,
.overview-time span {
  color: rgba(255, 245, 218, 0.66);
}

.overview-stage > div,
.overview-time > div {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 14px;
}

.overview-stage i,
.overview-time i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(216, 174, 95, 0.46);
  border-radius: 50%;
  color: var(--gold);
  font-size: 1.15rem;
}

.overview-stage strong,
.overview-time strong {
  color: var(--gold-light);
  font-family: "Amiri", serif;
  font-size: 1.35rem;
  line-height: 1.08;
}

.overview-stage button,
.continue-inline,
.next-card button,
.lesson-progress button,
.ghost-button,
.study-card button,
.study-card a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid rgba(216, 174, 95, 0.58);
  border-radius: 7px;
  background: rgba(44, 29, 18, 0.56);
  color: #fff0c6;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.overview-stage button {
  margin-top: 13px;
}

.overview-stage button:hover,
.continue-inline:hover,
.next-card button:hover,
.lesson-progress button:hover,
.ghost-button:hover,
.study-card button:hover,
.study-card a:hover {
  transform: translateY(-2px);
  background: rgba(216, 174, 95, 0.18);
  box-shadow: 0 0 22px rgba(216, 174, 95, 0.18);
}

.module-heading-actions .continue-inline {
  border-color: rgba(247, 221, 176, 0.52);
  background: linear-gradient(135deg, #e1ac5f, #9a5d20);
  color: #180f08;
}

.module-heading-actions .continue-inline:hover {
  background: linear-gradient(135deg, #f0c778, #b46f29);
}

.learning-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 304px);
  gap: 24px;
  align-items: start;
}

.learning-main,
.sidebar-card {
  border: 1px solid rgba(216, 174, 95, 0.36);
  border-radius: 10px;
  background:
    linear-gradient(115deg, rgba(6, 20, 27, 0.88), rgba(3, 13, 18, 0.70)),
    rgba(3, 13, 18, 0.78);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.30);
  backdrop-filter: blur(10px);
}

.module-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid rgba(216, 174, 95, 0.22);
}

.module-tabs button {
  min-height: 54px;
  border: 0;
  border-right: 1px solid rgba(216, 174, 95, 0.18);
  background: rgba(4, 13, 17, 0.38);
  color: rgba(255, 245, 218, 0.82);
  font-weight: 700;
  cursor: pointer;
}

.module-tabs button:last-child {
  border-right: 0;
}

.module-tabs button.active {
  color: var(--gold-light);
  background: rgba(216, 174, 95, 0.10);
  box-shadow: inset 0 -2px 0 var(--gold);
}

.module-tabs i {
  margin-right: 8px;
  color: var(--gold);
}

.module-panel {
  display: none;
  padding: 14px;
}

.module-panel.active {
  display: block;
}

.study-grid {
  display: grid;
  gap: 12px;
}

.study-card {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 16px;
  align-items: start;
  padding: 18px;
  border: 1px solid rgba(216, 174, 95, 0.26);
  border-radius: 10px;
  background: rgba(2, 11, 16, 0.50);
}

.study-card > i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(216, 174, 95, 0.42);
  border-radius: 50%;
  color: var(--gold);
}

.study-card h2 {
  color: var(--gold-light);
  font-family: "Amiri", serif;
  font-size: 1.35rem;
  line-height: 1.1;
}

.study-card p {
  margin: 5px 0 12px;
  color: rgba(255, 245, 218, 0.70);
}

.lesson-list {
  display: grid;
  gap: 8px;
  list-style: none;
}

.lesson-row {
  display: grid;
  grid-template-columns: 48px 142px minmax(190px, 1fr) minmax(132px, 158px) minmax(140px, 158px);
  align-items: center;
  gap: 14px;
  min-height: 82px;
  padding: 9px 12px;
  border: 1px solid rgba(216, 174, 95, 0.28);
  border-radius: 8px;
  background: rgba(3, 13, 18, 0.62);
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.lesson-row.is-current {
  border-color: rgba(216, 174, 95, 0.68);
  box-shadow: 0 0 24px rgba(216, 174, 95, 0.13);
}

.lesson-row.is-completed {
  border-color: rgba(108, 190, 122, 0.34);
}

.lesson-number,
.next-preview strong {
  color: #f2bd69;
  font-family: "Cinzel", serif;
  font-size: 1.25rem;
}

.lesson-thumb {
  position: relative;
  min-height: 62px;
  overflow: hidden;
  border: 1px solid rgba(216, 174, 95, 0.38);
  border-radius: 7px;
  background:
    radial-gradient(circle at 40% 36%, rgba(255, 230, 164, 0.22), transparent 36%),
    linear-gradient(135deg, rgba(179, 104, 35, 0.82), rgba(63, 35, 17, 0.86));
  color: #140e08;
}

.lesson-thumb span {
  position: absolute;
  inset: 4px 10px auto auto;
  font-family: "Noto Naskh Arabic", serif;
  font-size: 1.7rem;
  line-height: 1;
  opacity: 0.82;
}

.lesson-thumb i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(4, 13, 17, 0.76);
  color: var(--gold-light);
  transform: translate(-50%, -50%);
}

.lesson-thumb small {
  position: absolute;
  right: 6px;
  bottom: 5px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(4, 13, 17, 0.78);
  color: #fff2cf;
  font-size: 0.72rem;
}

.lesson-info h2 {
  color: var(--gold-light);
  font-family: "Amiri", serif;
  font-size: 1.24rem;
  line-height: 1.1;
}

.lesson-info p,
.lesson-teacher small,
.lesson-progress small {
  color: rgba(255, 245, 218, 0.66);
  font-size: 0.82rem;
  line-height: 1.35;
}

.lesson-teacher {
  display: grid;
  gap: 2px;
}

.lesson-teacher span {
  color: rgba(255, 245, 218, 0.90);
  font-weight: 700;
}

.lesson-teacher em {
  color: #f2bd69;
  font-size: 0.8rem;
  font-style: normal;
}

.lesson-progress {
  display: grid;
  gap: 4px;
}

.lesson-progress strong {
  color: #e4a94b;
  font-size: 0.88rem;
}

.lesson-row.is-completed .lesson-progress strong {
  color: #79d28a;
}

.lesson-progress button {
  min-height: 30px;
  padding-inline: 10px;
  font-size: 0.78rem;
}

.module-sidebar {
  display: grid;
  gap: 14px;
}

.sidebar-card {
  padding: 16px;
}

.sidebar-card > p i {
  margin-right: 8px;
  color: var(--gold);
}

.next-preview {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.next-preview .lesson-thumb {
  min-height: 84px;
}

.next-preview h2 {
  margin: 3px 0 8px;
  color: var(--gold-light);
  font-family: "Amiri", serif;
  font-size: 1.08rem;
  line-height: 1.12;
}

.next-preview span {
  display: block;
  color: rgba(255, 245, 218, 0.70);
  font-size: 0.8rem;
}

.next-card button,
.ghost-button {
  width: 100%;
}

.compact-progress-row {
  grid-template-columns: 92px 1fr;
}

.progress-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 15px 0;
}

.progress-stats span {
  padding: 10px;
  border: 1px solid rgba(216, 174, 95, 0.18);
  border-radius: 8px;
  color: rgba(255, 245, 218, 0.66);
  text-align: center;
  font-size: 0.78rem;
}

.progress-stats strong {
  display: block;
  color: var(--gold-light);
  font-size: 1.1rem;
}

.materials-card {
  display: grid;
  gap: 8px;
}

.materials-card a {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px;
  border: 1px solid rgba(216, 174, 95, 0.18);
  border-radius: 8px;
  color: rgba(255, 245, 218, 0.82);
  text-decoration: none;
  font-size: 0.86rem;
}

.materials-card a:hover {
  border-color: rgba(216, 174, 95, 0.46);
  background: rgba(216, 174, 95, 0.08);
}

.materials-card i,
.materials-card span {
  color: #f2bd69;
}

.materials-card span {
  font-size: 0.72rem;
}

html[data-theme="light"] .pagina-alfabeto #header,
html[data-theme="light"] .pagina-alfabeto #header.scrolled {
  background: rgba(5, 14, 18, 0.78);
  border-bottom-color: rgba(216, 174, 95, 0.16);
}

html[data-theme="light"] .pagina-alfabeto .menu-desktop a {
  color: rgba(255, 245, 218, 0.84);
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.70);
}

html[data-theme="light"] .pagina-alfabeto .menu-desktop a:hover,
html[data-theme="light"] .pagina-alfabeto .menu-desktop a.active {
  color: #fff5d8;
}

html[data-theme="light"] .pagina-alfabeto .theme-button,
html[data-theme="light"] .pagina-alfabeto .menu-toggle,
html[data-theme="light"] .pagina-alfabeto #backToTop {
  border-color: rgba(216, 174, 95, 0.42);
  background: rgba(13, 20, 21, 0.58);
  color: var(--gold-light);
}

html[data-theme="light"] .pagina-alfabeto .menu-toggle span {
  background: var(--gold-light);
}

@media (max-width: 1180px) {
  .pagina-alfabeto .menu-desktop ul {
    gap: 22px;
  }

  .pagina-alfabeto .menu-desktop a {
    font-size: 0.98rem;
  }

  .module-overview,
  .learning-layout {
    grid-template-columns: 1fr;
  }

  .module-overview article {
    border-right: 0;
    border-bottom: 1px solid rgba(216, 174, 95, 0.16);
  }

  .module-overview article:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 960px) {
  .alfabeto-page {
    --alfabeto-map-size: auto clamp(620px, 82vh, 760px);
  }

  .module-shell {
    width: min(100% - 30px, 820px);
    padding-top: clamp(258px, 31vh, 302px);
  }

  .module-heading {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    max-width: 760px;
    margin-inline: auto;
  }

  .module-title-block > span {
    margin-inline: auto;
  }

  .module-heading-actions {
    justify-content: center;
  }

  .lesson-row {
    grid-template-columns: 42px 132px minmax(190px, 1fr);
  }

  .lesson-teacher,
  .lesson-progress {
    grid-column: 3;
  }

  .module-sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .materials-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 650px) {
  .alfabeto-page {
    --alfabeto-map-size: auto clamp(640px, 82vh, 740px);
  }

  .module-shell {
    width: min(100% - 24px, 560px);
    padding-top: 252px;
  }

  .module-seal {
    width: 76px;
    height: 76px;
  }

  .module-seal span {
    font-size: 2.8rem;
  }

  .module-title-block h1 {
    font-size: clamp(2.4rem, 12vw, 3.6rem);
  }

  .module-breadcrumb {
    justify-content: center;
    flex-wrap: wrap;
  }

  .progress-summary,
  .compact-progress-row,
  .overview-stage > div,
  .overview-time > div {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .module-overview article {
    padding: 18px;
  }

  .module-heading-actions {
    width: 100%;
    margin-top: clamp(112px, 15vh, 132px);
  }

  .back-to-trails,
  .continue-inline {
    flex: 1 1 180px;
  }

  .module-tabs {
    grid-template-columns: 1fr;
  }

  .module-tabs button {
    border-right: 0;
    border-bottom: 1px solid rgba(216, 174, 95, 0.18);
  }

  .module-tabs button:last-child {
    border-bottom: 0;
  }

  .study-card,
  .lesson-row {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .lesson-row {
    padding: 16px;
  }

  .lesson-thumb {
    width: min(100%, 220px);
    min-height: 92px;
  }

  .lesson-teacher,
  .lesson-progress {
    grid-column: auto;
  }

  .lesson-progress {
    width: 100%;
  }

  .module-sidebar {
    grid-template-columns: 1fr;
  }

  .next-preview {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .module-shell {
    padding-top: 244px;
  }

  .module-title-block h1 {
    font-size: clamp(2.15rem, 12vw, 3rem);
  }
}
