/* ==========================================================================
   Citizenship and Values Education (CVE) - Stylesheet
   Modern, elegant, rounded design inspired by book covers & educational craft
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens & Variables
   -------------------------------------------------------------------------- */
:root {
  /* Fonts */
  --font-primary: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-doodle: 'Shantell Sans', cursive, sans-serif;

  /* Color Palette - Light / Warm Paper Theme */
  --bg-main: #f8f6f0;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-surface-subtle: #f2efe9;
  --bg-banner: #1e293b;

  --text-main: #192130;
  --text-muted: #576579;
  --text-subtle: #8493a5;
  --text-on-dark: #f8fafc;

  --border-light: rgba(0, 0, 0, 0.08);
  --border-focus: #0057d9;
  
  /* Grade 7 Tokens (Sage Botanical Green) */
  --g7-primary: #3d7a58;
  --g7-primary-hover: #2f6145;
  --g7-tint: #edf6f0;
  --g7-border: #c3e2d1;
  --g7-shadow: rgba(61, 122, 88, 0.18);

  /* Grade 8 Tokens (Warm Terracotta Amber) */
  --g8-primary: #ba6e24;
  --g8-primary-hover: #985719;
  --g8-tint: #fdf5ea;
  --g8-border: #f5d8b5;
  --g8-shadow: rgba(186, 110, 36, 0.18);

  /* Grade 9 Tokens (Ocean Slate Blue) */
  --g9-primary: #2b6f9a;
  --g9-primary-hover: #1f5679;
  --g9-tint: #eef6fa;
  --g9-border: #bedef2;
  --g9-shadow: rgba(43, 111, 154, 0.18);

  /* Values Palette */
  --val-respect: #de5b50;
  --val-compassion: #4e8c63;
  --val-honesty: #cf4f4f;
  --val-responsibility: #367ca7;
  --val-cooperation: #db8a2a;
  --val-truth: #c94c4c;

  /* Spacing & Radii */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(25, 33, 48, 0.04);
  --shadow-md: 0 8px 24px rgba(25, 33, 48, 0.07);
  --shadow-lg: 0 16px 40px rgba(25, 33, 48, 0.1);
  --shadow-card: 0 12px 36px rgba(25, 33, 48, 0.08), 0 2px 8px rgba(25, 33, 48, 0.04);
  --shadow-hover: 0 24px 50px rgba(25, 33, 48, 0.14), 0 4px 12px rgba(25, 33, 48, 0.06);

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --------------------------------------------------------------------------
   2. Dark Theme Overrides
   -------------------------------------------------------------------------- */
body.theme-dark {
  --bg-main: #0f172a;
  --bg-surface: #1e293b;
  --bg-surface-elevated: #283548;
  --bg-surface-subtle: #162032;
  --bg-banner: #090e1a;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --text-on-dark: #f8fafc;

  --border-light: rgba(255, 255, 255, 0.09);
  --border-focus: #38bdf8;

  --g7-tint: rgba(61, 122, 88, 0.15);
  --g7-border: rgba(61, 122, 88, 0.4);
  --g8-tint: rgba(186, 110, 36, 0.15);
  --g8-border: rgba(186, 110, 36, 0.4);
  --g9-tint: rgba(43, 111, 154, 0.15);
  --g9-border: rgba(43, 111, 154, 0.4);

  --shadow-card: 0 12px 36px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 20px 50px rgba(0, 0, 0, 0.55);
}

/* --------------------------------------------------------------------------
   3. Reset & Base Styles
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

.container {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: 24px;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --------------------------------------------------------------------------
   4. Floating Background Doodles (Atmospheric Decor)
   -------------------------------------------------------------------------- */
.bg-doodles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.doodle-shape {
  position: absolute;
  opacity: 0.12;
  font-family: var(--font-doodle);
  user-select: none;
  animation: floatDoodle 8s ease-in-out infinite alternate;
}

body.theme-dark .doodle-shape {
  opacity: 0.06;
}

.star-1 { top: 120px; left: 5%; font-size: 32px; color: var(--g8-primary); animation-delay: 0s; }
.star-2 { top: 450px; right: 8%; font-size: 28px; color: var(--g9-primary); animation-delay: 1.5s; }
.star-3 { top: 900px; left: 7%; font-size: 36px; color: var(--g7-primary); animation-delay: 3s; }
.heart-1 { top: 320px; left: 90%; font-size: 28px; color: var(--val-respect); animation-delay: 2s; }
.sparkle-1 { top: 680px; left: 12%; font-size: 24px; color: var(--g8-primary); animation-delay: 4s; }
.sparkle-2 { top: 1100px; right: 10%; font-size: 30px; color: var(--g9-primary); animation-delay: 2.5s; }

@keyframes floatDoodle {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-16px) rotate(8deg); }
}

