/* --- Root colors and fonts --- */
:root {
  --primary: #3A9468;
  --primary-dark: #2f7c57;
  --bg-light: #f7faf9;
  --text-dark: #1f2d2a;
  --text-muted: #5f6f6b;
  --white: #ffffff;
  --hero-mid: #e6f3ed;
  --hero-top: #cfe9dd;
  --footer-link-hover: #e8f5e9;
  /* Very pale green for hover */
  --light-badges: #e6f3ed;
}

/* --- Global resets --- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  color: var(--text-dark);
  background-color: var(--white);
  padding-top: 4.5rem;
}

/* --- ZEBRA UTILITIES (The only addition) --- */
.bg-light {
  background-color: var(--bg-light) !important;
}

.bg-white {
  background-color: var(--white) !important;
}

/* --- Navbar --- */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
  z-index: 1030;
  position: fixed;
  top: 0;
  width: 100%;
  padding: 0.6rem 1rem;
}

.site-logo {
  height: 48px;
}

.nav-link {
  font-weight: 500;
  color: var(--text-dark) !important;
  transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--primary) !important;
}

.navbar-toggler:focus {
  outline: 0;
  box-shadow: 0 0 0 0.15rem rgba(58, 148, 104, 0.5);
}

/* Bullet point styling (compass style) */
.list-compass {
  list-style: none;
  /* Removes default dots */
  padding-left: 0;
}

.list-compass li {
  position: relative;
  padding-left: 1.8rem;
  /* Space for the icon */
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.list-compass li::before {
  content: "\f14e";
  /* Font Awesome Compass */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: var(--primary);
  position: absolute;
  left: 0;
  top: 0.15rem;
  font-size: 1.1rem;
}

/* --- Buttons --- */
.btn-primary {
  background-color: var(--primary);
  border: 1px solid var(--primary);
  color: var(--white) !important;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  padding: 0.6rem 1.2rem;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: var(--primary-dark) !important;
  border-color: var(--primary-dark) !important;
}


.btn-outline-primary-custom {
  color: var(--primary-dark) !important;
  border: 1px solid var(--primary) !important;
  background-color: transparent;
  transition: all 0.3s ease;
  padding: 0.6rem 1.2rem;
  text-decoration: none;
  display: inline-block;
  border-radius: 0.375rem;
}

.btn-outline-primary-custom:hover,
.btn-outline-primary-custom:focus {
  color: var(--white) !important;
  background-color: var(--primary-dark) !important;
  border-color: var(--primary-dark) !important;
}

.contact-form button[type="submit"] {
  width: 33%;
  display: block;
  margin: 1rem auto 0 auto;
}

/* --- Icons --- */
.standard-icon {
  color: var(--primary);
  font-size: 1.5rem;
}

/* --- Hero Section --- */
.hero-section {
  background: linear-gradient(to top, var(--white) 0%, var(--hero-mid) 60%, var(--hero-top) 100%);
  padding: 4rem 1.5rem;
  min-height: 420px;
}

.hero-text h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--primary-dark);
}

.hero-text p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.6;
}

/* --- Profile Card --- */
.profile-card {
  border: 4px solid var(--white);
  background: var(--white);
  padding: 0.75rem;
  max-width: 320px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
  border-radius: 6px;
}

.profile-card img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 2px;
}

.profile-caption {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--primary-dark);
  text-align: center;
}

.profile-caption span {
  display: block;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
}


/* --- HERO GRID RESPONSIVE LOGIC --- */

