/* =============================================================================
   style.css — Armenian History Guide
   Color palette:
     --beige:      #F2E5CC  (main background)
     --beige-dark: #E8D5B0  (subtle accents on beige)
     --navy:       #162040  (sidebar, header)
     --navy-light: #1E2E56  (hover states in sidebar)
     --gold:       #C4922A  (active/selected, highlights)
     --gold-light: #E8B84B  (hover on gold elements)
     --cream:      #FBF5E6  (content area background)
     --text-dark:  #1A1A1A  (main text on light backgrounds)
     --text-muted: #6B5B45  (secondary text)
     --text-light: #F0E6CC  (text on dark backgrounds)
============================================================================= */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans Armenian', sans-serif;
  background-color: #F2E5CC;
  color: #1A1A1A;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
.site-header {
  background-color: #162040;
  border-bottom: 3px solid #C4922A;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.35);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 32px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.header-logo {
  height: 64px;
  width: 64px;
  object-fit: contain;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid #C4922A;
}

.header-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.header-subtitle {
  font-family: 'Noto Sans Armenian', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: #C4922A;
  text-transform: uppercase;
}

.header-title {
  font-family: 'Noto Serif Armenian', serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: #F0E6CC;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.header-dates {
  font-family: 'Noto Sans Armenian', sans-serif;
  font-size: 0.8rem;
  font-weight: 300;
  color: #9BAABF;
  letter-spacing: 0.05em;
}