/* --------------------------------------------------------------------------
   5. Announcement Header
   -------------------------------------------------------------------------- */
.top-banner {
  background-color: var(--bg-banner);
  color: var(--text-on-dark);
  font-size: 0.84rem;
  padding: 8px 0;
  position: relative;
  z-index: 20;
}

.top-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.banner-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.14);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background: #34d399;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.banner-text {
  flex: 1;
  color: #cbd5e1;
}

.banner-link {
  color: #38bdf8;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition-fast);
}

.banner-link:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   6. Navigation Bar
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 246, 240, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-light);
  transition: background-color var(--transition-normal);
}

body.theme-dark .site-header {
  background: rgba(15, 23, 42, 0.88);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 20px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  height: 28px;
  width: auto;
  transition: transform var(--transition-bounce);
}

.brand-link:hover .brand-logo {
  transform: scale(1.04);
}

.logo-dark-mode { display: none; }
body.theme-dark .logo-light-mode { display: none; }
body.theme-dark .logo-dark-mode { display: block; }

.brand-divider {
  width: 1px;
  height: 24px;
  background-color: var(--border-light);
}

.brand-meta {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--text-main);
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.main-nav {
  display: flex;
  align-items: center;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 8px;
}

.nav-link {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-main);
  background-color: var(--bg-surface-subtle);
}

.nav-link.active {
  color: var(--text-main);
  background-color: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Quick Search */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-subtle);
  pointer-events: none;
}

.search-box input {
  padding: 8px 14px 8px 36px;
  font-size: 0.88rem;
  font-family: inherit;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  background-color: var(--bg-surface);
  color: var(--text-main);
  outline: none;
  width: 200px;
  transition: all var(--transition-normal);
}

.search-box input:focus {
  width: 240px;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 87, 217, 0.15);
}

/* Theme Toggle Button */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background-color: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.theme-toggle:hover {
  transform: rotate(15deg);
  background-color: var(--bg-surface-subtle);
}

.moon-icon { display: none; }
body.theme-dark .sun-icon { display: none; }
body.theme-dark .moon-icon { display: block; }

/* --------------------------------------------------------------------------
   7. Hero Section
   -------------------------------------------------------------------------- */
.hero-section {
  position: relative;
  z-index: 1;
  padding: 64px 0 48px;
  text-align: center;
}

.hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 920px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.fplns-tag {
  background: #0057d9;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.badge-separator {
  color: var(--text-subtle);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin-bottom: 20px;
}

.hero-gradient-text {
  background: linear-gradient(135deg, #1e3a5f 0%, #0057d9 50%, #ba6e24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.theme-dark .hero-gradient-text {
  background: linear-gradient(135deg, #60a5fa 0%, #38bdf8 50%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.18rem);
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 760px;
  margin-bottom: 32px;
}

/* Values Cloud */
.values-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 40px;
}

.value-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.86rem;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1.5px solid transparent;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-bounce), box-shadow var(--transition-fast);
}

.value-chip:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.chip-icon {
  width: 15px;
  height: 15px;
}

.chip-respect { color: var(--val-respect); border-color: rgba(222, 91, 80, 0.25); background-color: rgba(222, 91, 80, 0.06); }
.chip-compassion { color: var(--val-compassion); border-color: rgba(78, 140, 99, 0.25); background-color: rgba(78, 140, 99, 0.06); }
.chip-honesty { color: var(--val-honesty); border-color: rgba(207, 79, 79, 0.25); background-color: rgba(207, 79, 79, 0.06); }
.chip-responsibility { color: var(--val-responsibility); border-color: rgba(54, 124, 167, 0.25); background-color: rgba(54, 124, 167, 0.06); }
.chip-cooperation { color: var(--val-cooperation); border-color: rgba(219, 138, 42, 0.25); background-color: rgba(219, 138, 42, 0.06); }
.chip-truth { color: var(--val-truth); border-color: rgba(201, 76, 76, 0.25); background-color: rgba(201, 76, 76, 0.06); }

