/* =====================================================
   shared.css — Primary Maths Website Design System
   ===================================================== */

/* ── 1. CSS Design Tokens ── */
:root {
  /* Brand colours */
  --color-green:        #2ecc71;
  --color-green-dark:   #27ae60;
  --color-orange:       #f39c12;
  --color-orange-dark:  #e67e22;
  --color-blue:         #3498db;
  --color-blue-dark:    #2980b9;
  --color-pink:         #ff80ab;
  --color-pink-dark:    #d81b60;
  --color-purple:       #6c5ce7;
  --color-purple-dark:  #5649c0;
  --color-red:          #e74c3c;
  --color-red-dark:     #c0392b;

  /* Year-group accent colours */
  --year1-color:   #2ecc71;   /* Year 1 – fresh green  */
  --year2-color:   #3498db;   /* Year 2 – sky blue     */
  --year3-color:   #f39c12;   /* Year 3 – warm orange  */
  --year4-color:   #9c27b0;   /* Year 4 – purple       */
  --year56-color:  #e74c3c;   /* Year 5–6 – bold red   */

  /* Typography */
  --font-main: 'Comic Sans MS', cursive, sans-serif;

  /* Surfaces */
  --bg-page: #f0f4f8;
  --bg-card: #ffffff;

  /* Navigation */
  --nav-height:  65px;
  --nav-bg:      #ffffff;
  --nav-border:  #e0e0e0;

  /* Shape */
  --radius-btn:   50px;
  --radius-card:  25px;
  --radius-input: 12px;

  /* Shadows */
  --shadow-card:       0 10px 30px rgba(0, 0, 0, 0.10);
  --shadow-btn-green:  0 4px 0 var(--color-green-dark);
  --shadow-btn-orange: 0 4px 0 var(--color-orange-dark);
  --shadow-btn-blue:   0 4px 0 var(--color-blue-dark);
  --shadow-btn-pink:   0 4px 0 var(--color-pink-dark);
  --shadow-btn-purple: 0 4px 0 var(--color-purple-dark);
  --shadow-btn-red:    0 4px 0 var(--color-red-dark);

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

/* ── 2. Base Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Topic pages: push content below the fixed nav */
body {
  padding-top: var(--nav-height);
}

/* ── 3. Site Navigation Bar ── */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--nav-bg);
  border-bottom: 3px solid var(--nav-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  font-family: var(--font-main);
}

.nav-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-green);
  color: white;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: bold;
  font-family: var(--font-main);
  box-shadow: var(--shadow-btn-green);
  transition: var(--transition-fast);
  white-space: nowrap;
}
.nav-home-btn:hover {
  background: var(--color-green-dark);
  transform: translateY(-2px);
}

.nav-title {
  font-size: 1.15rem;
  font-weight: bold;
  color: #2c3e50;
  text-align: center;
  flex: 1;
  padding: 0 14px;
  font-family: var(--font-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-topic-controls {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.nav-prev-btn,
.nav-next-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--color-blue);
  color: white;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 15px;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: bold;
  box-shadow: var(--shadow-btn-blue);
  transition: var(--transition-fast);
  white-space: nowrap;
}
.nav-prev-btn:hover,
.nav-next-btn:hover {
  background: var(--color-blue-dark);
  transform: translateY(-2px);
}

/* ── 4. Breadcrumb Bar ── */
.breadcrumb-bar {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-bottom: 2px solid #dee2e6;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-main);
  font-size: 0.88rem;
  color: #636e72;
  flex-wrap: wrap;
}

.breadcrumb-bar a {
  color: var(--color-blue);
  text-decoration: none;
  font-weight: bold;
}
.breadcrumb-bar a:hover {
  text-decoration: underline;
}

.breadcrumb-sep {
  color: #adb5bd;
}

.year-badge {
  background: var(--year-color, var(--color-green));
  color: white;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: bold;
}

.difficulty-stars {
  color: var(--color-orange);
  font-size: 1rem;
  letter-spacing: 1px;
}

/* ── 5. Shared Button Variants (additive — do not remove page-specific styles) ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 22px;
  font-size: 1rem;
  font-family: var(--font-main);
  font-weight: bold;
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: var(--transition-fast);
  color: white;
}
.btn:hover  { transform: translateY(-2px); }
.btn:active { transform: translateY(1px);  }
.btn:disabled {
  background: #bdc3c7 !important;
  box-shadow: none !important;
  cursor: not-allowed;
}

.btn-green  { background: var(--color-green);  box-shadow: var(--shadow-btn-green);  }
.btn-orange { background: var(--color-orange); box-shadow: var(--shadow-btn-orange); }
.btn-blue   { background: var(--color-blue);   box-shadow: var(--shadow-btn-blue);   }
.btn-pink   { background: var(--color-pink);   box-shadow: var(--shadow-btn-pink);   }
.btn-purple { background: var(--color-purple); box-shadow: var(--shadow-btn-purple); }
.btn-red    { background: var(--color-red);    box-shadow: var(--shadow-btn-red);    }
.btn-grey   { background: #95a5a6;             box-shadow: 0 4px 0 #7f8c8d;          }

/* ── 6. Homepage: Hero ── */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-align: center;
  padding: 70px 20px 90px;
  position: relative;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-family: var(--font-main);
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  margin-bottom: 12px;
  text-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.hero-subtitle {
  font-family: var(--font-main);
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  opacity: 0.92;
  margin-bottom: 30px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-orange);
  color: white;
  text-decoration: none;
  font-family: var(--font-main);
  font-size: 1.2rem;
  font-weight: bold;
  padding: 16px 38px;
  border-radius: var(--radius-btn);
  box-shadow: var(--shadow-btn-orange);
  transition: var(--transition-bounce);
}
.hero-cta:hover {
  background: var(--color-orange-dark);
  transform: translateY(-3px) scale(1.04);
}

