/* ============================================================
   CARING NATURE – style.css
   Bootstrap 5.3 + custom styles
   Font: Poppins (Google Fonts)
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --color-primary-dark:    #004c50;
  --color-text-dark:       #242c3d;
  --color-card-bg:         #edeff1;
  --font-main:             'Poppins', sans-serif;
}

/* ---------- Global ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-family: var(--font-main);
  color: var(--color-text-dark);
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  color: var(--color-text-dark);
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
}

img { max-width: 100%; }

/* ---------- HEADER ---------- */
.site-header {
  position: relative;
  z-index: 100;
}

.site-header .navbar {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.logo-img {
  max-width: 275px;
  height: auto;
}

/* Nav links */
.navbar-nav .nav-link {
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-dark);
  padding: 0.4rem 0.6rem;
  transition: color 0.2s;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--color-primary-dark);
}
.navbar-nav .dropdown-toggle::after {
  margin-left: 0.4em;
}

/* Dropdown */
.dropdown-menu {
  border: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  border-radius: 0.5rem;
  padding: 0.5rem 0;
  min-width: 200px;
}
.dropdown-item {
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 400;
  padding: 0.55rem 1.2rem;
  color: var(--color-text-dark);
  transition: background 0.15s, color 0.15s;
}
.dropdown-item:hover {
  background: var(--color-card-bg);
  color: var(--color-primary-dark);
}

/* Hamburger icon override */
.navbar-toggler:focus { box-shadow: none; }

/* Mobile nav panel: detach from logo with top padding */
@media (max-width: 991.98px) {
  .navbar-collapse {
    padding-top: 15px;
  }
}

/* ============================================================
   HERO – Desktop
   ============================================================ */
.hero-section {
  position: relative;
  width: 100%;
  /* Use flex-grow to fill remaining space between header and footer */
  flex: 1 0 0;
  min-height: 480px;
  background-image: url("/images/home-background.webp");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  overflow: hidden;
}




/* Title band */
.hero-title-band {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 76, 80, 0.90);
  padding: 1.25rem 0;
  text-align: center;
  z-index: 10;
}
.hero-title {
  font-family: var(--font-main);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.2rem;
  line-height: 1.2;
}
.hero-subtitle {
  font-family: var(--font-main);
  font-size: clamp(1rem, 1.8vw, 1.3rem);
  font-weight: 400;
  color: rgba(255,255,255,0.88);
  margin: 0;
}

/* Buttons wrapper covers the full hero area */
.hero-buttons-wrapper {
  position: absolute;
  inset: 0;
  z-index: 5;
}

/* Theme buttons – desktop positioned */
.theme-btn {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 2px solid #fff;
  border-radius: 4px;
  padding: 0.55rem 0.85rem;
  height: 2.75rem; /* fixed height — all buttons identical */
  font-family: var(--font-main);
  font-size: clamp(0.8rem, 1.1vw, 1rem);
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  transition: transform 0.15s, box-shadow 0.15s;
  transform: translate(-50%, -50%);
}
.theme-btn:hover {
  transform: translate(-50%, -50%) scale(1.05);
  box-shadow: 0 4px 18px rgba(0,0,0,0.4);
}

.theme-btn__icon img {
  display: block;
}

.theme-btn__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #fff;
  color: var(--color-primary-dark);
  font-size: 0.8rem;
  font-weight: 700;
  margin-left: 0.25rem;
  flex-shrink: 0;
}


/* ============================================================
   MOBILE LAYOUT
   ============================================================ */
.mobile-title-band {
  background: rgba(0, 76, 80, 0.90);
  padding: 1.25rem 1rem;
  text-align: center;
}
.mobile-title {
  font-family: var(--font-main);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.3rem;
}
.mobile-subtitle {
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 400;
  color: rgba(255,255,255,0.88);
  margin: 0;
}

.mobile-illustration {
  overflow: hidden;
  /* Block height stays the same as before — natural image ratio on full width ~56% */
  /* We just zoom and reposition within that same bounding box */
}

.mobile-illustration img {
  display: block;
  width: 100%;
  height: auto;
  /* Zoom in ~1.6× and shift right+down to centre on the green buildings */
  /* The green cluster sits roughly at 53% X, 30% Y of the full image */
  transform: scale(1.5) translate(5%, -15%);
  transform-origin: center top;
}

/* Mobile theme buttons */
.mobile-theme-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: none;
  border-radius: 4px;
  padding: 0.9rem 1rem;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  transition: opacity 0.15s;
}
.mobile-theme-btn:hover { opacity: 0.9; }

.mobile-btn-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.mobile-btn-label {
  flex: 1;
}

.mobile-btn-count {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #fff;
  color: var(--color-primary-dark);
  font-size: 0.9rem;
  font-weight: 700;
}


/* ============================================================
   MODALS
   ============================================================ */

