/* ==========================================================================
   Camelot Primary School - Main Stylesheet
   ========================================================================== */

:root {
  --primary: #2d6a00;       /* Deep Forest Green */
  --primary-dark: #1b4300;  /* Dark Green */
  --accent: #dca300;        /* Gold / Bright Yellow */
  --accent-hover: #b88600;  /* Hover state for Gold */
  --accent-red: #8b0000;    /* Crimson Red */
  --text-dark: #1f2937;
  --text-muted: #6b7280;
  --bg-light: #f4f7f2;      /* Light soft green background */
  --white: #ffffff;
  --border: #e5e7eb;
  --max-width: 1200px;
  --radius: 12px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px; /* Adjust spacing between logo and text */
}

.logo-img {
  width: 40px;  /* Adjust width to fit your navbar design */
  height: auto; /* Maintains aspect ratio */
  object-fit: contain;
}

/* Prevent horizontal scrolling and force responsive calculations */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* Ensure all images scale down proportionally on small screens */
img, svg, canvas, video {
  max-width: 100%;
  height: auto;
}

/* Container fluid scaling */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Flexible fluid typography (scales smoothly between screen sizes) */
h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
}

p {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
}

html {
  scroll-behavior: smooth;
  font-family: 'Inter', sans-serif;
}

body {
  color: var(--text-dark);
  background-color: var(--white);
  line-height: 1.6;
}

/* --- Top Bar --- */
.top-bar {
  background-color: var(--primary-dark);
  color: var(--white);
  font-size: 0.85rem;
  padding: 0.5rem 0;
}

.top-bar-content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.top-bar i {
  color: var(--accent);
  margin-right: 0.3rem;
}

/* --- Header / Navigation --- */
.header {
  background-color: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--primary);
}

.brand-logo.white {
  color: var(--white);
}

.brand-logo i {
  font-size: 2rem;
  color: var(--accent);
}

.brand-title {
  display: block;
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1;
}

.brand-subtitle {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary);
  cursor: pointer;
}

