/* 
 * Alderwood Academy Custom CSS
 * A clean, Bootstrap 5.3.3 extension with custom styling
 */

/* Custom Bootstrap Theme Variables 
   These extend Bootstrap's CSS variable system */
:root {
  /* Custom colors */
  --bs-primary: #7c8a61;
  --bs-primary-rgb: 124, 138, 97;
  --bs-primary-light: #c9d5b2;
  --bs-primary-light-rgb: 201, 213, 178;
  --bs-secondary: #b0c28d;
  --bs-secondary-rgb: 176, 194, 141;
  
  /* Font families */
  --bs-font-sans-serif: 'Open Sans', system-ui, -apple-system, sans-serif;
  --bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --bs-font-heading: 'Montserrat', var(--bs-font-sans-serif);
  --bs-font-secondary: 'Bitter', serif;
  --bs-font-accent: 'Roboto', var(--bs-font-sans-serif);
  
  /* Shorthand variables for backward compatibility */
  --primary: var(--bs-primary);
  --primary-light: var(--bs-primary-light);
  --secondary: var(--bs-secondary);
  --dark: var(--bs-dark);
  --white: var(--bs-white);
  --font-primary: var(--bs-font-sans-serif);
  --font-heading: var(--bs-font-heading);
  --font-secondary: var(--bs-font-secondary);
  --font-accent: var(--bs-font-accent);
}