@media (max-width: 991.98px) {
  body {
    padding-top: 3rem;
  }

  .hero-text {
    display: grid;
    grid-template-areas:
      "title"
      "image"
      "text";
    text-align: center;
  }

  .hero-text h1 {
    grid-area: title;
  }

  .hero-text .profile-card-col {
    grid-area: image;
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
  }

  .hero-description-content {
    grid-area: text;
  }

  .hero-text p {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-btns {
    justify-content: center;
  }
}

@media (min-width: 992px) {
  .hero-text {
    display: block;
  }
}

/* --- Section Titles --- */
.section-title {
  text-align: center;
  margin-bottom: 2rem;
  font-weight: 600;
  font-size: 1.75rem;
  color: var(--primary-dark);
}

/* --- Services Section --- */
.services-section {
  padding: 4rem 1.5rem;
}

.service-box {
  background: var(--white);
  border: 1px solid var(--primary);
  border-radius: 12px;
  padding: 2rem;
  height: 100%;
  transition: box-shadow 0.3s ease;
}

.service-box:hover {
  box-shadow: 0 5px 15px rgba(58, 148, 104, 0.3);
}

.service-icon {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.service-title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

/* --- Standards & Accreditation --- */
.standard-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.accreditation-logo {
  max-height: 90px;
  width: auto;
  display: block;
  margin: 0 auto;
  mix-blend-mode: multiply;
}

/* --- Testimonials --- */

/* Testimonials Styling */
.testimonial-wrapper {
  max-width: 800px;
  text-align: center;
  padding: 0 15px;
  /* Base padding for mobile */
}

.quote-icon {
  color: #2f7c57;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.testimonial-quote {
  font-style: normal;
  font-size: 1.1rem;
  color: #333;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.testimonial-author {
  margin-bottom: 0;
}

.testimonial-author strong {
  color: #2f7c57;
}

/* Controls - Centered below the text */
.testimonial-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.custom-carousel-prev,
.custom-carousel-next {
  background: none;
  border: 1px solid #2f7c57;
  color: #2f7c57;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.custom-carousel-prev:hover,
.custom-carousel-next:hover {
  background-color: #2f7c57;
  color: #ffffff;
}

.custom-carousel-prev i,
.custom-carousel-next i {
  font-size: 0.85rem;
}

/* The 'Stack' Logic: Forces the container to respect the tallest item */
.carousel-stack {
  display: grid !important;
}

.carousel-stack .carousel-item {
  grid-area: 1 / 1 / 2 / 2;
  /* Stacks all items in the first grid cell */
  display: block !important;
  /* Overrides Bootstrap display:none */
  visibility: hidden;
  /* Hides them from view but keeps their height */
  transition: opacity 0.8s ease-in-out, visibility 0.8s;
  opacity: 0;
  height: auto;
}

.carousel-stack .carousel-item.active {
  visibility: visible;
  opacity: 1;
  position: relative;
  z-index: 1;
}

/* This keeps the wrapper centered within the grid cell */
.testimonial-wrapper {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  padding: 0 40px;
}

/* Desktop Tweak */
@media (min-width: 768px) {
  .testimonial-wrapper {
    padding: 0 40px;
  }
}

/* --- Contact Section --- */
.contact-section {
  padding: 4rem 1.5rem;
}

#contact-markdown-content ul {
  list-style-type: none;
  padding-left: 0;
  text-align: center;
}

#contact-markdown-content li {
  margin-bottom: 0.5rem;
}

.contact-intro-width {
  max-width: 700px;
}

.contact-form-width {
  max-width: 600px;
}

/* Restoring the specific phone link color from your original design */
.contact-section a {
  color: var(--primary-dark);
  text-decoration: none;
}

/* --- Qualifications list --- */
#qualifications ul {
  max-width: 720px;
  margin: 0 auto;
  padding-left: 1.5rem;
  text-align: left;
  list-style-position: outside;
}

#qualifications li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

/* --- Footer --- */
.site-footer {
  background-color: var(--primary);
  padding: 2rem 0;
  color: var(--white);
}

.site-footer a {
  color: var(--white);
  text-decoration: none;
  transition: opacity 0.3s;
}

.site-footer a:hover {
  color: var(--footer-link-hover) !important;

}

/* --- BLOG ADD-ON --- */
a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-dark);
}

.pagination .page-link {
  color: var(--primary);
  border-color: var(--primary);
  background-color: transparent;
  transition: background-color 0.3s, color 0.3s;
}

.pagination .page-link:hover {
  color: var(--primary-dark);
  background-color: var(--hero-mid);
  border-color: var(--primary-dark);
}

.pagination .page-item.active .page-link {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--white);
  font-weight: 600;
  cursor: default;
}

.pagination .page-item.disabled .page-link {
  color: var(--text-muted);
  pointer-events: none;
  background-color: transparent;
  border-color: transparent;
}

.blog-title-left {
  text-align: left;
}

.blog-link-primary {
  color: var(--primary);
}

/* --- Video Caption Styling --- */
figure figcaption.text-start {
  font-style: italic !important;
  color: #6c757d;
  font-size: 0.875rem;
  /* Standard "small" size */
  text-align: left !important;
  display: block;
  margin-top: 8px;
  padding-left: 2px;
}

/* --- FIXED VIDEO SUPPORT --- */

.video-privacy-wrapper,
.video-container {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  /* Prevents horizontal overflow */
  position: relative;
}

/* We use a 'holder' to maintain the 16:9 shape BEFORE and AFTER play.
   This prevents the page jumping/resizing when the iframe loads.
*/
.video-placeholder,
.ratio-16x9 {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  /* Perfect 16:9 ratio */
  height: 0;
  background-color: #ebebeb;
}

/* This centers the privacy text inside the placeholder */
.privacy-notice {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 450px;
  margin: 0;
  z-index: 2;
}

.privacy-notice h5 {
  color: var(--primary-dark);
  font-weight: 600;
}

/* Iframe must fill the absolute space of the ratio-16x9 container */
.ratio-16x9 iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 4px;
}

