/* ================================================================
   АЛДАР КӨСЕ — ОБЩИЕ СТИЛИ (css/style.css)
   Подключается на всех страницах кроме главной (на главной — inline)
================================================================ */

/* ── ИМПОРТ ШРИФТОВ ──────────────────────────────────────────── */
/* Montserrat — поддерживает казахскую кириллицу (Ә,Ғ,Қ,Ң,Ө,Ұ,Ү,Һ) через cyrillic-ext */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;800;900&family=Nunito:wght@400;600;700;800;900&subset=cyrillic,cyrillic-ext&display=swap');

/* ── ПЕРЕМЕННЫЕ ──────────────────────────────────────────────── */
:root {
  --sky:        #1a9ed4;
  --sky-light:  #6dd5fa;
  --gold:       #f5c518;
  --gold-dark:  #d4a017;
  --sand:       #f0e0b0;
  --sand-dark:  #c8a96e;
  --cream:      #fffdf5;
  --text-dark:  #2c1a00;
  --text-mid:   #5a3e00;
  --inactive:   #b0b0b0;
  --navy:       #0a6fa8;
  --navy-deep:  #0d4f7c;
  --r-lg:       18px;
  --r-xl:       28px;
  --sh-card:    0 8px 32px rgba(0,0,0,.13);
  --sh-btn:     0 4px 16px rgba(245,197,24,.35);
}

/* ── БАЗА ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--cream);
  color: var(--text-dark);
  margin: 0;
  padding-top: 72px;           /* под fixed navbar */
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── НАВБАР ──────────────────────────────────────────────────── */
.navbar {
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy-deep) 50%, var(--navy) 100%);
  border-bottom: 4px solid var(--gold);
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
  padding: .4rem 1rem;
}

.navbar-brand {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gold) !important;
  text-shadow: 0 2px 6px rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  gap: .45rem;
  text-decoration: none;
  line-height: 1.2;
}
.brand-star {
  display: inline-block;
  animation: spin-slow 8s linear infinite;
}

.navbar-toggler {
  border-color: var(--gold);
  background: rgba(245,197,24,.12);
}
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(245,197,24,1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-nav .nav-link,
.navbar-nav .dropdown-toggle {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: .88rem;
  color: #ddeeff !important;
  padding: .5rem .75rem !important;
  border-radius: 8px;
  transition: background .2s, color .2s, transform .15s;
  white-space: nowrap;
}
.navbar-nav .nav-link:hover,
.navbar-nav .dropdown-toggle:hover,
.navbar-nav .nav-link.active {
  background: rgba(245,197,24,.2);
  color: var(--gold) !important;
  transform: translateY(-1px);
}

.dropdown-menu {
  background: linear-gradient(135deg, var(--navy-deep), var(--navy));
  border: 2px solid var(--gold);
  border-radius: var(--r-lg);
  box-shadow: 0 12px 36px rgba(0,0,0,.35);
  padding: .5rem;
  min-width: 240px;
}
.dropdown-item {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: .86rem;
  color: #ddeeff !important;
  border-radius: 8px;
  padding: .5rem .9rem;
  transition: background .18s, color .18s;
  white-space: normal;
  line-height: 1.35;
}
.dropdown-item:hover,
.dropdown-item:focus {
  background: rgba(245,197,24,.25);
  color: var(--gold) !important;
}

/* ── ОБЩИЕ СТРАНИЧНЫЕ ОБЁРТКИ ────────────────────────────────── */
.page-body {
  padding: 1rem 0 4rem;
  background: var(--cream);
}

/* Шапка секции */
.section-title-wrap  { text-align: center; margin-bottom: 2.2rem; }
.section-heading {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1.55rem, 5vw, 2.5rem);
  font-weight: 800;
  color: var(--navy);
  display: inline-block;
}
.section-heading::after {
  content: '';
  display: block;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--gold), var(--sky));
  margin-top: 5px;
}
.section-subtitle { font-size: 1rem; color: var(--text-mid); margin-top: .3rem; }