/*
 * Strategy: modal is always anchored to the top of the viewport.
 * It grows DOWNWARD as content expands — the dialog never repositions.
 * Scrolling within .modal-body-custom handles tall content.
 */

/* Override Bootstrap vertical centering — anchor to top */
.modal-custom {
  align-items: flex-start !important;
}

/* Dialog: fixed distance from top, no vertical centering */
.modal-custom .modal-dialog {
  max-width: min(1500px, 96vw);
  margin: 4vh auto 2vh;
}

/* max-height cap on the whole dialog */
.modal-custom .modal-dialog-scrollable {
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.modal-content-custom {
  border: none;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* Height is auto — grows downward with content */
  max-height: 92vh;
}

/* Scrollable body overflow */
.modal-body-custom {
  overflow-y: auto;
  padding: 1.5rem 0 2rem;
  background: #fff;
}

/* Modal header — white background */
.modal-header-custom {
  flex-shrink: 0;
  padding: 1.25rem 0;
  background: #fff;
  border-bottom: 1px solid #e8eaed;
}

/* Inner container for modal content (max 2000px, 30px padding) */
.modal-inner-container {
  max-width: 2000px;
  margin: 0 auto;
  padding: 0 30px;
  width: 100%;
}

.modal-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Category title — coloured by category, not the header bg */
.modal-category-title {
  font-family: var(--font-main);
  font-size: clamp(1.5rem, 3vw, 3.125rem); /* 50px at base */
  font-weight: 700;
  margin: 0;
}

/* Close button — text "Close" with icon */
.modal-close-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 2px solid var(--color-primary-dark);
  border-radius: 4px;
  background: transparent;
  color: var(--color-primary-dark);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.modal-close-btn:hover {
  background: var(--color-primary-dark);
  color: #fff;
}

/* Modal scrollable body */
.modal-body-custom {
  padding: 1.5rem 0 2rem;
  background: #fff;
}

/* ---- Column headers ---- */
.solution-headers {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #dde0e4;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--color-text-dark);
  letter-spacing: 0.03em;
  /* Transition for show/hide */
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease, padding 0.3s ease;
  max-height: 60px;
  opacity: 1;
}
.solution-headers.headers-hidden {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom-color: transparent;
}

/* Column widths – must mirror .sc-* columns below exactly */
.sh-solution  { flex: 0 0 22%; }
.sh-impact    { flex: 0 0 25%; padding-left: 1rem; } /* gap compensation to align with card cells */
.sh-where     { flex: 0 0 14%; }
.sh-developer { flex: 0 0 18%; }
.sh-action    { flex: 0 0 16%; margin-left: auto; }

/* ---- Solution cards ---- */
.solution-card {
  border-radius: 4px;
  margin-bottom: 0.6rem;
  border: 2px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  background-color: #edeff1; /* explicit hex — not var to ensure exact match */
}
.solution-card.is-expanded {
  background-color: #fff;
  border-color: var(--color-primary-dark);
}

/* Collapsed row */
.solution-card__collapsed {
  display: flex;
  align-items: top;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

/* Hide collapsed row via CSS when card is expanded (JS removes display:none approach) */
.solution-card.is-expanded .solution-card__collapsed {
  display: none;
}

.sc-solution  { flex: 0 0 22%; }
.sc-impact    { flex: 0 0 24%; }
.sc-where     { flex: 0 0 16%; }
.sc-developer { flex: 0 0 17%; }
.sc-action    { flex: 0 0 16%; margin-left: auto; text-align: right; }

.sc-title {
  font-family: var(--font-main);
  font-size: 1.125rem;   /* 18px */
  font-weight: 600;
  color: var(--color-primary-dark);
  margin: 0;
  line-height: 1.35;
}

.sc-impact p, 
.sc-impact li,
.sc-where  p,
.sc-where  li,
.sc-developer p,
.sc-developer  li
 {
  font-family: var(--font-main);
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--color-primary-dark);
  margin: 0;
  line-height: 1.5;
}

/* See more / see less buttons */
.btn-see-more {
  display: inline-flex;
  align-items: center;
  border: 2px solid rgba(255, 255, 255, 0.8); /* white border, same weight as see-less */
  border-radius: 4px;
  padding: 0.45rem 1rem;
  font-family: var(--font-main);
  font-size: 0.9375rem;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-see-more:hover { opacity: 0.85; }

.btn-see-less {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-primary-dark);
  border-radius: 4px;
  padding: 0.45rem 1.25rem;
  font-family: var(--font-main);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-primary-dark);
  background: #fff;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-see-less:hover {
  background: var(--color-primary-dark);
  color: #fff;
}

/* Mobile see-less: full width like "for more information" */
.d-md-none .btn-see-less {
  width: 100%;
}

/* ---- Expanded detail — animated expansion downward ---- */
.solution-card__expanded {
  /* Hidden by default — collapsed via max-height, not display:none */
  overflow: hidden;
  max-height: 0;
  /* padding collapses too so no visual bleed when closed */
  padding: 0 1.25rem;
  padding-top: 0;
  padding-bottom: 0;
  /* Collapse is instant so it doesn't clash with the collapsed row appearing */
  transition: none;
}