/* ---------- Layout ---------- */
.layout {
  display: flex;
  flex: 1;
  min-height: 0;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 320px;
  min-width: 280px;
  background-color: #162040;
  overflow-y: auto;
  position: sticky;
  top: 95px; /* header height */
  height: calc(100vh - 95px);
  flex-shrink: 0;
  border-right: 1px solid #C4922A33;
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-track { background: #162040; }
.sidebar::-webkit-scrollbar-thumb { background: #C4922A55; border-radius: 3px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: #C4922A; }

.sidebar-label {
  font-family: 'Noto Sans Armenian', sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: #C4922A;
  text-transform: uppercase;
  padding: 20px 22px 10px;
  border-bottom: 1px solid #ffffff10;
}

/* ---------- Navigation list ---------- */
.nav-parts {
  list-style: none;
  padding: 8px 0 24px;
}

/* PART item */
.nav-part-item {
  border-bottom: 1px solid #ffffff08;
}

.nav-part-btn {
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  padding: 13px 22px 13px 18px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  transition: background 0.18s;
  position: relative;
}

.nav-part-btn:hover {
  background-color: #1E2E56;
}

.nav-part-btn.open {
  background-color: #1A2848;
}

.nav-part-number {
  font-family: 'Noto Serif Armenian', serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: #C4922A;
  background-color: #C4922A22;
  border: 1px solid #C4922A55;
  border-radius: 4px;
  padding: 2px 7px;
  flex-shrink: 0;
  margin-top: 1px;
  letter-spacing: 0.05em;
}

.nav-part-title {
  font-family: 'Noto Sans Armenian', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: #D8C9A8;
  line-height: 1.45;
  flex: 1;
}

.nav-arrow {
  flex-shrink: 0;
  color: #C4922A88;
  font-size: 0.7rem;
  margin-top: 3px;
  transition: transform 0.22s ease;
  line-height: 1;
}

.nav-part-btn.open .nav-arrow {
  transform: rotate(90deg);
  color: #C4922A;
}

/* CHAPTERS dropdown */
.nav-chapters {
  list-style: none;
  display: none;
  background-color: #0F1929;
}

.nav-chapters.open {
  display: block;
}

/* CHAPTER item */
.nav-chapter-item {
  border-bottom: 1px solid #ffffff06;
}

.nav-chapter-btn {
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  padding: 11px 22px 11px 38px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  transition: background 0.15s;
}

.nav-chapter-btn:hover {
  background-color: #162040;
}

.nav-chapter-btn.open {
  background-color: #162040;
}

.nav-chapter-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #C4922A55;
  flex-shrink: 0;
  margin-top: 6px;
  transition: background 0.15s;
}

.nav-chapter-btn.open .nav-chapter-dot,
.nav-chapter-btn:hover .nav-chapter-dot {
  background-color: #C4922A;
}

.nav-chapter-title {
  font-family: 'Noto Sans Armenian', sans-serif;
  font-size: 0.77rem;
  font-weight: 400;
  color: #9BAABF;
  line-height: 1.4;
  flex: 1;
}

.nav-chapter-arrow {
  flex-shrink: 0;
  color: #ffffff30;
  font-size: 0.65rem;
  margin-top: 3px;
  transition: transform 0.2s ease;
}

.nav-chapter-btn.open .nav-chapter-arrow {
  transform: rotate(90deg);
  color: #C4922A88;
}

/* LESSONS dropdown */
.nav-lessons {
  list-style: none;
  display: none;
  background-color: #0A1020;
}

.nav-lessons.open {
  display: block;
}

/* LESSON item */
.nav-lesson-btn {
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  padding: 9px 18px 9px 52px;
  text-align: left;
  font-family: 'Noto Sans Armenian', sans-serif;
  font-size: 0.74rem;
  font-weight: 300;
  color: #7A8EA8;
  line-height: 1.4;
  transition: background 0.15s, color 0.15s;
  border-left: 2px solid transparent;
  display: block;
}

.nav-lesson-btn:hover {
  background-color: #111d35;
  color: #C4D4E8;
  border-left-color: #C4922A55;
}

.nav-lesson-btn.active {
  background-color: #162040;
  color: #E8B84B;
  border-left-color: #C4922A;
  font-weight: 500;
}

/* ---------- Content area ---------- */
.content {
  flex: 1;
  background-color: #FBF5E6;
  padding: 48px 56px;
  min-height: calc(100vh - 95px);
  overflow-y: auto;
}

/* ---------- Welcome screen ---------- */
.welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 50vh;
  gap: 16px;
  opacity: 0.75;
  border-radius: 12px;
  transition: background-image 0.4s ease;
  position: relative;
}

/* When a background image is set, overlay the content */
.welcome.has-bg-image {
  min-height: 70vh;
  opacity: 1;
  border-radius: 12px;
  overflow: hidden;
}

.welcome.has-bg-image::before {
  content: none;
}

.welcome.has-bg-image .welcome-icon,
.welcome.has-bg-image .welcome-title,
.welcome.has-bg-image .welcome-text {
  position: relative;
  z-index: 1;
}

.welcome.has-bg-image .welcome-title {
  color: #F0E6CC;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.welcome.has-bg-image .welcome-text {
  color: #C8B89A;
}

.welcome-icon {
  font-size: 3.5rem;
  line-height: 1;
  filter: grayscale(0.3);
}

.welcome-title {
  font-family: 'Noto Serif Armenian', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #162040;
}

.welcome-text {
  font-family: 'Noto Sans Armenian', sans-serif;
  font-size: 0.95rem;
  color: #6B5B45;
  max-width: 360px;
  line-height: 1.6;
}

/* ---------- Lesson view ---------- */
.lesson-view {
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Breadcrumb */
.lesson-breadcrumb {
  font-family: 'Noto Sans Armenian', sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  color: #9B8C6A;
  letter-spacing: 0.03em;
  margin-bottom: 14px;
  line-height: 1.5;
}

.lesson-breadcrumb span {
  color: #C4922A;
  font-weight: 500;
}

/* Lesson title */
.lesson-title {
  font-family: 'Noto Serif Armenian', serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: #162040;
  line-height: 1.35;
  margin-bottom: 20px;
}

/* Decorative divider */
.lesson-divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #C4922A, #E8B84B);
  border-radius: 2px;
  margin-bottom: 24px;
}

/* Description */
.lesson-description {
  font-family: 'Noto Sans Armenian', sans-serif;
  font-size: 0.97rem;
  font-weight: 400;
  color: #3A2E20;
  line-height: 1.8;
  margin-bottom: 36px;
  max-width: 720px;
  white-space: pre-wrap; /* preserves line breaks in description text */
}

/* Link button (optional, shown only when lesson.link exists) */
.lesson-link {
  display: none; /* shown by script when link exists */
  align-items: center;
  gap: 8px;
  background-color: #F2E5CC;
  border: 2px solid #C4922A;
  color: #162040;
  font-family: 'Noto Sans Armenian', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 8px;
  margin-bottom: 28px;
  transition: background 0.18s, transform 0.12s;
  width: fit-content;
}

.lesson-link:hover {
  background-color: #C4922A;
  color: #fff;
  transform: translateY(-1px);
}

.lesson-link-icon {
  font-size: 1rem;
  line-height: 1;
}

/* Download zone */
.download-zone {
  display: flex;
  align-items: center;
  gap: 20px;
  background-color: #162040;
  border-radius: 12px;
  padding: 22px 28px;
  max-width: 560px;
  box-shadow: 0 4px 20px rgba(22, 32, 64, 0.18);
  transition: box-shadow 0.2s;
}

.download-zone:hover {
  box-shadow: 0 6px 28px rgba(22, 32, 64, 0.28);
}

.download-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
  line-height: 1;
}

