/* ============================================================================
   CANOPUS.LK – GLOBAL UI FRAMEWORK
   Stable Hero Overlay • Safe Background • Modern Layout • No Overflow Bugs
   ============================================================================ */


/* ================================ RESET ================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html { scroll-behavior: smooth; }

img { max-width: 100%; display: block; }

a {
  text-decoration: none;
  color: inherit;
}

body {
  background: #f7f9f8;          /* SAFE background */
  color: #233230;
  overflow-x: hidden;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}


/* ============================== VARIABLES ============================== */

:root {
  --c-primary: #198754;
  --c-primary-dark: #146c43;
  --c-primary-soft: #e6f4ea;

  --c-accent: #033119;
  --c-accent-soft: #f3f6f4;

  --c-bg: #ffffff;
  --c-bg-alt: #f8faf9;

  --c-text: #233230;
  --c-text-light: #5a6c68;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-sm: 0 2px 6px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.12);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.18);
}


/* ============================== CONTAINERS ============================== */

.container {
  width: 100%;
  max-width: 1320px;
  margin: auto;
  padding: 0 20px;
}

.container-sm {
  max-width: 880px;
  margin: auto;
  padding: 0 20px;
}


/* ============================== SECTIONS ================================ */

section {
  padding-top: clamp(3rem, 6vw, 6rem);
  padding-bottom: clamp(3rem, 6vw, 6rem);
  position: relative;        /* Ensures proper stacking */
  z-index: 2;                /* ALWAYS above hero overlay */
}


/* ========================== SAFE HERO BLOCK ============================ */

.hero {
  position: relative;
  background-size: cover;
  background-position: center;
  color: #fff;

  /* dynamic hero height (prevents overlay overflow) */
  min-height: clamp(360px, 60vh, 540px);
  padding: clamp(80px, 12vw, 160px) 0;

  /* Prevent overlay from extending into next sections */
  overflow: hidden;         /* CRITICAL FIX */
  isolation: isolate;       /* CRITICAL FIX */
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;              /* Overlay sits BEHIND content (SAFE FIX) */

  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.55),
    rgba(0,0,0,0.35),
    rgba(0,0,0,0.1)
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: auto;
}

.hero-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: #fff;
}

.hero-subtext {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: #f1f1f1;
}


/* ============================== BUTTONS ================================ */

.btn {
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-block;
  transition: 0.25s ease;
  font-weight: 600;
}

.btn-success {
  background: var(--c-primary);
  color: #fff;
}
.btn-success:hover {
  background: var(--c-primary-dark);
}

.btn-outline-light {
  border: 2px solid #fff;
  background: transparent;
  color: #fff;
}
.btn-outline-light:hover {
  background: #fff;
  color: var(--c-primary);
}

.btn-outline-success {
  border: 2px solid var(--c-primary);
  color: var(--c-primary);
}
.btn-outline-success:hover {
  background: var(--c-primary);
  color: #fff;
}


/* ====================== SPECIALIZED HIGHLIGHT CARDS ===================== */

.highlight-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 30px;
  display: flex;
  gap: 25px;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease;
}

.highlight-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.highlight-card-icon {
  min-width: 90px;
  height: 90px;
  background: var(--c-primary-soft);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.highlight-card-icon img {
  width: 55px;
  height: 55px;
  object-fit: contain;
}

.highlight-card-body {
  flex-grow: 1;
}

.highlight-card-body h4 {
  color: var(--c-primary);
  font-weight: 700;
  margin-bottom: 10px;
}

.highlight-card-body p {
  color: var(--c-text-light);
  margin-bottom: 10px;
}

.highlight-card-body ul {
  margin-left: 18px;
  color: var(--c-text-light);
}

.highlight-card-action {
  margin-left: auto;
}

@media (max-width: 768px) {
  .highlight-card {
    flex-direction: column;
  }
  .highlight-card-action {
    margin-top: 15px;
    margin-left: 0;
  }
}


/* ============================== PROJECT CARDS ============================ */

.project-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.img-zoom img {
  transition: transform .4s ease;
}
.img-zoom:hover img {
  transform: scale(1.06);
}


/* ============================== UTILITIES ================================ */

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }

