/* ============================================================
   ZSI Technology — Unified Design System & Custom Styles
   ============================================================ */

/* --- Base Layout & Sections --- */
section[id] {
  scroll-margin-top: 80px;
}
.section-heading h2 {
  font-weight: 700;
}


/* ============================================================
   1. GLOBAL BUTTONS & INTERACTIONS
   ============================================================ */

.btn {
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(13, 110, 253, 0.4);
}
.btn-dark:hover, .btn-outline-dark:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.btn-light:hover {
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.3);
}


/* ============================================================
   2. GLOBAL UTILITIES (Logo Inversion)
   ============================================================ */

[data-bs-theme="dark"] .dark-invert {
  filter: invert(1) brightness(1.2);
}


/* ============================================================
   3. UNIFIED CARD SYSTEM (Posts, Jobs, Services, Team, Certs, Features)
   ============================================================ */

.card.post,
.job-card,
.service-card,
.team-2 .card,
.feature-card,
.card.shadow-sm {
  border-radius: 1rem;
  background: var(--bs-body-bg, #fff);
  transition: transform 0.35s ease, box-shadow 0.35s ease, background-color 0.35s ease, border-color 0.35s ease;
  overflow: hidden;
}

.card.post:hover,
.job-card:hover,
.service-card:hover,
.team-2 .card:hover,
.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
}

/* --- Image Zoom on Card Hover --- */
.card.post .card-img-top img,
.card.post > a:first-child img,
.team-2 .profile img {
  transition: transform 0.5s ease;
}
.card.post:hover .card-img-top img,
.card.post:hover > a:first-child img,
.team-2 .card:hover .profile img {
  transform: scale(1.08);
}

/* --- Title Color Transition on Hover --- */
.card.post h3 a,
.job-title-link,
.card.post .card-title h3,
.card.post h3.fw-semibold {
  transition: color 0.3s ease;
}
.card.post:hover h3 a,
.job-card:hover .job-title-link,
.card.post:hover .card-title h3,
.card.post:hover h3.fw-semibold {
  color: var(--bs-primary, #0d6efd) !important;
}


/* ============================================================
   4. SECTION-SPECIFIC STYLES
   ============================================================ */

/* --- Hero & CTA Background Animations --- */
.hero-3 .overlay,
.cta-1 .overlay {
  background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.65) 100%) !important;
}
@keyframes heroZoom {
  from { transform: translate(-50%, -50%) scale(1); }
  to   { transform: translate(-50%, -50%) scale(1.08); }
}
.hero-3 .background-container img,
.cta-1 .background-container img {
  animation: heroZoom 20s ease-in-out infinite alternate;
}
.hero-3 .heading {
  background: linear-gradient(90deg, #ffffff, #c8d8e8, #ffffff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 6s linear infinite;
}
@keyframes shimmer {
  to { background-position: 200% center; }
}

/* --- Services Icon Animation --- */
.service-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(13, 110, 253, 0.1);
  color: var(--bs-primary, #0d6efd);
  transition: transform 0.35s ease, background 0.35s ease, color 0.35s ease;
}
.service-card:hover .service-icon {
  transform: scale(1.1) rotate(-5deg);
  background: var(--bs-primary, #0d6efd);
  color: #fff;
}

/* --- Portfolio Tiles & Interactive Hover --- */
.portfolio-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 340px;
  border-radius: 1rem;
  overflow: hidden;
  cursor: pointer;
  background: #1a1a1a;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.portfolio-tile.interactive-card {
  border: 2px solid transparent;
}
.portfolio-tile.interactive-card:hover {
  border-color: var(--bs-primary, #0d6efd);
  transform: translateY(-8px);
  box-shadow: 0 25px 50px rgba(13, 110, 253, 0.2) !important;
}
.portfolio-tile.interactive-card .btn-outline-light {
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff;
  transition: all 0.3s ease;
}
.portfolio-tile.interactive-card:hover .btn-outline-light {
  background-color: var(--bs-primary, #0d6efd);
  border-color: var(--bs-primary, #0d6efd);
  color: #fff;
  transform: scale(1.05);
}

.portfolio-tile--cta {
  background: linear-gradient(135deg, #0d6efd 0%, #0445b8 100%);
  cursor: default;
}
.portfolio-tile--cta:hover,
.portfolio-tile:hover {
  transform: translateY(-6px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}
.portfolio-tile__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.portfolio-tile__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.portfolio-tile:hover .portfolio-tile__media img {
  transform: scale(1.12);
}
.portfolio-tile__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.5) 55%, rgba(0,0,0,0.85) 100%);
  transition: background 0.5s ease;
}
.portfolio-tile:hover .portfolio-tile__overlay {
  background: linear-gradient(180deg, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.65) 55%, rgba(0,0,0,0.92) 100%);
}
.portfolio-tile__content {
  position: relative;
  z-index: 2;
  padding: 1.75rem;
  color: #fff;
}
.portfolio-tile__number {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.6);
  margin-bottom: 0.5rem;
}
.portfolio-tile__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0;
  line-height: 1.2;
}
.portfolio-tile__desc {
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(255,255,255,0.85);
  margin: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(12px);
  transition: max-height 0.45s ease, opacity 0.35s ease 0.1s, transform 0.45s ease;
}
.portfolio-tile:hover .portfolio-tile__desc {
  max-height: 200px;
  opacity: 1;
  transform: translateY(0);
  margin-top: 0.75rem;
}