/* Stats Ribbon */
.stats-ribbon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 16px 28px;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-divider {
  width: 1px;
  height: 28px;
  background-color: var(--border-light);
}

/* --------------------------------------------------------------------------
   8. Main Downloads Section & Cards Grid
   -------------------------------------------------------------------------- */
.downloads-section {
  position: relative;
  z-index: 1;
  padding: 48px 0 80px;
}

.section-top-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 40px;
}

.section-intro {
  max-width: 520px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 8px;
}

.section-desc {
  font-size: 0.96rem;
  color: var(--text-muted);
}

.text-center {
  text-align: center;
}

.section-badge-center {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.section-badge-center span {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  color: var(--text-main);
  background-color: var(--bg-surface-subtle);
}

.filter-btn.active {
  color: var(--text-main);
  background-color: var(--bg-main);
  box-shadow: var(--shadow-sm);
}

.grade-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.grade-7-dot { background-color: var(--g7-primary); }
.grade-8-dot { background-color: var(--g8-primary); }
.grade-9-dot { background-color: var(--g9-primary); }

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  align-items: stretch;
}

/* --------------------------------------------------------------------------
   9. Grade Card Styling
   -------------------------------------------------------------------------- */
.grade-card {
  position: relative;
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.grade-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

/* Card Glow Effect */
.card-glow-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 180px;
  opacity: 0.6;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.grade-7-theme .card-glow-bg {
  background: radial-gradient(circle at 50% -20%, rgba(61, 122, 88, 0.25), transparent 70%);
}
.grade-8-theme .card-glow-bg {
  background: radial-gradient(circle at 50% -20%, rgba(186, 110, 36, 0.25), transparent 70%);
}
.grade-9-theme .card-glow-bg {
  background: radial-gradient(circle at 50% -20%, rgba(43, 111, 154, 0.25), transparent 70%);
}

.grade-7-theme:hover { border-color: var(--g7-border); }
.grade-8-theme:hover { border-color: var(--g8-border); }
.grade-9-theme:hover { border-color: var(--g9-border); }

.card-inner {
  padding: 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
  position: relative;
  z-index: 2;
}

/* Card Header Badge */
.card-header-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.grade-pill {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.88rem;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
}

.grade-7-theme .grade-pill {
  background: var(--g7-tint);
  color: var(--g7-primary);
  border: 1px solid var(--g7-border);
}
.grade-8-theme .grade-pill {
  background: var(--g8-tint);
  color: var(--g8-primary);
  border: 1px solid var(--g8-border);
}
.grade-9-theme .grade-pill {
  background: var(--g9-tint);
  color: var(--g9-primary);
  border: 1px solid var(--g9-border);
}

.academic-level {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Book Cover Presentation */
.cover-wrapper {
  position: relative;
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.book-mockup {
  position: relative;
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1 / 1.414; /* A4 aspect ratio */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.15), 0 3px 6px rgba(0, 0, 0, 0.08);
  transition: transform var(--transition-bounce), box-shadow var(--transition-normal);
  background: #f5f2eb;
}

.grade-card:hover .book-mockup {
  transform: scale(1.03) rotate(-1deg);
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.22);
}

.book-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.book-spine {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 6px;
  background: linear-gradient(to right, rgba(0,0,0,0.3), rgba(0,0,0,0.05) 70%, transparent);
  pointer-events: none;
}

.book-glare {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(120deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 40%);
  pointer-events: none;
}

.btn-preview-cover {
  position: absolute;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.78);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(6px);
  transition: all var(--transition-fast);
}

.cover-wrapper:hover .btn-preview-cover {
  opacity: 1;
  transform: translateY(0);
}

.btn-preview-cover:hover {
  background: rgba(15, 23, 42, 0.95);
  transform: scale(1.05);
}