.download-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.download-label {
  font-family: 'Noto Sans Armenian', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  color: #9BAABF;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.download-filename {
  font-family: 'Noto Sans Armenian', sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  color: #D8C9A8;
  word-break: break-word;
}

/* File type badges on download icon area */
.badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
}

.badge-pptx {
  background-color: #C84B1A22;
  color: #E8854B;
  border: 1px solid #C84B1A44;
}

.badge-pdf {
  background-color: #C81A1A22;
  color: #E84B4B;
  border: 1px solid #C81A1A44;
}

/* Download button */
.download-btn {
  flex-shrink: 0;
  background-color: #C4922A;
  color: #1A1008;
  font-family: 'Noto Sans Armenian', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  padding: 11px 24px;
  border-radius: 8px;
  letter-spacing: 0.03em;
  transition: background 0.18s, transform 0.12s;
  white-space: nowrap;
}

.download-btn:hover {
  background-color: #E8B84B;
  transform: translateY(-1px);
}

.download-btn:active {
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-width: unset;
    position: static;
    height: auto;
    max-height: 45vh;
    overflow-y: auto;
    border-right: none;
    border-bottom: 2px solid #C4922A55;
  }

  .content {
    padding: 28px 22px;
  }
}

@media (max-width: 600px) {
  .header-inner {
    padding: 12px 16px;
    gap: 12px;
  }

  .header-logo {
    height: 48px;
    width: 48px;
  }

  .header-title {
    font-size: 1.15rem;
  }

  .download-zone {
    flex-wrap: wrap;
    gap: 14px;
  }

  .lesson-title {
    font-size: 1.25rem;
  }
}
/* ---------- Back button ---------- */
.back-btn {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 200;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid #C4922A;
  background-color: #162040;
  color: #C4922A;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
  transition: opacity 0.22s ease, transform 0.22s ease, background 0.15s, color 0.15s;
}

.back-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.back-btn:hover {
  background-color: #C4922A;
  color: #162040;
  transform: scale(1.08);
}

.back-btn:active {
  transform: scale(0.96);
}

/* lesson-link margin when placed after download zone */
.lesson-view .lesson-link {
  margin-top: 20px;
}

/* Hide welcome text/icon while keeping background image visible */
.welcome-icon,
.welcome-title,
.welcome-text {
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.welcome.content-hidden .welcome-icon,
.welcome.content-hidden .welcome-title,
.welcome.content-hidden .welcome-text {
  opacity: 0;
  visibility: hidden;
}

/* Header Navigation Link */
.header-nav-link {
  margin-left: auto; /* Սա հղումը հրում է դեպի աջ */
  font-family: 'Noto Sans Armenian', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: #F0E6CC;
  text-decoration: none;
  padding: 8px 18px;
  border: 1px solid #C4922A;
  border-radius: 6px;
  transition: background-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.header-nav-link:hover {
  background-color: #C4922A;
  color: #162040;
}

/* Modifier for the about page content to center it without the sidebar */
.content.about-content {
  margin: 40px auto;
  max-width: 900px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  min-height: auto;
}

.names {
  text-align: center;
  white-space: pre-line;
}