/* --- Portfolio Modal Responsive & Spacing --- */
#portfolioModal .modal-dialog-scrollable .modal-content {
  max-height: min(90vh, 100dvh);
}
#portfolioModal {
  --bs-modal-margin: 0.5rem;
}

/* Use a clean 4:3 ratio so photos fill the space nicely without extreme cropping */
#portfolioModalGallery .ratio {
  --bs-aspect-ratio: 75%; /* 4:3 ratio */
  background-color: #000;
  overflow: hidden;
}

#portfolioModalGallery .ratio img {
  width: 100%;
  height: 100%;
  object-fit: cover;     /* Fills the card completely, no empty space */
  object-position: center;
  transition: transform 0.5s ease;
}

#portfolioModalGallery .card:hover .ratio img {
  transform: scale(1.04);
}



/* --- Client Logos --- */
.client-logo-link {
  display: inline-block;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  transition: background 0.3s ease, transform 0.3s ease;
}
.client-logo-link:hover {
  background: rgba(0, 0, 0, 0.04);
  transform: translateY(-4px);
}
.client-logo {
  transition: opacity 0.3s ease, filter 0.3s ease;
  opacity: 0.75;
}
.client-logo-link:hover .client-logo {
  opacity: 1;
}

/* --- Feature Sub-Boxes --- */
.feature-sub-box {
  background-color: #f8f9fa;
  transition: background-color 0.3s ease;
}


/* ============================================================
   5. UNIFIED DARK MODE OVERRIDES
   ============================================================ */

[data-bs-theme="dark"] .card.post,
[data-bs-theme="dark"] .job-card,
[data-bs-theme="dark"] .service-card,
[data-bs-theme="dark"] .feature-card,
[data-bs-theme="dark"] .card.shadow-sm {
  background-color: var(--bs-body-bg, #1a1a1a) !important;
  color: var(--bs-body-color, #fff) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-bs-theme="dark"] .card.post h3 a,
[data-bs-theme="dark"] .card.post h3.fw-semibold a,
[data-bs-theme="dark"] .job-card .job-title-link,
[data-bs-theme="dark"] .card.post h3,
[data-bs-theme="dark"] .feature-card h3,
[data-bs-theme="dark"] .card.shadow-sm h5 {
  color: #fff !important;
}

[data-bs-theme="dark"] .card.post p,
[data-bs-theme="dark"] .job-card p,
[data-bs-theme="dark"] .feature-card p,
[data-bs-theme="dark"] .card.shadow-sm p {
  color: rgba(255, 255, 255, 0.75) !important;
}

[data-bs-theme="dark"] .card.post:hover h3 a,
[data-bs-theme="dark"] .card.post:hover h3.fw-semibold a,
[data-bs-theme="dark"] .job-card:hover .job-title-link {
  color: var(--bs-primary, #0d6efd) !important;
}

[data-bs-theme="dark"] .feature-sub-box {
  background-color: #242424 !important;
  color: #fff !important;
}
[data-bs-theme="dark"] .feature-sub-box span,
[data-bs-theme="dark"] .feature-sub-box p {
  color: rgba(255, 255, 255, 0.85) !important;
}

[data-bs-theme="dark"] .cert-logo-wrapper {
  background-color: rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .client-logo-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .border-dark-subtle {
  border-color: rgba(255, 255, 255, 0.15) !important;
}

[data-bs-theme="dark"] #portfolioModalGallery .card {
  background: #242424 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