/* Ensure Cloudinary HTML5 video is responsive */
.video-container video {
  display: block;
  border-radius: 4px;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

/* Sidebar positioning */
.sidebar-sticky {
  top: 110px;
}

/* Typography and color mapping */
.post-title-link {
  color: var(--primary-dark);
  text-decoration: none;
}

.post-title-link:hover {
  color: var(--primary);
}

.read-more-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.read-more-link:hover {
  color: var(--primary-dark);
}

/* Small sidebar heading */
.sidebar-heading {
  color: var(--primary-dark);
  letter-spacing: 1px;
}

/* Height for the nav spacer */
.nav-spacer {
  height: 90px;
}

/* Custom Blog Badges */
.badge-topic {
  background-color: var(--light-badges);
  color: var(--primary-dark);
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.4em 0.8em;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.75rem;
  display: inline-block;
  transition: background-color 0.3s ease;
  margin-right: 0.5rem;
}

.badge-topic:hover {
  background-color: var(--primary);
  color: var(--white);
}

/* Post title and CTA heading */
.post-heading-dark {
  color: var(--primary-dark);
}

/* --- Page styling --- */
.page-header {
  /* This preserves your exact padding */
  padding: 120px 15px 60px 15px;
}

.page-header-title {
  /* This maps the dark green to your variable */
  color: var(--primary-dark);
}

/* --- My Approach (About page only) --- */
#approach-content {
  border-left: 4px solid var(--primary);
  padding-left: 2.5rem;
  margin-left: 1rem;
}

#approach-content p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-dark);
  margin-bottom: 1.75rem;
}

#approach-content p:first-child {
  font-weight: 500;
}

@media (max-width: 575px) {
  #approach-content {
    padding-left: 1.2rem;
    margin-left: 0.2rem;
    border-left-width: 3px;
  }
}

/* --- Automated Zebra Logic & Spacing --- */

/* 1. Reset all sections to default white and consistent spacing */
section {
  background-color: var(--white);
  padding: 5rem 1.5rem;
}

/* 2. Target the 3rd, 5th, etc. sections for the light background */
section:nth-of-type(odd):not(.hero-section) {
  background-color: var(--bg-light);
}

/* 3. Protection for Hero and About Header */
.hero-section,
.page-header {
  background: linear-gradient(to top, var(--white) 0%, var(--hero-mid) 60%, var(--hero-top) 100%) !important;
  padding: 4rem 1.5rem !important;
}

/* 4. Fix for Blog Cards alignment */
#blog .container {
  padding-left: 15px;
  padding-right: 15px;
}

/* Ensure anchors land below the fixed navbar */
section[id] {
  scroll-margin-top: 5rem;
}

/* --- Consistency Fix for Blog Images & Video Thumbnails --- */

.card-img-top,
.img-fluid.rounded.shadow-sm.mb-4 {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  background-color: #ebebeb;
}

.card-img-top {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.post-body img,
.post-media-container img {
  display: block !important;
  max-width: 85% !important;
  height: auto !important;
  margin: 0 auto !important;
  /* ← Changed from 3.5rem auto */
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.post-media-container {
  margin: 4rem auto;
  text-align: center;
}

.post-media-container video,
.post-media-container .ratio {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  background-color: #000;
}

.post-body figcaption,
.post-media-container figcaption {
  margin-top: 0.8rem;
  /* ← Reduced from 1.2rem for tighter spacing */
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
}

/* --- Scoped Typography & Blockquotes (Blog & Legal Only) --- */



.post-body h2,
main.py-5 h2,
.post-body h3,
main.py-5 h3,
.post-body h4,
main.py-5 h4,
.post-body h5,
main.py-5 h5,
.post-body h6,
main.py-5 h6 {
  color: var(--primary-dark);
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
  line-height: 1.3;
}

.privacy-notice h5 {
  margin-top: 0;
}

/* H2 Style: The Green Underline */
.post-body h2,
main.py-5 h2 {
  font-size: 1.75rem;
  position: relative;
  padding-bottom: 12px;
  border-bottom: 2px solid #e6f3ed !important;
  margin-top: 3rem;
}

.post-body h3,
main.py-5 h3 {
  font-size: 1.45rem;
  font-weight: 600;
}

.post-body h4,
main.py-5 h4 {
  font-size: 1.25rem;
  color: var(--primary);
  font-weight: 600;
}



/* Paragraph spacing strictly within these containers */
.post-body p,
main.py-5 p,
.post-body li,
main.py-5 li {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

/* --- Restored Global Blockquote Styling --- */
.post-body blockquote,
main.py-5 blockquote {
  font-style: italic;
  font-size: 1.15rem;
  color: #444;
  background-color: #f8fbf9 !important;
  border-left: 5px solid var(--primary) !important;
  padding: 1.5rem 2.5rem !important;
  margin: 2.5rem 0 !important;
  border-radius: 0 8px 8px 0;
  line-height: 1.6;
}

/* Further refine YouTube privacy notice sizing on small + medium screens */
@media (max-width: 991.98px) {
  .privacy-notice {
    padding: 0.8rem 0.6rem !important;
  }

  .privacy-notice h5 {
    font-size: 0.8rem !important;
    margin-bottom: 0.6rem !important;
  }

  .privacy-notice p {
    font-size: 0.8rem !important;
    line-height: 1.3 !important;
    margin-bottom: 0.6rem !important;
  }

  .privacy-notice .btn {
    font-size: 0.7rem !important;
    padding: 0.35rem 0.6rem !important;
  }
}