/* Base & Typography - Brand colors per legend (docs/brand-legend.md) */
body {
  font-family: var(--bs-font-sans-serif);
  color: #212529;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

/* Section titles - forest green, consistent across all pages */
.section-title {
  color: #4a5238;
}

/* Card titles - forest green (exclude cards with white text on dark backgrounds) */
.card-body:not(.text-white) .card-title {
  color: #4a5238;
}

/* Body/lead text - dark for readability */
.lead,
.vision-text {
  color: #212529;
}

.vision-text {
  font-size: 1.25rem;
}

h1, .h1, .hero-heading {
  font-family: var(--bs-font-heading);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h2, .h2, h3, .h3 {
  font-family: var(--bs-font-secondary);
  line-height: 1.2;
}

/* Bootstrap overrides and enhancements */
.bg-primary {
  background-color: var(--bs-primary) !important;
}

.bg-primary-light {
  background-color: var(--bs-primary-light) !important;
}

.text-primary {
  color: var(--bs-primary) !important;
}

/* Program card icons - forest green for contrast on light circle background */
.programs .card-body .rounded-circle .fas {
  color: #4a5238 !important;
}

.btn-primary {
  background-color: var(--bs-secondary);
  border-color: var(--bs-secondary);
  color: var(--bs-white);
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 12px 30px;
  transition: opacity 0.2s, background-color 0.3s;
}

.btn-primary:hover {
  background-color: #9aac7b;
  border-color: #9aac7b;
}

.btn-outline-light {
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 12px 30px;
}

.nav-link {
  font-weight: 500;
}

.dropdown-item:active {
  background-color: var(--bs-primary);
}

.letter-spacing-2 {
  letter-spacing: 2px;
}

/* Hero section styles */
.hero-heading {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subheading {
  font-family: var(--bs-font-accent);
  font-weight: 300;
  font-size: clamp(16px, 3vw, 20px);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-background {
  background-size: cover;
  background-position: center;
  min-height: 500px;
}

/* Card enhancements */
.hover-shadow {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-shadow:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

.transition {
  transition: all 0.3s ease;
}

.card .card-img-top {
  transition: transform 0.3s ease;
  object-position: center 25%;
}

.card:hover .card-img-top {
  transform: scale(1.03);
}

/* Carousel styling - aspect ratio 3/2 to avoid cropping people */
.carousel-inner {
  aspect-ratio: 3/2;
  min-height: 400px;
  max-height: 70vh;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

#exploreCarousel {
  margin-bottom: 30px;
  height: auto !important;
}

#exploreCarousel .carousel-item {
  aspect-ratio: 3/2;
  min-height: 400px;
  max-height: 70vh;
  position: relative;
}

#exploreCarousel .carousel-item img {
  object-fit: cover;
  object-position: center 25%;
  height: 100%;
  width: 100%;
}

.carousel-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.carousel-caption {
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  padding: 10px;
  bottom: 20px;
  max-width: 80%;
  margin: 0 auto;
  left: 0;
  right: 0;
  z-index: 2;
}

.carousel-control-prev,
.carousel-control-next {
  width: 10%;
  opacity: 0.7;
  z-index: 3;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  opacity: 1;
}

.carousel-indicators {
  z-index: 3;
}

/* Gallery & album images - prioritize faces when cropping */
.album-cover-image,
.gallery-image,
.image-10,
.card-img-top {
  object-position: center 25%;
}

/* Footer extras */
.hover-opacity {
  transition: opacity 0.3s ease;
}

.hover-opacity:hover {
  opacity: 0.8;
}

/* Animations */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Utility Classes */
.rounded-lg {
  border-radius: 10px;
}

.shadow-sm {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.shadow-md {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.overflow-hidden {
  overflow: hidden;
}

/* Responsive Adjustments */
@media (max-width: 767px) {
  .hero-background {
    min-height: 400px;
    background-image: url('../images/alderwood-academy-smile-happiness-fun-child-orange(p-500).webp') !important;
  }
  
  .hero-heading {
    font-size: 1.75rem;
  }
  
  .carousel-inner {
    min-height: 300px;
    max-height: 50vh;
  }
  
  .carousel-caption {
    padding: 5px;
    bottom: 10px;
  }
  
  .carousel-caption h5 {
    font-size: 0.9rem;
    margin: 0;
  }
  
  .carousel-item {
    background-position: center;
  }
  
  .btn-primary, .btn-outline-light {
    padding: 10px 20px;
    font-size: 14px;
  }
}

@media (max-width: 479px) {
  .hero-heading {
    font-size: 1.5rem;
  }
  
  .carousel-inner {
    min-height: 250px;
    max-height: 45vh;
  }
}

/* Load animation */
.loaded {
  animation: imageLoaded 0.3s ease-in-out;
}

@keyframes imageLoaded {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Image optimizations for different screen sizes */
@media (min-width: 768px) and (max-width: 991px) {
  .hero-background {
    background-image: url('../images/alderwood-academy-smile-happiness-fun-child-orange(p-800).webp') !important;
  }
}

@media (min-width: 992px) and (max-width: 1279px) {
  .hero-background {
    background-image: url('../images/alderwood-academy-smile-happiness-fun-child-orange(p-1080).webp') !important;
  }
}

/* Navbar Dropdown Animation */
.animate {
  animation-duration: 0.3s;
  animation-fill-mode: both;
}

@keyframes slideIn {
  0% {
    transform: translateY(1rem);
    opacity: 0;
  }
  100% {
    transform: translateY(0rem);
    opacity: 1;
  }
}

.slideIn {
  animation-name: slideIn;
}

.dropdown-menu {
  border-radius: 0.25rem;
  border: none;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-item {
  padding: 0.5rem 1.5rem;
  font-weight: 500;
}

.dropdown-item:hover {
  background-color: var(--bs-primary-light);
  color: var(--bs-dark);
}

/* Section 5: TEACHERS Enhancements */
#teachers {
  background-color: #f8f9fa; /* Light background for contrast */
  padding: 4rem 0; /* Add spacing around the section */
}

#teachers .hero-wrapper-3 {
  gap: 2rem; /* Add spacing between columns */
}

#teachers .hero-split-2 img {
  border-radius: 8px; /* Add rounded corners to images */
  transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smooth hover effect */
}

#teachers .hero-split-2 img:hover {
  transform: scale(1.05); /* Slight zoom on hover */
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); /* Add shadow on hover */
}

#teachers .heading-small {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  color: #7c8a61; /* Brand primary color */
  margin-bottom: 1rem;
}

#teachers .paragraph-12 {
  font-family: 'Open Sans', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #676770; /* Neutral text color */
}

#teachers .w-slider-arrow-left,
#teachers .w-slider-arrow-right {
  background-color: #7c8a61; /* Brand primary color */
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

#teachers .w-slider-arrow-left:hover,
#teachers .w-slider-arrow-right:hover {
  background-color: #b0c28d; /* Brand secondary color */
}

#teachers .w-slider-nav {
  margin-top: 1rem;
}

#teachers .w-slider-nav .w-slider-dot {
  background-color: #7c8a61; /* Brand primary color */
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

#teachers .w-slider-nav .w-slider-dot.w-active {
  background-color: #b0c28d; /* Brand secondary color */
}