/* ── КАРТОЧКА СКАЗКИ ─────────────────────────────────────────── */
.tale-card {
  background: #fff;
  border-radius: var(--r-xl);
  box-shadow: var(--sh-card);
  padding: 2rem 2.2rem;
  border: 2px solid var(--sand);
  position: relative;
  overflow: hidden;
}
.tale-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--gold), var(--sky), var(--gold));
}

.tale-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--text-dark);
  font-size: .78rem;
  font-weight: 800;
  border-radius: 50px;
  padding: .2rem .9rem;
  margin-bottom: .8rem;
  letter-spacing: .8px;
  text-transform: uppercase;
}
.tale-title {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 1rem;
  line-height: 1.3;
}
.tale-text {
  font-size: 1.05rem;
  line-height: 1.9;
  color: #333;
}

/* ── АУДИОПЛЕЕР ──────────────────────────────────────────────── */
.audio-block {
  background: linear-gradient(135deg, #e8f4fd, #d4eaf7);
  border-radius: var(--r-lg);
  padding: 1.2rem 1.5rem;
  margin-top: 1.8rem;
  border: 2px solid var(--sky);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.audio-label {
  font-weight: 800;
  color: var(--navy);
  font-size: .95rem;
  display: flex;
  align-items: center;
  gap: .4rem;
  white-space: nowrap;
}
.audio-block audio {
  flex: 1;
  min-width: 180px;
  border-radius: 8px;
}

/* ── ВИДЕОБЛОК ───────────────────────────────────────────────── */
.video-label {
  font-weight: 800;
  color: var(--navy);
  font-size: .95rem;
  margin-bottom: .6rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.video-wrap {
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 3px solid var(--gold);
  box-shadow: 0 8px 28px rgba(0,0,0,.14);
}

/* ── ИГРА (LearningApps) ─────────────────────────────────────── */
.game-card {
  background: #fff;
  border-radius: var(--r-xl);
  box-shadow: var(--sh-card);
  padding: 1.6rem;
  border: 3px solid var(--gold);
  position: relative;
  overflow: hidden;
}
.game-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 6px;
  background: linear-gradient(90deg, var(--sky), var(--gold), var(--sky));
}
.game-card-title {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  font-weight: 800;
  color: var(--navy);
  text-align: center;
  margin-bottom: 1.2rem;
}
.game-iframe {
  width: 100%;
  min-height: 520px;
  border: none;
  border-radius: var(--r-lg);
  background: #f0f4ff;
  display: block;
}

/* ── АЛФАВИТ ─────────────────────────────────────────────────── */
.alpha-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: .9rem;
}

/*
  ===================================================================
  УПРАВЛЕНИЕ АКТИВНЫМИ БУКВАМИ
  ===================================================================
  АКТИВНАЯ буква:   class="letter active"  + data-letter="A" + data-img="img/A.png"
    → Золотая, кликабельная, открывает модальное окно.

  НЕАКТИВНАЯ буква: class="letter"  (без слова 'active')
    → Серая, некликабельная.

  АКТИВИРОВАТЬ: добавьте 'active' и data-letter, data-img
  ДЕАКТИВИРОВАТЬ: уберите 'active'
  ===================================================================
*/
.letter {
  aspect-ratio: 1;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  user-select: none;
  position: relative;
  transition: transform .18s, box-shadow .18s;
  border: 3px solid transparent;
}
.letter:not(.active) {
  background: #e8e8e8;
  color: var(--inactive);
  border-color: #d0d0d0;
  cursor: default;
}
.letter.active {
  background: linear-gradient(135deg, var(--gold) 0%, #ffd700 60%, var(--gold-dark) 100%);
  color: var(--text-dark);
  border-color: var(--gold-dark);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(245,197,24,.4);
}
.letter.active:hover {
  transform: scale(1.12) rotate(-3deg);
  box-shadow: 0 8px 28px rgba(245,197,24,.6);
  border-color: var(--navy);
}
.letter.active:active { transform: scale(.95); }
.letter.active::after {
  content: '★';
  position: absolute;
  font-size: .5rem;
  top: 6px; right: 8px;
  color: var(--navy);
}

/* ── МОДАЛЬНОЕ ОКНО (буква) ──────────────────────────────────── */
.letter-modal .modal-content {
  border-radius: var(--r-xl);
  border: 3px solid var(--gold);
  overflow: hidden;
  background: var(--cream);
}
.letter-modal .modal-header {
  background: linear-gradient(135deg, var(--navy), #0d5e8a);
  border-bottom: 3px solid var(--gold);
  padding: 1rem 1.5rem;
}
.letter-modal .modal-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--gold);
}
.letter-modal .btn-close { filter: invert(1) sepia(1) saturate(5) hue-rotate(5deg); }
.letter-modal .modal-body { text-align: center; padding: 2rem; }
.letter-modal-img {
  max-width: 100%; max-height: 320px;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  object-fit: contain;
}
.letter-placeholder {
  width: 240px; height: 240px;
  margin: 0 auto;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, #e8f4fd, #d4eaf7);
  border: 3px dashed var(--sky);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--navy);
}
.letter-placeholder .big-ltr {
  font-family: 'Montserrat', sans-serif;
  font-size: 6rem; font-weight: 900;
  color: var(--gold); line-height: 1;
  text-shadow: 0 4px 12px rgba(245,197,24,.4);
}
.letter-placeholder p { font-size: .82rem; font-weight: 700; margin: .5rem 0 0; opacity: .7; }