/* When the parent card is expanded, reveal the content downward */
.solution-card.is-expanded .solution-card__expanded {
  max-height: 4000px; /* generous cap — any realistic content fits */
  padding-top: 1.5rem;
  padding-bottom: 1.25rem;
  transition: max-height 0.65s cubic-bezier(0.0, 0.0, 0.2, 1),
              padding-top 0.3s ease,
              padding-bottom 0.3s ease;
}

/* Title row in expanded state: title left, see-less right (desktop) */
.expanded-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.sc-title-expanded {
  font-family: var(--font-main);
  font-size: 2.25rem;    /* 36px */
  font-weight: 600;
  color: var(--color-primary-dark);
  margin: 0;
  line-height: 1.2;
}

/* Detail sections */
.detail-context {
  background: #edeff1;
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 0;
}

/* Video section: white background, padding matching the row columns (same as card expanded padding) */
.detail-video {
  background: transparent; /* white — same as expanded card */
  padding: 1rem 0 0; /* aligned with surrounding content, no extra inset */
}

.detail-subtitle {
  font-family: var(--font-main);
  font-size: 1.3125rem;  /* 21px */
  font-weight: 600;
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  margin-bottom: 0.9rem;
}
.detail-subtitle i {
  font-size: 1.1rem;
}

.solution-card__expanded p,.solution-card__expanded li, .solution-card__expanded p a {
  font-family: var(--font-main);
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--color-primary-dark);
  line-height: 1.65;
}

/* More info button — white with border, hover 8% primary dark bg, border stays */
.btn-more-info {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--color-primary-dark);
  border: 2px solid var(--color-primary-dark);
  border-radius: 4px;
  padding: 0.65rem 1rem;
  font-family: var(--font-main);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.18s;
}
.btn-more-info:hover {
  background: rgba(0, 76, 80, 0.08);
  color: var(--color-primary-dark);
  border-color: var(--color-primary-dark); /* explicitly keep border */
}

/* Video placeholder — 16:9 ratio */
.video-placeholder {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #1a1a2e;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.2s;
  overflow: hidden;
}
.video-placeholder:hover { opacity: 0.85; }
.video-placeholder__inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}


/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  flex-shrink: 0;
  background:  #004c50;
  padding: 1rem 0;
}

.footer-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  text-align: left;
}

.footer-flag {
  flex-shrink: 0;
  width: 50px;
  height: auto;
}

.footer-text {
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 400;
  color: rgba(255,255,255,0.85);
  margin: 0;
  max-width: 1100px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ============================================================
   RESPONSIVE OVERRIDES
   ============================================================ */

/* ---- Tablet / small desktop ---- */
@media (max-width: 1199px) {
  .sh-solution,  .sc-solution  { flex: 0 0 25%; }
  .sh-impact,    .sc-impact    { flex: 0 0 25%; } /* padding-left on .sh-impact kept from base rule */
  .sh-where,     .sc-where     { flex: 0 0 13%; }
  .sh-developer, .sc-developer { flex: 0 0 16%; }
  .sh-action,    .sc-action    { flex: 0 0 auto; }
}

/* ---- Mobile (< 768px) ---- */
@media (max-width: 767.98px) {

  /* Solution card collapsed: only title + impact, stacked */
  .solution-card__collapsed {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .sc-solution, .sc-impact, .sc-where, .sc-developer, .sc-action {
    flex: none;
    width: 100%;
  }
  .sc-where, .sc-developer { display: none; }
  .sc-action { text-align: left; }

  /* Expanded title row: stack vertically on mobile */
  .expanded-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Expanded title smaller */
  .sc-title-expanded {
    font-size: 1.125rem; /* 18px */
  }

  /* Detail subtitle */
  .detail-subtitle {
    font-size: 1rem; /* 16px */
  }

  .solution-card__expanded p {
    font-size: 0.875rem; /* 14px */
  }

  /* Modal title */
  .modal-category-title {
    font-size: 1.5625rem; /* 25px */
  }

  /* Modal inner padding reduced */
  .modal-inner-container {
    padding: 0 15px;
  }

  /* Footer: allow text to wrap on mobile */
  .footer-text {
    white-space: normal;
    font-size: 0.75rem;
  }

  /* Modal: full width on mobile */
  .modal-custom .modal-dialog {
    max-width: 100%;
    margin: 0;
    height: 100%;
  }
  .modal-custom .modal-dialog-scrollable {
    max-height: 100vh;
  }
  .modal-content-custom {
    border-radius: 0;
  }
}

/* ---- Large screens: logo scaling ---- */
@media (max-width: 576px) {
  .logo-img { max-width: 180px; }
}

.youtube-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
}
.youtube-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