/* Card Body */
.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.grade-7-theme .card-subtitle { color: var(--g7-primary); }
.grade-8-theme .card-subtitle { color: var(--g8-primary); }
.grade-9-theme .card-subtitle { color: var(--g9-primary); }

.card-description {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 16px;
  flex: 1;
}

/* Pillar Tags */
.pillars-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.pillar-tag {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background-color: var(--bg-surface-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

/* --------------------------------------------------------------------------
   10. Download Action Buttons
   -------------------------------------------------------------------------- */
.download-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.download-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-fast);
}

.btn-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: transform var(--transition-bounce);
}

.download-btn:hover .btn-icon-box {
  transform: scale(1.1);
}

.btn-text-box {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.btn-primary-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.94rem;
  line-height: 1.2;
}

.btn-meta-text {
  font-size: 0.74rem;
  line-height: 1.2;
  margin-top: 2px;
}

.download-arrow {
  flex-shrink: 0;
  transition: transform var(--transition-bounce);
}

.download-btn:hover .download-arrow {
  transform: translateY(2px);
}

/* Button Variants: Print Version (Solid High-Emphasis) */
.grade-7-theme .btn-print {
  background: var(--g7-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--g7-shadow);
}
.grade-7-theme .btn-print .btn-icon-box {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}
.grade-7-theme .btn-print .btn-meta-text { color: rgba(255, 255, 255, 0.8); }
.grade-7-theme .btn-print:hover { background: var(--g7-primary-hover); transform: translateY(-2px); }

.grade-8-theme .btn-print {
  background: var(--g8-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--g8-shadow);
}
.grade-8-theme .btn-print .btn-icon-box {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}
.grade-8-theme .btn-print .btn-meta-text { color: rgba(255, 255, 255, 0.8); }
.grade-8-theme .btn-print:hover { background: var(--g8-primary-hover); transform: translateY(-2px); }

.grade-9-theme .btn-print {
  background: var(--g9-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--g9-shadow);
}
.grade-9-theme .btn-print .btn-icon-box {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}
.grade-9-theme .btn-print .btn-meta-text { color: rgba(255, 255, 255, 0.8); }
.grade-9-theme .btn-print:hover { background: var(--g9-primary-hover); transform: translateY(-2px); }

/* Button Variants: Web Version (Soft Tinted Outline / Secondary) */
.grade-7-theme .btn-web {
  background: var(--g7-tint);
  color: var(--g7-primary);
  border: 1.5px solid var(--g7-border);
}
.grade-7-theme .btn-web .btn-icon-box { background: rgba(61, 122, 88, 0.12); color: var(--g7-primary); }
.grade-7-theme .btn-web .btn-meta-text { color: var(--text-muted); }
.grade-7-theme .btn-web:hover { background: #dcefe3; transform: translateY(-2px); }

.grade-8-theme .btn-web {
  background: var(--g8-tint);
  color: var(--g8-primary);
  border: 1.5px solid var(--g8-border);
}
.grade-8-theme .btn-web .btn-icon-box { background: rgba(186, 110, 36, 0.12); color: var(--g8-primary); }
.grade-8-theme .btn-web .btn-meta-text { color: var(--text-muted); }
.grade-8-theme .btn-web:hover { background: #faebd6; transform: translateY(-2px); }

.grade-9-theme .btn-web {
  background: var(--g9-tint);
  color: var(--g9-primary);
  border: 1.5px solid var(--g9-border);
}
.grade-9-theme .btn-web .btn-icon-box { background: rgba(43, 111, 154, 0.12); color: var(--g9-primary); }
.grade-9-theme .btn-web .btn-meta-text { color: var(--text-muted); }
.grade-9-theme .btn-web:hover { background: #dcecf7; transform: translateY(-2px); }

/* --------------------------------------------------------------------------
   11. Empty Search State
   -------------------------------------------------------------------------- */
.no-results-box {
  background: var(--bg-surface);
  border: 1.5px dashed var(--border-light);
  border-radius: var(--radius-xl);
  padding: 48px 24px;
  text-align: center;
  margin-top: 20px;
}

.no-results-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.no-results-box h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 6px;
}

.no-results-box p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 20px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  background: var(--bg-surface-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--bg-main);
  border-color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   12. Version Comparison Section (Web vs Print)
   -------------------------------------------------------------------------- */
.comparison-section {
  position: relative;
  z-index: 1;
  padding: 80px 0;
  background: var(--bg-surface-subtle);
  border-block: 1px solid var(--border-light);
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  margin-top: 48px;
}

.format-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--border-light);
  padding: 36px;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-normal);
}