.bg-green-soft  { background: var(--c-primary-soft); }
.bg-accent-soft { background: var(--c-accent-soft); }
.bg-light-grey  { background: var(--c-bg-alt); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.hide-mobile { display: block; }
.show-mobile { display: none; }

@media (max-width: 576px) {
  .hide-mobile { display: none; }
  .show-mobile { display: block; }
}

/* ===============================================
   FIX: Smaller, professional typography for cards
   =============================================== */

.highlight-card-body h4 {
    font-size: 1.25rem;       /* Previously ~1.5rem */
    font-weight: 700;
    margin-bottom: 12px;
}

.highlight-card-body p {
    font-size: 0.95rem;       /* Previously ~1.1rem */
    line-height: 1.55;
    margin-bottom: 12px;
    color: #444;
}

.highlight-card-body ul {
    padding-left: 18px;
    margin-bottom: 0;
}

.highlight-card-body ul li {
    font-size: 0.92rem;       /* Previously ~1rem */
    line-height: 1.45;
    padding-bottom: 4px;
    color: #4a4a4a;
}

/* Button area spacing */
.highlight-card-action {
    align-self: center;
    margin-left: auto;
    white-space: nowrap;
}

/* MOBILE TUNING */
@media (max-width: 768px) {
    .highlight-card-body h4 {
        font-size: 1.15rem;
    }
    .highlight-card-body p,
    .highlight-card-body ul li {
        font-size: 0.9rem;
    }
}
/* ====================================================
   UNIVERSAL HERO SYSTEM – VERTICAL CENTER + RESPONSIVE
   ==================================================== */

#home-hero.hero {
    position: relative;
    width: 100%;
    min-height: 600px;                  /* Default desktop height */
    display: flex;
    align-items: center;                /* TRUE VERTICAL CENTERING */
    justify-content: center;            /* Horizontal center */
    text-align: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 0 20px;                    /* Keep side spacing only */
}

/* HERO OVERLAY */
#home-hero.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.55),
        rgba(0,0,0,0.35),
        rgba(0,0,0,0.15)
    );
    z-index: 1;
}

/* HERO CONTENT */
#home-hero .hero-content {
    position: relative;
    z-index: 2;
    max-width: 760px;
}

/* Typography – Desktop */
#home-hero .hero-title {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.25;
}

#home-hero .hero-subtext {
    font-size: 1.22rem;
    line-height: 1.6;
    opacity: 0.95;
}

/* ==============================
   MOBILE BEHAVIOR – FULL OPTIMIZATION
   ============================== */
@media (max-width: 768px) {

    #home-hero.hero {
        min-height: 480px !important;       /* Reduce height for small screens */
        background-position: top center!important;
        background-size: cover!important;
        padding: 0 16px;
    }

    #home-hero .hero-title {
        font-size: 1.95rem;
        line-height: 1.25;
    }

    #home-hero .hero-subtext {
        font-size: 1.05rem;
        line-height: 1.55;
        margin-top: 10px;
        margin-bottom: 22px;
    }

    #home-hero .btn {
        font-size: 0.95rem!important;
        padding: 10px 22px!important;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    #home-hero.hero {
        min-height: 420px!important;
    }
    #home-hero .hero-title {
        font-size: 1.7rem;
    }
    #home-hero .hero-subtext {
        font-size: 0.95rem;
    }
}

/* Reduce spacing in highlight-card lists */
.highlight-card ul li {
    margin-bottom: 6px !important;   /* Reduce bottom gap */
    line-height: 1.35 !important;    /* Tighter line height */
}

/* Optional: Reduce spacing between icon & text if needed */
.highlight-card ul li::marker {
    font-size: 0.8rem;
}

/* Footer styles */
.footer-line {
    font-size: 1rem;
    opacity: 0.95;
}

/* Social Icons */
.footer-icon {
    transition: transform 0.25s ease, opacity 0.25s ease;
    opacity: 0.9;
}

.footer-icon:hover {
    transform: translateY(-4px);
    opacity: 1;
}

/* Mobile adjustments */
@media (max-width: 576px) {
    .footer-line {
        font-size: 0.95rem;
    }
    .footer-icon {
        font-size: 1.8rem;
    }
}