/* Floating maths symbols */
.floating-symbols {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.float-sym {
  position: absolute;
  font-family: var(--font-main);
  opacity: 0.18;
  animation: floatSym 5s ease-in-out infinite;
}

@keyframes floatSym {
  0%   { transform: translateY(0)    rotate(0deg);  opacity: 0.15; }
  50%  { transform: translateY(-28px) rotate(12deg); opacity: 0.28; }
  100% { transform: translateY(0)    rotate(0deg);  opacity: 0.15; }
}

/* ── 7. Homepage: Topics Section ── */
.topics-section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 50px 20px 30px;
}

.section-heading {
  font-family: var(--font-main);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: #2c3e50;
  text-align: center;
  margin-bottom: 8px;
}

.section-subtitle {
  font-family: var(--font-main);
  text-align: center;
  color: #636e72;
  margin-bottom: 40px;
  font-size: 1.05rem;
}

.year-group {
  margin-bottom: 44px;
}

.year-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-main);
  font-size: 1.2rem;
  font-weight: bold;
  padding: 12px 22px;
  border-radius: 15px;
  margin-bottom: 16px;
  color: white;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.activity-card {
  background: white;
  border-radius: 20px;
  border: 3px solid #e8e8e8;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,0.07);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}
.activity-card:hover {
  transform: translateY(-7px);
  box-shadow: 0 16px 36px rgba(0,0,0,0.14);
}

.card-header {
  padding: 26px 20px 16px;
  text-align: center;
}

.card-emoji {
  font-size: 3rem;
  display: block;
  margin-bottom: 10px;
}

.card-title {
  font-family: var(--font-main);
  font-size: 1.15rem;
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 4px;
}

.card-fun-title {
  font-family: var(--font-main);
  font-size: 0.85rem;
  color: #636e72;
  font-style: italic;
}

.card-footer {
  padding: 12px 20px;
  border-top: 2px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fafafa;
}

.card-age {
  font-family: var(--font-main);
  font-size: 0.8rem;
  color: #636e72;
}

.card-stars {
  color: var(--color-orange);
  font-size: 0.95rem;
}

/* Coloured top border per year group */
.card-year1  { border-top: 6px solid var(--year1-color);  }
.card-year2  { border-top: 6px solid var(--year2-color);  }
.card-year3  { border-top: 6px solid var(--year3-color);  }
.card-year4  { border-top: 6px solid var(--year4-color);  }
.card-year56 { border-top: 6px solid var(--year56-color); }

/* ── 8. Homepage: Parent Section ── */
.parent-section {
  background: linear-gradient(135deg, #f8f9fa, #edf2f7);
  border-top: 4px solid #dee2e6;
  padding: 55px 20px;
}

.parent-inner {
  max-width: 940px;
  margin: 0 auto;
}

.parent-section h2 {
  font-family: var(--font-main);
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: #2c3e50;
  margin-bottom: 16px;
}

.parent-section p {
  font-family: var(--font-main);
  color: #636e72;
  line-height: 1.75;
  margin-bottom: 10px;
}

.curriculum-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.curriculum-item {
  background: white;
  padding: 16px 18px;
  border-radius: 15px;
  border-left: 5px solid var(--year-color, var(--color-blue));
  box-shadow: 0 3px 12px rgba(0,0,0,0.06);
  font-family: var(--font-main);
  color: #2c3e50;
  line-height: 1.55;
}

/* ── 9. Homepage: Footer ── */
.site-footer {
  text-align: center;
  padding: 22px 20px;
  font-family: var(--font-main);
  font-size: 0.88rem;
  color: #adb5bd;
  border-top: 2px solid #dee2e6;
  background: #f8f9fa;
}

/* ── 10. Responsive ── */
@media (max-width: 600px) {
  /* Shrink nav title on small screens */
  .nav-title {
    font-size: 0.9rem;
  }

  /* Hide text labels in nav buttons, keep arrows */
  .nav-prev-btn .nav-btn-text,
  .nav-next-btn .nav-btn-text {
    display: none;
  }

  .nav-home-btn .nav-home-text {
    display: none;
  }

  /* Single column cards */
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .curriculum-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 50px 15px 65px;
  }

  .topics-section {
    padding: 30px 15px 20px;
  }
}