/* ── КНОПКА НАЗАД ────────────────────────────────────────────── */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: transparent;
  border: 2px solid var(--navy);
  color: var(--navy);
  font-weight: 800;
  font-size: .92rem;
  border-radius: 50px;
  padding: .5rem 1.4rem;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  transition: background .2s, color .2s, transform .15s;
  margin-bottom: 2rem;
  text-decoration: none;
}
.btn-back:hover {
  background: var(--navy);
  color: #fff;
  transform: translateX(-4px);
}

/* ── FOOTER ──────────────────────────────────────────────────── */
.site-footer {
  background: linear-gradient(90deg, #0a2a4a 0%, var(--navy) 50%, #0a2a4a 100%);
  color: rgba(255,255,255,.72);
  text-align: center;
  padding: 1.4rem 1rem;
  font-size: .86rem;
  border-top: 3px solid var(--gold);
  margin-top: auto;
}
.site-footer span { color: var(--gold); font-weight: 700; }

/* ── АНИМАЦИИ ────────────────────────────────────────────────── */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fade-up .5s ease both; }

/* ── АДАПТИВ ─────────────────────────────────────────────────── */
/* Планшет */
@media (max-width: 992px) {
  body { padding-top: 68px; }
  .tale-card { padding: 1.6rem 1.4rem; }
}

/* Мобильный */
@media (max-width: 768px) {
  body { padding-top: 65px; }
  .tale-card  { padding: 1.2rem 1rem; }
  .tale-text  { font-size: 1rem; }
  .audio-block { flex-direction: column; align-items: flex-start; }
  .audio-block audio { min-width: 100%; }
  .game-iframe { min-height: 400px; }
  .alpha-grid { grid-template-columns: repeat(auto-fill, minmax(66px,1fr)); gap: .65rem; }
  .letter { font-size: 1.5rem; }
}

/* Маленькие телефоны */
@media (max-width: 480px) {
  .navbar-brand { font-size: 1.2rem; }
  .alpha-grid { grid-template-columns: repeat(auto-fill, minmax(55px,1fr)); gap: .5rem; }
  .letter { font-size: 1.3rem; }
  .game-iframe { min-height: 340px; }
}

/* Скроллбар */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--sand-dark); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--navy); }