/* High-contrast footer text */
.footer-line {
    font-size: 1rem;
    color: #ffffff !important;         /* Pure white, very crisp */
}

/* Email link – strong contrast + hover */
.footer-email-link {
    color: #ffffff !important;
    text-decoration: underline;
    font-weight: 600;
}

.footer-email-link:hover {
    color: #e2e2e2 !important;
}

/* Social icons */
.footer-social-icon {
    color: #ffffff !important;
    font-size: 1.9rem;
    transition: transform .25s ease, color .25s ease;
}

.footer-social-icon:hover {
    transform: translateY(-4px);
    color: #d7ffd7 !important;        /* Light pastel green hover for visibility */
}

/* Copyright */
.footer-copy {
    opacity: 0.95;
    color: #ffffff !important;
}

/* Mobile readability improvements */
@media (max-width: 576px) {
    .footer-line {
        font-size: 0.95rem;
    }
    .footer-social-icon {
        font-size: 1.8rem;
    }
}

/* === Featured Project Cards — SAME HEIGHT === */
.featured-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
}

/* Ensure images never shrink oddly */
.featured-card img {
    height: 220px;              /* fixed uniform height */
    object-fit: cover;          /* crop instead of distort */
    width: 100%;
}

/* Make card body fill remaining height */
.featured-card .card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;   /* content aligned top */
    padding: 1.3rem;
}

/* Title consistent spacing */
.featured-card h5 {
    margin-bottom: 0.6rem;
}

/* "Learn More" button always aligned bottom */
.featured-card .learn-more-btn {
    margin-top: auto;
}

/* Optional: Hover effect */
.featured-card:hover {
    transform: translateY(-8px);
    transition: 0.3s ease;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

/* ================================
   FEATURED PROJECTS — PREMIUM STYLE
   ================================ */

/* Card container */
.featured-project {
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    transition: transform .3s ease, box-shadow .3s ease;
}

/* Hover effects */
.featured-project:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.18);
}

/* Image wrapper */
.featured-project-img {
    height: 220px;
    overflow: hidden;
}

.featured-project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

/* Zoom effect on hover */
.featured-project:hover img {
    transform: scale(1.06);
}

/* Card Body */
.featured-project-body {
    flex-grow: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    text-align: center;
}

/* Category badge */
.project-tag {
    display: inline-block;
    font-size: 0.75rem;
    background: #198754;
    color: #fff;
    padding: 4px 12px;
    border-radius: 30px;
    margin-bottom: 10px;
    font-weight: 600;
}

/* Title */
.featured-project-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #124f32;
    margin-bottom: 0.4rem;
}

/* Client text */
.featured-project-client {
    font-size: 0.9rem;
    color: #6b6b6b;
    margin-bottom: auto; /* Push button down */
}

/* Button */
.featured-project .learn-more-btn {
    margin-top: 1.2rem;
}

.learn-more-btn {
    border-radius: 30px;
    padding: 6px 18px;
}

/* Fade animation */
.fade-up {
    opacity: 0;
    transform: translateY(25px);
    animation: fadeUp .6s ease forwards;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile adjustments */
@media (max-width: 576px) {
    .featured-project-img {
        height: 180px;
    }
}

/* ===================== HERO SECTION FIX ===================== */
.hero {
    position: relative;
    background-size: cover;
    background-position: center;
    color: #fff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 20px;
    min-height: 340px;
}

.hero-sm {
    min-height: 280px;
}

/* Overlay */
.hero.overlay-dark::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45); /* Reduce opacity if too dark */
    z-index: 1;
}

/* Force content on top of overlay */
.hero-content {
    position: relative;
    z-index: 2;
    opacity: 1 !important;      /* FIX TEXT INVISIBLE */
    transform: translateY(0) !important; /* FIX fade-rise interfering */
}

/* Guarantee visibility of headings */
.hero-title {
    color: #ffffff !important; 
    font-weight: 800;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5); /* Improves readability */
}

.hero-subtext {
    color: #f5f5f5 !important;
    font-size: 1.1rem;
    text-shadow: 0 1px 6px rgba(0,0,0,0.4);
}