/* --- Buttons & Badges --- */
.btn {
  display: inline-block;
  padding: 0.65rem 1.3rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  text-align: center;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-accent {
  background-color: var(--accent);
  color: var(--primary-dark);
}

.btn-accent:hover {
  background-color: var(--accent-hover);
}

.btn-outline {
  border-color: var(--white);
  color: var(--white);
}

.btn-outline:hover {
  background-color: var(--white);
  color: var(--primary);
}

.btn-block {
  width: 100%;
}

.badge {
  display: inline-block;
  background-color: rgba(220, 163, 0, 0.2);
  color: var(--primary-dark);
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* --- Hero Banner Section --- */
.hero {
  background: url('images/banner.png') no-repeat center right / cover;
  color: var(--white);
  padding: 6rem 0;
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: center;
}

.hero-layout {
  display: flex;
  align-items: center;
  width: 100%;
}

.hero-content {
  max-width: 550px; /* Keeps text aligned over the dark background section */
  text-align: left;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.25rem;
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

.hero-actions {
  display: flex;
  justify-content: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero .school-motto {
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- Stats Bar --- */
.stats-bar {
  background-color: var(--white);
  box-shadow: var(--shadow);
  margin-top: -2rem;
  position: relative;
  z-index: 10;
  border-radius: var(--radius);
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  padding: 1.5rem;
  text-align: center;
}

.stat-card h3 {
  font-size: 2rem;
  color: var(--primary);
  font-weight: 800;
}

.stat-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

/* --- Section Formatting --- */
.section {
  padding: 5rem 0;
}

.bg-light {
  background-color: var(--bg-light);
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 3rem;
}

.section-header h2 {
  font-size: 2.2rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.divider {
  width: 50px;
  height: 4px;
  background-color: var(--accent);
  margin: 0.5rem auto 1rem;
  border-radius: 2px;
}

/* ==========================================================================
   UPDATED: About Our School Section (Matching Reference Design Layout)
   ========================================================================== */

#about {
  padding: 5rem 0;
  background-color: var(--white);
}

/* Main 3-Column Split Layout */
.about-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr 0.8fr;
  gap: 2.5rem;
  align-items: center;
}

/* --- Column 1: Text Content & Left Stats --- */
.about-text-content {
  display: flex;
  flex-direction: column;
}

.about-subtitle {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.5rem;
}

.about-title {
  color: var(--primary-dark);
  font-size: clamp(2rem, 3.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.about-title span {
  color: var(--accent);
  display: block;
}

.about-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 1rem 0 1.5rem 0;
}

.about-btn {
  align-self: flex-start;
  background-color: var(--primary-dark);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  transition: var(--transition);
  margin-bottom: 2rem;
}

.about-btn:hover {
  background-color: var(--primary);
  box-shadow: var(--shadow);
}

/* Bottom Inline Stats */
.about-inline-stats {
  display: flex;
  gap: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.inline-stat {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.inline-stat i {
  font-size: 1.5rem;
  color: var(--primary);
}

.inline-stat-info h4 {
  font-size: 1.1rem;
  color: var(--primary-dark);
  font-weight: 800;
  line-height: 1;
}

.inline-stat-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- Column 2: Center Image --- */
.about-image-wrapper {
  width: 100%;
  height: 100%;
  min-height: 350px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.about-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --- Column 3: Stacked Feature Cards --- */
.about-feature-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feature-card {
  background: var(--white);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.feature-card i {
  font-size: 2rem;
  color: var(--primary);
  background: var(--bg-light);
  padding: 0.75rem;
  border-radius: 10px;
}

.feature-card-info h3 {
  font-size: 1.3rem;
  color: var(--primary-dark);
  font-weight: 800;
  line-height: 1.1;
}

.feature-card-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Responsive adjustments for the About section */
@media (max-width: 992px) {
  .about-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .about-image-wrapper {
    height: 300px;
  }

  .about-feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

/* --- Content Grids & Cards (Other Sections) --- */
.academics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.dept-card {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.dept-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.dept-card h3 {
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.dept-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.dept-header i {
  font-size: 1.5rem;
  color: var(--accent);
}

/* --- Category Filter Buttons --- */
.gallery-filters {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.filter-btn {
  background-color: var(--white);
  color: var(--text-dark);
  border: 1px solid var(--border);
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background-color: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* --- Facebook 6-Picture Grid Carousel --- */
.gallery-carousel-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.gallery-viewport {
  overflow: hidden;
  width: 100%;
  border-radius: var(--radius);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 220px);
  gap: 1.25rem;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 2.5rem) / 3);
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.gallery-item.hide {
  display: none;
}

.gallery-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background-color: var(--border);
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.gallery-card:hover img {
  transform: scale(1.06);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(45, 106, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-overlay i {
  color: var(--white);
  font-size: 2rem;
}

.gallery-card:hover .gallery-overlay {
  opacity: 1;
}

/* Carousel Arrow Buttons */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--primary);
  color: var(--white);
  border: 2px solid var(--white);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: var(--transition);
}

.carousel-arrow:hover {
  background-color: var(--accent);
  color: var(--primary-dark);
}

.prev-btn { left: -20px; }
.next-btn { right: -20px; }

/* --- UPDATED: Admissions Form Section with Fitted Banner Background --- */
.admissions-banner {
  /* Fits the banner image to cover the container width and height */
  background: url('images/admissions-banner.png') no-repeat center center / 100% 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  width: 100%;
}

.admissions-wrapper {
  display: grid;
  /* 42% left space for text over students/green area, 58% right space for the form */
  grid-template-columns: 0.85fr 1.15fr; 
  gap: 2.5rem;
  align-items: center;
  padding: 3rem 3.5rem;
}

/* Align text to the right side of the left green area so it flows smoothly towards the center */
.admissions-info {
  color: var(--white);
  padding-right: 1.5rem;
}

.admissions-info h2 {
  color: var(--white);
  font-size: 2rem;
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.admissions-info p {
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.95rem;
  line-height: 1.5;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.contact-list {
  list-style: none;
  margin-top: 1.25rem;
}

.contact-list li {
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--white);
  font-size: 0.9rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.contact-list i {
  color: var(--accent);
}

/* Placed neatly over the light blank area on the right side of the banner */
.admissions-form {
  background-color: var(--white);
  padding: 2rem 2.25rem;
  border-radius: var(--radius);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  margin-left: auto;
  max-width: 480px;
  width: 100%;
}

.admissions-form h3 {
  color: var(--primary);
  margin-bottom: 1.25rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
}

/* Responsive adjustment for Mobile/Tablets */
@media (max-width: 900px) {
  .admissions-banner {
    background-size: cover;
  }

  .admissions-wrapper {
    grid-template-columns: 1fr;
    padding: 2rem 1.5rem;
    gap: 2rem;
    background: rgba(27, 67, 0, 0.85); /* Contrast background over image on small screens */
  }

  .admissions-info {
    padding-right: 0;
    text-align: center;
  }

  .contact-list li {
    justify-content: center;
  }

  .admissions-form {
    margin: 0 auto;
  }
}

/* --- Footer --- */
.footer {
  background-color: var(--primary-dark);
  color: var(--white);
  padding-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.5rem;
  padding-bottom: 3rem;
}

.footer-links h4, .footer-contact h4 {
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--white);
  text-decoration: none;
  opacity: 0.8;
  transition: var(--transition);
}

.footer-links a:hover {
  opacity: 1;
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.7;
}

/* --- Media Queries --- */
@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-columns: calc((100% - 1.25rem) / 2);
    grid-template-rows: repeat(3, 180px);
  }
}

@media (max-width: 768px) {
  .top-bar-content {
    justify-content: center;
    text-align: center;
  }

  .mobile-toggle {
    display: block;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--white);
    flex-direction: column;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    gap: 1rem;
  }

  .nav-menu.active {
    display: flex;
  }

  .hero {
    background-position: center center;
    padding: 4rem 0;
  }

  .hero-content {
    max-width: 100%;
    text-align: center;
    background: rgba(27, 67, 0, 0.85); /* Semi-transparent overlay to ensure text readability on smaller screens */
    padding: 2rem;
    border-radius: var(--radius);
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-actions {
    justify-content: center;
  }

  /* UPDATED: Admissions Mobile Responsiveness */
  .admissions-banner {
    background-position: left center;
  }

  .admissions-wrapper {
    grid-template-columns: 1fr;
    padding: 2rem 1.5rem;
    gap: 2rem;
    background: rgba(27, 67, 0, 0.8); /* Dark contrast overlay on smaller screens so text remains readable */
  }

  .admissions-info {
    text-align: center;
  }

  .contact-list li {
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-columns: 100%;
    grid-template-rows: repeat(6, 160px);
  }
  .prev-btn { left: -10px; }
  .next-btn { right: -10px; }
}