.format-card:hover {
  transform: translateY(-4px);
}

.format-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.format-icon-bubble {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.format-web .format-icon-bubble {
  background: var(--g9-tint);
  color: var(--g9-primary);
}

.format-print .format-icon-bubble {
  background: var(--g8-tint);
  color: var(--g8-primary);
}

.format-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
}

.format-badge-light {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-surface-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.format-summary {
  font-size: 0.94rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.format-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.format-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-main);
}

.check-icon {
  width: 18px;
  height: 18px;
  color: #10b981;
  flex-shrink: 0;
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   13. Core Values Grid
   -------------------------------------------------------------------------- */
.values-section {
  position: relative;
  z-index: 1;
  padding: 80px 0;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.value-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.value-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.value-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.val-respect { background: rgba(222, 91, 80, 0.12); }
.val-compassion { background: rgba(78, 140, 99, 0.12); }
.val-honesty { background: rgba(207, 79, 79, 0.12); }
.val-responsibility { background: rgba(54, 124, 167, 0.12); }
.val-cooperation { background: rgba(219, 138, 42, 0.12); }
.val-truth { background: rgba(201, 76, 76, 0.12); }

.value-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.value-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   14. FAQ Accordion
   -------------------------------------------------------------------------- */
.faq-section {
  position: relative;
  z-index: 1;
  padding: 60px 0 90px;
}

.faq-container {
  max-width: 840px;
}

.accordion-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 40px;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.faq-item[open] {
  border-color: var(--border-focus);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform var(--transition-normal);
  margin-left: 16px;
}

.faq-item[open] .faq-chevron {
  transform: rotate(-135deg);
  border-color: var(--border-focus);
}

.faq-answer {
  padding: 0 24px 20px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   15. Lightbox Modal
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  max-width: 780px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.95);
  transition: transform var(--transition-bounce);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-surface-subtle);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: transform var(--transition-fast);
}

.modal-close:hover {
  transform: scale(1.1) rotate(90deg);
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 28px;
  padding: 32px;
}

.modal-img-container {
  display: flex;
  justify-content: center;
}

.modal-img-container img {
  max-height: 400px;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(0,0,0,0.2);
}

.modal-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.modal-heading {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  margin: 12px 0 8px;
}

.modal-text {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* --------------------------------------------------------------------------
   16. Toast Notifications
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: #0f172a;
  color: #ffffff;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  pointer-events: auto;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.toast-success-icon {
  width: 20px;
  height: 20px;
  color: #34d399;
  flex-shrink: 0;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(20px) scale(0.9); }
}

/* --------------------------------------------------------------------------
   17. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: #090e1a;
  color: #cbd5e1;
  padding: 64px 0 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-container {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}

.footer-brand-area {
  max-width: 480px;
}

.footer-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.footer-logo {
  height: 26px;
  width: auto;
}

.footer-brand-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
}

.footer-tagline {
  font-size: 0.88rem;
  color: #94a3b8;
  line-height: 1.6;
}

.footer-heading {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links-col a {
  color: #94a3b8;
  font-size: 0.88rem;
  transition: color var(--transition-fast);
}

.footer-links-col a:hover {
  color: #38bdf8;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.82rem;
  color: #64748b;
}

.footer-a11y-badge {
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   18. Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .values-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-top {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none; /* Mobile navigation simplified */
  }
  .cards-grid {
    grid-template-columns: 1fr;
    max-width: 440px;
    margin-inline: auto;
  }
  .comparison-grid {
    grid-template-columns: 1fr;
  }
  .values-grid {
    grid-template-columns: 1fr;
  }
  .modal-body {
    grid-template-columns: 1fr;
  }
  .modal-img-container img {
    max-height: 260px;
  }
  .footer-top {
    grid-template-columns: 1fr;
  }
  .stats-ribbon {
    gap: 16px;
  }
  .stat-divider {
    display: none;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
