/*--- functions/styles/home.css ---*/

/* === Preview Section (Hero/Showcase) === */
.preview-section {
  height: calc(100vh - 104px);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 0;
}

.preview-section h2,
.preview-section p {
  text-align: center;
  margin-bottom: 1rem;
}

/* === Carousel fills the section === */
.preview-carousel {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 12px;
}

/* === Each slide (Prevent initial flicker) === */
.preview-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
  z-index: 0;
}

.preview-slide.active {
  opacity: 1;
  z-index: 1;
  pointer-events: auto;
  animation: fadeInPreview 0.8s ease;
}

/* === Smooth fade-in animation for first slide === */
@keyframes fadeInPreview {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* === 🖼️ Snapshot Preview Images (Full Image Scroll, Slower Speed) === */
.preview-image {
  position: absolute;
  width: 100%;
  height: auto;
  min-height: 120%;
  top: 0;
  left: 0;
  right: 0;
  border-radius: 12px;
  object-fit: contain;
  transform: translateY(0);
  animation: scrollFullImage 32s ease-in-out infinite; /* ⏳ slower and smoother */
}

/* Disable animation on inactive slides */
.preview-slide:not(.active) .preview-image {
  animation: none;
  transform: translateY(0);
}

/* Scroll the entire image smoothly upward */
@keyframes scrollFullImage {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-30%); } /* gentle upward scroll */
}

/* === Click overlay (optional, if using <a> around img this can be removed) === */
.preview-overlay {
  position: absolute;
  inset: 0;
  cursor: pointer;
  z-index: 2;
  display: block;
}

/* ✅ Featured Services Section === */
.services-section {
  height: auto;
  min-height: 0;
  padding-top: 2rem;
  padding-bottom: 2rem;
  overflow: visible;
}

/* === Featured Services Grid === */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 1.5rem;
  justify-items: stretch;
  align-items: stretch;
  margin-top: 2rem;
  padding: 1rem 0;
  height: auto;
  overflow: visible;
}

/* === Each Service Card === */
.service-card {
  position: relative;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: var(--cc-surface-raised);
  color: var(--cc-tertiary-text);
  box-shadow: 0 10px 24px var(--cc-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 450px;
  overflow: hidden;
  cursor: pointer;
}

.service-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3rem;
  background: linear-gradient(to bottom, rgba(223, 200, 194, 0), var(--cc-surface-raised));
  pointer-events: none;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 30px rgba(16, 12, 12, 0.22);
}

/* === Truncated Text Area === */
.service-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  color: var(--cc-secondary);
}

.service-card p,
.service-card ul {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 10;
  -webkit-box-orient: vertical;
}

.service-card ul {
  margin-left: 1.25rem;
  list-style: disc;
}

.service-card li { margin-bottom: 0.4rem; }

.service-card .service-link {
  margin-top: auto;
  font-weight: bold;
  text-decoration: none;
  transition: color 0.2s ease;
  font-size: 0.9rem;
  color: var(--cc-accent);
}

.service-card .service-link:hover {
  text-decoration: underline;
  color: #086f7f;
}

/* === About Section (Text Summary) === */
.about-section {
  background: var(--cc-surface);
  padding: 4rem 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.about-summary {
  max-width: 900px;
  background: var(--cc-surface-raised);
  padding: 2rem 3rem;
  border-radius: 10px;
  box-shadow: 0 14px 32px rgba(16, 12, 12, 0.18);
  border: 1px solid var(--cc-border);
  color: var(--cc-tertiary-text);
  line-height: 1.6;
}

.about-summary h2 {
  color: var(--cc-secondary);
  margin-bottom: 1rem;
  font-size: 2rem;
}

.about-summary p {
  margin-bottom: 1.25rem;
  font-size: 1rem;
}

/* === Learn More About Me Button === */
.learn-more-link {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.6rem 1.5rem;
  background-color: transparent;
  border: 2px solid var(--cc-accent);
  border-radius: 6px;
  color: var(--cc-accent);
  font-weight: bold;
  text-decoration: none;
  transition: all 0.25s ease;
}

.learn-more-link:hover {
  background-color: var(--cc-accent);
  color: var(--cc-accent-text);
  border-color: var(--cc-accent);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(11, 144, 167, 0.32);
}

/* === Responsive Adjustments === */
@media (max-width: 900px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .services-grid { grid-template-columns: 1fr; }
  .about-summary {
    padding: 1.5rem;
  }
  .about-summary h2 {
    font-size: 1.6rem;
  }
  .about-summary p {
    font-size: 0.95rem;
  }
}
