/* style.css - green & white palette */
:root{
  --brand-green: #007a3d; /* Nigerian green-ish */
  --brand-green-dark: #00592a;
  --brand-white: #ffffff;
  --muted:#6c757d;
}

body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; }

/* Hero slide */
.hero-slide{
  height: 65vh;
  background-size: cover;
  background-position: center;
  position: relative;
}
.hero-slide .overlay{
  position:absolute; inset:0; background: rgba(0,0,0,0.35);
}
.carousel-caption { position: absolute; left: 3rem; bottom: 3rem; text-align:left; }
.carousel-caption h1{ font-weight:700; color:var(--brand-white); text-shadow:0 2px 8px rgba(0,0,0,0.6);}
.carousel-caption p { color: rgba(255,255,255,0.95); }

/* nav */
.navbar .brand-text { font-weight:700; color:var(--brand-green); }
.navbar .btn-success { background:var(--brand-green); border-color:var(--brand-green); }

/* cards - subtle lift on hover + smooth transform */
.card { border-radius: 12px; }
.service-card, .instrument-card, .hod-card { transition: transform .25s ease, box-shadow .25s ease; }
.service-card:hover, .service-card.card-focus, .instrument-card:hover, .hod-card:hover {
  transform: translateY(-10px) rotate3d(0,0,0,0deg);
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

/* gallery */
.gallery-img{ width:100%; height:200px; object-fit:cover; border-radius:8px; }

/* small helpers */
.lead { color:var(--muted); }
.section-heading { font-weight:700; margin-bottom:1rem; color:var(--brand-green-dark); }

/* responsive tweaks */
@media (max-width:768px){
  .carousel-caption { left:1rem; right:1rem; bottom:2rem; text-align:center; }
}
/* ---------- Header & menu styles ---------- */
.header-brand {
  background: linear-gradient(90deg, var(--brand-green), #0b8a48);
  color: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}
.header-brand .navbar-brand .brand-text { color: #fff; font-weight:700; letter-spacing:0.2px; }
.header-brand .navbar-brand img { filter: none; }

/* nav links */
.header-brand .nav-link {
  color: rgba(255,255,255,0.95);
  margin: 0 .5rem;
  position: relative;
  transition: color .18s ease, transform .18s ease;
  padding-bottom: 8px;
  font-weight:500;
}
.header-brand .nav-link:hover,
.header-brand .nav-link:focus {
  color: #fff;
  transform: translateY(-3px);
}

/* animated underline */
.header-brand .nav-link::after{
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 3px;
  background: rgba(255,255,255,0.95);
  transition: width .22s ease, left .22s ease;
  transform: translateX(-50%);
  border-radius: 3px;
}
.header-brand .nav-link:hover::after,
.header-brand .nav-link:focus::after {
  width: 48%;
}

/* Get Quote button (white pill) */
.header-brand .btn-quote {
  background: #fff;
  color: var(--brand-green);
  border-radius: 28px;
  padding: 0.5rem 1.05rem;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  transition: transform .16s ease, box-shadow .16s ease;
}
.header-brand .btn-quote:hover,
.header-brand .btn-quote:focus {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.16);
  text-decoration: none;
}

/* Toggler color for small screens */
.header-brand .navbar-toggler-icon { filter: invert(1) brightness(1.2); }

/* ---------- Welcome ad (bottom-right, animated) ---------- */
.welcome-ad {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 320px;
  z-index: 1080;
  border-radius: 12px;
  overflow: hidden;
  transform: translateY(20px) scale(.98);
  opacity: 0;
  transition: transform .4s cubic-bezier(.2,.9,.3,1), opacity .35s ease;
  box-shadow: 0 18px 45px rgba(0,0,0,0.18);
}
.welcome-ad.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.welcome-ad.hide {
  opacity: 0;
  transform: translateY(20px) scale(.96);
}

/* inner content */
.welcome-ad-inner {
  display:flex;
  gap: .6rem;
  align-items:center;
  background: #fff;
  padding: 0.9rem 1rem;
}
.welcome-ad .welcome-content h6 { margin:0 0 .25rem 0; color:var(--brand-green-dark); font-weight:700; }
.welcome-ad .welcome-content p { margin:0; font-size:13px; color:#495057; }

/* close button */
.close-ad {
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #777;
  padding: 0 6px;
  cursor: pointer;
  margin-left: auto;
}
.close-ad:hover { color: #333; }

/* CTA link inside ad */
.welcome-ad .link-cta {
  color: var(--brand-green);
  font-weight:700;
  text-decoration: underline;
}

/* responsive: reduce size on very small screens */
@media (max-width: 420px) {
  .welcome-ad { width: 92%; left: 4%; right: 4%; bottom: 12px; }
  .header-brand .nav-link { display:none; } /* optional: reduce nav clutter */
}
/* responsive: adjust nav & welcome ad on very small screens */
@media (max-width: 420px) {
  /* keep nav links visible but stacked inside the collapse on mobile */
  .header-brand .navbar-collapse { background: linear-gradient(180deg,var(--brand-green), #0b8a48); padding: .75rem; border-radius: 8px; }
  .header-brand .nav-link { display: block; padding: .45rem 0; color: #fff !important; }
  .header-brand .nav-item { width:100%; }
  .header-brand .btn-quote { display:block; width:100%; text-align:center; margin-top:.5rem; }

  /* welcome ad responsive sizing */
  .welcome-ad { width: 92%; left: 4%; right: 4%; bottom: 12px; }
}
    /* alternate about background that matches green/white palette */
    .bg-about-green { background: linear-gradient(90deg, #0b7a3d, #006233); } /* darker green gradient */
    .text-white-90 { color: rgba(255,255,255,0.92); }

    /* certification thumbnails - no gaps look */
.cert-thumb { object-fit: contain; background:#fff; padding:6px; }

    @media (min-width: 992px) {
      .cert-thumb { height: 200px; } /* larger on desktop */
    }

    /* make carousel controls clearly visible on green background */
    .visible-control {
      width: 48px;
      height: 48px;
      top: 50%;
      transform: translateY(-50%);
      background: #ffffff;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0.98;
      box-shadow: 0 10px 25px rgba(0,0,0,0.15);
      border: none;
    }
    .visible-control .carousel-control-prev-icon,
    .visible-control .carousel-control-next-icon {
      filter: invert(0.1) sepia(1) saturate(10) hue-rotate(90deg); /* try to tint icon to green; optional */
      width: 20px;
      height: 20px;
      background-size: 100% 100%;
    }
    .carousel-control-prev { left: 10px; }
    .carousel-control-next { right: 10px; }

    /* ensure carousel touches container edges when using g-0 */
    #certCarousel .carousel-item { padding: 0; }
    #certCarousel .row.g-0 > [class*='col-'] { padding: 0; }

    /* card spacing: remove card borders so images align edge-to-edge */
    .cert-card { border-radius: 0; overflow: hidden; }
/* Smaller heights on small screens */
@media (max-width: 576px) {
  .cert-thumb-wrap { aspect-ratio: 3 / 2; } /* narrower on phones, optional */
}	
/* Commission slider - edge-to-edge 4-per-slide */
#commissionCarousel .row.g-0 > [class*='col-'] { padding: 0; }
.commission-thumb { width:100%; height:180px; object-fit:cover; display:block; }
@media (min-width: 992px) { .commission-thumb { height:220px; } }

/* reuse visible-control class for the commission carousel controls */
.visible-control { width:48px; height:48px; top:50%; transform:translateY(-50%); background:#fff; border-radius:50%; box-shadow:0 10px 25px rgba(0,0,0,0.15); border:none; z-index:2; }
.carousel-control-prev { left:10px; }
.carousel-control-next { right:10px; }

/* make commission cards flush to container edges */
#commissionCarousel .card { border-radius:0; overflow:hidden; border:0; }


/* =========================
   Mobile fit / overflow fixes
   Paste at end of style3.css
   ========================= */

/* safer box model everywhere */
*, *::before, *::after { box-sizing: border-box; }

/* Prevent accidental horizontal scroll on small screens */
html, body {
  max-width: 100%;
  overflow-x: hidden; /* hide any accidental overflow */
}

/* Make all media responsive by default */
img, picture, svg, video, iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Ensure cards, thumbnails and gallery images don't overflow */
.card, .card-img-top, .gallery-thumb, .commission-thumb, .cert-thumb, .product-thumb, .team-thumb {
  max-width: 100%;
  overflow: hidden;
  word-wrap: break-word;
}

/* Carousel slides: remove gutters inside slides to avoid overflow from padding */
#commissionCarousel .carousel-item .col-6,
#commissionCarousel .carousel-item .col-md-3,
#certCarousel .carousel-item .col-12,
#certCarousel .carousel-item .col-sm-6,
#commissionCarousel .carousel-item > .row > [class*="col-"] {
  padding-left: 0;
  padding-right: 0;
}

/* Fix for any element that may be using 100vw (100vw + scrollbar causes overflow) */
.w-100vw, .full-vw {
  width: 100%;
  max-width: 100%;
}

/* Limit oversized fixed / absolute elements (like overlays, hero backgrounds) */
.fixed-overlay, .hero-bg, .dept-hero, .dept-hero .overlay {
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Nav / header fixes */
.header-brand .navbar, .navbar {
  overflow-x: visible; /* if you used off-canvas or dropdowns, keep visible */
}

/* Prevent very long text from forcing width */
body, .card, p, h1, h2, h3, h4, h5, h6 {
  word-break: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
}

/* Make iframes responsive if not already handled */
.ratio iframe, iframe {
  max-width: 100%;
}

/* Make large controls scale on small screens */
.carousel-control-prev, .carousel-control-next {
  width: 44px;
  height: 44px;
  top: 50%;
  transform: translateY(-50%);
}

/* Make navbar collapse menu scrollable on very small screens */
.navbar-collapse {
  -webkit-overflow-scrolling: touch;
  overflow-x: auto;
}

/* WhatsApp floating button fix for tiny screens */
.floating-whatsapp {
  right: 14px;
  bottom: 14px;
}

/* Tiny helpers for small screens */
@media (max-width: 576px) {
  /* reduce large paddings that could cause overflow */
  .container, .container-fluid { padding-left: 12px; padding-right: 12px; }

  /* ensure hero background doesn't extend horizontally */
  .dept-hero, header.dept-hero { margin-left: 0; margin-right: 0; padding-left: 12px; padding-right: 12px; }

  /* make navbar toggler always on top */
  .navbar-toggler { z-index: 1200; }

  /* if carousel controls overlap or push content, make them smaller */
  .carousel-control-prev, .carousel-control-next { width: 36px; height:36px; }

  /* Ensure gallery / thumbnails fit */
  .commission-thumb { height: 160px; padding: 6px; object-fit: contain; }
  .gallery-thumb { height: 140px; object-fit: cover; }
}

/* final safety: limit any direct element accidentally set to >100vw */
*[style*="width:100vw"], *[style*="100vw"] {
  max-width: 100% !important;
  width: 100% !important;
}
/* MOBILE: move project buttons to next line and avoid stretching
   Paste at end of your stylesheet (style3.css) */
@media (max-width: 576px) {
  /* Target the exact header row in your #projects section */
  #projects > .container > .d-flex.justify-content-between.align-items-center.mb-3 {
    flex-wrap: wrap;   /* allow children to wrap */
    gap: .5rem;        /* small vertical gap when wrapped */
  }

  /* Make the left writeup take a full row so buttons fall onto next row */
  #projects > .container > .d-flex.justify-content-between.align-items-center.mb-3 > div:first-child {
    flex: 1 1 100%;
    min-width: 100%;
  }

  /* Keep each button wrapper sized to content (so buttons don't stretch to 100%) */
  #projects > .container > .d-flex.justify-content-between.align-items-center.mb-3 > .d-flex {
    flex: 0 1 auto;
    width: auto;
  }

  /* Make the buttons share the next line side-by-side but not full width */
  #projects > .container > .d-flex.justify-content-between.align-items-center.mb-3 .btn {
    display: inline-block;
    width: calc(50% - 6px); /* two buttons side-by-side with a small gap */
    min-width: 120px;       /* prevents extremely narrow buttons */
    white-space: normal;    /* allow wrapping of long labels */
  }

  /* Add a small spacing between the two button wrappers */
  #projects > .container > .d-flex.justify-content-between.align-items-center.mb-3 > .d-flex + .d-flex {
    margin-left: 6px;
  }

  /* Ensure buttons won't push horizontally when text is long */
  #projects .btn { box-sizing: border-box; }

  /* Slightly reduce the image height on small screens to avoid pushing layout */
  #projects .commission-thumb { height: 160px; padding: 6px; }
}
